|
@@ -42,6 +42,7 @@ type DataexportConfig struct {
|
|
|
Mail_order_finance_content string `json:"mail_order_finance_content"` //to北京财务申请发票内容
|
|
|
Finance_emails []string `json:"finance_emails"`
|
|
|
Qmxdomain string `json:"qmxdomain"`
|
|
|
+ DataReportContent string `json:"dataReportContent"`
|
|
|
}
|
|
|
type Dataexport_Field struct {
|
|
|
Names []string `json:"names"`
|
|
@@ -670,3 +671,27 @@ func (wx *WeixinStruct) GetAppWxPayStr(prepayid string) string {
|
|
|
}
|
|
|
return string(byteArr)
|
|
|
}
|
|
|
+
|
|
|
+//数据报告发送邮件
|
|
|
+func SendDatareportMailToPayUser(report_id int, user_mail string, auth []*mail.GmailAuth) {
|
|
|
+ res := Mysql.FindOne("jy_datareport", map[string]interface{}{
|
|
|
+ "report_id": report_id,
|
|
|
+ }, "s_url", "")
|
|
|
+ if res == nil || (*res)["s_url"] == "" {
|
|
|
+ log.Println("%d:未知数据报告\n", report_id)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ mailcontent := fmt.Sprintf(ExConf.DataReportContent, config.Sysconfig["webdomain"].(string)+(*res)["s_url"].(string))
|
|
|
+ if SendRetryMail(ExConf.Mail_retry, user_mail, "数据报告", mailcontent, "", nil, auth) {
|
|
|
+ log.Printf("用户%s:数据报告附件邮件发送成功!数据报告id:%d\n", user_mail, report_id)
|
|
|
+ now := time.Now()
|
|
|
+ Mysql.Update("jy_datareport_order", map[string]interface{}{
|
|
|
+ "report_id": report_id,
|
|
|
+ }, map[string]interface{}{
|
|
|
+ "service_status": 1,
|
|
|
+ "service_time": util.FormatDate(&now, util.Date_Full_Layout),
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ log.Printf("%s数据报告发送邮件出错,数据报告id:%d\n", user_mail, report_id)
|
|
|
+ }
|
|
|
+}
|