2
3
Эх сурвалжийг харах

资质或年审被检测到期改为暂停

yuedefeng 5 жил өмнө
parent
commit
3c32deb6f9

+ 9 - 1
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercert.go

@@ -1533,7 +1533,8 @@ func (this *OilSupplierCertController) ChangeSupplierStatus() {
 			"Remark",
 		}
 		sert.InFlag = "2"
-		sert.Remark = "资质已到期"
+		sert.Remark = "资质过期"
+
 		where := "SupplierId=" + strconv.Itoa(item.Id) + " AND InFlag = '1'"
 		if item.SupplierTypeCode != "000" {
 			where = where + " and SupplierTypeCode='" + item.SupplierTypeCode + "'"
@@ -1541,6 +1542,13 @@ func (this *OilSupplierCertController) ChangeSupplierStatus() {
 		svcsupp.UpdateEntityBywheretbl(OilSupplierCertName, &sert, cols, where)
 	}
 
+	// 查询年审过期 和 资质都过期的
+	sqlYearCertLost := "update OilSupplierCert set Remark=CONCAT_WS(',', '年审过期', Remark) where Remark in ('资质过期', '不良记录', '资质过期,不良记录') AND InFlag = '2' AND ApplyTime <= '" + time.Now().AddDate(0, 0, -1).Format("2006-01-02") + "'"
+	utils.DBE.Query(sqlYearCertLost)
+
+	// 查询年审过期的
+	sqlYearLost := "update OilSupplierCert set Remark='年审过期', InFlag = '2'  where InFlag = '1' AND ApplyTime <= '" + time.Now().AddDate(0, 0, -1).Format("2006-01-02") + "'"
+	utils.DBE.Query(sqlYearLost)
 }
 
 // @Title 更新Inflag状态

+ 7 - 8
src/dashoo.cn/backend/api/controllers/toolbox/toolbox.go

@@ -2,7 +2,6 @@ package toolbox
 
 import (
 	"dashoo.cn/backend/api/controllers/oilsupplier"
-	"fmt"
 	"github.com/astaxie/beego/toolbox"
 )
 
@@ -27,10 +26,10 @@ func TimingTask(){
 		c.SendingSMS()
 		return nil
 	})
-	err := tkSMSnotice.Run()
+	/*err := tkSMSnotice.Run()
 	if err != nil {
 		fmt.Println(err)
-	}
+	}*/
 	toolbox.AddTask("myTaskSMSnotice", tkSMSnotice)
 
 	//  资质到期提醒
@@ -38,22 +37,22 @@ func TimingTask(){
 		c.SendingSMSSupplierFile()
 		return nil
 	})
-	err = tkSupplierFile.Run()
+	/* err = tkSupplierFile.Run()
 	if err != nil {
 		fmt.Println(err)
-	}
+	} */
 	toolbox.AddTask("myTaskSupplierFile", tkSupplierFile)
 
 
-	//  资质到期 企业改为暂停
+	//  资质到期,年审到期 企业改为暂停
 	tkSupplierStatus := toolbox.NewTask("myTaskSupplierStatus", "0 0 2 * * *", func() error {
 		c.ChangeSupplierStatus()
 		return nil
 	})
-	err = tkSupplierStatus.Run()
+	/* err = tkSupplierStatus.Run()
 	if err != nil {
 		fmt.Println(err)
-	}
+	} */
 	toolbox.AddTask("myTaskSupplierStatus", tkSupplierStatus)