|
@@ -40,6 +40,7 @@ type DataexportConfig struct {
|
|
Mail_invoice_finance_content string `json:"mail_invoice_finance_content"` //to北京财务订单内容
|
|
Mail_invoice_finance_content string `json:"mail_invoice_finance_content"` //to北京财务订单内容
|
|
Mail_order_finance_content string `json:"mail_order_finance_content"` //to北京财务申请发票内容
|
|
Mail_order_finance_content string `json:"mail_order_finance_content"` //to北京财务申请发票内容
|
|
Finance_emails []string `json:"finance_emails"`
|
|
Finance_emails []string `json:"finance_emails"`
|
|
|
|
+ Qmxdomain string `json:"qmxdomain"`
|
|
}
|
|
}
|
|
type Dataexport_Field struct {
|
|
type Dataexport_Field struct {
|
|
Names []string `json:"names"`
|
|
Names []string `json:"names"`
|
|
@@ -220,7 +221,7 @@ func SendMailToBJFinance(order *map[string]interface{}, pay_time, transaction_id
|
|
product_type := util.ObjToString((*order)["product_type"]) + "导出"
|
|
product_type := util.ObjToString((*order)["product_type"]) + "导出"
|
|
//
|
|
//
|
|
order_money := float64(util.IntAll((*order)["order_money"])) / 100
|
|
order_money := float64(util.IntAll((*order)["order_money"])) / 100
|
|
- if transaction_id == "" {
|
|
|
|
|
|
+ if transaction_id == "" && util.ObjToString((*order)["pay_way"]) == "微信" { //线下支付没有微信订单编号
|
|
out_trade_no := util.ObjToString((*order)["out_trade_no"])
|
|
out_trade_no := util.ObjToString((*order)["out_trade_no"])
|
|
wxpaydata := Mysql.FindOne("weixin_pay", map[string]interface{}{
|
|
wxpaydata := Mysql.FindOne("weixin_pay", map[string]interface{}{
|
|
"out_trade_no": out_trade_no,
|
|
"out_trade_no": out_trade_no,
|
|
@@ -278,7 +279,7 @@ func SendMailToBJFinance(order *map[string]interface{}, pay_time, transaction_id
|
|
mail_title = "剑鱼历史数据订单【" + order_code + "】,请查收"
|
|
mail_title = "剑鱼历史数据订单【" + order_code + "】,请查收"
|
|
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)
|
|
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 {
|
|
} else {
|
|
- //
|
|
|
|
|
|
+ //申请发票
|
|
pay_time = util.ObjToString((*order)["pay_time"])
|
|
pay_time = util.ObjToString((*order)["pay_time"])
|
|
if pay_time != "" {
|
|
if pay_time != "" {
|
|
pay_time = strings.Replace(pay_time, "-", ".", -1)
|
|
pay_time = strings.Replace(pay_time, "-", ".", -1)
|
|
@@ -297,8 +298,27 @@ func SendMailToBJFinance(order *map[string]interface{}, pay_time, transaction_id
|
|
company_flag = "flex"
|
|
company_flag = "flex"
|
|
taxnum_flag = "flex"
|
|
taxnum_flag = "flex"
|
|
}
|
|
}
|
|
|
|
+ //线下支付获取凭证照片
|
|
|
|
+ offlineImgSrc := ""
|
|
|
|
+ if (*order)["pay_way"] == "线下支付" {
|
|
|
|
+ offlinePayMap := map[string]interface{}{}
|
|
|
|
+ offlinePayMap["out_trade_no"] = (*order)["out_trade_no"]
|
|
|
|
+ offlinePay := Mysql.FindOne("offline_pay", offlinePayMap, "", "create_time desc")
|
|
|
|
+ if imgs := util.ObjToString((*offlinePay)["img_src"]); imgs != "" {
|
|
|
|
+ ImgArr := strings.Split(imgs, ",")
|
|
|
|
+ offlineImgSrc = "<p style='margin: 0px 0px 1px; font-size: 14px; color: rgb(29, 29, 29);'>线下支付凭证:%s</p>"
|
|
|
|
+ for k, v := range ImgArr {
|
|
|
|
+ var add = ",%s"
|
|
|
|
+ if k == len(ImgArr)-1 {
|
|
|
|
+ add = ""
|
|
|
|
+ }
|
|
|
|
+ pz := fmt.Sprintf("<a href='%s'>凭证%d</a>%s", ExConf.Qmxdomain+v, k+1, add)
|
|
|
|
+ offlineImgSrc = fmt.Sprintf(offlineImgSrc, pz)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
mail_title = "电子发票申请,剑鱼历史数据订单【" + order_code + "】,请查收"
|
|
mail_title = "电子发票申请,剑鱼历史数据订单【" + order_code + "】,请查收"
|
|
- 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)
|
|
|
|
|
|
+ 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, offlineImgSrc, data_spec, data_count, order_money, user_mail, user_phone)
|
|
}
|
|
}
|
|
//发送邮件
|
|
//发送邮件
|
|
for _, finance_mail := range ExConf.Finance_emails {
|
|
for _, finance_mail := range ExConf.Finance_emails {
|