Parcourir la source

支付权重bug

yubin il y a 1 semaine
Parent
commit
4bcec09b97

+ 8 - 0
cif-service/src/main/java/com/txz/cif/web/mng/MidChannelMethodController.java

@@ -1,5 +1,6 @@
 package com.txz.cif.web.mng;
 import cn.hutool.core.bean.BeanUtil;
+import com.txz.cif.configurer.LocalUtil;
 import com.txz.cif.core.Result;
 import com.txz.cif.core.ResultGenerator;
 import com.txz.cif.model.MidChannelMethod;
@@ -10,6 +11,7 @@ import com.txz.cif.core.ResultCode;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.txz.cif.web.para.updateparam.MidChannelMethodUpdateParam;
+import org.springframework.util.ObjectUtils;
 import org.springframework.web.bind.annotation.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -79,7 +81,13 @@ public class MidChannelMethodController {
     	if(midChannelMethodUpdateParam.getId() == null){
     		return ResultGenerator.genFailResult(ResultCode.ID_IS_NULL);
     	}
+        if(!ObjectUtils.isEmpty(midChannelMethodUpdateParam.getWeight())){
+			Byte weight = 10;
+			if(midChannelMethodUpdateParam.getWeight()>weight){
+				return ResultGenerator.genFailResult(LocalUtil.get("the.weight.cannot.exceed.10"));
+			}
 
+		}
 		MidChannelMethod bean = BeanUtil.toBean(midChannelMethodUpdateParam, MidChannelMethod.class);
 		try {
     //		midChannelMethod.setUpdateTime(new Date());

+ 2 - 0
cif-service/src/main/resources/static/i18n/messages_en.properties

@@ -125,6 +125,8 @@ account.not.found=account not found
 account.not.found=account not found
 increment.factor.must.be.greater.than.0=increment factor must be greater than 0
 
+the.weight.cannot.exceed.10=the weight cannot exceed 10
+
 interface=interface
 does.not.exist=does not exist
 internal.error.please.contact.the.administrator=internal error please contact the administrator

+ 2 - 0
cif-service/src/main/resources/static/i18n/messages_zh_CN.properties

@@ -125,6 +125,8 @@ frozen.account.not.found=\u51BB\u7ED3\u8D26\u53F7\u672A\u627E\u5230
 account.not.found=\u8D26\u53F7\u672A\u627E\u5230
 account.not.found=\u8D26\u53F7\u672A\u627E\u5230
 increment.factor.must.be.greater.than.0=\u9012\u589E\u56E0\u5B50\u5FC5\u987B\u5927\u4E8E0
+the.weight.cannot.exceed.10=\u6743\u91CD\u4E0D\u80FD\u5927\u4E8E10
+
 
 interface=\u63A5\u53E3
 does.not.exist=\u4E0D\u5B58\u5728