Jelajahi Sumber

监听回调放到审批方法处理

baichengfei 5 tahun lalu
induk
melakukan
a9e24a7fcd

+ 21 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercert.go

@@ -1083,6 +1083,27 @@ func (this *OilSupplierCertController) UpdateIsStorage() {
 		}
 	}
 
+	cols := []string{
+		"Id",
+		"Status",
+		"ApplyTime",
+		"InFlag",
+		"StorageOn",
+		"ModifiedOn",
+	}
+	//进入此步骤,记录在数据库中
+	if result == "1" {
+		supplierCertEntity.Status = suppliercert.STORE_STATUS // 7 已入库
+		supplierCertEntity.StorageOn = time.Now()
+		supplierCertEntity.ApplyTime = time.Now().AddDate(1, 0, 0)
+		supplierCertEntity.InFlag = "1"
+	} else {
+		supplierCertEntity.Status = suppliercert.NO_STOREING_STATUS // -7 待入库未通过
+	}
+
+	supplierCertEntity.ModifiedOn = time.Now()
+	certSrv.UpdateEntityByIdCols(id, supplierCertEntity, cols)
+
 	svcActiviti := workflow.GetActivitiService(utils.DBE)
 	var ActiComplete workflow.ActiCompleteVM
 	ActiComplete.ProcessKey = workflow.OIL_ENUSER_SUPPLIER_APPLY

+ 0 - 28
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertListener.go

@@ -349,34 +349,6 @@ func (this *OilSupplierCertListenerController) GetStorageAuditor() {
 // @Success 200 {string} string
 // @router /workflow-end [get]
 func (this *OilSupplierCertListenerController) WorkflowEndAudit() {
-	businessKey := this.GetString("businessKey")
-	supplierCertId := strings.Split(businessKey, "-")[0]
-	result := this.GetString("result")
-	certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
-	var supplierCertEntity suppliercert.OilSupplierCert
-	certSrv.GetEntityById(supplierCertId, &supplierCertEntity)
-
-	cols := []string{
-		"Id",
-		"Status",
-		"ApplyTime",
-		"InFlag",
-		"StorageOn",
-		"ModifiedOn",
-	}
-	//进入此步骤,记录在数据库中
-	if result == "1" {
-		supplierCertEntity.Status = suppliercert.STORE_STATUS // 7 已入库
-	} else {
-		supplierCertEntity.Status = suppliercert.NO_STOREING_STATUS // -7 待入库未通过
-	}
-
-	supplierCertEntity.StorageOn = time.Now()
-	supplierCertEntity.ApplyTime = time.Now().AddDate(1, 0, 0)
-	supplierCertEntity.InFlag = "1"
-	supplierCertEntity.ModifiedOn = time.Now()
-	certSrv.UpdateEntityByIdCols(supplierCertId, supplierCertEntity, cols)
-
 	this.Data["json"] = 1
 	this.ServeJSON()
 }