Pārlūkot izejas kodu

后端: 资质审查定时任务log

baichengfei 4 gadi atpakaļ
vecāks
revīzija
c3376fb5b8

+ 7 - 5
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercert.go

@@ -694,9 +694,9 @@ func (this *OilSupplierCertController) CompanyAuditEntity() {
 	// 修改推荐单位
 	supplierCertEntity.RecUnitId = unitId
 	var orglist organize.Base_Organize
-	certSrv.GetEntityByWhere("Base_Organize", "Id = " + unitId, &orglist)
+	certSrv.GetEntityByWhere("Base_Organize", "Id = "+unitId, &orglist)
 	supplierCertEntity.RecUnitName = orglist.Fullname
-	certSrv.UpdateEntityBywheretbl(OilSupplierCertName, &supplierCertEntity, []string{"RecUnitName","RecUnitId"}, "Id = " + strconv.Itoa(supplierCertEntity.Id))
+	certSrv.UpdateEntityBywheretbl(OilSupplierCertName, &supplierCertEntity, []string{"RecUnitName", "RecUnitId"}, "Id = "+strconv.Itoa(supplierCertEntity.Id))
 
 	svcActiviti := workflow.GetActivitiService(utils.DBE)
 	//启动工作流
@@ -1646,6 +1646,7 @@ func (this *OilSupplierCertController) ChangeSupplierStatus() {
 		svcsupp.GetEntitysByWhere(OilSupplierCertName, where, &tmpCertList)
 		for _, tmpCertItem := range tmpCertList {
 			if tmpCertItem.InFlag == "1" {
+				log.Print("定时任务资质检查 InFlag == 1:" + item.SupplierName)
 				tmpCertItem.InFlag = "2"
 				if tmpCertItem.ApplyTime.Before(time.Now()) {
 					// 年审到期
@@ -1656,6 +1657,7 @@ func (this *OilSupplierCertController) ChangeSupplierStatus() {
 				svcsupp.UpdateEntityByIdCols(tmpCertItem.Id, &tmpCertItem, cols)
 
 			} else if tmpCertItem.InFlag == "2" && !strings.Contains(tmpCertItem.Remark, "资质过期") {
+				log.Print("定时任务资质检查 InFlag == 2:" + item.SupplierName)
 				tmpCertItem.InFlag = "2"
 				tmpCertItem.Remark = strings.Trim("资质过期,"+tmpCertItem.Remark, ",")
 				svcsupp.UpdateEntityByIdCols(tmpCertItem.Id, &tmpCertItem, cols)
@@ -1701,7 +1703,7 @@ func (this *OilSupplierCertController) ReInput() {
 		return
 	}
 
-	needWorkflowId := [] string{}
+	needWorkflowId := []string{}
 
 	session := utils.DBE.NewSession()
 	svc := suppliercert.GetOilSupplierCertSession(session)
@@ -1765,7 +1767,7 @@ func (this *OilSupplierCertController) ReInput() {
 				return
 			}
 
-			for idx,_ := range delpay {
+			for idx, _ := range delpay {
 				delpay[idx].DeleteDate = time.Now()
 			}
 
@@ -2046,7 +2048,7 @@ func (this *OilSupplierCertController) ReInput() {
 		activitiService := workflow.GetActivitiService(utils.DBE)
 		var deleteProcessVM workflow.DeleteProcessVM
 		for _, workflowId := range needWorkflowId {
-			if workflowId != "" && workflowId != "0"{
+			if workflowId != "" && workflowId != "0" {
 				deleteProcessVM.ProcessInstanceId = workflowId
 				deleteProcessVM.DeleteReason = "企业重新入库"
 				activitiService.DeleteComplete(deleteProcessVM)