wangchuanjin 4 miesięcy temu
rodzic
commit
6208eb21c2

+ 4 - 1
src/jfw/modules/subscribepay/src/entity/bidCreditReport/bidCreditReport.go

@@ -137,6 +137,7 @@ func (b *bidCreditReport) ReportQuery(orderNo string) bool {
 	ctx := gctx.New()
 	orderCode := gconv.String((*datas)[0]["order_code"])
 	entName := gconv.String((*datas)[0]["ent_name"])
+	buyer := gconv.String((*datas)[0]["buyer"])
 	fileName := "/" + b.folderName(bcrId, orderCode, entName) + "/" + entName + ".pdf"
 	downloadUrl := g.Config().MustGet(ctx, "bidCreditReport.visitUrl").String() + fileName
 	r1 := util.Mysql.UpdateOrDeleteBySql(`update jianyu.bid_credit_report set download_url=?,report_url=?,status=2,complete_time=? where id=?`, downloadUrl, reportUrl, gtime.Datetime(), bcrId)
@@ -155,6 +156,8 @@ func (b *bidCreditReport) ReportQuery(orderNo string) bool {
 			"l_createTime": time.Now().Unix(),
 			"s_pdfUrl":     downloadUrl,
 			"bcr_id":       bcrId,
+			"ent":          entName,
+			"buyer":        buyer,
 		},
 	}, true, false)
 	downloadUrl = config.Config.WebDomain + downloadUrl
@@ -182,7 +185,7 @@ func (b *bidCreditReport) ReportQuery(orderNo string) bool {
 	}
 	for _, v := range userMails {
 		go func(vv string) {
-			if b.sendMail(userId, v, entName, gconv.String((*datas)[0]["buyer"]), downloadUrl, orderCode) && userMail == vv {
+			if b.sendMail(userId, v, entName, buyer, downloadUrl, orderCode) && userMail == vv {
 				util.Mysql.UpdateOrDeleteBySql(`update jianyu.bid_credit_report set status=2,send_mail=1,send_mail_time=? where id=?`, gtime.Datetime(), bcrId)
 			}
 		}(v)

+ 1 - 1
src/jfw/modules/subscribepay/src/entity/bidCreditReport/bidCreditReport_test.go

@@ -28,7 +28,7 @@ func TestReportQuery(t *testing.T) {
 }
 
 func TestSendMail(t *testing.T) {
-	BidCreditReport.sendMail("", "wangchuanjin@topnet.net.cn", "芝麻企业信用管理有限公司", "", "https://jybx2-webtest.jydev.jianyu360.com/bidCreditReportFile/%E5%8C%97%E4%BA%AC%E5%89%91%E9%B1%BC%E4%BF%A1%E6%81%AF%E6%8A%80%E6%9C%AF%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8.pdf", "abcdef")
+	BidCreditReport.sendMail("", "yangfeng@topnet.net.cn", "芝麻企业信用管理有限公司", "", "https://jybx2-webtest.jydev.jianyu360.com/bidCreditReportFile/%E5%8C%97%E4%BA%AC%E5%89%91%E9%B1%BC%E4%BF%A1%E6%81%AF%E6%8A%80%E6%9C%AF%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8.pdf", "abcdef")
 	time.Sleep(time.Minute)
 }