Răsfoiți Sursa

feat:xiugai

wangchuanjin 4 luni în urmă
părinte
comite
ec0e5488bb

+ 6 - 5
src/jfw/modules/subscribepay/src/entity/bidCreditReport/bidCreditReport.go

@@ -418,13 +418,14 @@ func (b *bidCreditReport) NewOrderWarn() {
 		ids := map[int64]bool{}
 		util.Mysql.SelectByBath(1, func(l *[]map[string]interface{}) bool {
 			v := gmap.NewStrAnyMapFrom((*l)[0])
-			log.Println("有新的投标企业信用报告订单给运维发邮件加载到数据", v.String())
 			id := v.GetVar("id").Int64()
-			if _, ok := all[id]; !ok {
-				v.Set("isNew", true)
-				b.sendWarnNotice(v.GetVar("id").Int64(), v.GetVar("order_code").String(), v.GetVar("ent_name").String(), v.GetVar("buyer").String())
-			}
 			ids[id] = true
+			if _, ok := all[id]; ok {
+				return true
+			}
+			log.Println("有新的投标企业信用报告订单给运维发邮件加载到数据", v.String())
+			v.Set("isNew", true)
+			b.sendWarnNotice(v.GetVar("id").Int64(), v.GetVar("order_code").String(), v.GetVar("ent_name").String(), v.GetVar("buyer").String())
 			all[id] = v
 			return true
 		}, `select id,order_code,ent_name,buyer from jianyu.bid_credit_report where status=0`)

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

@@ -39,6 +39,7 @@ func TestCreate(t *testing.T) {
 
 func TestNewOrderWarn(t *testing.T) {
 	BidCreditReport.NewOrderWarn()
+	time.Sleep(time.Hour)
 }
 
 func TestCallBack(t *testing.T) {