|
@@ -201,7 +201,7 @@ func SendNotice(order *map[string]interface{}, order_money float64, pay_time, do
|
|
|
var finaceLock *sync.Mutex = &sync.Mutex{}
|
|
|
|
|
|
//给北京财务人员发邮件
|
|
|
-func SendMailToBJFinance(order *map[string]interface{}, pay_time string, mailType int, auth []*mail.GmailAuth) {
|
|
|
+func SendMailToBJFinance(order *map[string]interface{}, pay_time, transaction_id string, mailType int, auth []*mail.GmailAuth) {
|
|
|
defer util.Catch()
|
|
|
finaceLock.Lock()
|
|
|
defer finaceLock.Unlock()
|
|
@@ -211,16 +211,23 @@ func SendMailToBJFinance(order *map[string]interface{}, pay_time string, mailTyp
|
|
|
data_spec := util.ObjToString((*order)["data_spec"])
|
|
|
data_count := util.IntAll((*order)["data_count"])
|
|
|
//
|
|
|
+ create_time := util.ObjToString((*order)["create_time"])
|
|
|
+ if create_time != "" {
|
|
|
+ create_time = strings.Replace(create_time, "-", ".", -1)
|
|
|
+ create_time = regexp.MustCompile(":[^:]+$").ReplaceAllString(create_time, "")
|
|
|
+ }
|
|
|
+ //
|
|
|
product_type := util.ObjToString((*order)["product_type"]) + "导出"
|
|
|
//
|
|
|
order_money := float64(util.IntAll((*order)["order_money"])) / 100
|
|
|
- out_trade_no := util.ObjToString((*order)["out_trade_no"])
|
|
|
- wxpaydata := Mysql.FindOne("weixin_pay", map[string]interface{}{
|
|
|
- "out_trade_no": out_trade_no,
|
|
|
- }, "transaction_id", "")
|
|
|
- transaction_id := ""
|
|
|
- if wxpaydata != nil && len(*wxpaydata) > 0 {
|
|
|
- transaction_id = util.ObjToString((*wxpaydata)["transaction_id"])
|
|
|
+ if transaction_id == "" {
|
|
|
+ out_trade_no := util.ObjToString((*order)["out_trade_no"])
|
|
|
+ wxpaydata := Mysql.FindOne("weixin_pay", map[string]interface{}{
|
|
|
+ "out_trade_no": out_trade_no,
|
|
|
+ }, "transaction_id", "")
|
|
|
+ if wxpaydata != nil && len(*wxpaydata) > 0 {
|
|
|
+ transaction_id = util.ObjToString((*wxpaydata)["transaction_id"])
|
|
|
+ }
|
|
|
}
|
|
|
mailcontent := ""
|
|
|
var mail_title = ""
|
|
@@ -269,8 +276,14 @@ func SendMailToBJFinance(order *map[string]interface{}, pay_time string, mailTyp
|
|
|
log.Println("用户筛选条件错误", err, sc)
|
|
|
}
|
|
|
mail_title = "剑鱼历史数据订单【" + order_code + "】,请查收"
|
|
|
- mailcontent = fmt.Sprintf(ExConf.Mail_order_finance_content, order_code, pay_time, product_type, transaction_id, data_spec, data_count, order_money, user_mail, user_phone, publishtime, region, industry, keys, sc_money, subtype, buyer, winner)
|
|
|
+ mailcontent = fmt.Sprintf(ExConf.Mail_order_finance_content, order_code, create_time, pay_time, product_type, transaction_id, data_spec, data_count, order_money, user_mail, user_phone, publishtime, region, industry, keys, sc_money, subtype, buyer, winner)
|
|
|
} else {
|
|
|
+ //
|
|
|
+ pay_time = util.ObjToString((*order)["pay_time"])
|
|
|
+ if pay_time != "" {
|
|
|
+ pay_time = strings.Replace(pay_time, "-", ".", -1)
|
|
|
+ pay_time = regexp.MustCompile(":[^:]+$").ReplaceAllString(pay_time, "")
|
|
|
+ }
|
|
|
applybill_type := util.IntAll((*order)["applybill_type"])
|
|
|
bill_title := "个人"
|
|
|
bill_company := ""
|
|
@@ -285,7 +298,7 @@ func SendMailToBJFinance(order *map[string]interface{}, pay_time string, mailTyp
|
|
|
taxnum_flag = "flex"
|
|
|
}
|
|
|
mail_title = "电子发票申请,剑鱼历史数据订单【" + order_code + "】,请查收"
|
|
|
- mailcontent = fmt.Sprintf(ExConf.Mail_invoice_finance_content, bill_title, company_flag, bill_company, taxnum_flag, bill_taxnum, order_code, pay_time, product_type, transaction_id, data_spec, data_count, order_money, user_mail, user_phone)
|
|
|
+ mailcontent = fmt.Sprintf(ExConf.Mail_invoice_finance_content, bill_title, company_flag, bill_company, taxnum_flag, bill_taxnum, order_code, create_time, pay_time, product_type, transaction_id, data_spec, data_count, order_money, user_mail, user_phone)
|
|
|
}
|
|
|
//发送邮件
|
|
|
for _, finance_mail := range ExConf.Finance_emails {
|
|
@@ -314,6 +327,7 @@ func SendMailToPayUser(order *map[string]interface{}, order_money float64, pay_t
|
|
|
order_id := util.Int64All((*order)["id"])
|
|
|
order_code := util.ObjToString((*order)["order_code"])
|
|
|
user_mail := util.ObjToString((*order)["user_mail"])
|
|
|
+ user_phone := util.ObjToString((*order)["user_phone"])
|
|
|
data_spec := util.ObjToString((*order)["data_spec"])
|
|
|
data_count := util.IntAll((*order)["data_count"])
|
|
|
//
|
|
@@ -321,6 +335,12 @@ func SendMailToPayUser(order *map[string]interface{}, order_money float64, pay_t
|
|
|
filter := util.ObjToString((*order)["filter"])
|
|
|
product_type := util.ObjToString((*order)["product_type"])
|
|
|
//
|
|
|
+ create_time := util.ObjToString((*order)["create_time"])
|
|
|
+ if create_time != "" {
|
|
|
+ create_time = strings.Replace(create_time, "-", ".", -1)
|
|
|
+ create_time = regexp.MustCompile(":[^:]+$").ReplaceAllString(create_time, "")
|
|
|
+ }
|
|
|
+ //
|
|
|
file := xlsx.NewFile()
|
|
|
sheet, _ := file.AddSheet("Sheet1")
|
|
|
var row *xlsx.Row
|
|
@@ -456,7 +476,7 @@ func SendMailToPayUser(order *map[string]interface{}, order_money float64, pay_t
|
|
|
log.Println("用户筛选条件错误", err, sc)
|
|
|
}
|
|
|
downloadurl := fmt.Sprintf("%s%s", config.Sysconfig["webdomain"].(string), download_url)
|
|
|
- mailcontent = fmt.Sprintf(ExConf.Mail_attach_content, downloadurl, order_code, pay_time, product_type, data_spec, data_count, order_money, user_mail, publishtime, region, industry, keys, sc_money, subtype, buyer, winner)
|
|
|
+ mailcontent = fmt.Sprintf(ExConf.Mail_attach_content, downloadurl, order_code, create_time, pay_time, product_type, data_spec, data_count, order_money, user_mail, user_phone, publishtime, region, industry, keys, sc_money, subtype, buyer, winner)
|
|
|
//发送邮件
|
|
|
if user_mail != "" {
|
|
|
if SendRetryMail(ExConf.Mail_retry, user_mail, "历史数据", mailcontent, "", nil, auth) {
|