Kaynağa Gözat

后端: 增项申请物资类 准入范围小于50项不交费

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

+ 12 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertAppendListener.go

@@ -11,6 +11,7 @@ import (
 	"dashoo.cn/backend/api/business/register"
 	"dashoo.cn/business/userRole"
 	"encoding/json"
+	"log"
 	"strconv"
 	"strings"
 	"time"
@@ -215,6 +216,17 @@ func (this *OilSupplierCertAppendListenerController) CheckNeedPay() {
 			break
 		}
 	}
+	if supplierCertAppendEntity.AppendType == "01" && result == 1 {
+		// 如果是物资类且属于需要付费类型
+		where := " SupplierCertId = " + strconv.Itoa(supplierCertAppendEntity.SupplierCertId) + " and SupplierTypeCode = '" + supplierCertAppendEntity.AppendType + "' and SupplierCertAppendId = " + strconv.Itoa(supplierCertAppendEntity.Id)
+		svc := suppliercertappendsub.GetOilSupplierCertAppendSubService(utils.DBE)
+		var list []suppliercertsub.OilSupplierCertSub
+		total := svc.GetPagingEntitiesWithOrder(1, 10, "CreateOn", false, &list, where)
+		if total <= 50 {
+			log.Print("物资类增项准入范围小于50项, 公司:" + supplierCertAppendEntity.SupplierName + " 增项ID:" + strconv.Itoa(supplierCertAppendEntity.Id))
+			result = 2
+		}
+	}
 	if isPay == unPay {
 		// 准入类型是否付费有误!请联系管理员
 		result = 0