he2802 2 anni fa
parent
commit
e1a888d1bd

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserBankRecordServiceImpl.java

@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.convert.Convert;
 import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
+import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.common.utils.ip.IpUtils;
@@ -133,6 +134,9 @@ public class UserBankRecordServiceImpl extends ServiceImpl<UserBankRecordMapper,
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Long insertByAddBo(UserBankRecordAddBo bo) {
+        if(Validator.isEmpty(bo.getGradeId())){
+            throw new CustomException("参数缺失");
+        }
         UserBankRecord add = BeanUtil.toBean(bo, UserBankRecord.class);
         validEntityBeforeSave(add);
         add.setStatus(1);