Kaynağa Gözat

准入申请-兼容驳回后在是否再交费的判断

baichengfei 5 yıl önce
ebeveyn
işleme
e04599bfdb

+ 12 - 0
src/dashoo.cn/backend/api/business/oilsupplier/suppliercertcommon/oilsuppliercertCheckStatus.go

@@ -2,6 +2,7 @@ package suppliercertcommon
 
 import (
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
+	"dashoo.cn/backend/api/business/paymentinfo"
 	. "dashoo.cn/backend/api/mydb"
 	"github.com/go-xorm/xorm"
 )
@@ -98,3 +99,14 @@ func (s *OilSupplierCertCheckStatus) CheckOilSupplierCertIsNeedConcentrateAudit(
 
 	return result
 }
+
+func (s *OilSupplierCertCheckStatus) CheckOilSupplierCertHavePayed(certId string) bool {
+	var paymentInfoEntity paymentinfo.OilPaymentInfo
+	where := "where isPay='2' and SrcId='" + certId + "' and SupplierCertId='" + certId + "'"
+	s.GetEntityByWhere("OilPaymentInfo", where, &paymentInfoEntity)
+	if paymentInfoEntity.Id > 0 {
+		return true
+	} else {
+		return false
+	}
+}

+ 6 - 2
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercert.go

@@ -1044,7 +1044,11 @@ func (this *OilSupplierCertController) UpdateIsStorage() {
 			this.ServeJSON()
 		} else {
 			//返回正确结果
-			errinfo.Message = "入库成功"
+			if result == "1" {
+				errinfo.Message = "入库成功"
+			} else {
+				errinfo.Message = "退回成功"
+			}
 			errinfo.Code = 0
 			this.Data["json"] = &errinfo
 			this.ServeJSON()
@@ -1110,7 +1114,7 @@ func (this *OilSupplierCertController) UpdateIsStorage() {
 	ActiComplete.ProcessKey = workflow.OIL_ENUSER_SUPPLIER_APPLY
 	ActiComplete.BusinessKey = supplierCertEntity.BusinessKey
 	ActiComplete.UserId = this.User.Id //审批人员
-	ActiComplete.Result = "1"
+	ActiComplete.Result = result
 	ActiComplete.Remarks = AuditRemark
 	ActiComplete.CallbackUrl = utils.Cfg.MustValue("workflow", "callbackHost")
 	receiveVal := svcActiviti.TaskComplete(ActiComplete)

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

@@ -260,6 +260,11 @@ func (this *OilSupplierCertListenerController) CheckNeedPay() {
 	//certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
 	checkStatus := suppliercertcommon.GetOilSupplierCertCheckStatusService(utils.DBE)
 	result := checkStatus.CheckOilSupplierCertIsNeedPay(supplierCertId)
+	checkHavePayed := false
+	checkHavePayed = checkStatus.CheckOilSupplierCertHavePayed(supplierCertId)
+	if checkHavePayed {
+		result = 2 // 已交费, 不再需要交费
+	}
 
 	this.Data["json"] = result
 	this.ServeJSON()