Browse Source

收费增加查询条件为空校验

wangli 4 years ago
parent
commit
eb48f314cb

+ 1 - 0
smart-city-platform/src/main/java/com/bz/smart_city/commom/model/ResultStatus.java

@@ -86,6 +86,7 @@ public enum ResultStatus {
     ACCOUNT_OPERATOR_EERROR(-724,"操作员信息异常"),
     PAYFEE_NOT_ENOUGH(-725,"缴费金额不足"),
     PAY_INVOICE_EXISTED(-726,"收据信息已存在"),
+    PAY_CONDITION_ISNULL(-727,"查询条件为空"),
     CUSTOMER_IS_EXISTED(-3001,"客户名称已存在");
 
     private final int status;

+ 5 - 1
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/pay/PayFeeServiceImp.java

@@ -1,6 +1,6 @@
 package com.bz.smart_city.service.impl.pay;
 
-import com.aliyuncs.utils.StringUtils;
+
 import com.bz.smart_city.commom.exception.ServiceException;
 import com.bz.smart_city.commom.model.ResultStatus;
 import com.bz.smart_city.commom.util.UserUtil;
@@ -13,6 +13,7 @@ import com.bz.smart_city.entity.pay.BaseClosingAccountInfo;
 import com.bz.smart_city.entity.pay.PayPayReceived;
 import com.bz.smart_city.entity.pay.PayReceivable;
 import com.bz.smart_city.service.pay.PayFeeService;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -760,6 +761,9 @@ public class PayFeeServiceImp implements PayFeeService {
     }
 
     public List<PayfeeAccountInfoDto> findPayfeeAccountInfo(BigInteger id, String condition ){
+        if(StringUtils.isBlank(condition)&&id == null){
+            throw new ServiceException(ResultStatus.PAY_CONDITION_ISNULL);
+        }
         LoginUser loginUser = UserUtil.getCurrentUser();
         //数据权限
         return payFeeMapper.findPayfeeAccountInfo(id, condition ,loginUser.getSiteId(),loginUser.getCustomerId(),UserUtil.getCurrentSiteProgramItems(loginUser));