Bladeren bron

代码规范调整20220116

mashengyi 2 jaren geleden
bovenliggende
commit
32aedbc186

+ 9 - 3
src/main/java/com/jkcredit/invoice/controller/business/CustomerController.java

@@ -397,15 +397,14 @@ public class CustomerController {
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
     public RespR findCustomerRecTimeList(Page page, CustomerRec customerRec) {
         IPage ipage = null;
-        if ((StringUtils.isNotEmpty(customerRec.getServiceEndTime()) && !NULL.equals(customerRec.getServiceEndTime())) ||
-                (StringUtils.isNotEmpty(customerRec.getCompanyName()) && !NULL.equals(customerRec.getCompanyName())) ||
-                (StringUtils.isNotEmpty(customerRec.getCompanyBelongName()) && !NULL.equals(customerRec.getCompanyBelongName()))) {
+        if (isaBoolean(customerRec)) {
             if (StringUtils.isNotEmpty(customerRec.getServiceEndTime()) && !NULL.equals(customerRec.getServiceEndTime())) {
                 String[] res = customerRec.getServiceEndTime().split(",");
                 customerRec.setServiceEndTimeStart(res[0]);
                 customerRec.setServiceEndTimeEnd(res[1].replace("00:00:00", "23:59:59"));
             }
             ipage = customerRecService.findAllCustomerRecWarning(page, customerRec);
+
         } else {
             Param param = paramService.getParamsByParamName("CUST_EARLY_WARNING");
             ipage = customerRecService.findAllCustomerRecWarning(page, customerRec);
@@ -427,6 +426,13 @@ public class CustomerController {
         return new RespR(ipage);
     }
 
+    private boolean isaBoolean(CustomerRec customerRec) {
+        return (StringUtils.isNotEmpty(customerRec.getServiceEndTime())
+                && !NULL.equals(customerRec.getServiceEndTime())) ||
+                (StringUtils.isNotEmpty(customerRec.getCompanyName()) && !NULL.equals(customerRec.getCompanyName())) ||
+                (StringUtils.isNotEmpty(customerRec.getCompanyBelongName()) && !NULL.equals(customerRec.getCompanyBelongName()));
+    }
+
     /**
      * 分页查询余额告警用户
      *

+ 6 - 3
src/main/java/com/jkcredit/invoice/credit/SimpleCoreFilter.java

@@ -371,9 +371,7 @@ public class SimpleCoreFilter implements Filter {
             if (0 >= new BigDecimal(customer1.getAccountBalance()).compareTo(new BigDecimal(0.0))) {
                 flags = true;
             }
-            if (0 == new BigDecimal(customer1.getAccountBalance()).compareTo(new BigDecimal(0.0))
-
-                    && ("WAY_BILL_NUM_FIND_INVOICE".equals(api) || "B2B_INVOICE_QUERY_V1".equals(api))) {
+            if (isaBoolean(api, customer1)) {
                 flags = false;
             }
             if (flags) {
@@ -388,6 +386,11 @@ public class SimpleCoreFilter implements Filter {
         return ResponseCode.SUCCESS;
     }
 
+    private boolean isaBoolean(String api, Customer customer1) {
+        return 0 == new BigDecimal(customer1.getAccountBalance()).compareTo(new BigDecimal(0.0))
+                && ("WAY_BILL_NUM_FIND_INVOICE".equals(api) || "B2B_INVOICE_QUERY_V1".equals(api));
+    }
+
     public String getOpenApiRequestData(HttpServletRequest request) {
         String str = "";
         try {

+ 8 - 1
src/main/java/com/jkcredit/invoice/credit/interserver/NoCarInterServiceImpl.java

@@ -760,7 +760,7 @@ public class NoCarInterServiceImpl implements NoCarInterService {
                 noCarWayBill1.setInterType(0);
                 noCarWayBill1.setBillwayStatus(-5);
             }
-            if (noCarWayBill1.getInterType() == REC_STATUS_WAIT || (noCarWayBill1.getBillwayStatus() < REC_STATUS_UN && noCarWayBill1.getFailReason() != null && noCarWayBill1.getFailReason().contains(XY_WAYBILL_HISTORY_END))) {
+            if (isaBoolean(noCarWayBill1)) {
                 noCarWayBill1.setBillwayStatus(-5);
             }
             noCarWayBill1.setCustomerName(appKey);
@@ -791,6 +791,13 @@ public class NoCarInterServiceImpl implements NoCarInterService {
         return result;
     }
 
+    private boolean isaBoolean(NoCarWayBill noCarWayBill1) {
+        return noCarWayBill1.getInterType() == REC_STATUS_WAIT ||
+                (noCarWayBill1.getBillwayStatus() < REC_STATUS_UN &&
+                        noCarWayBill1.getFailReason() != null &&
+                        noCarWayBill1.getFailReason().contains(XY_WAYBILL_HISTORY_END));
+    }
+
     /**
      * 无车  获取未查询过发票的运单编号
      *

+ 15 - 2
src/main/java/com/jkcredit/invoice/service/lowerservice/impl/NoCarServiceImpl.java

@@ -619,8 +619,8 @@ public class NoCarServiceImpl implements NoCarService {
             isKf = 5;
         }
         log.info("取票啦:NoCarServiceImpl.getInvoiceByWayBillNumReal{},isCurr{}", noCarWayBill, isInterface);
-        if (isInterface && (noCarWayBill.getBillwayStatus() != NE_FIVE_NUM || noCarWayBill.getInterType() == FOR_NUM)) {
-            if (noCarWayBill.getBillwayStatus() == ONE_NUM || noCarWayBill.getBillwayStatus() == TWO_NUM || noCarWayBill.getBillwayStatus() == THREE_NUM || noCarWayBill.getBillwayStatus() == FOR_NUM) {
+        if (isaBoolean(noCarWayBill, isInterface)) {
+            if (isaBoolean(noCarWayBill)) {
                 //直接返回发票信息
                 List<BillInvoice> billInvoices = billInvoiceMapper.selectByBillNum(noCarWayBill.getBillNum());
                 WaybillNumFindInvoiceResponse waybillNumFindInvoiceResponse = buildInterFaceVoiceData(noCarWayBill, billInvoices);
@@ -686,6 +686,19 @@ public class NoCarServiceImpl implements NoCarService {
         return new RespR("success");
     }
 
+    private boolean isaBoolean(NoCarWayBill noCarWayBill, boolean isInterface) {
+        return isInterface &&
+                (noCarWayBill.getBillwayStatus() != NE_FIVE_NUM ||
+                        noCarWayBill.getInterType() == FOR_NUM);
+    }
+
+    private boolean isaBoolean(NoCarWayBill noCarWayBill) {
+        return noCarWayBill.getBillwayStatus() == ONE_NUM ||
+                noCarWayBill.getBillwayStatus() == TWO_NUM ||
+                noCarWayBill.getBillwayStatus() == THREE_NUM ||
+                noCarWayBill.getBillwayStatus() == FOR_NUM;
+    }
+
     private boolean countCalculateInfo(NoCarWayBill noCarWayBill, byte isKf, RespR<WaybillNumFindInvoiceResponse> responseRespR) {
         //删除已有发票
         billInvoiceMapper.deleteByBillNum(noCarWayBill.getBillNum());