Переглянути джерело

阿里巴巴代码规约问题修改-4 20230115

mashengyi 2 роки тому
батько
коміт
6f60a5530d
100 змінених файлів з 2709 додано та 2583 видалено
  1. 1 1
      src/main/java/com/jkcredit/invoice/annotation/LoginRequired.java
  2. 5 6
      src/main/java/com/jkcredit/invoice/annotation/annotationdes/AuthenticationInterceptor.java
  3. 1 2
      src/main/java/com/jkcredit/invoice/annotation/annotationdes/CurrentUserMethodArgumentResolver.java
  4. 5 6
      src/main/java/com/jkcredit/invoice/common/ApiResult.java
  5. 3 5
      src/main/java/com/jkcredit/invoice/common/CommonConst.java
  6. 2 2
      src/main/java/com/jkcredit/invoice/common/DataResult.java
  7. 7 8
      src/main/java/com/jkcredit/invoice/common/RequestApi.java
  8. 19 19
      src/main/java/com/jkcredit/invoice/common/ResponseCode.java
  9. 0 3
      src/main/java/com/jkcredit/invoice/common/TokenConst.java
  10. 18 15
      src/main/java/com/jkcredit/invoice/component/SendMailService.java
  11. 29 32
      src/main/java/com/jkcredit/invoice/component/StatisRequestIdTimeComp.java
  12. 4 3
      src/main/java/com/jkcredit/invoice/config/CorsConfig.java
  13. 5 1
      src/main/java/com/jkcredit/invoice/config/GlobalExceptionHandler.java
  14. 7 0
      src/main/java/com/jkcredit/invoice/config/InvoiceWebMvcConfigurer.java
  15. 2 3
      src/main/java/com/jkcredit/invoice/config/RedisConfig.java
  16. 128 131
      src/main/java/com/jkcredit/invoice/controller/business/CustomerController.java
  17. 295 283
      src/main/java/com/jkcredit/invoice/controller/business/NoCarController.java
  18. 171 164
      src/main/java/com/jkcredit/invoice/controller/business/SelfCarController.java
  19. 13 12
      src/main/java/com/jkcredit/invoice/controller/interserver/CustomerLowerServiceController.java
  20. 35 32
      src/main/java/com/jkcredit/invoice/controller/interserver/NoCarServiceController.java
  21. 71 68
      src/main/java/com/jkcredit/invoice/controller/interserver/SelfCarServiceController.java
  22. 10 11
      src/main/java/com/jkcredit/invoice/controller/param/ParamController.java
  23. 6 5
      src/main/java/com/jkcredit/invoice/controller/user/AuthenticationController.java
  24. 2 2
      src/main/java/com/jkcredit/invoice/controller/user/RoleController.java
  25. 14 13
      src/main/java/com/jkcredit/invoice/controller/user/UserController.java
  26. 107 107
      src/main/java/com/jkcredit/invoice/credit/InterfaceCheckServer.java
  27. 87 98
      src/main/java/com/jkcredit/invoice/credit/SimpleCoreFilter.java
  28. 1 3
      src/main/java/com/jkcredit/invoice/credit/dto/CardChangeDto.java
  29. 14 16
      src/main/java/com/jkcredit/invoice/credit/interserver/CustomerInterLowerService.java
  30. 102 113
      src/main/java/com/jkcredit/invoice/credit/interserver/CustomerInterLowerServiceImpl.java
  31. 220 250
      src/main/java/com/jkcredit/invoice/credit/interserver/NoCarInterServiceImpl.java
  32. 192 205
      src/main/java/com/jkcredit/invoice/credit/interserver/SelfCarInterServiceImpl.java
  33. 14 3
      src/main/java/com/jkcredit/invoice/mapper/binvoce/BillInvoiceMapper.java
  34. 3 2
      src/main/java/com/jkcredit/invoice/mapper/binvoce/HcInvoiceMapper.java
  35. 4 1
      src/main/java/com/jkcredit/invoice/mapper/binvoce/SelfCarApplMapper.java
  36. 4 0
      src/main/java/com/jkcredit/invoice/mapper/binvoce/SelfCarInvoiceMapper.java
  37. 1 1
      src/main/java/com/jkcredit/invoice/mapper/calculateinfor/NoCarCalculateInforMapper.java
  38. 1 1
      src/main/java/com/jkcredit/invoice/mapper/calculateinfor/SelfCarCalculateInforMapper.java
  39. 18 0
      src/main/java/com/jkcredit/invoice/mapper/customer/CustomerCarRecMapper.java
  40. 4 1
      src/main/java/com/jkcredit/invoice/mapper/customer/CustomerChangeInfoMapper.java
  41. 7 2
      src/main/java/com/jkcredit/invoice/mapper/customer/CustomerMapper.java
  42. 16 2
      src/main/java/com/jkcredit/invoice/mapper/customer/CustomerRecMapper.java
  43. 3 4
      src/main/java/com/jkcredit/invoice/mapper/manager/ParamMapper.java
  44. 8 3
      src/main/java/com/jkcredit/invoice/mapper/user/UserMapper.java
  45. 2 1
      src/main/java/com/jkcredit/invoice/mapper/waybill/NoCarWaybillImprtMapper.java
  46. 8 1
      src/main/java/com/jkcredit/invoice/mapper/waybill/NoCarWaybillMapper.java
  47. 6 1
      src/main/java/com/jkcredit/invoice/mapper/waybill/SellCarTradeMapper.java
  48. 3 3
      src/main/java/com/jkcredit/invoice/model/entity/calculate/NoCarCalculateInfor.java
  49. 8 7
      src/main/java/com/jkcredit/invoice/model/entity/customer/Customer.java
  50. 5 2
      src/main/java/com/jkcredit/invoice/model/entity/customer/CustomerCarRec.java
  51. 2 2
      src/main/java/com/jkcredit/invoice/model/entity/customer/CustomerEtcChangeInfo.java
  52. 9 13
      src/main/java/com/jkcredit/invoice/model/entity/customer/CustomerRec.java
  53. 14 14
      src/main/java/com/jkcredit/invoice/model/entity/invoice/BillInvoice.java
  54. 8 7
      src/main/java/com/jkcredit/invoice/model/entity/invoice/SelfCarAppl.java
  55. 9 9
      src/main/java/com/jkcredit/invoice/model/entity/invoice/SelfCarInvoice.java
  56. 1 2
      src/main/java/com/jkcredit/invoice/model/entity/manager/Param.java
  57. 1 1
      src/main/java/com/jkcredit/invoice/model/entity/user/User.java
  58. 10 10
      src/main/java/com/jkcredit/invoice/model/entity/waybill/NoCarWayBill.java
  59. 1 1
      src/main/java/com/jkcredit/invoice/model/entity/waybill/SelfCarTrade.java
  60. 2 2
      src/main/java/com/jkcredit/invoice/model/vo/SearchInvoiceResultVo.java
  61. 4 1
      src/main/java/com/jkcredit/invoice/service/calculateinfor/NoCarCalculateInfoService.java
  62. 3 1
      src/main/java/com/jkcredit/invoice/service/calculateinfor/SelfCarCalculateInfoService.java
  63. 17 15
      src/main/java/com/jkcredit/invoice/service/calculateinfor/impl/NocarCalculateInfoServiceImpl.java
  64. 15 13
      src/main/java/com/jkcredit/invoice/service/calculateinfor/impl/SelfcarCalculateInfoServiceImpl.java
  65. 1 1
      src/main/java/com/jkcredit/invoice/service/customer/CustomerChangeInfoService.java
  66. 3 1
      src/main/java/com/jkcredit/invoice/service/customer/CustomerOperService.java
  67. 6 1
      src/main/java/com/jkcredit/invoice/service/customer/CustomerRecService.java
  68. 2 0
      src/main/java/com/jkcredit/invoice/service/customer/CustomerRechargeService.java
  69. 23 7
      src/main/java/com/jkcredit/invoice/service/customer/CustomerService.java
  70. 4 3
      src/main/java/com/jkcredit/invoice/service/customer/impl/CustomerChangeInfoServiceImpl.java
  71. 6 4
      src/main/java/com/jkcredit/invoice/service/customer/impl/CustomerOperServiceImpl.java
  72. 16 6
      src/main/java/com/jkcredit/invoice/service/customer/impl/CustomerRecServiceImpl.java
  73. 5 3
      src/main/java/com/jkcredit/invoice/service/customer/impl/CustomerRechargeServiceImpl.java
  74. 65 70
      src/main/java/com/jkcredit/invoice/service/customer/impl/CustomerServiceImpl.java
  75. 4 2
      src/main/java/com/jkcredit/invoice/service/lowerservice/CheckHasAuthRole.java
  76. 5 0
      src/main/java/com/jkcredit/invoice/service/lowerservice/CustomeLowerService.java
  77. 16 2
      src/main/java/com/jkcredit/invoice/service/lowerservice/NoCarService.java
  78. 11 3
      src/main/java/com/jkcredit/invoice/service/lowerservice/SelfCarServiceL.java
  79. 8 7
      src/main/java/com/jkcredit/invoice/service/lowerservice/impl/CheckHasAuthRoleImpl.java
  80. 68 66
      src/main/java/com/jkcredit/invoice/service/lowerservice/impl/CustomerLowerServiceImpl.java
  81. 268 257
      src/main/java/com/jkcredit/invoice/service/lowerservice/impl/NoCarServiceImpl.java
  82. 185 176
      src/main/java/com/jkcredit/invoice/service/lowerservice/impl/SelfCarServiceLImpl.java
  83. 1 3
      src/main/java/com/jkcredit/invoice/service/lowerservice/vo/EtcQueryVo.java
  84. 1 1
      src/main/java/com/jkcredit/invoice/service/lowerservice/vo/EtcValidVo.java
  85. 1 1
      src/main/java/com/jkcredit/invoice/service/lowerservice/vo/InvoiceApplVo.java
  86. 1 1
      src/main/java/com/jkcredit/invoice/service/lowerservice/vo/MonthAccountQueryVo.java
  87. 1 1
      src/main/java/com/jkcredit/invoice/service/lowerservice/vo/TradeApplyQueryInvVo.java
  88. 3 7
      src/main/java/com/jkcredit/invoice/service/manager/ParamService.java
  89. 1 5
      src/main/java/com/jkcredit/invoice/service/manager/impl/ParamServiceImpl.java
  90. 1 3
      src/main/java/com/jkcredit/invoice/service/nocar/HcInvoiceService.java
  91. 5 2
      src/main/java/com/jkcredit/invoice/service/nocar/NoCarBillWayImportService.java
  92. 9 3
      src/main/java/com/jkcredit/invoice/service/nocar/NoCarBillWayService.java
  93. 1 3
      src/main/java/com/jkcredit/invoice/service/nocar/NoCarRecService.java
  94. 4 3
      src/main/java/com/jkcredit/invoice/service/nocar/NocarInvoiceService.java
  95. 3 3
      src/main/java/com/jkcredit/invoice/service/nocar/impl/HcInvoiceServiceImpl.java
  96. 6 4
      src/main/java/com/jkcredit/invoice/service/nocar/impl/NoCarBillWayImportServiceImpl.java
  97. 137 139
      src/main/java/com/jkcredit/invoice/service/nocar/impl/NoCarBillWayServiceImpl.java
  98. 34 33
      src/main/java/com/jkcredit/invoice/service/nocar/impl/NoCarRecServiceImpl.java
  99. 17 17
      src/main/java/com/jkcredit/invoice/service/nocar/impl/NocarInvoiceServiceImpl.java
  100. 0 0
      src/main/java/com/jkcredit/invoice/service/selfcar/SelfCarApplyService.java

+ 1 - 1
src/main/java/com/jkcredit/invoice/annotation/LoginRequired.java

@@ -11,6 +11,6 @@ import java.lang.annotation.Target;
 @Target({ElementType.METHOD})
 @Retention(RetentionPolicy.RUNTIME)
 public @interface LoginRequired {
-    String role() default "" ;
+    String role() default "";
 }
 

+ 5 - 6
src/main/java/com/jkcredit/invoice/annotation/annotationdes/AuthenticationInterceptor.java

@@ -25,9 +25,9 @@ import java.lang.reflect.Method;
  **/
 public class AuthenticationInterceptor implements HandlerInterceptor {
 
-    public static final String AUTH_ADMIN ="1";
-    public static final String AUTH_NOCAR ="2";
-    public static final String AUTH_SELFCAR ="0";
+    public static final String AUTH_ADMIN = "1";
+    public static final String AUTH_NOCAR = "2";
+    public static final String AUTH_SELFCAR = "0";
     @Autowired
     private UserService userService;
     @Autowired
@@ -48,8 +48,7 @@ public class AuthenticationInterceptor implements HandlerInterceptor {
         // 有 @LoginRequired 注解,需要认证
         if (methodAnnotation != null) {
             // 执行认证 从 http 请求头中取出 token
-            String token = request.getHeader("token")==null? request.getParameter("token"):request.getHeader("token");
-           ;
+            String token = request.getHeader("token") == null ? request.getParameter("token") : request.getHeader("token");
             if (token == null) {
                 throw new RuntimeException("无token,请重新登录");
             }
@@ -62,7 +61,7 @@ public class AuthenticationInterceptor implements HandlerInterceptor {
                 throw new RuntimeException("用户不存在,请重新登录");
             }
             request.setAttribute("currentUser", user);
-            if((!StringUtils.isEmpty(methodAnnotation.role())) && !methodAnnotation.role().equals(user.getRoleId()) && !AuthenticationInterceptor.AUTH_ADMIN.equals(user.getRoleId())){
+            if ((!StringUtils.isEmpty(methodAnnotation.role())) && !methodAnnotation.role().equals(user.getRoleId()) && !AuthenticationInterceptor.AUTH_ADMIN.equals(user.getRoleId())) {
                 throw new RuntimeException("无权限");
             }
             return true;

+ 1 - 2
src/main/java/com/jkcredit/invoice/annotation/annotationdes/CurrentUserMethodArgumentResolver.java

@@ -1,6 +1,5 @@
 package com.jkcredit.invoice.annotation.annotationdes;
 
-import com.jkcredit.invoice.annotation.CurrentUser;
 import com.jkcredit.invoice.model.entity.user.User;
 import org.springframework.core.MethodParameter;
 import org.springframework.web.bind.support.WebDataBinderFactory;
@@ -11,7 +10,7 @@ import org.springframework.web.method.support.ModelAndViewContainer;
 import org.springframework.web.multipart.support.MissingServletRequestPartException;
 
 /**
- *  增加方法注入,将含有 @CurrentUser 注解的方法参数注入当前登录用户
+ * 增加方法注入,将含有 @CurrentUser 注解的方法参数注入当前登录用户
  */
 public class CurrentUserMethodArgumentResolver implements HandlerMethodArgumentResolver {
     @Override

+ 5 - 6
src/main/java/com/jkcredit/invoice/common/ApiResult.java

@@ -65,7 +65,7 @@ public class ApiResult<T> implements Serializable {
     /**
      * 获取成功状态结果
      *
-     * @param data 返回数据
+     * @param data      返回数据
      * @param extraData 附加数据
      * @return
      */
@@ -112,12 +112,11 @@ public class ApiResult<T> implements Serializable {
      * @param responseCode 返回状态码
      * @return
      */
-    public static ApiResult failure(ResponseCode responseCode,String requestid) {
-        return failure(responseCode.getData(),responseCode.getCode(), requestid, responseCode.getMsg());
+    public static ApiResult failure(ResponseCode responseCode, String requestid) {
+        return failure(responseCode.getData(), responseCode.getCode(), requestid, responseCode.getMsg());
     }
 
 
-
     /**
      * 获取失败状态结果
      *
@@ -125,7 +124,7 @@ public class ApiResult<T> implements Serializable {
      * @return
      */
     public static ApiResult failure(DataResult dataResult) {
-        return failure(dataResult.getData(),dataResult.getCode(), dataResult.getRequestid(),dataResult.getMsg());
+        return failure(dataResult.getData(), dataResult.getCode(), dataResult.getRequestid(), dataResult.getMsg());
     }
 
     /**
@@ -163,7 +162,7 @@ public class ApiResult<T> implements Serializable {
      * @param data 返回结果
      * @return
      */
-    public static ApiResult failure( int data, int code,String requestid, String msg) {
+    public static ApiResult failure(int data, int code, String requestid, String msg) {
         ApiResult result = new ApiResult();
         result.setData(data);
         result.setCode(code);

+ 3 - 5
src/main/java/com/jkcredit/invoice/common/CommonConst.java

@@ -18,16 +18,15 @@ public class CommonConst {
     public static final char COMMAS = ',';
 
     /**
-     *  0 -自有车
-     *  1 -外协车
-     *  2 -无车
+     * 0 -自有车
+     * 1 -外协车
+     * 2 -无车
      */
     public static final String SELF_CAR = "0";
     public static final String FOREIGE_CAR = "1";
     public static final String NO_CAR = "2";
 
 
-
     public static final String ZERO = "0";
     public static final String ONE = "1";
     public static final String TWO = "2";
@@ -106,5 +105,4 @@ public class CommonConst {
     public static final String CONTEXT_PATH = "/jkcredit/";
 
 
-
 }

+ 2 - 2
src/main/java/com/jkcredit/invoice/common/DataResult.java

@@ -12,8 +12,8 @@ public class DataResult implements Serializable {
     private int code;
     private String msg;
     private int data = 3;
-    
-  
+
+
     /**
      * 返回客户信息定位标记
      */

+ 7 - 8
src/main/java/com/jkcredit/invoice/common/RequestApi.java

@@ -1,14 +1,13 @@
 package com.jkcredit.invoice.common;
 
 /**
-* @Description 包装接口返回值工具类
-* @Author  mashengyi
-* @Date   2022/2/8 18:14
-* @Param
-* @Return
-* @Exception
-*
-*/
+ * @Description 包装接口返回值工具类
+ * @Author mashengyi
+ * @Date 2022/2/8 18:14
+ * @Param
+ * @Return
+ * @Exception
+ */
 public class RequestApi {
     String api = "";
     String appKey = "";

+ 19 - 19
src/main/java/com/jkcredit/invoice/common/ResponseCode.java

@@ -12,34 +12,34 @@ import lombok.ToString;
 @ToString
 public enum ResponseCode {
 
-  /**
+    /**
      * 成功与失败
      */
-    SUCCESS(1,200, "成功"),
-    FAILQUERYNO(2,200, "未查得"),
-    FAIL(3,200, "失败"),
+    SUCCESS(1, 200, "成功"),
+    FAILQUERYNO(2, 200, "未查得"),
+    FAIL(3, 200, "失败"),
     /**
      * 参数异常
      */
-    ACCOUNT_NOT_EXIST(3,1000,"无效用户"),
-    PARAM_NOT_NULL(3,1010, "参数不能为空"),
+    ACCOUNT_NOT_EXIST(3, 1000, "无效用户"),
+    PARAM_NOT_NULL(3, 1010, "参数不能为空"),
 
-    MEDIA_TYPE_NOT_SUPPORT_ERROR(3,1020,"参数类型不正确"),
-    ONE_DAY_QUERY_ERROR(3,1030,"单日查询次数到达上限"),
-    SIGN_ERROR(3,1040,"appkey错误/签名校验失败"),
-    TIME_ERROR(3,1050,"账号使用时间未到"),
-    TIME_OUT_ERROR(3,1060,"账号使用时间已过"),
-    ALL_DAY_QUERY_ERROR(3,1070,"总查询次数到达上限"),
-    CUSTOMER_QUERY_ERROR(3,1080,"商户模块未配置"),
-    BALANCE_QUERY_ERROR(3,1090,"商户余额不足"),
-    API_QUERY_ERROR(3,1100,"请求的API模块不存在"),
-    TIME_QUERY_ERROR(3,1110,"商户单位时间内请求超过限制"),
-    OTHER_ERROR(3,9999,"其他异常-"),
+    MEDIA_TYPE_NOT_SUPPORT_ERROR(3, 1020, "参数类型不正确"),
+    ONE_DAY_QUERY_ERROR(3, 1030, "单日查询次数到达上限"),
+    SIGN_ERROR(3, 1040, "appkey错误/签名校验失败"),
+    TIME_ERROR(3, 1050, "账号使用时间未到"),
+    TIME_OUT_ERROR(3, 1060, "账号使用时间已过"),
+    ALL_DAY_QUERY_ERROR(3, 1070, "总查询次数到达上限"),
+    CUSTOMER_QUERY_ERROR(3, 1080, "商户模块未配置"),
+    BALANCE_QUERY_ERROR(3, 1090, "商户余额不足"),
+    API_QUERY_ERROR(3, 1100, "请求的API模块不存在"),
+    TIME_QUERY_ERROR(3, 1110, "商户单位时间内请求超过限制"),
+    OTHER_ERROR(3, 9999, "其他异常-"),
 
     /**
      * 其他
      */
-    UNKNOWN_ERROR(3,500,"系统异常,内部执行错误");
+    UNKNOWN_ERROR(3, 500, "系统异常,内部执行错误");
 
     /**
      * 返回码
@@ -56,7 +56,7 @@ public enum ResponseCode {
      */
     private int data;
 
-    private ResponseCode(int data ,int code, String msg) {
+    ResponseCode(int data, int code, String msg) {
         this.code = code;
         this.msg = msg;
         this.data = data;

+ 0 - 3
src/main/java/com/jkcredit/invoice/common/TokenConst.java

@@ -37,7 +37,4 @@ public class TokenConst {
     public static final long TOKEN_EXPIRE_TIME_MILLIS = 1000 * 60 * 60 * 24 * 30L;
 
 
-
-
-
 }

+ 18 - 15
src/main/java/com/jkcredit/invoice/component/SendMailService.java

@@ -6,33 +6,36 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.mail.javamail.JavaMailSenderImpl;
 import org.springframework.mail.javamail.MimeMessageHelper;
 import org.springframework.stereotype.Component;
+
 import javax.mail.MessagingException;
 import javax.mail.internet.MimeMessage;
+
 @Component
 @Slf4j
 /**
-* @Description 发送邮箱
-* @Author  mashengyi
-* @Date   2022/2/8 18:07
-* @Param
-* @Return
-* @Exception
-*
-*/
+ * @Description 发送邮箱
+ * @Author mashengyi
+ * @Date 2022/2/8 18:07
+ * @Param
+ * @Return
+ * @Exception
+ *
+ */
 public class SendMailService {
-    
-    @Autowired
-    private JavaMailSenderImpl javaMailSender;
+
     @Value("${spring.mail.username}")
     String user;
-    public void sendMail(String email,String contents,String company) throws MessagingException {
+    @Autowired
+    private JavaMailSenderImpl javaMailSender;
+
+    public void sendMail(String email, String contents, String company) throws MessagingException {
         MimeMessage message = javaMailSender.createMimeMessage();
         MimeMessageHelper helper = new MimeMessageHelper(message);
         helper.setFrom(user);
-        String [] emailStr = email.split("#");
+        String[] emailStr = email.split("#");
         helper.setTo(emailStr);
-        helper.setSubject(company+"备案提交");
-        helper.setText(contents,true);
+        helper.setSubject(company + "备案提交");
+        helper.setText(contents, true);
         log.info("before send emil");
         javaMailSender.send(message);
         log.info("send emil");

+ 29 - 32
src/main/java/com/jkcredit/invoice/component/StatisRequestIdTimeComp.java

@@ -14,47 +14,47 @@ import java.util.concurrent.TimeUnit;
 @Component
 @Slf4j
 /**
-* @Description 接口服务容器限流工具
-* @Author  mashengyi
-* @Date   2022/2/8 18:13
-* @Param
-* @Return
-* @Exception
-*
-*/
+ * @Description 接口服务容器限流工具
+ * @Author mashengyi
+ * @Date 2022/2/8 18:13
+ * @Param
+ * @Return
+ * @Exception
+ *
+ */
 public class StatisRequestIdTimeComp {
+    public static volatile boolean isLimit = false;
+    /**
+     * requestId 及 时间
+     */
+    public Map<String, Long> map = new ConcurrentHashMap<>();
+    ScheduledExecutorService service = Executors.newScheduledThreadPool(1);
     /**
      * 关注的请求时间秒
      */
     private byte costTimeAtten = 3;
     private int limitCount = 200;
-    /**
-     * requestId 及 时间
-     */
-    public  Map<String,Long> map = new ConcurrentHashMap<>();
-
-    public static volatile boolean isLimit = false;
-
-
-    ScheduledExecutorService service = Executors.newScheduledThreadPool(1);
 
     /**
      * 放入requestid 及时间
+     *
      * @param requestId
      */
-    public void putReQuestIdAndTime(String requestId){
-        map.put(requestId,System.currentTimeMillis());
+    public void putReQuestIdAndTime(String requestId) {
+        map.put(requestId, System.currentTimeMillis());
     }
 
     /**
      * 放入requestid 及时间
+     *
      * @param requestId
      */
-    public void removeReQuestIdAndTime(String requestId){
+    public void removeReQuestIdAndTime(String requestId) {
         map.remove(requestId);
     }
+
     @PostConstruct
-    public void initScan(){
+    public void initScan() {
         log.info("StatisRequestIdTimeComp-initScan-开始轮训计数");
         service.scheduleAtFixedRate(new Runnable() {
             @Override
@@ -62,23 +62,20 @@ public class StatisRequestIdTimeComp {
 
                 int count = 0;
                 long currTime = System.currentTimeMillis();
-                for(Map.Entry<String,Long> entry:map.entrySet()){
-                    if(currTime-entry.getValue()>costTimeAtten*1000){
+                for (Map.Entry<String, Long> entry : map.entrySet()) {
+                    if (currTime - entry.getValue() > costTimeAtten * 1000) {
                         count++;
-                        log.info("耗时requestid************"+entry.getKey()+"***************"+(currTime-entry.getValue()));
+                        log.info("耗时requestid************" + entry.getKey() + "***************" + (currTime - entry.getValue()));
                     }
                 }
-                if(count>limitCount){
-                    isLimit = true;
-                }else{
-                    isLimit=false;
-                }
-              //  log.info("当前请求数:"+map.size()+"当前耗时请求数:"+count+"是否限制:"+isLimit);
+                isLimit = count > limitCount;
+                //  log.info("当前请求数:"+map.size()+"当前耗时请求数:"+count+"是否限制:"+isLimit);
             }
-        },1,1, TimeUnit.SECONDS);
+        }, 1, 1, TimeUnit.SECONDS);
     }
+
     @PreDestroy
-    public void destroy(){
+    public void destroy() {
         service.shutdown();
     }
 }

+ 4 - 3
src/main/java/com/jkcredit/invoice/config/CorsConfig.java

@@ -8,6 +8,7 @@ import org.springframework.web.filter.CorsFilter;
 
 /**
  * 处理跨域
+ *
  * @author sunzhaoning
  */
 @Configuration
@@ -21,9 +22,9 @@ public class CorsConfig {
         corsConfiguration.addAllowedHeader("*");
         // 3允许任何方法(post、get等)
         corsConfiguration.addAllowedMethod("*");
-        return corsConfiguration;  
-    }  
-  
+        return corsConfiguration;
+    }
+
     @Bean
     public CorsFilter corsFilter() {
         UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();

+ 5 - 1
src/main/java/com/jkcredit/invoice/config/GlobalExceptionHandler.java

@@ -6,7 +6,9 @@ import org.springframework.http.HttpStatus;
 import org.springframework.validation.BindException;
 import org.springframework.validation.FieldError;
 import org.springframework.web.bind.MethodArgumentNotValidException;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseStatus;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
 
 import java.util.List;
 
@@ -22,6 +24,7 @@ public class GlobalExceptionHandler {
 
     /**
      * 全局异常
+     *
      * @param e
      * @return RespR
      */
@@ -34,6 +37,7 @@ public class GlobalExceptionHandler {
 
     /**
      * validation Exception
+     *
      * @param exception
      * @return RespR
      */

+ 7 - 0
src/main/java/com/jkcredit/invoice/config/InvoiceWebMvcConfigurer.java

@@ -25,8 +25,10 @@ public class InvoiceWebMvcConfigurer extends WebMvcConfigurationSupport {
                 .addPathPatterns("/**");
         super.addInterceptors(registry);
     }
+
     /**
      * 支持跨域访问
+     *
      * @param registry
      */
     @Override
@@ -36,9 +38,11 @@ public class InvoiceWebMvcConfigurer extends WebMvcConfigurationSupport {
                 .allowedMethods("POST", "GET", "PUT", "OPTIONS", "DELETE")
                 .allowCredentials(true);
     }
+
     /**
      * 发现如果继承了WebMvcConfigurationSupport,则在yml中配置的相关内容会失效。
      * 需要重新指定静态资源
+     *
      * @param registry
      */
     @Override
@@ -51,14 +55,17 @@ public class InvoiceWebMvcConfigurer extends WebMvcConfigurationSupport {
 
         super.addResourceHandlers(registry);
     }
+
     @Bean
     public CurrentUserMethodArgumentResolver currentUserMethodArgumentResolver() {
         return new CurrentUserMethodArgumentResolver();
     }
+
     @Override
     public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) {
         resolvers.add(new CurrentUserMethodArgumentResolver());
     }
+
     @Bean
     public AuthenticationInterceptor authenticationInterceptor() {
         return new AuthenticationInterceptor();

+ 2 - 3
src/main/java/com/jkcredit/invoice/config/RedisConfig.java

@@ -8,9 +8,8 @@ import org.springframework.cache.annotation.EnableCaching;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.data.redis.connection.RedisConnectionFactory;
-import org.springframework.data.redis.core.*;
+import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
-import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer;
 import org.springframework.data.redis.serializer.StringRedisSerializer;
 
 /**
@@ -23,7 +22,7 @@ import org.springframework.data.redis.serializer.StringRedisSerializer;
 @Configuration
 @AllArgsConstructor
 public class RedisConfig {
-    
+
     private final RedisConnectionFactory factory;
 
     @Bean

+ 128 - 131
src/main/java/com/jkcredit/invoice/controller/business/CustomerController.java

@@ -48,14 +48,14 @@ import static com.jkcredit.invoice.common.CommonConst.*;
 @RestController
 @RequestMapping(value = {"/customer"})
 /**
-* @Description 客户操作
-* @Author  mashengyi
-* @Date   2022/2/8 18:16
-* @Param
-* @Return
-* @Exception
-*
-*/
+ * @Description 客户操作
+ * @Author mashengyi
+ * @Date 2022/2/8 18:16
+ * @Param
+ * @Return
+ * @Exception
+ *
+ */
 @Slf4j
 public class CustomerController {
     @Autowired
@@ -68,20 +68,21 @@ public class CustomerController {
 
     @Autowired
     CustomerRecService customerRecService;
-
-
+    @Autowired
+    CustomerChangeInfoService customerChangeInfoService;
     @Autowired
     private ParamService paramService;
     @Autowired
     private CheckHasAuthRole checkHasAuthRole;
+
     /**
      * 分页查询客户
      *
-     * @param page    参数集
+     * @param page 参数集
      * @return 用户集合
      */
     @PostMapping("/findCustomer")
-    @ApiOperation(value="分页查询客户", notes="分页查询客户")
+    @ApiOperation(value = "分页查询客户", notes = "分页查询客户")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
     public RespR getCustomersByPage(Page page, Customer customer) {
 
@@ -91,128 +92,136 @@ public class CustomerController {
     /**
      * 分页查询客户
      *
-     * @param page    参数集
+     * @param page 参数集
      * @return 用户集合
      */
     @PostMapping("/findCustomerRecharge")
-    @ApiOperation(value="分页查询客户充值信息", notes="分页查询客户充值信息")
+    @ApiOperation(value = "分页查询客户充值信息", notes = "分页查询客户充值信息")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
     public RespR findCustomerRecharge(Page page, CustomerRecharge customerRecharge) {
 
         return new RespR(customerRechargeService.findAllCustomerRecharge(page, customerRecharge));
     }
 
-
-
     /**
      * 分页查询客户
      *
-     * @param page    参数集
+     * @param page 参数集
      * @return 用户集合
      */
     @PostMapping("/findCustomerRechargeMoney")
-    @ApiOperation(value="分页查询客户端客户充值信息", notes="分页查询客户端客户充值信息")
+    @ApiOperation(value = "分页查询客户端客户充值信息", notes = "分页查询客户端客户充值信息")
     @LoginRequired
     public RespR findCustomerRechargeMoney(Page page, CustomerRecharge customerRecharge, User user) {
-        checkHasAuthRole.checkCustomerRole(user,customerRecharge.getCustomerName());
+        checkHasAuthRole.checkCustomerRole(user, customerRecharge.getCustomerName());
         return new RespR(customerRechargeService.findAllCustomerRechargeMoney(page, customerRecharge));
     }
+
     /**
      * 导出客户信息
+     *
      * @param
      * @return 用户集合
      */
     @GetMapping("/findCustomerRecListExport")
-    @ApiOperation(value="客户信息导出", notes="客户信息导出")
+    @ApiOperation(value = "客户信息导出", notes = "客户信息导出")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
-    public void findCustomerRechargeExport(String  customerName,String companyName,String companyBelongName,HttpServletResponse response) throws Exception{
+    public void findCustomerRechargeExport(String customerName, String companyName, String companyBelongName, HttpServletResponse response) throws Exception {
         CustomerRec customerRec = new CustomerRec();
         customerRec.setCustomerName(customerName);
         customerRec.setCompanyBelongName(companyBelongName);
         customerRec.setCompanyName(companyName);
         List<CustomerRec> customerRecs = customerRecService.findAllCustomerRecForExport(customerRec);
 
-        if(customerRecs!=null && customerRecs.size()>0){
+        if (customerRecs != null && customerRecs.size() > 0) {
             customerRecs.stream().forEach(customerRec1 -> {
 
-                if(NO_CAR.equals(customerRec1.getBussinessType())){
+                if (NO_CAR.equals(customerRec1.getBussinessType())) {
                     customerRec1.setBussinessType("无车");
-                }else if(SELF_CAR.equals(customerRec1.getBussinessType())){
+                } else if (SELF_CAR.equals(customerRec1.getBussinessType())) {
                     customerRec1.setBussinessType("自有车");
                 }
             });
         }
-        ExportParams exportParams = new ExportParams("客户信息","客户信息");
-        ExportUtil.exportExcel(customerRecs,CustomerRec.class,"客户信息导出",exportParams,response);
+        ExportParams exportParams = new ExportParams("客户信息", "客户信息");
+        ExportUtil.exportExcel(customerRecs, CustomerRec.class, "客户信息导出", exportParams, response);
     }
+
     /**
      * 分页查询客户注册信息
      *
-     * @param page    参数集
+     * @param page 参数集
      * @return 用户集合
      */
     @PostMapping("/findCustomerRecList")
-    @ApiOperation(value="分页查询客户注册信息", notes="分页查询客户注册信息")
+    @ApiOperation(value = "分页查询客户注册信息", notes = "分页查询客户注册信息")
     @LoginRequired
-    public RespR findCustomerRecList(Page page, CustomerRec customerRec,User user) {
-        checkHasAuthRole.checkCustomerRole(user,customerRec.getCustomerName());
+    public RespR findCustomerRecList(Page page, CustomerRec customerRec, User user) {
+        checkHasAuthRole.checkCustomerRole(user, customerRec.getCustomerName());
         return new RespR(customerRecService.findAllCustomerRec(page, customerRec));
     }
+
     /**
      * 添加客户
+     *
      * @return 用户集合
      */
     @PostMapping("/addCustomer")
-    @ApiOperation(value="添加客户", notes="添加客户")
+    @ApiOperation(value = "添加客户", notes = "添加客户")
     @LoginRequired
-    public RespR addCustomer(@RequestBody  Customer customer,User user) {
-        checkHasAuthRole.checkCustomerRole(user,customer.getCustomerName());
-        return new RespR(customerService.addCustomers(customer),"客户添加失败,请查看是否重复");
+    public RespR addCustomer(@RequestBody Customer customer, User user) {
+        checkHasAuthRole.checkCustomerRole(user, customer.getCustomerName());
+        return new RespR(customerService.addCustomers(customer), "客户添加失败,请查看是否重复");
     }
+
     /**
      * 修改客户状态
+     *
      * @return 用户集合
      */
     @PostMapping("/updateCustomer")
-    @ApiOperation(value="更新用户", notes="更新用户")
+    @ApiOperation(value = "更新用户", notes = "更新用户")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
-    public RespR updateCustomer(@RequestBody  Customer customer) {
+    public RespR updateCustomer(@RequestBody Customer customer) {
 
         return new RespR(customerService.updateCustomer(customer));
     }
+
     /**
      * 修改客户状态
+     *
      * @return 用户集合
      */
     @PostMapping("/customeRecStop")
-    @ApiOperation(value="停用备案用户", notes="停用备案用户")
+    @ApiOperation(value = "停用备案用户", notes = "停用备案用户")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
-    public RespR customeRecStop(@RequestBody  CustomerRec customerRec) {
+    public RespR customeRecStop(@RequestBody CustomerRec customerRec) {
         customerRec.setRecStatus(4);
         return customerService.updateCustomerRecStatus(customerRec);
     }
 
     /**
      * 修改客户状态
+     *
      * @return 用户集合
      */
     @PostMapping("/customeRecStart")
-    @ApiOperation(value="启用备案用户", notes="启用备案用户")
+    @ApiOperation(value = "启用备案用户", notes = "启用备案用户")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
-    public RespR customeRecStart(@RequestBody  CustomerRec customerRec) {
+    public RespR customeRecStart(@RequestBody CustomerRec customerRec) {
         customerRec.setRecStatus(1);
         return customerService.updateCustomerRecStatus(customerRec);
     }
 
-
     /**
      * 修改客户状态
+     *
      * @return 用户集合customerRecAdd
      */
     @PostMapping("/customerRecAdd")
-    @ApiOperation(value="手工添加备案信息", notes="手工添加备案信息")
+    @ApiOperation(value = "手工添加备案信息", notes = "手工添加备案信息")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
-    public RespR customerRecAdd(@RequestBody  CustomerRec customerRec) {
+    public RespR customerRecAdd(@RequestBody CustomerRec customerRec) {
         customerRec.setInterType(1);
         List<CustomerRec> customerRecList = new ArrayList<>();
         customerRecList.add(customerRec);
@@ -221,26 +230,27 @@ public class CustomerController {
 
     /**
      * 修改客户状态
+     *
      * @return 用户集合customerRecAdd
      */
     @PostMapping("/customeRecQueryUpper")
-    @ApiOperation(value="查询备案信息", notes="手工添加备案信息")
+    @ApiOperation(value = "查询备案信息", notes = "手工添加备案信息")
     @LoginRequired
-    public RespR customeRecQueryUpper(@RequestBody  CustomerRec customerRec,User user) {
-        checkHasAuthRole.checkCustomerRole(user,customerRec.getCustomerName());
+    public RespR customeRecQueryUpper(@RequestBody CustomerRec customerRec, User user) {
+        checkHasAuthRole.checkCustomerRole(user, customerRec.getCustomerName());
         RespR<List<B2bCompanyModel>> respR = customerService.customerRecQuery(customerRec);
 
-        if(respR.getCode() == 1){
+        if (respR.getCode() == 1) {
             return respR;
-        }else{
+        } else {
             List<B2bCompanyModel> resArr = respR.getData();
-            if(resArr == null || resArr.size() == 0){
-                return new RespR(false,"未注册,无法回填");
-            }else {
+            if (resArr == null || resArr.size() == 0) {
+                return new RespR(false, "未注册,无法回填");
+            } else {
 
-                if(resArr.size()>=1){
-                    resArr.forEach(b2bCompanyModel->{
-                        if(b2bCompanyModel.getCompanyType().equals(customerRec.getCompanyType())){
+                if (resArr.size() >= 1) {
+                    resArr.forEach(b2bCompanyModel -> {
+                        if (b2bCompanyModel.getCompanyType().equals(customerRec.getCompanyType())) {
                             customerRec.setCompanyType(b2bCompanyModel.getCompanyType());
                             customerRec.setOperatingRangeType(b2bCompanyModel.getOperatingRangeType());
                             customerRec.setCompanyLeader(b2bCompanyModel.getContact());
@@ -262,13 +272,13 @@ public class CustomerController {
 
     }
 
-
     /**
      * 充值
+     *
      * @return 用户集合
      */
     @PostMapping("/customRecharge")
-    @ApiOperation(value="账号充值", notes="账号充值")
+    @ApiOperation(value = "账号充值", notes = "账号充值")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
     public RespR customRecharge(@RequestBody CustomerRecharge customerRecharge) {
 
@@ -276,68 +286,60 @@ public class CustomerController {
     }
 
     @PostMapping("/customeRec")
-    @ApiOperation(value="用户备案确认", notes="用户备案确认")
+    @ApiOperation(value = "用户备案确认", notes = "用户备案确认")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
-    public RespR customeRec(@RequestBody CustomerRec customerRec){
+    public RespR customeRec(@RequestBody CustomerRec customerRec) {
         return customerService.customeRec(customerRec);
     }
 
     @PostMapping("/contractAdd")
-    @ApiOperation(value="协议上传确认", notes="协议上传确认")
+    @ApiOperation(value = "协议上传确认", notes = "协议上传确认")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
-    public RespR contractAdd(@RequestBody CustomerRec customerRec){
+    public RespR contractAdd(@RequestBody CustomerRec customerRec) {
         return customerService.contractAdd(customerRec);
     }
 
-
     @PostMapping("/contractStatusFail")
-    @ApiOperation(value="协议上传失败状态确认", notes="协议上传失败状态确认")
+    @ApiOperation(value = "协议上传失败状态确认", notes = "协议上传失败状态确认")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
-    public RespR contractStatusFail(@RequestBody CustomerRec customerRec){
+    public RespR contractStatusFail(@RequestBody CustomerRec customerRec) {
         return customerService.contractStatusFail(customerRec);
     }
 
-
-
     @PostMapping("/contractStatusProcess")
-    @ApiOperation(value="协议上传成功,审批中状态确认", notes="协议上传成功,审批中状态确认")
+    @ApiOperation(value = "协议上传成功,审批中状态确认", notes = "协议上传成功,审批中状态确认")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
-    public RespR contractStatusProcess(@RequestBody CustomerRec customerRec){
+    public RespR contractStatusProcess(@RequestBody CustomerRec customerRec) {
         return customerService.contractStatusProcess(customerRec);
     }
 
-
-
-
     @PostMapping("/contractStatusSuccess")
-    @ApiOperation(value="备案成功状态确认", notes="备案成功状态确认")
+    @ApiOperation(value = "备案成功状态确认", notes = "备案成功状态确认")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
-    public RespR contractStatusSuccess(@RequestBody CustomerRec customerRec){
+    public RespR contractStatusSuccess(@RequestBody CustomerRec customerRec) {
         return customerService.contractStatusSuccess(customerRec);
     }
 
-
-
     @GetMapping("/contractDownload")
-    @ApiOperation(value="协议下载", notes="协议下载")
+    @ApiOperation(value = "协议下载", notes = "协议下载")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
-    public RespR contractDownload(String customerRecId,HttpServletResponse response){
+    public RespR contractDownload(String customerRecId, HttpServletResponse response) {
         CustomerRec customerRec = (CustomerRec) customerService.contractDownload(customerRecId).getData();
         String fileName = customerRec.getLowerFileName();
         InputStream inputStream = null;
         OutputStream outputStream = null;
-        if(customerRec.getLowerBase64Str()!=null){
+        if (customerRec.getLowerBase64Str() != null) {
             try {
-             //将base64编码的字符串解码成字节数组
+                //将base64编码的字符串解码成字节数组
                 byte[] byteArray = new sun.misc.BASE64Decoder().decodeBuffer(customerRec.getLowerBase64Str());
                 inputStream = new ByteArrayInputStream(byteArray);
-                response.setHeader("Content-Disposition", "attachment;filename="+ URLEncoder.encode(fileName, "UTF-8"));
+                response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
                 outputStream = response.getOutputStream();
                 IOUtils.copy(inputStream, outputStream);
                 response.flushBuffer();
                 return new RespR(true);
             } catch (IOException e) {
-                log.error("协议下载CustomerController.contractDownload协议下载失败{}",e.getMessage());
+                log.error("协议下载CustomerController.contractDownload协议下载失败{}", e.getMessage());
             } finally {
                 IOUtils.closeQuietly(inputStream);
                 IOUtils.closeQuietly(outputStream);
@@ -346,13 +348,14 @@ public class CustomerController {
 
         return new RespR(false);
     }
+
     @GetMapping("/generateWord")
-    @ApiOperation(value="文档下载", notes="文档下载")
+    @ApiOperation(value = "文档下载", notes = "文档下载")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
-    public RespR generateWord(String customerRecId,HttpServletResponse response){
+    public RespR generateWord(String customerRecId, HttpServletResponse response) {
         CustomerRec customerRec = (CustomerRec) customerService.generateWordDownload(customerRecId).getData();
-        if(null == customerRec || null ==customerRec.getServiceStartTime() || null ==customerRec.getServiceEndTime()){
-            return new RespR(false,"企业维护信息缺失服务时间,请手动维护");
+        if (null == customerRec || null == customerRec.getServiceStartTime() || null == customerRec.getServiceEndTime()) {
+            return new RespR(false, "企业维护信息缺失服务时间,请手动维护");
         }
         String fileName = "合作说明.doc";
         Map<String, String> dataMap = new HashMap<>();
@@ -363,60 +366,57 @@ public class CustomerController {
         dataMap.put("e", customerRec.getCompanyPhone());
         dataMap.put("f", customerRec.getCompanyOpenbank());
         dataMap.put("g", customerRec.getCompanyOpenbankAcc());
-        dataMap.put("j", customerRec.getServiceStartTime().substring(0,10));
-        dataMap.put("k", customerRec.getServiceEndTime().substring(0,10));
+        dataMap.put("j", customerRec.getServiceStartTime().substring(0, 10));
+        dataMap.put("k", customerRec.getServiceEndTime().substring(0, 10));
         Calendar now = Calendar.getInstance();
-        dataMap.put("l",now.get(Calendar.YEAR)+"");
-        dataMap.put("h",(now.get(Calendar.MONTH) + 1) + "");
-        dataMap.put("i", now.get(Calendar.DAY_OF_MONTH)+"");
-        OutputStream outputStream =null;
-        try{
-            response.setHeader("Content-Disposition", "attachment;filename="+ URLEncoder.encode(fileName, "UTF-8"));
+        dataMap.put("l", now.get(Calendar.YEAR) + "");
+        dataMap.put("h", (now.get(Calendar.MONTH) + 1) + "");
+        dataMap.put("i", now.get(Calendar.DAY_OF_MONTH) + "");
+        OutputStream outputStream = null;
+        try {
+            response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
             outputStream = response.getOutputStream();
-            WordUtil.exportSimpleWord(dataMap,"/static/templates/excel/",outputStream);
+            WordUtil.exportSimpleWord(dataMap, "/static/templates/excel/", outputStream);
             response.flushBuffer();
-        }catch (Exception e){
-            log.error("文档下载CustomerController.generateWord文档下载失败{}",e.getMessage());
-        }finally {
+        } catch (Exception e) {
+            log.error("文档下载CustomerController.generateWord文档下载失败{}", e.getMessage());
+        } finally {
             IOUtils.closeQuietly(outputStream);
         }
         return new RespR(false);
     }
 
-
-
-
     /**
      * 分页查询客户备案预警信息
      *
-     * @param page    参数集
+     * @param page 参数集
      * @return 用户集合
      */
     @PostMapping("/findCustomerRecTimeList")
-    @ApiOperation(value="客户备案预警查询", notes="客户备案预警查询")
+    @ApiOperation(value = "客户备案预警查询", notes = "客户备案预警查询")
     @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(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"));
+        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 (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{
+        } else {
             Param param = paramService.getParamsByParamName("CUST_EARLY_WARNING");
             ipage = customerRecService.findAllCustomerRecWarning(page, customerRec);
             List<CustomerRec> lists = ipage.getRecords();
-            if(lists.size()>0){
+            if (lists.size() > 0) {
                 //遍历删除
                 Iterator<CustomerRec> iterator = lists.iterator();
                 while (iterator.hasNext()) {
                     CustomerRec customerRec1 = iterator.next();
-                    if (((DateUtil.daysBetween(customerRec1.getServiceEndTime(),new Date()) < 0 ) )
-                            || (Integer.valueOf(param.getParamValue()) <= (DateUtil.daysBetween(customerRec1.getServiceEndTime(),new Date())))) {
+                    if (((DateUtil.daysBetween(customerRec1.getServiceEndTime(), new Date()) < 0))
+                            || (Integer.valueOf(param.getParamValue()) <= (DateUtil.daysBetween(customerRec1.getServiceEndTime(), new Date())))) {
                         iterator.remove();//使用迭代器的删除方法删除
                     }
                 }
@@ -427,63 +427,60 @@ public class CustomerController {
         return new RespR(ipage);
     }
 
-
-
-
-
     /**
      * 分页查询余额告警用户
      *
-     * @param page    参数集
+     * @param page 参数集
      * @return 用户集合
      */
     @PostMapping("/findCustomerMoney")
-    @ApiOperation(value="分页查询余额告警用户", notes="分页查询余额告警用户")
+    @ApiOperation(value = "分页查询余额告警用户", notes = "分页查询余额告警用户")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
     public RespR getCustomerMoneysByPage(Page page, Customer customer) {
         Param param = paramService.getParamsByParamName("CUST_MONEY_WARNING");
         IPage ipage = null;
-        if(customer.getMoneyUpper() == null || customer.getMoneyUpper() == -1){
+        if (customer.getMoneyUpper() == null || customer.getMoneyUpper() == -1) {
             customer.setMoneyUpper(Double.valueOf(param.getParamValue()));
             ipage = customerService.findAllNomoneyCustomers(page, customer);
-        }else if(customer.getMoneyUpper() == null || customer.getMoneyUpper() == 0){
+        } else if (customer.getMoneyUpper() == null || customer.getMoneyUpper() == 0) {
             ipage = customerService.findAllNomoneyCustomersByZero(page, customer);
-        }else {
+        } else {
             ipage = customerService.findAllNomoneyCustomers(page, customer);
         }
 
         return new RespR(ipage);
     }
+
     /**
      * @param customerRec
      * @return
      */
     @PostMapping("/customeRecQueryListByPage")
-    @ApiOperation(value="用户备案列表分页查询", notes="用户备案列表分页查询")
+    @ApiOperation(value = "用户备案列表分页查询", notes = "用户备案列表分页查询")
     @LoginRequired
-    public RespR customeRecQueryListByPage(Page page, CustomerRec customerRec,User user){
-        checkHasAuthRole.checkCustomerRole(user,customerRec.getCustomerName());
+    public RespR customeRecQueryListByPage(Page page, CustomerRec customerRec, User user) {
+        checkHasAuthRole.checkCustomerRole(user, customerRec.getCustomerName());
         IPage ipage = customerRecService.findAllCustomerRec(page, customerRec);
         return new RespR(ipage);
     }
-    @Autowired
-   CustomerChangeInfoService customerChangeInfoService;
+
     /**
      * @param customerEtcChangeInfo
      * @return
      */
     @PostMapping("/customerChangeList")
-    @ApiOperation(value="用户换卡信息列表查询", notes="用户换卡信息列表查询")
+    @ApiOperation(value = "用户换卡信息列表查询", notes = "用户换卡信息列表查询")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
-    public RespR customeChangeInfoListByPage(Page page, CustomerEtcChangeInfo customerEtcChangeInfo){
+    public RespR customeChangeInfoListByPage(Page page, CustomerEtcChangeInfo customerEtcChangeInfo) {
         IPage ipage = customerChangeInfoService.findAllCustomerChangeInfo(page, customerEtcChangeInfo);
         return new RespR(ipage);
     }
+
     @PostMapping("/customerChangeInfo")
-    @ApiOperation(value="用户换卡信息查询", notes="用户换卡信息查询")
+    @ApiOperation(value = "用户换卡信息查询", notes = "用户换卡信息查询")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
-    public RespR customerChangeInfo(String applyId){
-        List<Map<String,String>> cards = customerChangeInfoService.selectChangeCards(applyId);
+    public RespR customerChangeInfo(String applyId) {
+        List<Map<String, String>> cards = customerChangeInfoService.selectChangeCards(applyId);
         return new RespR(cards);
     }
 }

+ 295 - 283
src/main/java/com/jkcredit/invoice/controller/business/NoCarController.java

@@ -48,16 +48,16 @@ import static com.jkcredit.invoice.common.CommonConst.*;
 @RequestMapping(value = {"/noCar"})
 @Slf4j
 /**
-* @Description 无车操作
-* @Author  mashengyi
-* @Date   2022/2/8 18:15
-* @Param
-* @Return
-* @Exception
-*
-*/
+ * @Description 无车操作
+ * @Author mashengyi
+ * @Date 2022/2/8 18:15
+ * @Param
+ * @Return
+ * @Exception
+ *
+ */
 public class NoCarController {
-    
+
     @Autowired
     NoCarRecService noCarRecService;
 
@@ -82,230 +82,239 @@ public class NoCarController {
     CustomerOperService customerOperService;
     @Autowired
     private CheckHasAuthRole checkHasAuthRole;
+
     /**
      * 分页查询无车备案信息
      *
-     * @param page    参数集
+     * @param page 参数集
      * @return 用户集合
      */
     @PostMapping("/findCarRec")
-    @ApiOperation(value="分页查询无车/自有车备案信息", notes="分页查询无车/自有车备案信息")
+    @ApiOperation(value = "分页查询无车/自有车备案信息", notes = "分页查询无车/自有车备案信息")
     @LoginRequired
-    public RespR getCustomersByPage(Page page, CustomerCarRec customerCarRec,User user) {
+    public RespR getCustomersByPage(Page page, CustomerCarRec customerCarRec, User user) {
         try {
-            checkHasAuthRole.checkCustomerRole(user,customerCarRec.getCustomerName());
-            if(!StringUtils.isEmpty(customerCarRec.getStartTime()) && !NULL.equals(customerCarRec.getStartTime())){
-                String [] res = customerCarRec.getStartTime().split(",");
+            checkHasAuthRole.checkCustomerRole(user, customerCarRec.getCustomerName());
+            if (!StringUtils.isEmpty(customerCarRec.getStartTime()) && !NULL.equals(customerCarRec.getStartTime())) {
+                String[] res = customerCarRec.getStartTime().split(",");
                 customerCarRec.setStartTime(res[0]);
-                customerCarRec.setEndTime(res[1].replace("00:00:00","23:59:59"));
-            }else{
+                customerCarRec.setEndTime(res[1].replace("00:00:00", "23:59:59"));
+            } else {
                 customerCarRec.setStartTime(null);
             }
             RespR respR = new RespR(noCarRecService.findByPageAndCarRec(page, customerCarRec));
             return respR;
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
-            return new RespR(false,e.getMessage());
+            return new RespR(false, e.getMessage());
         }
     }
-    public void setTimeDue(NoCarWayBill noCarWayBill){
-        if(!StringUtils.isEmpty(noCarWayBill.getStartBegin()) && !NULL.equals(noCarWayBill.getStartBegin())){
-            String [] res = noCarWayBill.getStartBegin().split(",");
+
+    public void setTimeDue(NoCarWayBill noCarWayBill) {
+        if (!StringUtils.isEmpty(noCarWayBill.getStartBegin()) && !NULL.equals(noCarWayBill.getStartBegin())) {
+            String[] res = noCarWayBill.getStartBegin().split(",");
             noCarWayBill.setStartBegin(res[0]);
-            noCarWayBill.setStartEnd(res[1].replace("00:00:00","23:59:59"));
-        }else{
+            noCarWayBill.setStartEnd(res[1].replace("00:00:00", "23:59:59"));
+        } else {
             noCarWayBill.setStartBegin(null);
         }
-        if(!StringUtils.isEmpty(noCarWayBill.getEndBegin()) && !NULL.equals(noCarWayBill.getEndBegin())){
-            String [] res = noCarWayBill.getEndBegin().split(",");
+        if (!StringUtils.isEmpty(noCarWayBill.getEndBegin()) && !NULL.equals(noCarWayBill.getEndBegin())) {
+            String[] res = noCarWayBill.getEndBegin().split(",");
             noCarWayBill.setEndBegin(res[0]);
-            noCarWayBill.setEndEnd(res[1].replace("00:00:00","23:59:59"));
-        }else{
+            noCarWayBill.setEndEnd(res[1].replace("00:00:00", "23:59:59"));
+        } else {
             noCarWayBill.setEndBegin(null);
         }
     }
 
 
-    public void setTimeDue2(NoCarWayBill noCarWayBill){
-        if(NULL.equals(noCarWayBill.getStartBegin())){
+    public void setTimeDue2(NoCarWayBill noCarWayBill) {
+        if (NULL.equals(noCarWayBill.getStartBegin())) {
             noCarWayBill.setStartBegin(null);
         }
-        if(NULL.equals(noCarWayBill.getStartEnd())){
+        if (NULL.equals(noCarWayBill.getStartEnd())) {
             noCarWayBill.setStartEnd(null);
         }
-        if(NULL.equals(noCarWayBill.getEndBegin())){
+        if (NULL.equals(noCarWayBill.getEndBegin())) {
             noCarWayBill.setEndBegin(null);
         }
-        if(NULL.equals(noCarWayBill.getEndEnd())){
+        if (NULL.equals(noCarWayBill.getEndEnd())) {
             noCarWayBill.setEndEnd(null);
         }
     }
+
     /**
      * 分页查询运单信息
      *
-     * @param page    参数集
+     * @param page 参数集
      * @return 用户集合
      */
     @PostMapping("/findBillWay")
-    @ApiOperation(value="分页查询无车运单信息", notes="分页查询无车运单信息")
+    @ApiOperation(value = "分页查询无车运单信息", notes = "分页查询无车运单信息")
     @LoginRequired
-    public RespR findBillWay(Page page, NoCarWayBill noCarWayBill,User user) {
+    public RespR findBillWay(Page page, NoCarWayBill noCarWayBill, User user) {
         try {
-            checkHasAuthRole.checkCustomerRole(user,noCarWayBill.getCustomerName());
+            checkHasAuthRole.checkCustomerRole(user, noCarWayBill.getCustomerName());
             setTimeDue(noCarWayBill);
             setBillNums(noCarWayBill);
             RespR respR = new RespR(noCarBillWayService.findByPageAndWayBill(page, noCarWayBill));
             return respR;
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
-            return new RespR(false,e.getMessage());
+            return new RespR(false, e.getMessage());
         }
     }
 
-    public void setBillNums(NoCarWayBill noCarWayBill){
+    public void setBillNums(NoCarWayBill noCarWayBill) {
         String billNums = noCarWayBill.getBillNum();
-        if(!StringUtils.isEmpty(billNums)){
-            String [] billNumArr = billNums.split(",");
+        if (!StringUtils.isEmpty(billNums)) {
+            String[] billNumArr = billNums.split(",");
             noCarWayBill.setBillNums(Arrays.asList(billNumArr));
         }
     }
+
     /**
      * 分页查询客户运单信息
      *
-     * @param page    参数集
+     * @param page 参数集
      * @return 用户集合
      */
     @PostMapping("/findBillWayCust")
-    @ApiOperation(value="分页查询无车运单信息", notes="分页查询无车运单信息")
+    @ApiOperation(value = "分页查询无车运单信息", notes = "分页查询无车运单信息")
     @LoginRequired
-    public RespR findBillWayCust(Page page, NoCarWayBill noCarWayBill,User user) {
+    public RespR findBillWayCust(Page page, NoCarWayBill noCarWayBill, User user) {
         try {
-            checkHasAuthRole.checkCustomerRole(user,noCarWayBill.getCustomerName());
+            checkHasAuthRole.checkCustomerRole(user, noCarWayBill.getCustomerName());
             setTimeDue2(noCarWayBill);
             setBillNums(noCarWayBill);
             noCarWayBill.setBatchNum("1");
             RespR respR = new RespR(noCarBillWayService.findByPageAndWayBill(page, noCarWayBill));
             return respR;
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
-            return new RespR(false,e.getMessage());
+            return new RespR(false, e.getMessage());
         }
     }
+
     /**
      * 分页查询运单信息
      *
-     * @param page    参数集
+     * @param page 参数集
      * @return 用户集合
      */
     @PostMapping("/findImportBillWay")
-    @ApiOperation(value="分页查询无车运单信息", notes="分页查询无车运单信息")
+    @ApiOperation(value = "分页查询无车运单信息", notes = "分页查询无车运单信息")
     @LoginRequired
-    public RespR findImportBillWay(Page page, NoCarWayBill noCarWayBill,User user) {
+    public RespR findImportBillWay(Page page, NoCarWayBill noCarWayBill, User user) {
         try {
-            checkHasAuthRole.checkCustomerRole(user,noCarWayBill.getCustomerName());
+            checkHasAuthRole.checkCustomerRole(user, noCarWayBill.getCustomerName());
             setTimeDue(noCarWayBill);
             RespR respR = new RespR(noCarBillWayImportService.findByPageAndWayBill(page, noCarWayBill));
             return respR;
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
-            return new RespR(false,e.getMessage());
+            return new RespR(false, e.getMessage());
         }
     }
+
     /**
      * 重新获取发票并更新状态
      *
      * @return 用户集合
      */
     @PostMapping("/updateStatus")
-    @ApiOperation(value="重新获取发票并更新状态", notes="重新获取发票并更新状态")
+    @ApiOperation(value = "重新获取发票并更新状态", notes = "重新获取发票并更新状态")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
     public RespR updateStatus(String noCarWayBillStr) {
-        List<NoCarWayBill> noCarWayBills = JSON.parseArray(noCarWayBillStr,NoCarWayBill.class);
-
-            if(noCarWayBills!=null && noCarWayBills.size()>0){
-                noCarWayBills.stream().forEach(noCarWayBill -> {
-                    try {
-                         noCarWayBill.setBillwayStatus(-5);
-                         noCarService.getInvoiceByWayBillNumReal(noCarWayBill,false);
-                    }catch (Exception e){
-                        log.info("1111111111222222"+e.getMessage());
-                    }
-                });
-            }
-            return new RespR("更新成功");
+        List<NoCarWayBill> noCarWayBills = JSON.parseArray(noCarWayBillStr, NoCarWayBill.class);
+
+        if (noCarWayBills != null && noCarWayBills.size() > 0) {
+            noCarWayBills.stream().forEach(noCarWayBill -> {
+                try {
+                    noCarWayBill.setBillwayStatus(-5);
+                    noCarService.getInvoiceByWayBillNumReal(noCarWayBill, false);
+                } catch (Exception e) {
+                    log.info("1111111111222222" + e.getMessage());
+                }
+            });
+        }
+        return new RespR("更新成功");
 
     }
+
     /**
      * 分页查询异常运单信息
      *
-     * @param page    参数集
+     * @param page 参数集
      * @return 用户集合
      */
     @PostMapping("/findBillWayException")
-    @ApiOperation(value="分页查询异常运单信息", notes="分页查询异常运单信息")
+    @ApiOperation(value = "分页查询异常运单信息", notes = "分页查询异常运单信息")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
     public RespR findBillWayException(Page page, NoCarWayBill noCarWayBill) {
         try {
             setTimeDue(noCarWayBill);
             RespR respR = new RespR(noCarBillWayService.findByPageAndWayBillException(page, noCarWayBill));
             return respR;
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
-            return new RespR(false,e.getMessage());
+            return new RespR(false, e.getMessage());
         }
     }
+
     /**
      * 分页查询无车运单信息
      *
-     * @param page    参数集
+     * @param page 参数集
      * @return 用户集合
      */
     @PostMapping("/findNocarInvoices")
-    @ApiOperation(value="分页查询无车发票信息", notes="分页查询无车发票信息")
+    @ApiOperation(value = "分页查询无车发票信息", notes = "分页查询无车发票信息")
     @LoginRequired
-    public RespR findNocarInvoices(Page page, BillInvoice billInvoice,User user) {
+    public RespR findNocarInvoices(Page page, BillInvoice billInvoice, User user) {
         try {
-            checkHasAuthRole.checkCustomerRole(user,billInvoice.getCustomerName());
+            checkHasAuthRole.checkCustomerRole(user, billInvoice.getCustomerName());
             setParams(billInvoice);
             RespR respR = new RespR(nocarInvoiceService.findByPageAndInvoice(page, billInvoice));
             return respR;
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
-            return new RespR(false,e.getMessage());
+            return new RespR(false, e.getMessage());
         }
     }
-    private void setParams(BillInvoice billInvoice){
-        if(!StringUtils.isEmpty(billInvoice.getInvoiceMakeTime()) && !NULL.equals(billInvoice.getInvoiceMakeTime())){
-            String [] res =billInvoice.getInvoiceMakeTime().split(",");
+
+    private void setParams(BillInvoice billInvoice) {
+        if (!StringUtils.isEmpty(billInvoice.getInvoiceMakeTime()) && !NULL.equals(billInvoice.getInvoiceMakeTime())) {
+            String[] res = billInvoice.getInvoiceMakeTime().split(",");
             billInvoice.setInvoiceMakeStart(res[0]);
-            billInvoice.setInvoiceMakeEnd(res[1].replace("00:00:00","23:59:59"));
+            billInvoice.setInvoiceMakeEnd(res[1].replace("00:00:00", "23:59:59"));
         }
-        if(!StringUtils.isEmpty(billInvoice.getCalculateTime()) && !NULL.equals(billInvoice.getCalculateTime())){
-            String [] res =billInvoice.getCalculateTime().split(",");
+        if (!StringUtils.isEmpty(billInvoice.getCalculateTime()) && !NULL.equals(billInvoice.getCalculateTime())) {
+            String[] res = billInvoice.getCalculateTime().split(",");
             billInvoice.setCalculateTimeStart(res[0]);
-            billInvoice.setCalculateTimeEnd(res[1].replace("00:00:00","23:59:59"));
+            billInvoice.setCalculateTimeEnd(res[1].replace("00:00:00", "23:59:59"));
         }
-        if(!StringUtils.isEmpty(billInvoice.getWaybillNum())){
-            String [] billNumArr = billInvoice.getWaybillNum().split(",");
+        if (!StringUtils.isEmpty(billInvoice.getWaybillNum())) {
+            String[] billNumArr = billInvoice.getWaybillNum().split(",");
             billInvoice.setWaybillNums(Arrays.asList(billNumArr));
         }
-        if(!StringUtils.isEmpty(billInvoice.getPlateNum())){
-            String [] plateNums = billInvoice.getPlateNum().split(COMMA);
+        if (!StringUtils.isEmpty(billInvoice.getPlateNum())) {
+            String[] plateNums = billInvoice.getPlateNum().split(COMMA);
             billInvoice.setPlateNums(Arrays.asList(plateNums));
         }
-        if(!StringUtils.isEmpty(billInvoice.getInvoiceCode()) && billInvoice.getInvoiceCode().indexOf(COMMAS)>0){
-            String [] invoiceCodeArr = billInvoice.getInvoiceCode().split(",");
-            String [] invoiceNumArr=null;
-            if( billInvoice.getInvoiceNum()!=null){
-                invoiceNumArr =  billInvoice.getInvoiceNum().split(",");
+        if (!StringUtils.isEmpty(billInvoice.getInvoiceCode()) && billInvoice.getInvoiceCode().indexOf(COMMAS) > 0) {
+            String[] invoiceCodeArr = billInvoice.getInvoiceCode().split(",");
+            String[] invoiceNumArr = null;
+            if (billInvoice.getInvoiceNum() != null) {
+                invoiceNumArr = billInvoice.getInvoiceNum().split(",");
             }
             List<CodeAndNumVo> codeAndNumVos = new ArrayList<>();
-            for (int i=0;i<invoiceCodeArr.length;i++){
+            for (int i = 0; i < invoiceCodeArr.length; i++) {
                 CodeAndNumVo codeAndNumVo = new CodeAndNumVo();
                 codeAndNumVo.setCode(invoiceCodeArr[i]);
-                if(invoiceNumArr!=null && invoiceNumArr.length>=i+1){
+                if (invoiceNumArr != null && invoiceNumArr.length >= i + 1) {
                     codeAndNumVo.setNum(invoiceNumArr[i]);
-                }else{
+                } else {
                     codeAndNumVo.setNum("");
                 }
                 codeAndNumVos.add(codeAndNumVo);
@@ -314,26 +323,27 @@ public class NoCarController {
 
         }
     }
+
     /**
      * 批量查询无车发票信息
      *
-     * @param file    参数集
+     * @param file 参数集
      * @return
      */
     @PostMapping("/batchImportNocarInvoices")
-    @ApiOperation(value="批量查询无车发票信息", notes="批量查询无车发票信息")
+    @ApiOperation(value = "批量查询无车发票信息", notes = "批量查询无车发票信息")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
     public RespR batchImportNocarInvoices(@RequestParam("file") MultipartFile file) {
         try {
             ImportParams params = new ImportParams();
             params.setTitleRows(1);
             params.setHeadRows(1);
-            List<BillInvoice> list = ExcelImportUtil.importExcel(file.getInputStream(), BillInvoice.class,params) ;
+            List<BillInvoice> list = ExcelImportUtil.importExcel(file.getInputStream(), BillInvoice.class, params);
             RespR respR = nocarInvoiceService.findImportNocarInvoices(list);
             return respR;
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
-            return new RespR(false,e.getMessage());
+            return new RespR(false, e.getMessage());
         }
     }
 
@@ -341,372 +351,374 @@ public class NoCarController {
     /**
      * 批量查询无车运单信息
      *
-     * @param file    参数集
+     * @param file 参数集
      * @return
      */
     @PostMapping("/batchImportNocarBillWay")
-    @ApiOperation(value="批量查询无车运单信息", notes="批量查询无车运单信息")
+    @ApiOperation(value = "批量查询无车运单信息", notes = "批量查询无车运单信息")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
     public RespR batchImportNocarBillWay(@RequestParam("file") MultipartFile file) {
         try {
             ImportParams params = new ImportParams();
             params.setTitleRows(1);
             params.setHeadRows(1);
-            List<NoCarWayBill> list = ExcelImportUtil.importExcel(file.getInputStream(), NoCarWayBill.class,params) ;
+            List<NoCarWayBill> list = ExcelImportUtil.importExcel(file.getInputStream(), NoCarWayBill.class, params);
             RespR respR = noCarBillWayService.findImportNocarBillWay(list);
             return respR;
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
-            return new RespR(false,e.getMessage());
+            return new RespR(false, e.getMessage());
         }
     }
 
 
-
-
     /**
      * 分页查询无车运单统计信息
      *
-     * @param    billInvoice
+     * @param billInvoice
      * @return 用户集合
      */
     @PostMapping("/findNocarInvoicesStatic")
-    @ApiOperation(value="分页查询无车发票统计信息", notes="分页查询无车发票统计信息")
+    @ApiOperation(value = "分页查询无车发票统计信息", notes = "分页查询无车发票统计信息")
     @LoginRequired
-    public RespR findNocarInvoicesStatic(BillInvoice billInvoice,User user) {
-        checkHasAuthRole.checkCustomerRole(user,billInvoice.getCustomerName());
+    public RespR findNocarInvoicesStatic(BillInvoice billInvoice, User user) {
+        checkHasAuthRole.checkCustomerRole(user, billInvoice.getCustomerName());
         try {
-            if(!StringUtils.isEmpty(billInvoice.getInvoiceMakeTime()) && !NULL.equals(billInvoice.getInvoiceMakeTime())){
-                String [] res =billInvoice.getInvoiceMakeTime().split(",");
+            if (!StringUtils.isEmpty(billInvoice.getInvoiceMakeTime()) && !NULL.equals(billInvoice.getInvoiceMakeTime())) {
+                String[] res = billInvoice.getInvoiceMakeTime().split(",");
                 billInvoice.setInvoiceMakeStart(res[0]);
-                billInvoice.setInvoiceMakeEnd(res[1].replace("00:00:00","23:59:59"));
+                billInvoice.setInvoiceMakeEnd(res[1].replace("00:00:00", "23:59:59"));
             }
-            if(!StringUtils.isEmpty(billInvoice.getCalculateTime()) && !NULL.equals(billInvoice.getCalculateTime())){
-                String [] res =billInvoice.getCalculateTime().split(",");
+            if (!StringUtils.isEmpty(billInvoice.getCalculateTime()) && !NULL.equals(billInvoice.getCalculateTime())) {
+                String[] res = billInvoice.getCalculateTime().split(",");
                 billInvoice.setCalculateTimeStart(res[0]);
-                billInvoice.setCalculateTimeEnd(res[1].replace("00:00:00","23:59:59"));
+                billInvoice.setCalculateTimeEnd(res[1].replace("00:00:00", "23:59:59"));
             }
             RespR respR = new RespR(nocarInvoiceService.findInvoiceStatics(billInvoice));
             return respR;
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
-            return new RespR(false,e.getMessage());
+            return new RespR(false, e.getMessage());
         }
     }
 
     /**
      * 批量运单导入
      *
-     * @param file    参数集
+     * @param file 参数集
      * @return
      */
     @PostMapping("/batchImprotBillWay")
-    @ApiOperation(value="批量运单导入", notes="批量运单导入")
+    @ApiOperation(value = "批量运单导入", notes = "批量运单导入")
     @LoginRequired
-    public RespR batchImprotBillWay(@RequestParam("file") MultipartFile file,String customerName,User user) {
+    public RespR batchImprotBillWay(@RequestParam("file") MultipartFile file, String customerName, User user) {
         try {
-            checkHasAuthRole.checkCustomerRole(user,customerName);
+            checkHasAuthRole.checkCustomerRole(user, customerName);
             ImportParams params = new ImportParams();
             params.setTitleRows(1);
             params.setHeadRows(1);
             params.setKeyIndex(2);
-            List<NoCarWayBill> list = ExcelImportUtil.importExcel(file.getInputStream(), NoCarWayBill.class,params) ;
+            List<NoCarWayBill> list = ExcelImportUtil.importExcel(file.getInputStream(), NoCarWayBill.class, params);
             buildDate(list);
-            RespR respR = noCarBillWayService.batchBillWayStart(list,customerName);
+            RespR respR = noCarBillWayService.batchBillWayStart(list, customerName);
             return respR;
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
-            return new RespR(false,e.getMessage());
+            return new RespR(false, e.getMessage());
         }
     }
 
     /**
      * 批量运单导入
      *
-     * @param file    参数集
+     * @param file 参数集
      * @return
      */
     @PostMapping("/batchImprotHistoryBillWay")
-    @ApiOperation(value="批量历史运单导入", notes="批量历史运单导入")
+    @ApiOperation(value = "批量历史运单导入", notes = "批量历史运单导入")
     @LoginRequired
-    public RespR batchImprotHistoryBillWay(@RequestParam("file") MultipartFile file,String customerName,User user) {
+    public RespR batchImprotHistoryBillWay(@RequestParam("file") MultipartFile file, String customerName, User user) {
         try {
-            checkHasAuthRole.checkCustomerRole(user,customerName);
+            checkHasAuthRole.checkCustomerRole(user, customerName);
             ImportParams params = new ImportParams();
             params.setTitleRows(1);
             params.setHeadRows(1);
             params.setKeyIndex(2);
-            List<NoCarWayBill> list = ExcelImportUtil.importExcel(file.getInputStream(), NoCarWayBill.class,params);
-            log.info("batchImprotHistoryBillWay数量"+list.size());
+            List<NoCarWayBill> list = ExcelImportUtil.importExcel(file.getInputStream(), NoCarWayBill.class, params);
+            log.info("batchImprotHistoryBillWay数量" + list.size());
             buildDate(list);
-            RespR respR = noCarBillWayService.batchHsitoryBillWay(list,customerName);
+            RespR respR = noCarBillWayService.batchHsitoryBillWay(list, customerName);
             return respR;
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
-            return new RespR(false,e.getMessage());
+            return new RespR(false, e.getMessage());
         }
     }
+
     /**
      * 批量运单导入
      *
-     * @param file    参数集
+     * @param file 参数集
      * @return
      */
     @PostMapping("/batchImprotEndBillWay")
-    @ApiOperation(value="批量运单结束", notes="批量运单结束")
+    @ApiOperation(value = "批量运单结束", notes = "批量运单结束")
     @LoginRequired
-    public RespR batchImprotEndBillWay(@RequestParam("file") MultipartFile file,String customerName,User user) {
-        checkHasAuthRole.checkCustomerRole(user,customerName);
+    public RespR batchImprotEndBillWay(@RequestParam("file") MultipartFile file, String customerName, User user) {
+        checkHasAuthRole.checkCustomerRole(user, customerName);
         try {
             ImportParams params = new ImportParams();
             params.setTitleRows(1);
             params.setHeadRows(1);
             params.setKeyIndex(2);
-            List<NoCarWayBill> list = ExcelImportUtil.importExcel(file.getInputStream(), NoCarWayBill.class,params);
+            List<NoCarWayBill> list = ExcelImportUtil.importExcel(file.getInputStream(), NoCarWayBill.class, params);
             buildDateEnd(list);
-            log.info("batchImprotEndBillWay数量"+list.size());
-            RespR respR = noCarBillWayService.batchBillWayEnd(list,customerName);
+            log.info("batchImprotEndBillWay数量" + list.size());
+            RespR respR = noCarBillWayService.batchBillWayEnd(list, customerName);
             return respR;
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
-            return new RespR(false,e.getMessage());
+            return new RespR(false, e.getMessage());
         }
     }
-    public void buildDate(List<NoCarWayBill> list){
+
+    public void buildDate(List<NoCarWayBill> list) {
         StringBuffer sb = new StringBuffer();
         DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         int i = 0;
         String strError = "";
-        for(int j = 0 ;j<list.size();j++){
+        for (int j = 0; j < list.size(); j++) {
 
             NoCarWayBill noCarWayBill = list.get(j);
             try {
-                if(null == noCarWayBill){
-                    log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查数据是否未传递");
-                    strError =  "第"+(j+1)+"行数据存在错误,请检查数据是否未传递";
-                    throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查数据是否未传递");
+                if (null == noCarWayBill) {
+                    log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查数据是否未传递");
+                    strError = "第" + (j + 1) + "行数据存在错误,请检查数据是否未传递";
+                    throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查数据是否未传递");
                 }
-                if(org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getBillNum())){
-                    log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查运单编号是否未输入或者输入是否正确");
-                    strError =   "第"+(j+1)+"行数据存在错误,请检查运单编号是否未输入或者输入是否正确";
-                    throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查运单编号是否未输入或者输入是否正确");
+                if (org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getBillNum())) {
+                    log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查运单编号是否未输入或者输入是否正确");
+                    strError = "第" + (j + 1) + "行数据存在错误,请检查运单编号是否未输入或者输入是否正确";
+                    throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查运单编号是否未输入或者输入是否正确");
                 }
-                if(org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getPlateNum())){
-                    log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查车牌号码是否未输入或者输入是否正确");
-                    strError =   "第"+(j+1)+"行数据存在错误,请检查车牌号码是否未输入或者输入是否正确";
-                    throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查车牌号码是否未输入或者输入是否正确");
+                if (org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getPlateNum())) {
+                    log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查车牌号码是否未输入或者输入是否正确");
+                    strError = "第" + (j + 1) + "行数据存在错误,请检查车牌号码是否未输入或者输入是否正确";
+                    throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查车牌号码是否未输入或者输入是否正确");
                 }
-                if(org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getPlateColor())){
-                    log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查车牌颜色是否未输入或者输入是否正确");
-                    strError =   "第"+(j+1)+"行数据存在错误,请检查车牌颜色是否未输入或者输入是否正确";
-                    throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查车牌颜色是否未输入或者输入是否正确");
+                if (org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getPlateColor())) {
+                    log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查车牌颜色是否未输入或者输入是否正确");
+                    strError = "第" + (j + 1) + "行数据存在错误,请检查车牌颜色是否未输入或者输入是否正确";
+                    throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查车牌颜色是否未输入或者输入是否正确");
                 }
-                if( null == noCarWayBill.getStartTimeDate()){
-                    log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查运单开始时间是否未输入或者输入是否正确");
-                    strError =   "第"+(j+1)+"行数据存在错误,请检查运单开始时间是否未输入或者输入是否正确";
-                    throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查运单开始时间是否未输入或者输入是否正确");
+                if (null == noCarWayBill.getStartTimeDate()) {
+                    log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查运单开始时间是否未输入或者输入是否正确");
+                    strError = "第" + (j + 1) + "行数据存在错误,请检查运单开始时间是否未输入或者输入是否正确";
+                    throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查运单开始时间是否未输入或者输入是否正确");
                 }
-                if(org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getSourceAddr())){
-                    log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查运单开始地址是否未输入或者输入是否正确");
-                    strError =   "第"+(j+1)+"行数据存在错误,请检查运单开始地址是否未输入或者输入是否正确";
-                    throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查运单开始地址是否未输入或者输入是否正确");
+                if (org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getSourceAddr())) {
+                    log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查运单开始地址是否未输入或者输入是否正确");
+                    strError = "第" + (j + 1) + "行数据存在错误,请检查运单开始地址是否未输入或者输入是否正确";
+                    throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查运单开始地址是否未输入或者输入是否正确");
                 }
-                if(org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getDestAddr())){
-                    log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查运单目的地址是否未输入或者输入是否正确");
-                    strError =   "第"+(j+1)+"行数据存在错误,请检查运单目的地址是否未输入或者输入是否正确";
-                    throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查运单目的地址是否未输入或者输入是否正确");
+                if (org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getDestAddr())) {
+                    log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查运单目的地址是否未输入或者输入是否正确");
+                    strError = "第" + (j + 1) + "行数据存在错误,请检查运单目的地址是否未输入或者输入是否正确";
+                    throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查运单目的地址是否未输入或者输入是否正确");
                 }
-                if(null == noCarWayBill.getPredictEndTimeDate()){
-                    log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查运单预计完成时间是否未输入或者输入是否正确");
-                    strError =   "第"+(j+1)+"行数据存在错误,请检查运单预计完成时间是否未输入或者输入是否正确";
-                    throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查运单预计完成时间是否未输入或者输入是否正确");
+                if (null == noCarWayBill.getPredictEndTimeDate()) {
+                    log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查运单预计完成时间是否未输入或者输入是否正确");
+                    strError = "第" + (j + 1) + "行数据存在错误,请检查运单预计完成时间是否未输入或者输入是否正确";
+                    throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查运单预计完成时间是否未输入或者输入是否正确");
                 }
-                if(null == noCarWayBill.getFeeD()){
-                    log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查运单费用是否未输入或者输入是否正确");
-                    strError =   "第"+(j+1)+"行数据存在错误,请检查运单费用是否未输入或者输入是否正确";
-                    throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查运单费用是否未输入或者输入是否正确");
+                if (null == noCarWayBill.getFeeD()) {
+                    log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查运单费用是否未输入或者输入是否正确");
+                    strError = "第" + (j + 1) + "行数据存在错误,请检查运单费用是否未输入或者输入是否正确";
+                    throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查运单费用是否未输入或者输入是否正确");
                 }
-                if(org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getTaxplayerCode())){
-                    log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查税号是否未输入或者输入是否正确");
-                    strError =   "第"+(j+1)+"行数据存在错误,请检查税号是否未输入或者输入是否正确";
-                    throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查税号是否未输入或者输入是否正确");
+                if (org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getTaxplayerCode())) {
+                    log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查税号是否未输入或者输入是否正确");
+                    strError = "第" + (j + 1) + "行数据存在错误,请检查税号是否未输入或者输入是否正确";
+                    throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查税号是否未输入或者输入是否正确");
                 }
                 noCarWayBill.setStartTime(format.format(noCarWayBill.getStartTimeDate()));
                 noCarWayBill.setPredictEndTime(format.format(noCarWayBill.getPredictEndTimeDate()));
-                if(noCarWayBill.getFeeD() !=null){
-                    noCarWayBill.setFee(Math.round(noCarWayBill.getFeeD()*100));
+                if (noCarWayBill.getFeeD() != null) {
+                    noCarWayBill.setFee(Math.round(noCarWayBill.getFeeD() * 100));
                 }
                 noCarWayBill.setTaxplayerCode(noCarWayBill.getTaxplayerCode().trim());
                 noCarWayBill.setBillNum(noCarWayBill.getBillNum().trim());
-            }catch (Exception e){
-                sb.append(noCarWayBill.getBillNum()+"#");
+            } catch (Exception e) {
+                sb.append(noCarWayBill.getBillNum() + "#");
                 log.error(noCarWayBill.getBillNum());
                 i++;
             }
         }
-        if(i>0){
-            log.error(org.apache.commons.lang3.StringUtils.isBlank(strError)?"buildDateError"+sb.toString()+"第"+i+"行数据存在错误,请检查文件中数据,金额是否有空的,时间是否全是时间格式":"buildDateError"+sb.toString()+strError);
-            throw new RuntimeException(org.apache.commons.lang3.StringUtils.isBlank(strError)?"第"+i+"行数据存在错误,请检查文件中数据,金额是否有空的,时间是否全是时间格式":strError);
+        if (i > 0) {
+            log.error(org.apache.commons.lang3.StringUtils.isBlank(strError) ? "buildDateError" + sb.toString() + "第" + i + "行数据存在错误,请检查文件中数据,金额是否有空的,时间是否全是时间格式" : "buildDateError" + sb.toString() + strError);
+            throw new RuntimeException(org.apache.commons.lang3.StringUtils.isBlank(strError) ? "第" + i + "行数据存在错误,请检查文件中数据,金额是否有空的,时间是否全是时间格式" : strError);
         }
     }
-    public void buildDateEnd(List<NoCarWayBill> list){
+
+    public void buildDateEnd(List<NoCarWayBill> list) {
         DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         int i = 0;
         StringBuffer sb = new StringBuffer();
         String strError = "";
-        for(int j = 0 ;j<list.size();j++){
+        for (int j = 0; j < list.size(); j++) {
             NoCarWayBill noCarWayBill = list.get(j);
 
-            try{
-                if(null == noCarWayBill){
-                    log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查数据是否未传递");
-                    strError =  "第"+(j+1)+"行数据存在错误,请检查数据是否未传递";
-                    throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查数据是否未传递");
+            try {
+                if (null == noCarWayBill) {
+                    log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查数据是否未传递");
+                    strError = "第" + (j + 1) + "行数据存在错误,请检查数据是否未传递";
+                    throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查数据是否未传递");
                 }
-                if(org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getBillNum())){
-                    log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查运单编号是否未输入或者输入是否正确");
-                    strError =   "第"+(j+1)+"行数据存在错误,请检查运单编号是否未输入或者输入是否正确";
-                    throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查运单编号是否未输入或者输入是否正确");
+                if (org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getBillNum())) {
+                    log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查运单编号是否未输入或者输入是否正确");
+                    strError = "第" + (j + 1) + "行数据存在错误,请检查运单编号是否未输入或者输入是否正确";
+                    throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查运单编号是否未输入或者输入是否正确");
                 }
-                if(null == noCarWayBill.getActEndTimeDate()){
-                    log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查运单实际结束时间是否未输入或者输入是否正确");
-                    strError =   "第"+(j+1)+"行数据存在错误,请检查运单实际结束时间是否未输入或者输入是否正确";
-                    throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查运单实际结束时间是否未输入或者输入是否正确");
+                if (null == noCarWayBill.getActEndTimeDate()) {
+                    log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查运单实际结束时间是否未输入或者输入是否正确");
+                    strError = "第" + (j + 1) + "行数据存在错误,请检查运单实际结束时间是否未输入或者输入是否正确";
+                    throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查运单实际结束时间是否未输入或者输入是否正确");
                 }
-                if(org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getDestAddr())){
-                    log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查运单目的地址是否未输入或者输入是否正确");
-                    strError =   "第"+(j+1)+"行数据存在错误,请检查运单目的地址是否未输入或者输入是否正确";
-                    throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查运单目的地址是否未输入或者输入是否正确");
+                if (org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getDestAddr())) {
+                    log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查运单目的地址是否未输入或者输入是否正确");
+                    strError = "第" + (j + 1) + "行数据存在错误,请检查运单目的地址是否未输入或者输入是否正确";
+                    throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查运单目的地址是否未输入或者输入是否正确");
                 }
                 noCarWayBill.setPredictEndTime(format.format(noCarWayBill.getActEndTimeDate()));
-            }catch (Exception e){
-                sb.append(noCarWayBill.getBillNum()+"#");
+            } catch (Exception e) {
+                sb.append(noCarWayBill.getBillNum() + "#");
                 log.error(noCarWayBill.getBillNum());
                 i++;
             }
 
         }
-        if(i>0){
+        if (i > 0) {
 
-            log.error(org.apache.commons.lang3.StringUtils.isBlank(strError)?"buildDateError"+sb.toString()+"第"+i+"行数据存在错误,请检查文件中数据,时间是否全是时间格式":"buildDateError"+sb.toString()+strError);
-            throw new RuntimeException(org.apache.commons.lang3.StringUtils.isBlank(strError)?"第"+i+"行数据存在错误,请检查文件中数据,时间是否全是时间格式":strError);
+            log.error(org.apache.commons.lang3.StringUtils.isBlank(strError) ? "buildDateError" + sb.toString() + "第" + i + "行数据存在错误,请检查文件中数据,时间是否全是时间格式" : "buildDateError" + sb.toString() + strError);
+            throw new RuntimeException(org.apache.commons.lang3.StringUtils.isBlank(strError) ? "第" + i + "行数据存在错误,请检查文件中数据,时间是否全是时间格式" : strError);
         }
     }
+
     /**
      * 分页查询无车计费信息
      *
-     * @param page    参数集
+     * @param page 参数集
      * @return 用户集合
      */
     @PostMapping("/findBatchList")
-    @ApiOperation(value="运单批次号查询", notes="运单批次号查询")
+    @ApiOperation(value = "运单批次号查询", notes = "运单批次号查询")
     @LoginRequired
-    public RespR findBatchList(Page page, CustomerOper customerOper,User user) {
+    public RespR findBatchList(Page page, CustomerOper customerOper, User user) {
         try {
-            checkHasAuthRole.checkCustomerRole(user,customerOper.getCustomerName());
+            checkHasAuthRole.checkCustomerRole(user, customerOper.getCustomerName());
             RespR respR = new RespR(customerOperService.findAllCustomerOper(page, customerOper));
             return respR;
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
-            return new RespR(false,e.getMessage());
+            return new RespR(false, e.getMessage());
         }
     }
 
     /**
      * 分页查询无车计费信息
      *
-     * @param page    参数集
+     * @param page 参数集
      * @return 用户集合
      */
     @PostMapping("/findNocarCalculateInfo")
-    @ApiOperation(value="分页查询无车计费信息", notes="分页查询无车计费信息")
+    @ApiOperation(value = "分页查询无车计费信息", notes = "分页查询无车计费信息")
     @LoginRequired
-    public RespR findNocarCalculateInfo(Page page, NoCarCalculateInfor carCalculateInfor,User user) {
+    public RespR findNocarCalculateInfo(Page page, NoCarCalculateInfor carCalculateInfor, User user) {
         try {
-            checkHasAuthRole.checkCustomerRole(user,carCalculateInfor.getCustomId());
+            checkHasAuthRole.checkCustomerRole(user, carCalculateInfor.getCustomId());
             setTimeDue1(carCalculateInfor);
             RespR respR = new RespR(noCarCalculateInfoService.findByPageAndCalculateInfor(page, carCalculateInfor));
             return respR;
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
-            return new RespR(false,e.getMessage());
+            return new RespR(false, e.getMessage());
         }
     }
 
     /**
      * 分页查询无车计费统计信息
      *
-     * @param carCalculateInfor    参数集
+     * @param carCalculateInfor 参数集
      * @return 用户集合
      */
     @PostMapping("/findNocarCalculateInfoStatis")
-    @ApiOperation(value="分页查询无车计费统计信息", notes="分页查询无车计费统计信息")
+    @ApiOperation(value = "分页查询无车计费统计信息", notes = "分页查询无车计费统计信息")
     @LoginRequired
-    public RespR findNocarCalculateInfoStatis(NoCarCalculateInfor carCalculateInfor,User user) {
+    public RespR findNocarCalculateInfoStatis(NoCarCalculateInfor carCalculateInfor, User user) {
         try {
-            checkHasAuthRole.checkCustomerRole(user,carCalculateInfor.getCustomId());
+            checkHasAuthRole.checkCustomerRole(user, carCalculateInfor.getCustomId());
             setTimeDue1(carCalculateInfor);
             RespR respR = new RespR(noCarCalculateInfoService.findNocarCalculateInfoStatis(carCalculateInfor));
             return respR;
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
-            return new RespR(false,e.getMessage());
+            return new RespR(false, e.getMessage());
         }
     }
 
 
-
     @GetMapping("/templateDownload")
-    @ApiOperation(value="模板下载", notes="模板下载")
-    public RespR contractDownload(String fileName,HttpServletResponse response){
-            if(ONE.equals(fileName)){
-                fileName = "运单模板.xlsx";
-            }else if(TWO.equals(fileName)){
-                fileName = "运单结束模板.xlsx";
-            }else if(THREE.equals(fileName)){
-                fileName = "历史运单模板.xlsx";
-            }else if(FOR.equals(fileName)){
-                fileName = "无车发票查询模板.xlsx";
-            }else if(FIVE.equals(fileName)){
-                fileName = "无车运单查询模板.xlsx";
-            }else if(SIX.equals(fileName)){
-                fileName = "自有车交易查询模板.xlsx";
-            }else if(SEVEN.equals(fileName)){
-                fileName = "自有车发票查询模板.xlsx";
-            }else if(EIGHT.equals(fileName)){
-                fileName = "自有车按交易查询申请模板.xlsx";
-            }
-            OutputStream outputStream = null;
-            InputStream inputStream = null;
-            try {
-                File file = new File("/home/app/excel/"+fileName);
-                inputStream = new FileInputStream(file);
-                response.setHeader("Content-Disposition", "attachment;filename="+ URLEncoder.encode(fileName, "UTF-8"));
-                outputStream = response.getOutputStream();
-                IOUtils.copy(inputStream, outputStream);
-                response.flushBuffer();
-                return new RespR(true);
-            } catch (IOException e) {
-
-            } finally {
-                IOUtils.closeQuietly(inputStream);
-                IOUtils.closeQuietly(outputStream);
-            }
+    @ApiOperation(value = "模板下载", notes = "模板下载")
+    public RespR contractDownload(String fileName, HttpServletResponse response) {
+        if (ONE.equals(fileName)) {
+            fileName = "运单模板.xlsx";
+        } else if (TWO.equals(fileName)) {
+            fileName = "运单结束模板.xlsx";
+        } else if (THREE.equals(fileName)) {
+            fileName = "历史运单模板.xlsx";
+        } else if (FOR.equals(fileName)) {
+            fileName = "无车发票查询模板.xlsx";
+        } else if (FIVE.equals(fileName)) {
+            fileName = "无车运单查询模板.xlsx";
+        } else if (SIX.equals(fileName)) {
+            fileName = "自有车交易查询模板.xlsx";
+        } else if (SEVEN.equals(fileName)) {
+            fileName = "自有车发票查询模板.xlsx";
+        } else if (EIGHT.equals(fileName)) {
+            fileName = "自有车按交易查询申请模板.xlsx";
+        }
+        OutputStream outputStream = null;
+        InputStream inputStream = null;
+        try {
+            File file = new File("/home/app/excel/" + fileName);
+            inputStream = new FileInputStream(file);
+            response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
+            outputStream = response.getOutputStream();
+            IOUtils.copy(inputStream, outputStream);
+            response.flushBuffer();
+            return new RespR(true);
+        } catch (IOException e) {
+
+        } finally {
+            IOUtils.closeQuietly(inputStream);
+            IOUtils.closeQuietly(outputStream);
+        }
         return new RespR(false);
     }
-    public void setTimeDue1(NoCarCalculateInfor carCalculateInfor){
-        if(!StringUtils.isEmpty(carCalculateInfor.getInvoiceMakeTime()) && !NULL.equals(carCalculateInfor.getInvoiceMakeTime())){
-            String [] res = carCalculateInfor.getInvoiceMakeTime().split(",");
+
+    public void setTimeDue1(NoCarCalculateInfor carCalculateInfor) {
+        if (!StringUtils.isEmpty(carCalculateInfor.getInvoiceMakeTime()) && !NULL.equals(carCalculateInfor.getInvoiceMakeTime())) {
+            String[] res = carCalculateInfor.getInvoiceMakeTime().split(",");
             carCalculateInfor.setInvoiceMakeStart(res[0]);
-            carCalculateInfor.setInvoiceMakeEnd(res[1].replace("00:00:00","23:59:59"));
-        }else{
+            carCalculateInfor.setInvoiceMakeEnd(res[1].replace("00:00:00", "23:59:59"));
+        } else {
             carCalculateInfor.setInvoiceMakeTime(null);
         }
-        if(!StringUtils.isEmpty(carCalculateInfor.getCalculateTime()) && !NULL.equals(carCalculateInfor.getCalculateTime())){
-            String [] res = carCalculateInfor.getCalculateTime().split(",");
+        if (!StringUtils.isEmpty(carCalculateInfor.getCalculateTime()) && !NULL.equals(carCalculateInfor.getCalculateTime())) {
+            String[] res = carCalculateInfor.getCalculateTime().split(",");
             carCalculateInfor.setCalculateStart(res[0]);
-            carCalculateInfor.setCalculateEnd(res[1].replace("00:00:00","23:59:59"));
-        }else{
+            carCalculateInfor.setCalculateEnd(res[1].replace("00:00:00", "23:59:59"));
+        } else {
             carCalculateInfor.setCalculateTime(null);
         }
     }

+ 171 - 164
src/main/java/com/jkcredit/invoice/controller/business/SelfCarController.java

@@ -46,14 +46,14 @@ import static com.jkcredit.invoice.common.CommonConst.NULL;
 @RestController
 @RequestMapping(value = {"/selfCar"})
 /**
-* @Description 自有车操作
-* @Author  mashengyi
-* @Date   2022/2/8 18:18
-* @Param
-* @Return
-* @Exception
-*
-*/
+ * @Description 自有车操作
+ * @Author mashengyi
+ * @Date 2022/2/8 18:18
+ * @Param
+ * @Return
+ * @Exception
+ *
+ */
 public class SelfCarController {
     @Autowired
     SelfCarServiceL selfCarServiceL;
@@ -72,268 +72,278 @@ public class SelfCarController {
     @Autowired
     CustomerService customerService;
     @Autowired
+    SelfCarApplyService selfCarApplyService;
+    @Autowired
+    CustomerRecMapper customerRecMapper;
+    @Autowired
+    CustomerCarRecMapper customerCarRecMapper;
+    @Autowired
     private CheckHasAuthRole checkHasAuthRole;
+
     /**
      * 解绑etc卡
-     * @param etcNum    参数集
+     *
+     * @param etcNum 参数集
      * @return 用户集合
      */
     @PostMapping("/selfCarUnBind")
-    @ApiOperation(value="解绑etc卡", notes="解绑etc卡")
+    @ApiOperation(value = "解绑etc卡", notes = "解绑etc卡")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
     public RespR selfCarUnBind(String etcNum) {
         try {
             RespR respR = selfCarService.selfCarUnBind(etcNum);
             return respR;
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
-            return new RespR(false,e.getMessage());
+            return new RespR(false, e.getMessage());
         }
     }
 
     /**
      * 分页查询自有车交易信息
      *
-     * @param page    参数集
+     * @param page 参数集
      * @return 交易信息
      */
     @PostMapping("/findTrades")
-    @ApiOperation(value="分页查询自有车交易信息", notes="分页查询自有车交易信息")
+    @ApiOperation(value = "分页查询自有车交易信息", notes = "分页查询自有车交易信息")
     @LoginRequired
     public RespR findTrades(Page page, SelfCarTrade selfCarTrade, User user) {
         try {
-            checkHasAuthRole.checkCustomerRole(user,selfCarTrade.getCustomId());
+            checkHasAuthRole.checkCustomerRole(user, selfCarTrade.getCustomId());
             setTimeDue(selfCarTrade);
             RespR respR = new RespR(selfCarTradeService.findByPageAndTrade(page, selfCarTrade));
             return respR;
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
-            return new RespR(false,e.getMessage());
+            return new RespR(false, e.getMessage());
         }
     }
+
     /**
      * 分页查询自有车交易信息
      *
-     * @param page    参数集
+     * @param page 参数集
      * @return 交易信息
      */
     @PostMapping("/findTradesUpper")
-    @ApiOperation(value="分页查询自有车交易信息", notes="分页查询自有车交易信息")
+    @ApiOperation(value = "分页查询自有车交易信息", notes = "分页查询自有车交易信息")
     @LoginRequired
-    public RespR findTradesUpper(Page page, SelfCarTrade selfCarTrade,User user) {
+    public RespR findTradesUpper(Page page, SelfCarTrade selfCarTrade, User user) {
         try {
-            checkHasAuthRole.checkCustomerRole(user,selfCarTrade.getCustomId());
+            checkHasAuthRole.checkCustomerRole(user, selfCarTrade.getCustomId());
             setTimeDue(selfCarTrade);
-            if(StringUtils.isEmpty(selfCarTrade.getCompanyName())){
-                return new RespR(false,"需要输入公司名称");
+            if (StringUtils.isEmpty(selfCarTrade.getCompanyName())) {
+                return new RespR(false, "需要输入公司名称");
             }
-            if(StringUtils.isEmpty(selfCarTrade.getExTimeBegin())){
-                return new RespR(false,"需要交易开始时间");
+            if (StringUtils.isEmpty(selfCarTrade.getExTimeBegin())) {
+                return new RespR(false, "需要交易开始时间");
             }
-            if(StringUtils.isEmpty(selfCarTrade.getExTimeEnd())){
-                return new RespR(false,"需要输入交易结束时间");
+            if (StringUtils.isEmpty(selfCarTrade.getExTimeEnd())) {
+                return new RespR(false, "需要输入交易结束时间");
             }
             //先更新查询信息
-            TradeRequestVo tradeRequestVo  = new TradeRequestVo();
+            TradeRequestVo tradeRequestVo = new TradeRequestVo();
             tradeRequestVo.setCustomerName(selfCarTrade.getCustomId());
             tradeRequestVo.setCompanyName(selfCarTrade.getCompanyName());
             tradeRequestVo.setStartTime(selfCarTrade.getExTimeBegin());
             tradeRequestVo.setEndTime(selfCarTrade.getExTimeEnd());
             tradeRequestVo.setTradeStatus(selfCarTrade.getStatus());
             tradeRequestVo.setInterType(1);//0 接口
-            if(StringUtils.isEmpty(selfCarTrade.getCardId())){
+            if (StringUtils.isEmpty(selfCarTrade.getCardId())) {
                 List<CustomerCarRec> customerCarRecs = selfCarService.getEtcsByCompany(selfCarTrade.getCompanyName());
-                if(customerCarRecs!=null && customerCarRecs.size()>0){
-                    for(CustomerCarRec customerCarRec:customerCarRecs){
+                if (customerCarRecs != null && customerCarRecs.size() > 0) {
+                    for (CustomerCarRec customerCarRec : customerCarRecs) {
                         tradeRequestVo.setEtcId(customerCarRec.getEtcNum());
-                        if(tradeRequestVo.getTradeStatus() ==null){
+                        if (tradeRequestVo.getTradeStatus() == null) {
                             tradeRequestVo.setTradeStatus(1);
                             selfCarServiceL.getTradeList(tradeRequestVo);
                             tradeRequestVo.setTradeStatus(2);
                             selfCarServiceL.getTradeList(tradeRequestVo);
                             tradeRequestVo.setTradeStatus(3);
                             selfCarServiceL.getTradeList(tradeRequestVo);
-                        }else{
+                        } else {
                             selfCarServiceL.getTradeList(tradeRequestVo);
                         }
                     }
                 }
-            }else{
+            } else {
                 tradeRequestVo.setEtcId(selfCarTrade.getCardId());
-                if(tradeRequestVo.getTradeStatus() ==null){
+                if (tradeRequestVo.getTradeStatus() == null) {
                     tradeRequestVo.setTradeStatus(1);
                     selfCarServiceL.getTradeList(tradeRequestVo);
                     tradeRequestVo.setTradeStatus(2);
                     selfCarServiceL.getTradeList(tradeRequestVo);
                     tradeRequestVo.setTradeStatus(3);
                     selfCarServiceL.getTradeList(tradeRequestVo);
-                }else{
+                } else {
                     selfCarServiceL.getTradeList(tradeRequestVo);
                 }
             }
             RespR respR = new RespR(selfCarTradeService.findByPageAndTrade(page, selfCarTrade));
             return respR;
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
-            return new RespR(false,e.getMessage());
+            return new RespR(false, e.getMessage());
         }
     }
 
     /**
      * 分页查询自有车交易信息
      *
-     * @param  selfCarTradesStr
+     * @param selfCarTradesStr
      * @return 交易信息
      */
     @PostMapping("/updateTrades")
-    @ApiOperation(value="更新交易id状态", notes="更新交易id状态")
+    @ApiOperation(value = "更新交易id状态", notes = "更新交易id状态")
     @LoginRequired
-    public void updateTrades( String selfCarTradesStr,String companyName,User user) {
+    public void updateTrades(String selfCarTradesStr, String companyName, User user) {
         try {
-            checkHasAuthRole.checkCompanyRole(user,companyName);
-            List<SelfCarTrade>  selfCarTrades = JSON.parseArray(selfCarTradesStr,SelfCarTrade.class);
-            if(selfCarTrades== null || selfCarTrades.size()==0){
-                selfCarTrades = sellCarTradeMapper.selectByStatus("2",companyName);
+            checkHasAuthRole.checkCompanyRole(user, companyName);
+            List<SelfCarTrade> selfCarTrades = JSON.parseArray(selfCarTradesStr, SelfCarTrade.class);
+            if (selfCarTrades == null || selfCarTrades.size() == 0) {
+                selfCarTrades = sellCarTradeMapper.selectByStatus("2", companyName);
 
             }
             selfCarTradeService.updateTrades(selfCarTrades);
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
         }
     }
 
-    public void setTimeDue(SelfCarTrade selfCarTrade){
-        if(!StringUtils.isEmpty(selfCarTrade.getCardId()) && !StringUtils.isEmpty(selfCarTrade.getTradeId())){
-            String [] cardIdArr = selfCarTrade.getCardId().split(",");
-            String [] tradeIdArr=null;
-            if( selfCarTrade.getTradeId()!=null){
-                tradeIdArr =  selfCarTrade.getTradeId().split(",");
+    public void setTimeDue(SelfCarTrade selfCarTrade) {
+        if (!StringUtils.isEmpty(selfCarTrade.getCardId()) && !StringUtils.isEmpty(selfCarTrade.getTradeId())) {
+            String[] cardIdArr = selfCarTrade.getCardId().split(",");
+            String[] tradeIdArr = null;
+            if (selfCarTrade.getTradeId() != null) {
+                tradeIdArr = selfCarTrade.getTradeId().split(",");
             }
             List<CardAndTradeVo> cardAndTradeVos = new ArrayList<>();
-            for (int i=0;i<cardIdArr.length;i++){
+            for (int i = 0; i < cardIdArr.length; i++) {
                 CardAndTradeVo cardAndTradeVo = new CardAndTradeVo();
                 cardAndTradeVo.setCardId(cardIdArr[i]);
-                if(tradeIdArr!=null && tradeIdArr.length>=i+1){
+                if (tradeIdArr != null && tradeIdArr.length >= i + 1) {
                     cardAndTradeVo.setTradeId(tradeIdArr[i]);
-                }else{
+                } else {
                     cardAndTradeVo.setTradeId("");
                 }
                 cardAndTradeVos.add(cardAndTradeVo);
             }
             selfCarTrade.setCardAndTradeVos(cardAndTradeVos);
-        }else if(!StringUtils.isEmpty(selfCarTrade.getCardId())){
+        } else if (!StringUtils.isEmpty(selfCarTrade.getCardId())) {
             selfCarTrade.setCardIds(Arrays.asList(selfCarTrade.getCardId().split(",")));
-        }else if(!StringUtils.isEmpty(selfCarTrade.getTradeId())){
+        } else if (!StringUtils.isEmpty(selfCarTrade.getTradeId())) {
             selfCarTrade.setTradeIds(Arrays.asList(selfCarTrade.getTradeId().split(",")));
         }
-        if(!StringUtils.isEmpty(selfCarTrade.getAclTimeBegin()) && !NULL.equals(selfCarTrade.getAclTimeBegin())){
-            String [] res = selfCarTrade.getAclTimeBegin().split(",");
+        if (!StringUtils.isEmpty(selfCarTrade.getAclTimeBegin()) && !NULL.equals(selfCarTrade.getAclTimeBegin())) {
+            String[] res = selfCarTrade.getAclTimeBegin().split(",");
             selfCarTrade.setAclTimeBegin(res[0]);
-            selfCarTrade.setAclTimeEnd(res[1].replace("00:00:00","23:59:59"));
-        }else{
+            selfCarTrade.setAclTimeEnd(res[1].replace("00:00:00", "23:59:59"));
+        } else {
             selfCarTrade.setAclTimeBegin(null);
         }
-        if(!StringUtils.isEmpty(selfCarTrade.getExTimeBegin()) && !NULL.equals(selfCarTrade.getExTimeBegin())){
-            String [] res = selfCarTrade.getExTimeBegin().split(",");
+        if (!StringUtils.isEmpty(selfCarTrade.getExTimeBegin()) && !NULL.equals(selfCarTrade.getExTimeBegin())) {
+            String[] res = selfCarTrade.getExTimeBegin().split(",");
             selfCarTrade.setExTimeBegin(res[0]);
-            selfCarTrade.setExTimeEnd(res[1].replace("00:00:00","23:59:59"));
-        }else{
+            selfCarTrade.setExTimeEnd(res[1].replace("00:00:00", "23:59:59"));
+        } else {
             selfCarTrade.setExTimeBegin(null);
         }
     }
+
     /**
      * 分页查询所有发票信息
      *
-     * @param page    参数集
+     * @param page 参数集
      * @return 交易信息
      */
     @PostMapping("/findSelfCarInvoices")
-    @ApiOperation(value="分页查询自有车发票信息", notes="分页查询自有车发票信息")
+    @ApiOperation(value = "分页查询自有车发票信息", notes = "分页查询自有车发票信息")
     @LoginRequired
-    public RespR findSelfCarInvoices(Page page, SelfCarInvoice selfCarInvoice,User user) {
+    public RespR findSelfCarInvoices(Page page, SelfCarInvoice selfCarInvoice, User user) {
         try {
-            checkHasAuthRole.checkCustomerRole(user,selfCarInvoice.getCustomerName());
-            if(!StringUtils.isEmpty(selfCarInvoice.getCardId()) && !StringUtils.isEmpty(selfCarInvoice.getTradeId())){
-                String [] cardIdArr = selfCarInvoice.getCardId().split(",");
-                String [] tradeIdArr=null;
-                if( selfCarInvoice.getTradeId()!=null){
-                    tradeIdArr =  selfCarInvoice.getTradeId().split(",");
+            checkHasAuthRole.checkCustomerRole(user, selfCarInvoice.getCustomerName());
+            if (!StringUtils.isEmpty(selfCarInvoice.getCardId()) && !StringUtils.isEmpty(selfCarInvoice.getTradeId())) {
+                String[] cardIdArr = selfCarInvoice.getCardId().split(",");
+                String[] tradeIdArr = null;
+                if (selfCarInvoice.getTradeId() != null) {
+                    tradeIdArr = selfCarInvoice.getTradeId().split(",");
                 }
                 List<CardAndTradeVo> cardAndTradeVos = new ArrayList<>();
-                for (int i=0;i<cardIdArr.length;i++){
+                for (int i = 0; i < cardIdArr.length; i++) {
                     CardAndTradeVo cardAndTradeVo = new CardAndTradeVo();
                     cardAndTradeVo.setCardId(cardIdArr[i]);
-                    if(tradeIdArr!=null && tradeIdArr.length>=i+1){
+                    if (tradeIdArr != null && tradeIdArr.length >= i + 1) {
                         cardAndTradeVo.setTradeId(tradeIdArr[i]);
-                    }else{
+                    } else {
                         cardAndTradeVo.setTradeId("");
                     }
                     cardAndTradeVos.add(cardAndTradeVo);
                 }
                 selfCarInvoice.setCardAndTradeVos(cardAndTradeVos);
-            }else if(!StringUtils.isEmpty(selfCarInvoice.getCardId())){
+            } else if (!StringUtils.isEmpty(selfCarInvoice.getCardId())) {
                 selfCarInvoice.setCardIds(Arrays.asList(selfCarInvoice.getCardId().split(",")));
-            }else if(!StringUtils.isEmpty(selfCarInvoice.getTradeId())){
+            } else if (!StringUtils.isEmpty(selfCarInvoice.getTradeId())) {
                 selfCarInvoice.setTradeIds(Arrays.asList(selfCarInvoice.getTradeId().split(",")));
             }
-            if(!StringUtils.isEmpty(selfCarInvoice.getInvoiceMakeTime()) && !NULL.equals(selfCarInvoice.getInvoiceMakeTime())){
-                String [] res =selfCarInvoice.getInvoiceMakeTime().split(",");
+            if (!StringUtils.isEmpty(selfCarInvoice.getInvoiceMakeTime()) && !NULL.equals(selfCarInvoice.getInvoiceMakeTime())) {
+                String[] res = selfCarInvoice.getInvoiceMakeTime().split(",");
                 selfCarInvoice.setInvoiceMakeStart(res[0]);
-                selfCarInvoice.setInvoiceMakeEnd(res[1].replace("00:00:00","23:59:59"));
+                selfCarInvoice.setInvoiceMakeEnd(res[1].replace("00:00:00", "23:59:59"));
             }
             RespR respR = new RespR(selfCarInvoiceService.findByPageAndInvoice(page, selfCarInvoice));
             return respR;
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
-            return new RespR(false,e.getMessage());
+            return new RespR(false, e.getMessage());
         }
     }
 
     /**
      * 分页查询自有车计费信息
      *
-     * @param page    参数集
+     * @param page 参数集
      * @return 用户集合
      */
     @PostMapping("/findSelfcarCalculateInfo")
-    @ApiOperation(value="分页查询自有车计费信息", notes="分页查询自有车计费信息")
+    @ApiOperation(value = "分页查询自有车计费信息", notes = "分页查询自有车计费信息")
     @LoginRequired
-    public RespR findSelfcarCalculateInfo(Page page, SelfCarCalculateInfor carCalculateInfor,User user) {
+    public RespR findSelfcarCalculateInfo(Page page, SelfCarCalculateInfor carCalculateInfor, User user) {
         try {
-            checkHasAuthRole.checkCustomerRole(user,carCalculateInfor.getCustomId());
-            if(!StringUtils.isEmpty(carCalculateInfor.getCalTime()) && !NULL.equals(carCalculateInfor.getCalTime())){
-                String [] res =carCalculateInfor.getCalTime().split(",");
+            checkHasAuthRole.checkCustomerRole(user, carCalculateInfor.getCustomId());
+            if (!StringUtils.isEmpty(carCalculateInfor.getCalTime()) && !NULL.equals(carCalculateInfor.getCalTime())) {
+                String[] res = carCalculateInfor.getCalTime().split(",");
                 carCalculateInfor.setCalTimeStart(res[0]);
                 carCalculateInfor.setCalTimeEnd(res[1]);
             }
             RespR respR = new RespR(selfCarCalculateInfoService.findByPageAndCalculateInfor(page, carCalculateInfor));
             return respR;
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
-            return new RespR(false,e.getMessage());
+            return new RespR(false, e.getMessage());
         }
     }
-    @Autowired
-    SelfCarApplyService selfCarApplyService;
+
     /**
      * 分页查询自有车申请信息
      *
-     * @param page    参数集
+     * @param page 参数集
      * @return 用户集合
      */
     @PostMapping("/findSelfcarAppls")
-    @ApiOperation(value="分页查询自有车申请信息", notes="分页查询自有车申请信息")
+    @ApiOperation(value = "分页查询自有车申请信息", notes = "分页查询自有车申请信息")
     @LoginRequired
-    public RespR findSelfcarAppls(Page page, SelfCarAppl selfCarAppl,User user) {
+    public RespR findSelfcarAppls(Page page, SelfCarAppl selfCarAppl, User user) {
         try {
-            checkHasAuthRole.checkCustomerRole(user,selfCarAppl.getCustomId());
-            RespR respR = new RespR(selfCarApplyService.findByPageAndInvoice(page,selfCarAppl));
+            checkHasAuthRole.checkCustomerRole(user, selfCarAppl.getCustomId());
+            RespR respR = new RespR(selfCarApplyService.findByPageAndInvoice(page, selfCarAppl));
             return respR;
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
-            return new RespR(false,e.getMessage());
+            return new RespR(false, e.getMessage());
         }
     }
+
     /**
      * 分页查询自有车计费信息
      *
@@ -341,36 +351,37 @@ public class SelfCarController {
      * @return 用户集合
      */
     @PostMapping("/findSelfcarCalculateInfoSta")
-    @ApiOperation(value="自有车计费统计信息", notes="自有车计费统计信息")
+    @ApiOperation(value = "自有车计费统计信息", notes = "自有车计费统计信息")
     @LoginRequired
-    public RespR findSelfcarCalculateInfoSta(SelfCarCalculateInfor carCalculateInfor,User user) {
+    public RespR findSelfcarCalculateInfoSta(SelfCarCalculateInfor carCalculateInfor, User user) {
         try {
-            checkHasAuthRole.checkCustomerRole(user,carCalculateInfor.getCustomId());
-            if(!StringUtils.isEmpty(carCalculateInfor.getCalTime()) && !NULL.equals(carCalculateInfor.getCalTime())){
-                String [] res =carCalculateInfor.getCalTime().split(",");
+            checkHasAuthRole.checkCustomerRole(user, carCalculateInfor.getCustomId());
+            if (!StringUtils.isEmpty(carCalculateInfor.getCalTime()) && !NULL.equals(carCalculateInfor.getCalTime())) {
+                String[] res = carCalculateInfor.getCalTime().split(",");
                 carCalculateInfor.setCalTimeStart(res[0]);
                 carCalculateInfor.setCalTimeEnd(res[1]);
             }
             RespR respR = new RespR(selfCarCalculateInfoService.findSelfcarCalculateInfoSta(carCalculateInfor));
             return respR;
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
-            return new RespR(false,e.getMessage());
+            return new RespR(false, e.getMessage());
         }
     }
+
     /**
      * @param tradeRequestCarNumVo
      * @return
      */
     @PostMapping("/getTradeList")
-    @ApiOperation(value="获取需要开票的交易Id列表", notes="获取需要开票的交易Id列表")
+    @ApiOperation(value = "获取需要开票的交易Id列表", notes = "获取需要开票的交易Id列表")
     @LoginRequired
-    public RespR getTradeList(@RequestBody TradeRequestCarNumVo tradeRequestCarNumVo,User user){
-        checkHasAuthRole.checkCompanyRole(user,tradeRequestCarNumVo.getCompanyName());
+    public RespR getTradeList(@RequestBody TradeRequestCarNumVo tradeRequestCarNumVo, User user) {
+        checkHasAuthRole.checkCompanyRole(user, tradeRequestCarNumVo.getCompanyName());
         //通过车牌号查询所有的Etc卡号
         List<CustomerCarRec> customerCarRecs = selfCarService.getEtcsByCarNum(tradeRequestCarNumVo.getCarNum());
-        if(customerCarRecs == null || customerCarRecs.size()<=0){
-            return new RespR(false,"请输入有绑定ETC卡号的车牌");
+        if (customerCarRecs == null || customerCarRecs.size() <= 0) {
+            return new RespR(false, "请输入有绑定ETC卡号的车牌");
         }
         //合并展示
         List<CardTradeModel> cardTradeModels = new ArrayList<>();
@@ -384,58 +395,56 @@ public class SelfCarController {
             tradeRequestVo.setTradeStatus(1);
             tradeRequestVo.setEtcId(customerCarRec.getEtcNum());
             RespR<List<CardTradeModel>> respRbefore = selfCarServicel.getTradeList(tradeRequestVo);
-            if(respRbefore.getCode() == 0){
+            if (respRbefore.getCode() == 0) {
                 cardTradeModels.addAll(respRbefore.getData());
             }
         });
         return new RespR(cardTradeModels);
     }
+
     /**
      * @param tradeRequestCarNumVo
      * @return
      */
     @PostMapping("/applTradeList")
-    @ApiOperation(value="根据车牌号进行开票操作", notes="根据车牌号进行开票操作")
+    @ApiOperation(value = "根据车牌号进行开票操作", notes = "根据车牌号进行开票操作")
     @LoginRequired
-    public RespR applTradeList(@RequestBody TradeRequestCarNumVo tradeRequestCarNumVo,User user){
-        checkHasAuthRole.checkCompanyRole(user,tradeRequestCarNumVo.getCompanyName());
-        String [] cardAndTrades = tradeRequestCarNumVo.getCarIdStr().split(",");
-        Map<String,InvoiceApplVo> map = new HashMap<>();
-        for(int i = 0;i<cardAndTrades.length;i++){
-            if(!StringUtils.isEmpty(cardAndTrades[i])){
-                String [] cardAndTrade = cardAndTrades[i].split("#");
+    public RespR applTradeList(@RequestBody TradeRequestCarNumVo tradeRequestCarNumVo, User user) {
+        checkHasAuthRole.checkCompanyRole(user, tradeRequestCarNumVo.getCompanyName());
+        String[] cardAndTrades = tradeRequestCarNumVo.getCarIdStr().split(",");
+        Map<String, InvoiceApplVo> map = new HashMap<>();
+        for (int i = 0; i < cardAndTrades.length; i++) {
+            if (!StringUtils.isEmpty(cardAndTrades[i])) {
+                String[] cardAndTrade = cardAndTrades[i].split("#");
                 InvoiceApplVo invoiceApplVo = map.get(cardAndTrade[0]);
-                if(invoiceApplVo == null){
+                if (invoiceApplVo == null) {
                     invoiceApplVo.setCompanyName(tradeRequestCarNumVo.getCompanyName());
                     invoiceApplVo.setCustomerName(tradeRequestCarNumVo.getCustomerName());
                     invoiceApplVo.setCardId(cardAndTrade[0]);
                     invoiceApplVo.setTradeIds(new ArrayList<String>());
                     invoiceApplVo.getTradeIds().add(cardAndTrade[1]);
-                    map.put(cardAndTrade[0],invoiceApplVo);
-                }else{
+                    map.put(cardAndTrade[0], invoiceApplVo);
+                } else {
                     invoiceApplVo.getTradeIds().add(cardAndTrade[1]);
                 }
             }
         }
         StringBuffer stringBuffer = new StringBuffer();
-        for(Map.Entry<String,InvoiceApplVo> elm:map.entrySet()){
+        for (Map.Entry<String, InvoiceApplVo> elm : map.entrySet()) {
             InvoiceApplVo invoiceApplVo = elm.getValue();
             RespR respR = selfCarServicel.applInvoice(invoiceApplVo);
-            if(respR.getCode() == 1){
-                stringBuffer.append(invoiceApplVo.getCardId()+"开票申请失败原因:"+respR.getMsg()+"#");
+            if (respR.getCode() == 1) {
+                stringBuffer.append(invoiceApplVo.getCardId() + "开票申请失败原因:" + respR.getMsg() + "#");
             }
         }
-        if(StringUtils.isEmpty(stringBuffer.toString())){
+        if (StringUtils.isEmpty(stringBuffer.toString())) {
             return new RespR(true);
-        }else{
-            return new RespR(false,stringBuffer.toString());
+        } else {
+            return new RespR(false, stringBuffer.toString());
         }
 
     }
-    @Autowired
-    CustomerRecMapper customerRecMapper;
-    @Autowired
-    CustomerCarRecMapper customerCarRecMapper;
+
     /**
      * 查询已经开票信息
      *
@@ -443,33 +452,33 @@ public class SelfCarController {
      * @return
      */
     @PostMapping("/findSelfcarInvoiceByTime")
-    @ApiOperation(value="通过时间,车牌号查询开票信息", notes="通过时间,车牌号查询开票信息")
+    @ApiOperation(value = "通过时间,车牌号查询开票信息", notes = "通过时间,车牌号查询开票信息")
     @LoginRequired
-    public RespR findSelfcarInvoiceByTime(@RequestBody  SelfcarInvoiceByTimeVo selfcarInvoiceByTimeVo,User user) {
+    public RespR findSelfcarInvoiceByTime(@RequestBody SelfcarInvoiceByTimeVo selfcarInvoiceByTimeVo, User user) {
         try {
-            checkHasAuthRole.checkCompanyRole(user,selfcarInvoiceByTimeVo.getCompanyName());
-            if(!customerService.checkMoneyEnough(selfcarInvoiceByTimeVo.getCustomerName())){
-                return new RespR(false,"余额不足");
+            checkHasAuthRole.checkCompanyRole(user, selfcarInvoiceByTimeVo.getCompanyName());
+            if (!customerService.checkMoneyEnough(selfcarInvoiceByTimeVo.getCustomerName())) {
+                return new RespR(false, "余额不足");
             }
             //通过车牌号查询所有的Etc卡号
             List<CustomerCarRec> customerCarRecs = null;
-            if(selfcarInvoiceByTimeVo.getCarNum() != null && selfcarInvoiceByTimeVo.getCarNum() != ""){
+            if (selfcarInvoiceByTimeVo.getCarNum() != null && selfcarInvoiceByTimeVo.getCarNum() != "") {
                 customerCarRecs = selfCarService.getEtcsByCarNum(selfcarInvoiceByTimeVo.getCarNum());
-            }else{
+            } else {
                 customerCarRecs = customerCarRecMapper.selectAllEtcByCompany(selfcarInvoiceByTimeVo.getCompanyName());
             }
 
-            if(customerCarRecs == null || customerCarRecs.size()<=0){
-                return new RespR(false,"无ETC卡号的车牌");
+            if (customerCarRecs == null || customerCarRecs.size() <= 0) {
+                return new RespR(false, "无ETC卡号的车牌");
             }
             CustomerRec customerRec = new CustomerRec();
             customerRec.setCustomerName(selfcarInvoiceByTimeVo.getCustomerName());
             customerRec.setCompanyName(selfcarInvoiceByTimeVo.getCompanyName());
             CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompany(customerRec);
-            if(customerRec1 == null || customerRec1.getRecStatus().intValue() !=1 ){
-                return new RespR(false,"客户未备案");
+            if (customerRec1 == null || customerRec1.getRecStatus().intValue() != 1) {
+                return new RespR(false, "客户未备案");
             }
-            List<B2BInvoiceListModel>  allSelfInvocies = new ArrayList<>();
+            List<B2BInvoiceListModel> allSelfInvocies = new ArrayList<>();
             customerCarRecs.forEach(customerCarRec -> {
                 SelfCarDueQueryVo selfCarDueQueryVo = new SelfCarDueQueryVo();
                 selfCarDueQueryVo.setCustomername(selfcarInvoiceByTimeVo.getCustomerName());
@@ -477,65 +486,63 @@ public class SelfCarController {
                 selfCarDueQueryVo.setStartTime(selfcarInvoiceByTimeVo.getStartTime());
                 selfCarDueQueryVo.setEndTime(selfcarInvoiceByTimeVo.getEndTime());
                 selfCarDueQueryVo.setCardId(customerCarRec.getEtcNum());
-                RespR<List<B2BInvoiceListModel>> respR = selfCarServicel.getSelfCarInvoicesByTime(selfCarDueQueryVo,customerRec1);
-                if(respR.getCode() == 0){
+                RespR<List<B2BInvoiceListModel>> respR = selfCarServicel.getSelfCarInvoicesByTime(selfCarDueQueryVo, customerRec1);
+                if (respR.getCode() == 0) {
                     allSelfInvocies.addAll(respR.getData());
                 }
             });
-           return new RespR(allSelfInvocies);
-        }catch (Exception e){
+            return new RespR(allSelfInvocies);
+        } catch (Exception e) {
             e.printStackTrace();
-            return new RespR(false,e.getMessage());
+            return new RespR(false, e.getMessage());
         }
     }
 
 
-
     /**
      * 批量查询自有车交易信息
      *
-     * @param file    参数集
+     * @param file 参数集
      * @return
      */
     @PostMapping("/batchImportSelfcarTrades")
-    @ApiOperation(value="批量查询自有车交易信息", notes="批量查询自有车交易信息")
+    @ApiOperation(value = "批量查询自有车交易信息", notes = "批量查询自有车交易信息")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
     public RespR batchImportSelfcarTrades(@RequestParam("file") MultipartFile file) {
         try {
             ImportParams params = new ImportParams();
             params.setTitleRows(1);
             params.setHeadRows(1);
-            List<SelfCarTrade> list = ExcelImportUtil.importExcel(file.getInputStream(), SelfCarTrade.class,params) ;
+            List<SelfCarTrade> list = ExcelImportUtil.importExcel(file.getInputStream(), SelfCarTrade.class, params);
             RespR respR = selfCarTradeService.batchImportSelfcarTrades(list);
             return respR;
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
-            return new RespR(false,e.getMessage());
+            return new RespR(false, e.getMessage());
         }
     }
 
 
-
     /**
      * 批量查询自有车发票信息
      *
-     * @param file    参数集
+     * @param file 参数集
      * @return
      */
     @PostMapping("/batchImportSelfcarInvoices")
-    @ApiOperation(value="批量查询自有车发票信息", notes="批量查询自有车发票信息")
+    @ApiOperation(value = "批量查询自有车发票信息", notes = "批量查询自有车发票信息")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
     public RespR batchImportSelfcarInvoices(@RequestParam("file") MultipartFile file) {
         try {
             ImportParams params = new ImportParams();
             params.setTitleRows(1);
             params.setHeadRows(1);
-            List<SelfCarInvoice> list = ExcelImportUtil.importExcel(file.getInputStream(), SelfCarInvoice.class,params) ;
+            List<SelfCarInvoice> list = ExcelImportUtil.importExcel(file.getInputStream(), SelfCarInvoice.class, params);
             RespR respR = selfCarInvoiceService.findImportSelfcarInvoices(list);
             return respR;
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
-            return new RespR(false,e.getMessage());
+            return new RespR(false, e.getMessage());
         }
     }
 

+ 13 - 12
src/main/java/com/jkcredit/invoice/controller/interserver/CustomerLowerServiceController.java

@@ -28,14 +28,15 @@ public class CustomerLowerServiceController {
     CustomerService customerService;
     @Autowired
     private CheckHasAuthRole checkHasAuthRole;
+
     /**
      * @param customerRecs
      * @return
      */
     @PostMapping("/customeRec")
-    @ApiOperation(value="用户备案", notes="用户备案")
+    @ApiOperation(value = "用户备案", notes = "用户备案")
     @LoginRequired
-    public RespR customeRec(@RequestBody List<CustomerRec> customerRecs){
+    public RespR customeRec(@RequestBody List<CustomerRec> customerRecs) {
         return lowerService.customeRec(customerRecs);
     }
 
@@ -45,10 +46,10 @@ public class CustomerLowerServiceController {
      * @return
      */
     @PostMapping("/customeRecQueryList")
-    @ApiOperation(value="用户备案列表查询", notes="用户备案列表查询")
+    @ApiOperation(value = "用户备案列表查询", notes = "用户备案列表查询")
     @LoginRequired
-    public RespR customeRecQueryList(@RequestBody CustomerRec customerRec,User user){
-        checkHasAuthRole.checkCustomerRole(user,customerRec.getCustomerName());
+    public RespR customeRecQueryList(@RequestBody CustomerRec customerRec, User user) {
+        checkHasAuthRole.checkCustomerRole(user, customerRec.getCustomerName());
         return lowerService.customeRecQueryList(customerRec);
     }
 
@@ -57,24 +58,24 @@ public class CustomerLowerServiceController {
      * @return
      */
     @PostMapping("/customeRecQueryUpper")
-    @ApiOperation(value="企业备案信息上游查询", notes="企业备案上游查询")
+    @ApiOperation(value = "企业备案信息上游查询", notes = "企业备案上游查询")
     @LoginRequired
-    public RespR customeRecQueryUpper(@RequestBody CustomerRec customerRec,User user){
-        checkHasAuthRole.checkCustomerRole(user,customerRec.getCustomerName());
+    public RespR customeRecQueryUpper(@RequestBody CustomerRec customerRec, User user) {
+        checkHasAuthRole.checkCustomerRole(user, customerRec.getCustomerName());
         return customerService.customerRecQuery(customerRec);
     }
+
     /**
      * @param customerRec
      * @return
      */
     @PostMapping("/customeRecQuery")
-    @ApiOperation(value="用户备案信息查询", notes="用户备案信息查询")
+    @ApiOperation(value = "用户备案信息查询", notes = "用户备案信息查询")
     @LoginRequired
-    public RespR customeRecQuery(@RequestBody CustomerRec customerRec,User user){
-        checkHasAuthRole.checkCustomerRole(user,customerRec.getCustomerName());
+    public RespR customeRecQuery(@RequestBody CustomerRec customerRec, User user) {
+        checkHasAuthRole.checkCustomerRole(user, customerRec.getCustomerName());
         return lowerService.customeRecQuery(customerRec);
     }
 
 
-
 }

+ 35 - 32
src/main/java/com/jkcredit/invoice/controller/interserver/NoCarServiceController.java

@@ -28,23 +28,24 @@ import java.util.List;
 @RequestMapping(value = {"/noCarService"})
 public class NoCarServiceController {
     @Autowired
+    MounthAccMapper mounthAccMapper;
+    @Autowired
     private NoCarService noCarService;
-
     @Autowired
     private CustomerRecMapper customerRecMapper;
-
     @Autowired
     private CheckHasAuthRole checkHasAuthRole;
+
     /**
      * @param
      * @return
      */
     @PostMapping("/noCarVoiceQuery")
-    @ApiOperation(value="发票查询接口(走本地库)", notes="发票查询接口(走本地库)")
+    @ApiOperation(value = "发票查询接口(走本地库)", notes = "发票查询接口(走本地库)")
     @LoginRequired
-    public RespR noCarVoiceQuery(@RequestBody NoCarWayBill noCarWayBill, User user){
-        checkHasAuthRole.checkCustomerRole(user,noCarWayBill.getCustomerName());
-        return noCarService.getInvoiceByWayBillNumReal(noCarWayBill,true);
+    public RespR noCarVoiceQuery(@RequestBody NoCarWayBill noCarWayBill, User user) {
+        checkHasAuthRole.checkCustomerRole(user, noCarWayBill.getCustomerName());
+        return noCarService.getInvoiceByWayBillNumReal(noCarWayBill, true);
     }
 
     /**
@@ -52,101 +53,103 @@ public class NoCarServiceController {
      * @return
      */
     @PostMapping("/hCVoiceQuery")
-    @ApiOperation(value="红冲发票查询接口", notes="红冲发票查询接口")
+    @ApiOperation(value = "红冲发票查询接口", notes = "红冲发票查询接口")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
-    public RespR hcvoicequery(@RequestBody HCInvoiceQueryVo hcInvoiceQueryVo){
+    public RespR hcvoicequery(@RequestBody HCInvoiceQueryVo hcInvoiceQueryVo) {
         return noCarService.hcinvoicequery(hcInvoiceQueryVo);
     }
+
     /**
      * @param
      * @return
      */
     @PostMapping("/hCVoiceUpdate")
-    @ApiOperation(value="红冲发票更新接口", notes="红冲发票更新接口")
+    @ApiOperation(value = "红冲发票更新接口", notes = "红冲发票更新接口")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
-    public RespR hcvoiceupdate(@RequestBody HCInvoiceQueryVo hcInvoiceQueryVo){
+    public RespR hcvoiceupdate(@RequestBody HCInvoiceQueryVo hcInvoiceQueryVo) {
         return noCarService.hcinvoiceupdate(hcInvoiceQueryVo);
     }
+
     /**
      * @param
      * @return
      */
     @PostMapping("/monthAccQuery")
-    @ApiOperation(value="月账单交易查询", notes="月账单交易查询")
+    @ApiOperation(value = "月账单交易查询", notes = "月账单交易查询")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
-    public RespR monthAccQuery(@RequestBody MonthAccountQueryVo monthAccountQueryVo){
+    public RespR monthAccQuery(@RequestBody MonthAccountQueryVo monthAccountQueryVo) {
         return noCarService.monthAccQuery(monthAccountQueryVo);
     }
-    @Autowired
-    MounthAccMapper mounthAccMapper;
 
     /**
      * @param
      * @return
      */
     @PostMapping("/monthAccQueryAll")
-    @ApiOperation(value="月账单交易查询", notes="月账单交易查询")
+    @ApiOperation(value = "月账单交易查询", notes = "月账单交易查询")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
-    public RespR monthAccQueryAll(){
+    public RespR monthAccQueryAll() {
         return new RespR(mounthAccMapper.selectAllMounthAcc());
     }
+
     /**
      * @param
      * @return
      */
     @PostMapping("/monthAccUpdate")
-    @ApiOperation(value="月账单交易查询更新", notes="月账单交易查询更新")
+    @ApiOperation(value = "月账单交易查询更新", notes = "月账单交易查询更新")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
-    public RespR monthAccQueryUpdate(@RequestBody MonthAccountQueryVo monthAccountQueryVo){
+    public RespR monthAccQueryUpdate(@RequestBody MonthAccountQueryVo monthAccountQueryVo) {
 
-       List<CustomerRec> companys =  customerRecMapper.selectAllNoCarComapany();
+        List<CustomerRec> companys = customerRecMapper.selectAllNoCarComapany();
         mounthAccMapper.deleteAll();
-        for(int i=0;i<companys.size();i++){
+        for (int i = 0; i < companys.size(); i++) {
             monthAccountQueryVo.setCompanyName(companys.get(i).getCompanyName());
             noCarService.monthAccQueryUpdate(monthAccountQueryVo);
 
         }
         return new RespR(true);
     }
+
     /**
      * @param customerCarRecs
      * @return
      */
     @PostMapping("/customerCarRec")
-    @ApiOperation(value="", notes="车辆备案")
+    @ApiOperation(value = "", notes = "车辆备案")
     @LoginRequired
-    public RespR customerCarRec(@RequestBody List<CustomerCarRec> customerCarRecs,User user){
-        if(customerCarRecs!=null && customerCarRecs.size()>0){
-            for(CustomerCarRec customerCarRec:customerCarRecs){
-                checkHasAuthRole.checkCustomerRole(user,customerCarRec.getCustomerName());
+    public RespR customerCarRec(@RequestBody List<CustomerCarRec> customerCarRecs, User user) {
+        if (customerCarRecs != null && customerCarRecs.size() > 0) {
+            for (CustomerCarRec customerCarRec : customerCarRecs) {
+                checkHasAuthRole.checkCustomerRole(user, customerCarRec.getCustomerName());
             }
 
         }
         return noCarService.customerCarRec(customerCarRecs);
     }
+
     /**
      * @param customerCarRec
      * @return
      */
     @PostMapping("/customeRecUpperQuery")
-    @ApiOperation(value="车辆备案信息查询", notes="用户备案信息查询")
+    @ApiOperation(value = "车辆备案信息查询", notes = "用户备案信息查询")
     @LoginRequired
-    public RespR customeRecUpperQuery(@RequestBody CustomerCarRec customerCarRec,User user){
-        checkHasAuthRole.checkCustomerRole(user,customerCarRec.getCustomerName());
+    public RespR customeRecUpperQuery(@RequestBody CustomerCarRec customerCarRec, User user) {
+        checkHasAuthRole.checkCustomerRole(user, customerCarRec.getCustomerName());
         return noCarService.customerCarRecQueryUpper(customerCarRec);
     }
 
 
-
     /**
      * @param customerCarRec
      * @return
      */
     @PostMapping("/customerCarRecQuery")
-    @ApiOperation(value="", notes="车辆备案查询")
+    @ApiOperation(value = "", notes = "车辆备案查询")
     @LoginRequired
-    public RespR customerCarRecQuery(@RequestBody CustomerCarRec customerCarRec,User user){
-        checkHasAuthRole.checkCustomerRole(user,customerCarRec.getCustomerName());
+    public RespR customerCarRecQuery(@RequestBody CustomerCarRec customerCarRec, User user) {
+        checkHasAuthRole.checkCustomerRole(user, customerCarRec.getCustomerName());
         return noCarService.customerCarRecQuery(customerCarRec);
     }
 }

+ 71 - 68
src/main/java/com/jkcredit/invoice/controller/interserver/SelfCarServiceController.java

@@ -29,16 +29,17 @@ public class SelfCarServiceController {
     SelfCarServiceL selfCarService;
     @Autowired
     private CheckHasAuthRole checkHasAuthRole;
+
     /**
      * @param tradeRequestVo
      * @return
      */
     @PostMapping("/getTradeList")
-    @ApiOperation(value="获取交易Id列表", notes="获取交易Id列表")
+    @ApiOperation(value = "获取交易Id列表", notes = "获取交易Id列表")
     @LoginRequired
-    public RespR getTradeList(@RequestBody TradeRequestVo tradeRequestVo, User user){
-        checkHasAuthRole.checkCustomerRole(user,tradeRequestVo.getCustomerName());
-        if(tradeRequestVo.getTradeStatus() ==null){
+    public RespR getTradeList(@RequestBody TradeRequestVo tradeRequestVo, User user) {
+        checkHasAuthRole.checkCustomerRole(user, tradeRequestVo.getCustomerName());
+        if (tradeRequestVo.getTradeStatus() == null) {
             tradeRequestVo.setTradeStatus(1);
             RespR<List<CardTradeModel>> respRbefore = selfCarService.getTradeList(tradeRequestVo);
             tradeRequestVo.setTradeStatus(2);
@@ -47,13 +48,13 @@ public class SelfCarServiceController {
             RespR<List<CardTradeModel>> listRespR = selfCarService.getTradeList(tradeRequestVo);
             //合并展示
             List<CardTradeModel> cardTradeModels = new ArrayList<>();
-            if(respRbefore.getCode() == 0){
+            if (respRbefore.getCode() == 0) {
                 cardTradeModels.addAll(respRbefore.getData());
             }
-            if(tradeList.getCode() == 0){
+            if (tradeList.getCode() == 0) {
                 cardTradeModels.addAll(tradeList.getData());
             }
-            if(listRespR.getCode() == 0){
+            if (listRespR.getCode() == 0) {
                 cardTradeModels.addAll(listRespR.getData());
             }
             return new RespR(cardTradeModels);
@@ -68,10 +69,10 @@ public class SelfCarServiceController {
      * @return
      */
     @PostMapping("/applInvoice")
-    @ApiOperation(value="开票申请", notes="开票申请")
+    @ApiOperation(value = "开票申请", notes = "开票申请")
     @LoginRequired
-    public RespR applInvoice(@RequestBody InvoiceApplVo invoiceApplVo,User user){
-        checkHasAuthRole.checkCompanyRole(user,invoiceApplVo.getCompanyName());
+    public RespR applInvoice(@RequestBody InvoiceApplVo invoiceApplVo, User user) {
+        checkHasAuthRole.checkCompanyRole(user, invoiceApplVo.getCompanyName());
         return selfCarService.applInvoice(invoiceApplVo);
     }
 
@@ -80,59 +81,61 @@ public class SelfCarServiceController {
      * @return
      */
     @PostMapping("/getSelfCarInvoicesByTime")
-    @ApiOperation(value="已开发票查询", notes="已开发票查询")
+    @ApiOperation(value = "已开发票查询", notes = "已开发票查询")
     @LoginRequired
-    public RespR getSelfCarInvoicesByTime(@RequestBody SelfCarDueQueryVo selfCarDueQueryVo,User user){
-        checkHasAuthRole.checkCompanyRole(user,selfCarDueQueryVo.getCompanyName());
-        return selfCarService.getSelfCarInvoicesByTime(selfCarDueQueryVo,null);
+    public RespR getSelfCarInvoicesByTime(@RequestBody SelfCarDueQueryVo selfCarDueQueryVo, User user) {
+        checkHasAuthRole.checkCompanyRole(user, selfCarDueQueryVo.getCompanyName());
+        return selfCarService.getSelfCarInvoicesByTime(selfCarDueQueryVo, null);
     }
+
     /**
      * @param invoicePackageVo
      * @return
      */
     @PostMapping("/getSelfCarInvoicePackage")
-    @ApiOperation(value="发票打包下载", notes="发票打包下载")
+    @ApiOperation(value = "发票打包下载", notes = "发票打包下载")
     @LoginRequired
-    public RespR getSelfCarInvoicePackage(@RequestBody InvoicePackageVo invoicePackageVo,User user){
-        checkHasAuthRole.checkCustomerRole(user,invoicePackageVo.getCustomerName());
+    public RespR getSelfCarInvoicePackage(@RequestBody InvoicePackageVo invoicePackageVo, User user) {
+        checkHasAuthRole.checkCustomerRole(user, invoicePackageVo.getCustomerName());
         return selfCarService.getInvoicePackge(invoicePackageVo);
     }
+
     /**
      * @param applQueryInvVo
      * @return
      */
     @PostMapping("/getSelfCarInvoicesByAppl")
-    @ApiOperation(value="按申请id查询发票", notes="按申请id查询发票")
+    @ApiOperation(value = "按申请id查询发票", notes = "按申请id查询发票")
     @LoginRequired
-    public RespR getSelfCarInvoicesByAppl(ApplQueryInvVo applQueryInvVo){
-        if(StringUtils.isEmpty(applQueryInvVo.getApplId()) || StringUtils.isEmpty(applQueryInvVo.getCompanyNum()) || StringUtils.isEmpty(applQueryInvVo.getEtcNum())){
-            return new RespR(false,"参数不能为空");
+    public RespR getSelfCarInvoicesByAppl(ApplQueryInvVo applQueryInvVo) {
+        if (StringUtils.isEmpty(applQueryInvVo.getApplId()) || StringUtils.isEmpty(applQueryInvVo.getCompanyNum()) || StringUtils.isEmpty(applQueryInvVo.getEtcNum())) {
+            return new RespR(false, "参数不能为空");
         }
         return selfCarService.getSelfCarInvoicesByApplyIds(applQueryInvVo);
     }
+
     /**
      * @param etcQueryVo
      * @return
      */
     @PostMapping("/customerETCQuery")
-    @ApiOperation(value="", notes="ETC绑定列表查询")
+    @ApiOperation(value = "", notes = "ETC绑定列表查询")
     @LoginRequired
-    public RespR customeretcquery(@RequestBody EtcQueryVo etcQueryVo, User user){
-        checkHasAuthRole.checkCustomerRole(user,etcQueryVo.getCustomerName());
+    public RespR customeretcquery(@RequestBody EtcQueryVo etcQueryVo, User user) {
+        checkHasAuthRole.checkCustomerRole(user, etcQueryVo.getCustomerName());
         return selfCarService.getEtcInfo(etcQueryVo);
     }
 
 
-
     /**
      * @param etcBindVo
      * @return
      */
     @PostMapping("/queryEtcInfo")
-    @ApiOperation(value="", notes="备案ETC查询")
+    @ApiOperation(value = "", notes = "备案ETC查询")
     @LoginRequired
-    public RespR customerQueryEtcInfo(@RequestBody EtcBindVo etcBindVo,User user){
-        checkHasAuthRole.checkCustomerRole(user,etcBindVo.getCustomerName());
+    public RespR customerQueryEtcInfo(@RequestBody EtcBindVo etcBindVo, User user) {
+        checkHasAuthRole.checkCustomerRole(user, etcBindVo.getCustomerName());
         return selfCarService.queryEtcInfo(etcBindVo);
     }
 
@@ -141,10 +144,10 @@ public class SelfCarServiceController {
      * @return
      */
     @PostMapping("/customerETCRec")
-    @ApiOperation(value="", notes="ETC备案")
+    @ApiOperation(value = "", notes = "ETC备案")
     @LoginRequired
-    public RespR customerEtcRec(@RequestBody EtcBindVo etcBindVo, User user){
-        checkHasAuthRole.checkCompanyRole(user,etcBindVo.getCompanyName());
+    public RespR customerEtcRec(@RequestBody EtcBindVo etcBindVo, User user) {
+        checkHasAuthRole.checkCompanyRole(user, etcBindVo.getCompanyName());
         return selfCarService.customerEtcRec(etcBindVo);
     }
 
@@ -154,9 +157,9 @@ public class SelfCarServiceController {
      * @return
      */
     @PostMapping("/customerETCRecValid")
-    @ApiOperation(value="", notes="ETC备案验证")
+    @ApiOperation(value = "", notes = "ETC备案验证")
     @LoginRequired
-    public RespR customerEtcRecValid(@RequestBody EtcValidVo etcValidVo){
+    public RespR customerEtcRecValid(@RequestBody EtcValidVo etcValidVo) {
         return selfCarService.customerEtcRecValid(etcValidVo);
     }
 
@@ -165,9 +168,9 @@ public class SelfCarServiceController {
      * @return
      */
     @PostMapping("/customerCarUnRec")
-    @ApiOperation(value="", notes="etc解绑")
+    @ApiOperation(value = "", notes = "etc解绑")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
-    public RespR customerCarUnRec(@RequestBody List<CustomerCarRec> customerCarRecs){
+    public RespR customerCarUnRec(@RequestBody List<CustomerCarRec> customerCarRecs) {
         return selfCarService.customerCarUnRec(customerCarRecs);
     }
 
@@ -177,45 +180,45 @@ public class SelfCarServiceController {
      * @return
      */
     @PostMapping("/getApplyQueryByTradeIds")
-    @ApiOperation(value="按交易查申请", notes="按交易查申请")
+    @ApiOperation(value = "按交易查申请", notes = "按交易查申请")
     @LoginRequired
-    public RespR getApplyQueryByTradeId(TradeApplyQueryInvVo tradeApplyQueryInvVo){
+    public RespR getApplyQueryByTradeId(TradeApplyQueryInvVo tradeApplyQueryInvVo) {
         try {
-        if(StringUtils.isEmpty(tradeApplyQueryInvVo.getCompanyNum()) || StringUtils.isEmpty(tradeApplyQueryInvVo.getTradeId()) || StringUtils.isEmpty(tradeApplyQueryInvVo.getCardId())){
-            return new RespR(false,"参数不能为空");
-        }
-
-        List<TradeApplyQueryInvVo> tradeApplyQueryInvVos = new ArrayList<>();
-
-        if(!org.springframework.util.StringUtils.isEmpty(tradeApplyQueryInvVo.getCompanyNum()) &&
-                !org.springframework.util.StringUtils.isEmpty(tradeApplyQueryInvVo.getCardId()) &&
-                !org.springframework.util.StringUtils.isEmpty(tradeApplyQueryInvVo.getTradeId())){
-            String [] companyNumArr = tradeApplyQueryInvVo.getCompanyNum().split(",");
-            String [] cardIdArr = tradeApplyQueryInvVo.getCardId().split(",");
-            String [] tradeIdArr=  tradeApplyQueryInvVo.getTradeId().split(",");
-
+            if (StringUtils.isEmpty(tradeApplyQueryInvVo.getCompanyNum()) || StringUtils.isEmpty(tradeApplyQueryInvVo.getTradeId()) || StringUtils.isEmpty(tradeApplyQueryInvVo.getCardId())) {
+                return new RespR(false, "参数不能为空");
+            }
 
-            for (int i=0;i<cardIdArr.length;i++){
-                TradeApplyQueryInvVo tradeApplyQueryInvVoTmp = new TradeApplyQueryInvVo();
-                tradeApplyQueryInvVoTmp.setCardId(cardIdArr[i]);
-                if(tradeIdArr!=null && tradeIdArr.length>=i+1){
-                    tradeApplyQueryInvVoTmp.setTradeId(tradeIdArr[i]);
-                }else{
-                    tradeApplyQueryInvVoTmp.setTradeId("");
-                }
-                if(companyNumArr!=null && companyNumArr.length>=i+1){
-                    tradeApplyQueryInvVoTmp.setCompanyNum(companyNumArr[i]);
-                }else{
-                    tradeApplyQueryInvVoTmp.setCompanyNum("");
+            List<TradeApplyQueryInvVo> tradeApplyQueryInvVos = new ArrayList<>();
+
+            if (!org.springframework.util.StringUtils.isEmpty(tradeApplyQueryInvVo.getCompanyNum()) &&
+                    !org.springframework.util.StringUtils.isEmpty(tradeApplyQueryInvVo.getCardId()) &&
+                    !org.springframework.util.StringUtils.isEmpty(tradeApplyQueryInvVo.getTradeId())) {
+                String[] companyNumArr = tradeApplyQueryInvVo.getCompanyNum().split(",");
+                String[] cardIdArr = tradeApplyQueryInvVo.getCardId().split(",");
+                String[] tradeIdArr = tradeApplyQueryInvVo.getTradeId().split(",");
+
+
+                for (int i = 0; i < cardIdArr.length; i++) {
+                    TradeApplyQueryInvVo tradeApplyQueryInvVoTmp = new TradeApplyQueryInvVo();
+                    tradeApplyQueryInvVoTmp.setCardId(cardIdArr[i]);
+                    if (tradeIdArr != null && tradeIdArr.length >= i + 1) {
+                        tradeApplyQueryInvVoTmp.setTradeId(tradeIdArr[i]);
+                    } else {
+                        tradeApplyQueryInvVoTmp.setTradeId("");
+                    }
+                    if (companyNumArr != null && companyNumArr.length >= i + 1) {
+                        tradeApplyQueryInvVoTmp.setCompanyNum(companyNumArr[i]);
+                    } else {
+                        tradeApplyQueryInvVoTmp.setCompanyNum("");
+                    }
+                    tradeApplyQueryInvVos.add(tradeApplyQueryInvVoTmp);
                 }
-                tradeApplyQueryInvVos.add(tradeApplyQueryInvVoTmp);
-            }
 
-        }
-        return selfCarService.getApplyQueryByTradeIds(tradeApplyQueryInvVos);
-        } catch (Exception e){
+            }
+            return selfCarService.getApplyQueryByTradeIds(tradeApplyQueryInvVos);
+        } catch (Exception e) {
             e.printStackTrace();
-            return new RespR(false,"查询数据有误,请排查");
+            return new RespR(false, "查询数据有误,请排查");
         }
     }
 }

+ 10 - 11
src/main/java/com/jkcredit/invoice/controller/param/ParamController.java

@@ -9,7 +9,10 @@ import com.jkcredit.invoice.util.RespR;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 /**
  * @description:
@@ -23,7 +26,6 @@ import org.springframework.web.bind.annotation.*;
 public class ParamController {
 
 
-
     @Autowired
     private ParamService paramService;
 
@@ -31,19 +33,18 @@ public class ParamController {
     /**
      * 分页查询参数
      *
-     * @param page    参数集
+     * @param page  参数集
      * @param param 查询参数列表
      * @return 用户集合
      */
     @PostMapping("/page")
-    @ApiOperation(value="分页查询参数管理", notes="分页查询参数管理")
+    @ApiOperation(value = "分页查询参数管理", notes = "分页查询参数管理")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
     public RespR getParamPage(Page page, Param param) {
         return new RespR<>(paramService.getParamWithRolePage(page, param));
     }
 
 
-
     /**
      * 添加参数
      *
@@ -51,19 +52,17 @@ public class ParamController {
      * @return success/false
      */
     @PostMapping
-    @ApiOperation(value="新增参数详细信息", notes="新增参数详细信息")
+    @ApiOperation(value = "新增参数详细信息", notes = "新增参数详细信息")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
     public RespR param(@RequestBody Param param) {
         Param param1 = paramService.getParamsByParamName(param.getParamName());
-        if(param1 != null){
-            return new RespR<>(false,"参数名称已存在,请重新维护!");
+        if (param1 != null) {
+            return new RespR<>(false, "参数名称已存在,请重新维护!");
         }
         return new RespR<>(paramService.saveParam(param));
     }
 
 
-
-
     /**
      * 更新参数信息
      *
@@ -71,7 +70,7 @@ public class ParamController {
      * @return R
      */
     @PostMapping("/updateParam")
-    @ApiOperation(value="更新参数信息", notes="更新参数信息")
+    @ApiOperation(value = "更新参数信息", notes = "更新参数信息")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
     public RespR updateUser(@RequestBody Param param) {
         return new RespR<>(paramService.updateParam(param));

+ 6 - 5
src/main/java/com/jkcredit/invoice/controller/user/AuthenticationController.java

@@ -34,7 +34,7 @@ public class AuthenticationController {
     @Autowired
     private UserService userService;
 
-    @ApiOperation(value="用户登录", notes="用户登录")
+    @ApiOperation(value = "用户登录", notes = "用户登录")
     @PostMapping("")
     public RespR login(@RequestBody User user) {
         //获取用户名
@@ -48,9 +48,9 @@ public class AuthenticationController {
             return new RespR<>(Boolean.FALSE, "用户不存在");
         } else if (STATUS_SUC == userInDataBase.getIsLock()) {
             return new RespR<>(Boolean.FALSE, "该账号已被锁定");
-        }else if(STATUS_UN == userInDataBase.getIsLock()){
+        } else if (STATUS_UN == userInDataBase.getIsLock()) {
             return new RespR<>(Boolean.FALSE, "该账号已停用");
-        }else if (!StrUtil.equals(MD5Util.encrypt(password), userInDataBase.getPassword())) {
+        } else if (!StrUtil.equals(MD5Util.encrypt(password), userInDataBase.getPassword())) {
             return new RespR<>(Boolean.FALSE, "密码不正确");
         } else {
             //获取token
@@ -62,9 +62,10 @@ public class AuthenticationController {
         }
         return new RespR<>(jsonObject);
     }
-    @ApiOperation(value="用户退出", notes="用户退出")
+
+    @ApiOperation(value = "用户退出", notes = "用户退出")
     @PostMapping("/loginOut")
-    public void login( String token) {
+    public void login(String token) {
         authenticationService.deleteToken(token);
     }
 }

+ 2 - 2
src/main/java/com/jkcredit/invoice/controller/user/RoleController.java

@@ -27,8 +27,8 @@ public class RoleController {
 
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
     @PostMapping(value = "/list")
-    @ApiOperation(value="角色列表", notes="角色列表")
-    public RespR roleList(){
+    @ApiOperation(value = "角色列表", notes = "角色列表")
+    public RespR roleList() {
         return new RespR<>(roleService.list());
     }
 }

+ 14 - 13
src/main/java/com/jkcredit/invoice/controller/user/UserController.java

@@ -35,14 +35,14 @@ public class UserController {
      * @return 用户信息
      */
     @GetMapping("/{id}")
-    @ApiOperation(value="通过ID查询用户信息", notes="通过ID查询用户信息")
+    @ApiOperation(value = "通过ID查询用户信息", notes = "通过ID查询用户信息")
     @LoginRequired
     @ApiImplicitParams({
             @ApiImplicitParam(name = "id", value = "用id", required = true, dataType = "Integer")
     })
-    public RespR user(@PathVariable Integer id,User user) {
-        if(!AuthenticationInterceptor.AUTH_ADMIN.equals(user.getRoleId()) && !(user.getId().compareTo(id)==0)){
-            return new RespR<>(false,"无权限");
+    public RespR user(@PathVariable Integer id, User user) {
+        if (!AuthenticationInterceptor.AUTH_ADMIN.equals(user.getRoleId()) && !(user.getId().compareTo(id) == 0)) {
+            return new RespR<>(false, "无权限");
         }
         return new RespR<>(userService.selectUserById(id));
     }
@@ -54,7 +54,7 @@ public class UserController {
      * @return R
      */
     @DeleteMapping("/{id}")
-    @ApiOperation(value="根据用户名id删除用户信息", notes="根据用户名id删除用户信息")
+    @ApiOperation(value = "根据用户名id删除用户信息", notes = "根据用户名id删除用户信息")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
     public RespR userDel(@PathVariable Integer id) {
         User sysUser = userService.getById(id);
@@ -68,12 +68,12 @@ public class UserController {
      * @return success/false
      */
     @PostMapping
-    @ApiOperation(value="新增用户详细信息", notes="新增用户详细信息")
+    @ApiOperation(value = "新增用户详细信息", notes = "新增用户详细信息")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
     public RespR user(@RequestBody User user) {
         user.setPassword(MD5Util.encrypt(user.getPassword()));
         User user1 = userService.selectUserByUserName(user.getUserName());
-        if(null != user1){
+        if (null != user1) {
             return new RespR<>(Boolean.FALSE, "该用户已存在");
         }
         return new RespR<>(userService.saveUser(user));
@@ -86,23 +86,24 @@ public class UserController {
      * @return R
      */
     @PostMapping("/updateUser")
-    @ApiOperation(value="更新用户信息", notes="更新用户信息")
+    @ApiOperation(value = "更新用户信息", notes = "更新用户信息")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
     public RespR updateUser(@RequestBody User user) {
-        if(user.getPassword()!=null){
+        if (user.getPassword() != null) {
             user.setPassword(MD5Util.encrypt(user.getPassword()));
         }
         return new RespR<>(userService.updateUserInfo(user));
     }
+
     /**
      * 分页查询用户
      *
-     * @param page    参数集
+     * @param page 参数集
      * @param user 查询参数列表
      * @return 用户集合
      */
     @PostMapping("/page")
-    @ApiOperation(value="分页查询用户", notes="分页查询用户")
+    @ApiOperation(value = "分页查询用户", notes = "分页查询用户")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
     public RespR getUserPage(Page page, User user) {
         return new RespR<>(userService.getUserWithRolePage(page, user));
@@ -115,7 +116,7 @@ public class UserController {
      * @return success/false
      */
     @PutMapping("/restPassword")
-    @ApiOperation(value="重置密码", notes="重置密码")
+    @ApiOperation(value = "重置密码", notes = "重置密码")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
     public RespR updateUserInfoPassWord(@RequestBody User user) {
         user.setPassword(MD5Util.encrypt(user.getPassword()));
@@ -129,7 +130,7 @@ public class UserController {
      * @return success/false
      */
     @PutMapping("/lock")
-    @ApiOperation(value="修改锁定状态", notes="修改锁定状态")
+    @ApiOperation(value = "修改锁定状态", notes = "修改锁定状态")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
     public RespR updateLock(@RequestBody User user) {
         return userService.updateLock(user);

+ 107 - 107
src/main/java/com/jkcredit/invoice/credit/InterfaceCheckServer.java

@@ -13,19 +13,19 @@ import org.springframework.stereotype.Service;
 @Slf4j
 public class InterfaceCheckServer {
 
-     @Autowired
-     CustomerInterLowerService customerInterLowerService;
+    @Autowired
+    CustomerInterLowerService customerInterLowerService;
 
-     @Autowired
-     SelfCarInterService selfCarInterService;
-     @Autowired
-     NoCarInterService noCarInterService;
-     @Autowired
-     StatisRequestIdTimeComp statisRequestIdTimeComp;
+    @Autowired
+    SelfCarInterService selfCarInterService;
+    @Autowired
+    NoCarInterService noCarInterService;
+    @Autowired
+    StatisRequestIdTimeComp statisRequestIdTimeComp;
 
     //跳转到对应的Service服务处理逻辑
-    public  DataResult doJumpHandler(String appKey, String api, String data,String requestid ) {
-        log.info("[-InterfaceCheckServer.doJumpHandler-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data + " ,requestid=" +requestid);
+    public DataResult doJumpHandler(String appKey, String api, String data, String requestid) {
+        log.info("[-InterfaceCheckServer.doJumpHandler-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
         long startTime = System.currentTimeMillis();
         DataResult resultTimeOut = new DataResult();
         resultTimeOut.setData(3);
@@ -34,254 +34,254 @@ public class InterfaceCheckServer {
         resultTimeOut.setMsg("网络异常");
         DataResult result;
         result = getDataResult(appKey, api, data, requestid, resultTimeOut);
-        log.info("[-InterfaceCheckServer.doJumpHandler-] result appKey=" + appKey + " ,api=" + api + " ,data=" +data + " ,requestid=" +requestid+ " ,result="+result + " ,costTime="+(System.currentTimeMillis()-startTime) );
+        log.info("[-InterfaceCheckServer.doJumpHandler-] result appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid + " ,result=" + result + " ,costTime=" + (System.currentTimeMillis() - startTime));
         return result;
 
     }
 
     private DataResult getDataResult(String appKey, String api, String data, String requestid, DataResult resultTimeOut) {
         DataResult result;
-        switch (api){
+        switch (api) {
             //----------------------------自有车、无车公共接口---------------------------------//
             case "COMPANY_ADD_V1"://无车、自有车企业注册
-                if(StatisRequestIdTimeComp.isLimit){
-                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api="+api + " ,data=" + data + " ,requestid=" + requestid +"=被拒绝");
+                if (StatisRequestIdTimeComp.isLimit) {
+                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid + "=被拒绝");
                     result = resultTimeOut;
-                }else{
+                } else {
                     statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
-                    result = customerInterLowerService.customeInterRec(appKey,api,data,requestid);
+                    result = customerInterLowerService.customeInterRec(appKey, api, data, requestid);
                     statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
                 }
                 break;
             case "PROTOCOL_ADD_V1"://无车、自有车协议上传
-                if(StatisRequestIdTimeComp.isLimit){
-                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api="+api + " ,data=" + data + " ,requestid=" + requestid +"=被拒绝");
+                if (StatisRequestIdTimeComp.isLimit) {
+                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid + "=被拒绝");
                     result = resultTimeOut;
-                }else{
+                } else {
                     statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
-                    result = customerInterLowerService.customeProtocolUpLoad(appKey,api,data,requestid);
+                    result = customerInterLowerService.customeProtocolUpLoad(appKey, api, data, requestid);
                     statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
                 }
                 break;
             case "COMPANY_QUERY_V1"://无车、自有车企业查询
-                if(StatisRequestIdTimeComp.isLimit){
-                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api="+api + " ,data=" + data + " ,requestid=" + requestid +"=被拒绝");
+                if (StatisRequestIdTimeComp.isLimit) {
+                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid + "=被拒绝");
                     result = resultTimeOut;
-                }else{
+                } else {
                     statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
-                    result = customerInterLowerService.customeInterRecQuery(appKey,api,data,requestid);
+                    result = customerInterLowerService.customeInterRecQuery(appKey, api, data, requestid);
                     statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
                 }
                 break;
             case "PROTOCOL_STATUS_V1"://自有车 无车、协议上传状态查询
-                if(StatisRequestIdTimeComp.isLimit){
-                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api="+api + " ,data=" + data + " ,requestid=" + requestid +"=被拒绝");
+                if (StatisRequestIdTimeComp.isLimit) {
+                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid + "=被拒绝");
                     result = resultTimeOut;
-                }else{
+                } else {
                     statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
-                    result = customerInterLowerService.customeProtocolStatus(appKey,api,data,requestid);
+                    result = customerInterLowerService.customeProtocolStatus(appKey, api, data, requestid);
                     statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
                 }
                 break;
-                //----------------------------自有车下游接口---------------------------------//
+            //----------------------------自有车下游接口---------------------------------//
             case "CARD_BIND_QUERY_LIST_V1"://自有车 用户卡列表查询
-                if(StatisRequestIdTimeComp.isLimit){
-                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api="+api + " ,data=" + data + " ,requestid=" + requestid +"=被拒绝");
+                if (StatisRequestIdTimeComp.isLimit) {
+                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid + "=被拒绝");
                     result = resultTimeOut;
-                }else{
+                } else {
                     statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
-                    result = selfCarInterService.customeretcquery(appKey,api,data,requestid);
+                    result = selfCarInterService.customeretcquery(appKey, api, data, requestid);
                     statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
                 }
                 break;
             case "CARD_QUERY_CARD_V1"://自有车 卡信息查询
-                if(StatisRequestIdTimeComp.isLimit){
-                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api="+api + " ,data=" + data + " ,requestid=" + requestid +"=被拒绝");
+                if (StatisRequestIdTimeComp.isLimit) {
+                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid + "=被拒绝");
                     result = resultTimeOut;
-                }else{
+                } else {
                     statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
-                    result = selfCarInterService.customerQueryEtcInfo(appKey,api,data,requestid);
+                    result = selfCarInterService.customerQueryEtcInfo(appKey, api, data, requestid);
                     statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
                 }
                 break;
             case "CARD_BINDING_V1"://自有车 下发短信验证码
-                if(StatisRequestIdTimeComp.isLimit){
-                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api="+api + " ,data=" + data + " ,requestid=" + requestid +"=被拒绝");
+                if (StatisRequestIdTimeComp.isLimit) {
+                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid + "=被拒绝");
                     result = resultTimeOut;
-                }else{
+                } else {
                     statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
-                    result = selfCarInterService.customeretcrec(appKey,api,data,requestid);
+                    result = selfCarInterService.customeretcrec(appKey, api, data, requestid);
                     statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
                 }
                 break;
             case "CARD_VALID_CODE_V1"://自有车 卡绑定接口 渠道调用此接口,上传用户收到的短信验证码
-                if(StatisRequestIdTimeComp.isLimit){
-                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api="+api + " ,data=" + data + " ,requestid=" + requestid +"=被拒绝");
+                if (StatisRequestIdTimeComp.isLimit) {
+                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid + "=被拒绝");
                     result = resultTimeOut;
-                }else{
+                } else {
                     statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
-                    result = selfCarInterService.customeretcrecvalid(appKey,api,data,requestid);
+                    result = selfCarInterService.customeretcrecvalid(appKey, api, data, requestid);
                     statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
                 }
                 break;
             case "CARD_TRADE_V1"://自有车 交易查询接口 渠道通过此接口可以查询单张卡连续90天内的交易(待开票、开票中、已开票)
-                if(StatisRequestIdTimeComp.isLimit){
-                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api="+api + " ,data=" + data + " ,requestid=" + requestid +"=被拒绝");
+                if (StatisRequestIdTimeComp.isLimit) {
+                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid + "=被拒绝");
                     result = resultTimeOut;
-                }else{
+                } else {
                     statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
-                    result = selfCarInterService.getTradeList(appKey,api,data,requestid);
+                    result = selfCarInterService.getTradeList(appKey, api, data, requestid);
                     statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
                 }
                 break;
             case "B2B_INVOICE_APPLY_V1"://自有车 申请开票接口 渠道通过此接口可以对该公司绑定的单张卡连续90天内的交易进行开票。
-                if(StatisRequestIdTimeComp.isLimit){
-                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api="+api + " ,data=" + data + " ,requestid=" + requestid +"=被拒绝");
+                if (StatisRequestIdTimeComp.isLimit) {
+                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid + "=被拒绝");
                     result = resultTimeOut;
-                }else{
+                } else {
                     statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
-                    result = selfCarInterService.applInvoice(appKey,api,data,requestid);
+                    result = selfCarInterService.applInvoice(appKey, api, data, requestid);
                     statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
                 }
                 break;
             case "B2B_INVOICE_QUERY_V1"://自有车 已开发票查询接口 渠道通过此接口可以根据该公司绑定的单张卡查询此卡在某个月开具的发票。
-                if(StatisRequestIdTimeComp.isLimit){
-                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api="+api + " ,data=" + data + " ,requestid=" + requestid +"=被拒绝");
+                if (StatisRequestIdTimeComp.isLimit) {
+                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid + "=被拒绝");
                     result = resultTimeOut;
-                }else{
+                } else {
                     statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
-                    result = selfCarInterService.getSelfCarInvoicesByTime(appKey,api,data,requestid);
+                    result = selfCarInterService.getSelfCarInvoicesByTime(appKey, api, data, requestid);
                     statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
                 }
                 break;
             case "B2B_INVOICE_APPL_QUERY_V1"://自有车 已开发票查询接口 根据开票id进行查询。
-                if(StatisRequestIdTimeComp.isLimit){
-                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api="+api + " ,data=" + data + " ,requestid=" + requestid +"=被拒绝");
+                if (StatisRequestIdTimeComp.isLimit) {
+                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid + "=被拒绝");
                     result = resultTimeOut;
-                }else{
+                } else {
                     statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
-                    result = selfCarInterService.getSelfCarInvoicesByAppl(appKey,api,data,requestid);
+                    result = selfCarInterService.getSelfCarInvoicesByAppl(appKey, api, data, requestid);
                     statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
                 }
                 break;
             case "B2B_INVOICE_PACKAGE_V1"://自有车 发票下载 渠道通过此接口可以下载某公司某个月份开具的发票。
-                if(StatisRequestIdTimeComp.isLimit){
-                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api="+api + " ,data=" + data + " ,requestid=" + requestid +"=被拒绝");
+                if (StatisRequestIdTimeComp.isLimit) {
+                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid + "=被拒绝");
                     result = resultTimeOut;
-                }else{
+                } else {
                     statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
-                    result = selfCarInterService.getSelfCarInvoicePackage(appKey,api,data,requestid);
+                    result = selfCarInterService.getSelfCarInvoicePackage(appKey, api, data, requestid);
                     statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
                 }
                 break;
             case "CARD_UNBIND_V1"://自有车 卡解绑接口。
-                result = selfCarInterService.customerCarUnRec(appKey,api,data,requestid);
+                result = selfCarInterService.customerCarUnRec(appKey, api, data, requestid);
                 break;
             case "B2B_CHANGE_CARD_V1"://自有车 用户卡换绑。
-                result = selfCarInterService.customerCardChange(appKey,api,data,requestid);
+                result = selfCarInterService.customerCardChange(appKey, api, data, requestid);
                 break;
             case "B2B_CHANGE_CARD_QUERY_V1"://自有车 用户卡换绑查询。
-                result = selfCarInterService.customerCardChangeQuery(appKey,api,data,requestid);
+                result = selfCarInterService.customerCardChangeQuery(appKey, api, data, requestid);
                 break;
             case "B2B_QUERY_TRADE_APPLY_V1"://自有车 按交易查申请。
-                result = selfCarInterService.tradeApplyQuery(appKey,api,data,requestid);
+                result = selfCarInterService.tradeApplyQuery(appKey, api, data, requestid);
                 break;
             //----------------------------无车下游接口---------------------------------//
             case "VEHICLE_REGISTER"://无车 车辆备案接口
-                if(StatisRequestIdTimeComp.isLimit){
-                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api="+api + " ,data=" + data + " ,requestid=" + requestid +"=被拒绝");
+                if (StatisRequestIdTimeComp.isLimit) {
+                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid + "=被拒绝");
                     result = resultTimeOut;
-                }else{
+                } else {
                     statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
-                    result = noCarInterService.customerCarRec(appKey,api,data,requestid);
+                    result = noCarInterService.customerCarRec(appKey, api, data, requestid);
                     statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
                 }
                 break;
             case "VEHICLE_REGISTER_QUERY"://无车 车辆备案查询接口
-                if(StatisRequestIdTimeComp.isLimit){
-                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api="+api + " ,data=" + data + " ,requestid=" + requestid +"=被拒绝");
+                if (StatisRequestIdTimeComp.isLimit) {
+                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid + "=被拒绝");
                     result = resultTimeOut;
-                }else{
+                } else {
                     statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
-                    result = noCarInterService.customeRecUpperQuery(appKey,api,data,requestid);
+                    result = noCarInterService.customeRecUpperQuery(appKey, api, data, requestid);
                     statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
                 }
                 break;
             case "WAY_BILL_START"://无车 实时运单开始指令
-                if(StatisRequestIdTimeComp.isLimit){
-                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api="+api + " ,data=" + data + " ,requestid=" + requestid +"=被拒绝");
+                if (StatisRequestIdTimeComp.isLimit) {
+                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid + "=被拒绝");
                     result = resultTimeOut;
-                }else{
+                } else {
                     statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
-                    result = noCarInterService.noCarBillStart(appKey,api,data,requestid);
+                    result = noCarInterService.noCarBillStart(appKey, api, data, requestid);
                     statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
                 }
                 break;
             case "WAY_BILL_END"://无车 实时运单结束指令
-                if(StatisRequestIdTimeComp.isLimit){
-                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api="+api + " ,data=" + data + " ,requestid=" + requestid +"=被拒绝");
+                if (StatisRequestIdTimeComp.isLimit) {
+                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid + "=被拒绝");
                     result = resultTimeOut;
-                }else{
+                } else {
                     statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
-                    result = noCarInterService.noCarBillEnd(appKey,api,data,requestid);
+                    result = noCarInterService.noCarBillEnd(appKey, api, data, requestid);
                     statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
                 }
                 break;
             case "WAY_BILL_HISTORY_START"://无车 历史运单开始指令
-                if(StatisRequestIdTimeComp.isLimit){
-                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api="+api + " ,data=" + data + " ,requestid=" + requestid +"=被拒绝");
+                if (StatisRequestIdTimeComp.isLimit) {
+                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid + "=被拒绝");
                     result = resultTimeOut;
-                }else{
+                } else {
                     statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
-                    result = noCarInterService.noCarHisWaybillStart(appKey,api,data,requestid);
+                    result = noCarInterService.noCarHisWaybillStart(appKey, api, data, requestid);
                     statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
                 }
                 break;
             case "WAY_BILL_HISTORY_END"://无车 历史运单结束指令
-                if(StatisRequestIdTimeComp.isLimit){
-                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api="+api + " ,data=" + data + " ,requestid=" + requestid +"=被拒绝");
+                if (StatisRequestIdTimeComp.isLimit) {
+                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid + "=被拒绝");
                     result = resultTimeOut;
-                }else{
+                } else {
                     statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
-                    result = noCarInterService.noCarHisWaybillEnd(appKey,api,data,requestid);
+                    result = noCarInterService.noCarHisWaybillEnd(appKey, api, data, requestid);
                     statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
                 }
                 break;
             case "WAY_BILL_NUM_FIND_INVOICE"://无车  运单号查询发票数据
-                result = noCarInterService.noCarVoiceQuery(appKey,api,data,requestid);
+                result = noCarInterService.noCarVoiceQuery(appKey, api, data, requestid);
                 break;
             case "FIND_NO_SEARCH_NUM"://无车  获取未查询过发票的运单编号
-                if(StatisRequestIdTimeComp.isLimit){
-                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api="+api + " ,data=" + data + " ,requestid=" + requestid +"=被拒绝");
+                if (StatisRequestIdTimeComp.isLimit) {
+                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid + "=被拒绝");
                     result = resultTimeOut;
-                }else{
+                } else {
                     statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
-                    result = noCarInterService.noCarNoVoiceQuery(appKey,api,data,requestid);
+                    result = noCarInterService.noCarNoVoiceQuery(appKey, api, data, requestid);
                     statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
                 }
                 break;
             case "BALANCE_QUERY"://无车   账号余额查询接口
-                if(StatisRequestIdTimeComp.isLimit){
-                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api="+api + " ,data=" + data + " ,requestid=" + requestid +"=被拒绝");
+                if (StatisRequestIdTimeComp.isLimit) {
+                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid + "=被拒绝");
                     result = resultTimeOut;
-                }else{
+                } else {
                     statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
-                    result = noCarInterService.balanceQuery(appKey,api,data,requestid);
+                    result = noCarInterService.balanceQuery(appKey, api, data, requestid);
                     statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
                 }
                 break;
             case "RED_INK_INVOICE_QUERY"://无车  红冲发票查询接口
-                if(StatisRequestIdTimeComp.isLimit){
-                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api="+api + " ,data=" + data + " ,requestid=" + requestid +"=被拒绝");
+                if (StatisRequestIdTimeComp.isLimit) {
+                    log.info("InterfaceCheckServer.doJumpHandler,appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid + "=被拒绝");
                     result = resultTimeOut;
-                }else{
+                } else {
                     statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
-                    result = noCarInterService.redInkInvoiceQuery(appKey,api,data,requestid);
+                    result = noCarInterService.redInkInvoiceQuery(appKey, api, data, requestid);
                     statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
                 }
                 break;
             case "WAY_BILL_NUM_FIND_OWNER_INVOICE"://无车  运单号查询发票数据 透传上游
-                result = noCarInterService.noCarVoiceOwnerQuery(appKey,api,data,requestid);
+                result = noCarInterService.noCarVoiceOwnerQuery(appKey, api, data, requestid);
                 break;
             default:
                 result = null;

+ 87 - 98
src/main/java/com/jkcredit/invoice/credit/SimpleCoreFilter.java

@@ -33,69 +33,56 @@ import static com.jkcredit.invoice.common.CommonConst.*;
 public class SimpleCoreFilter implements Filter {
 
 
-    @Autowired
-    CustomerService customerService;
-
-    @Autowired
-    InterfaceCheckServer interfaceCheckServer;
-
-
-
     private static final String PASS_API = "api=credit.sec.data";
     private static final String PASS_GATEWAY = "/gateway";
     private static final String PASS_REST = "/api/rest";
-
-
     //全局定义ApiConstant
-    private final static Map<String, String> API_MAPS=new HashMap<String, String>(){
+    private final static Map<String, String> API_MAPS = new HashMap<String, String>() {
         {
 
 
             //无车、自有车 公共下游客户调用接口
-            put( "COMPANY_ADD_V1" ,  "1");//自有车 无车、企业注册
-            put( "COMPANY_QUERY_V1" ,  "1");//自有车 无车、企业查询
-            put( "PROTOCOL_ADD_V1" ,  "1");//自有车 无车、协议上传
-            put( "PROTOCOL_STATUS_V1" ,  "1");//自有车 无车、协议上传状态查询
+            put("COMPANY_ADD_V1", "1");//自有车 无车、企业注册
+            put("COMPANY_QUERY_V1", "1");//自有车 无车、企业查询
+            put("PROTOCOL_ADD_V1", "1");//自有车 无车、协议上传
+            put("PROTOCOL_STATUS_V1", "1");//自有车 无车、协议上传状态查询
 
             //无车下游客户调用接口
-            put( "VEHICLE_REGISTER" ,  "1");//车辆备案
-            put( "VEHICLE_REGISTER_QUERY" ,  "1");//车辆备案查询
-            put( "WAY_BILL_START" ,  "1");// 实时运单开始指令
-            put( "WAY_BILL_END" ,  "1");//实时运单结束指令
-            put( "WAY_BILL_HISTORY_START" ,  "1");//历史运单开始指令
-            put( "WAY_BILL_HISTORY_END" ,  "1");// 历史运单结束指令
-            put( "WAY_BILL_NUM_FIND_INVOICE" ,  "1");// 运单号查询发票数据
-            put( "FIND_NO_SEARCH_NUM" ,  "1");//获取未查询过发票的运单编号
-            put( "BALANCE_QUERY" ,  "1");//账号余额查询
-            put( "RED_INK_INVOICE_QUERY" ,  "1");//红冲发票查询
-            put( "WAY_BILL_NUM_FIND_OWNER_INVOICE" ,  "1");// 运单号查询发票数据 透传上游,自己使用,不对外
+            put("VEHICLE_REGISTER", "1");//车辆备案
+            put("VEHICLE_REGISTER_QUERY", "1");//车辆备案查询
+            put("WAY_BILL_START", "1");// 实时运单开始指令
+            put("WAY_BILL_END", "1");//实时运单结束指令
+            put("WAY_BILL_HISTORY_START", "1");//历史运单开始指令
+            put("WAY_BILL_HISTORY_END", "1");// 历史运单结束指令
+            put("WAY_BILL_NUM_FIND_INVOICE", "1");// 运单号查询发票数据
+            put("FIND_NO_SEARCH_NUM", "1");//获取未查询过发票的运单编号
+            put("BALANCE_QUERY", "1");//账号余额查询
+            put("RED_INK_INVOICE_QUERY", "1");//红冲发票查询
+            put("WAY_BILL_NUM_FIND_OWNER_INVOICE", "1");// 运单号查询发票数据 透传上游,自己使用,不对外
 
 
             //自有车下游客户调用接口
-            put( "CARD_BIND_QUERY_LIST_V1" ,  "1"); //用户卡列表查询
-            put( "CARD_QUERY_CARD_V1" ,  "1");//卡信息查询
-            put( "CARD_BINDING_V1" ,  "1");//下发短信验证码
-            put( "CARD_VALID_CODE_V1" ,  "1");//自有车卡绑定接口、自有车输入参数接口
-            put( "CARD_TRADE_V1" ,  "1");//交易查询
-            put( "B2B_INVOICE_APPLY_V1" ,  "1");//申请开票
-            put( "B2B_INVOICE_QUERY_V1" ,  "1");//已开发票查询
-            put( "B2B_INVOICE_APPL_QUERY_V1" ,  "1");//按申请查询
-            put( "B2B_INVOICE_PACKAGE_V1" ,  "1");//发票下载
-            put( "CARD_UNBIND_V1" ,  "1");//卡解绑
-            put( "B2B_INVOICE_APPL_QUERY_V1" ,  "1");//按照申请ID查询发票
-            put( "B2B_CHANGE_CARD_V1" ,  "1");//用户卡换绑
-            put( "B2B_CHANGE_CARD_QUERY_V1" ,  "1");//用户卡换绑查询
-            put( "B2B_QUERY_TRADE_APPLY_V1" ,  "1");//按交易查申请
+            put("CARD_BIND_QUERY_LIST_V1", "1"); //用户卡列表查询
+            put("CARD_QUERY_CARD_V1", "1");//卡信息查询
+            put("CARD_BINDING_V1", "1");//下发短信验证码
+            put("CARD_VALID_CODE_V1", "1");//自有车卡绑定接口、自有车输入参数接口
+            put("CARD_TRADE_V1", "1");//交易查询
+            put("B2B_INVOICE_APPLY_V1", "1");//申请开票
+            put("B2B_INVOICE_QUERY_V1", "1");//已开发票查询
+            put("B2B_INVOICE_APPL_QUERY_V1", "1");//按申请查询
+            put("B2B_INVOICE_PACKAGE_V1", "1");//发票下载
+            put("CARD_UNBIND_V1", "1");//卡解绑
+            put("B2B_INVOICE_APPL_QUERY_V1", "1");//按照申请ID查询发票
+            put("B2B_CHANGE_CARD_V1", "1");//用户卡换绑
+            put("B2B_CHANGE_CARD_QUERY_V1", "1");//用户卡换绑查询
+            put("B2B_QUERY_TRADE_APPLY_V1", "1");//按交易查申请
 
         }
     };
-
-
-
     /**
      * 这些映射无需进行api/appSecret等参数校验,故过滤
      */
-    private final static String[] NO_TOKEN_API_PATHS ={
+    private final static String[] NO_TOKEN_API_PATHS = {
             "/**/favicon.ico",
             "/favicon.ico",
             "/swagger-ui.html",
@@ -213,6 +200,24 @@ public class SimpleCoreFilter implements Filter {
             "/user/restPassword",
             "/user/lock"
     };
+    @Autowired
+    CustomerService customerService;
+    @Autowired
+    InterfaceCheckServer interfaceCheckServer;
+
+    public static String getsrt(String startkeystr, String endstr, String str) {
+        int customerindex = str.indexOf(startkeystr);
+        String temp = str.substring(customerindex + startkeystr.length());
+        int endindex = temp.indexOf(endstr);
+        String sss = temp.substring(0, endindex);
+        return sss;
+    }
+
+    public static String getsrt1(String startkeystr, String str) {
+        int customerindex = str.indexOf(startkeystr);
+        String temp = str.substring(customerindex + startkeystr.length());
+        return temp;
+    }
 
     @Override
     public void init(FilterConfig filterConfig) throws ServletException {
@@ -233,7 +238,7 @@ public class SimpleCoreFilter implements Filter {
          * 这些映射无需进行api/appSecret等参数校验,故过滤
          */
         boolean flag = (!Arrays.asList(NO_TOKEN_API_PATHS).contains(httpRequest.getRequestURI()));
-        if(httpRequest.getRequestURI().contains(USER_PATH) || PATH.equals(httpRequest.getRequestURI()) || httpRequest.getRequestURI().contains(STATIC_PATH) || httpRequest.getRequestURI().contains(CONTEXT_PATH)){
+        if (httpRequest.getRequestURI().contains(USER_PATH) || PATH.equals(httpRequest.getRequestURI()) || httpRequest.getRequestURI().contains(STATIC_PATH) || httpRequest.getRequestURI().contains(CONTEXT_PATH)) {
             flag = false;
         }
         if (flag) {
@@ -245,21 +250,21 @@ public class SimpleCoreFilter implements Filter {
             long startTime = System.currentTimeMillis();
             String flagUuid = UUID.randomUUID().toString();
             RequestApi requestApi = new RequestApi();
-            ResponseCode responseCode = checkToken(httpRequest, httpResponse,startTime,flagUuid,requestApi);
+            ResponseCode responseCode = checkToken(httpRequest, httpResponse, startTime, flagUuid, requestApi);
             if (!Objects.equals(responseCode, ResponseCode.SUCCESS)) {
-                log.error("FILE - SimpleCORSFilterError = {}", responseCode + " ,requestURI = {" + httpRequest.getRequestURI() +"}");
+                log.error("FILE - SimpleCORSFilterError = {}", responseCode + " ,requestURI = {" + httpRequest.getRequestURI() + "}");
                 httpResponse.setContentType("application/json; charset=utf-8");
                 httpResponse.setCharacterEncoding("utf-8");
                 PrintWriter writer = httpResponse.getWriter();
-                writer.write(new ObjectMapper().writeValueAsString(ApiResult.failure(responseCode,requestid)));
-                log.error("[FILE - SimpleCORSFilter-] return result=" + responseCode.toString() + " , param is api="+  requestApi.getApi() + " , data=" + requestApi.getData() + " , appKey=" + requestApi.getAppKey() + " , appSecret=" + requestApi.getAppSecret() +  " ,timeCost=" +(System.currentTimeMillis()-startTime) + "ms" +" , flag=" + flagUuid);
+                writer.write(new ObjectMapper().writeValueAsString(ApiResult.failure(responseCode, requestid)));
+                log.error("[FILE - SimpleCORSFilter-] return result=" + responseCode.toString() + " , param is api=" + requestApi.getApi() + " , data=" + requestApi.getData() + " , appKey=" + requestApi.getAppKey() + " , appSecret=" + requestApi.getAppSecret() + " ,timeCost=" + (System.currentTimeMillis() - startTime) + "ms" + " , flag=" + flagUuid);
                 return;
-            }else{
-                log.info("SUCCESS - SimpleCORSFilterWarn = {}", responseCode + " ,requestURI = {" + httpRequest.getRequestURI() +"}");
+            } else {
+                log.info("SUCCESS - SimpleCORSFilterWarn = {}", responseCode + " ,requestURI = {" + httpRequest.getRequestURI() + "}");
 
 
-                DataResult dataResult =  interfaceCheckServer.doJumpHandler(requestApi.getAppKey(),requestApi.getApi(),requestApi.getData(),requestid);
-                if(null == dataResult){
+                DataResult dataResult = interfaceCheckServer.doJumpHandler(requestApi.getAppKey(), requestApi.getApi(), requestApi.getData(), requestid);
+                if (null == dataResult) {
                     dataResult = new DataResult();
                     dataResult.setData(3);
                     dataResult.setCode(200);
@@ -270,7 +275,7 @@ public class SimpleCoreFilter implements Filter {
                 httpResponse.setCharacterEncoding("utf-8");
                 PrintWriter writer = httpResponse.getWriter();
                 writer.write(new ObjectMapper().writeValueAsString(ApiResult.failure(dataResult)));
-                log.info("[SUCCESS - SimpleCORSFilter-] return result=" + dataResult.toString() + " , param is api="+  requestApi.getApi() + " , data=" + requestApi.getData() + " , appKey=" + requestApi.getAppKey() + " , appSecret=" + requestApi.getAppSecret() +  " ,timeCost=" +(System.currentTimeMillis()-startTime) + "ms" +" , flag=" + flagUuid);
+                log.info("[SUCCESS - SimpleCORSFilter-] return result=" + dataResult.toString() + " , param is api=" + requestApi.getApi() + " , data=" + requestApi.getData() + " , appKey=" + requestApi.getAppKey() + " , appSecret=" + requestApi.getAppSecret() + " ,timeCost=" + (System.currentTimeMillis() - startTime) + "ms" + " , flag=" + flagUuid);
                 return;
             }
         }
@@ -278,25 +283,27 @@ public class SimpleCoreFilter implements Filter {
         filterChain.doFilter(httpRequest, servletResponse);
     }
 
-
-
     @Override
     public void destroy() {
 
     }
 
-    private String getApi(String request){
-        return  CorsFilterCheckUtil.getApi(request);
+    private String getApi(String request) {
+        return CorsFilterCheckUtil.getApi(request);
     }
-    private String getAppKey(String request){
-        return  CorsFilterCheckUtil.getAppKey(request);
+
+    private String getAppKey(String request) {
+        return CorsFilterCheckUtil.getAppKey(request);
     }
-    private String getAppSecret(String request){
-        return  CorsFilterCheckUtil.getAppSecret(request);
+
+    private String getAppSecret(String request) {
+        return CorsFilterCheckUtil.getAppSecret(request);
     }
-    private String getData(String request){
-        return  CorsFilterCheckUtil.getData(request);
+
+    private String getData(String request) {
+        return CorsFilterCheckUtil.getData(request);
     }
+
     /**
      * 用户 Token 校验
      *
@@ -304,28 +311,28 @@ public class SimpleCoreFilter implements Filter {
      * @param response
      * @return
      */
-    private ResponseCode checkToken(HttpServletRequest request, HttpServletResponse response,long startTime,String flag,RequestApi requestApi) {
+    private ResponseCode checkToken(HttpServletRequest request, HttpServletResponse response, long startTime, String flag, RequestApi requestApi) {
         try {
 
 
-            if(null != request && null != request.getQueryString() && !PASS_API.equals(request.getQueryString())){
+            if (null != request && null != request.getQueryString() && !PASS_API.equals(request.getQueryString())) {
                 return ResponseCode.UNKNOWN_ERROR;
-            };
+            }
 
-            if(null != request && null != request.getQueryString() && !PASS_GATEWAY.equals(request.getRequestURI())){
+            if (null != request && null != request.getQueryString() && !PASS_GATEWAY.equals(request.getRequestURI())) {
                 return ResponseCode.UNKNOWN_ERROR;
             }
 
 
-            if(null != request && null == request.getQueryString() && !PASS_REST.equals(request.getRequestURI())){
+            if (null != request && null == request.getQueryString() && !PASS_REST.equals(request.getRequestURI())) {
                 return ResponseCode.UNKNOWN_ERROR;
             }
 
-            if(null == request ){
+            if (null == request) {
                 return ResponseCode.UNKNOWN_ERROR;
             }
 
-            if(null != request  && null == request.getQueryString() && null == request.getRequestURI()  ){
+            if (null != request && null == request.getQueryString() && null == request.getRequestURI()) {
                 return ResponseCode.UNKNOWN_ERROR;
             }
 
@@ -351,23 +358,23 @@ public class SimpleCoreFilter implements Filter {
             if (null == customer1 || customer1.getAccstatus() != 0) {
                 return ResponseCode.ACCOUNT_NOT_EXIST;
             }
-            if(null != customer1 && ! appSecret.equals(customer1.getAppSecret())){
+            if (null != customer1 && !appSecret.equals(customer1.getAppSecret())) {
                 return ResponseCode.SIGN_ERROR;
             }
-            if(!API_MAPS.containsKey(api)){
+            if (!API_MAPS.containsKey(api)) {
                 return ResponseCode.CUSTOMER_QUERY_ERROR;
             }
             boolean flags = false;
 
             if (0 >= new BigDecimal(customer1.getAccountBalance()).compareTo(new BigDecimal(0.0))) {
-                flags =  true;
+                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))) {
-                flags =  false;
+                    && ("WAY_BILL_NUM_FIND_INVOICE".equals(api) || "B2B_INVOICE_QUERY_V1".equals(api))) {
+                flags = false;
             }
-            if(flags){
+            if (flags) {
                 return ResponseCode.BALANCE_QUERY_ERROR;
             }
 
@@ -379,10 +386,7 @@ public class SimpleCoreFilter implements Filter {
         return ResponseCode.SUCCESS;
     }
 
-
-
-
-    public  String getOpenApiRequestData(HttpServletRequest request){
+    public String getOpenApiRequestData(HttpServletRequest request) {
         String str = "";
         try {
 
@@ -394,7 +398,7 @@ public class SimpleCoreFilter implements Filter {
                 return null;
             }
             byte[] buffer = new byte[contentLength];
-            for (int i = 0; i < contentLength;) {
+            for (int i = 0; i < contentLength; ) {
 
                 int readlen = request.getInputStream().read(buffer, i, contentLength - i);
                 if (readlen == -1) {
@@ -407,7 +411,7 @@ public class SimpleCoreFilter implements Filter {
             if (charEncoding == null) {
                 charEncoding = "UTF-8";
             }
-            str = new String(buffer, charEncoding)+"&";
+            str = new String(buffer, charEncoding) + "&";
             str = URLDecoder.decode(str, "UTF-8");
 
 
@@ -420,19 +424,4 @@ public class SimpleCoreFilter implements Filter {
         return null;
     }
 
-
-    public static String getsrt(String startkeystr, String endstr, String str) {
-        int customerindex = str.indexOf(startkeystr);
-        String temp = str.substring(customerindex + startkeystr.length());
-        int endindex = temp.indexOf(endstr);
-        String sss = temp.substring(0, endindex);
-        return sss;
-    }
-
-    public static String getsrt1(String startkeystr, String str) {
-        int customerindex = str.indexOf(startkeystr);
-        String temp = str.substring(customerindex + startkeystr.length());
-        return temp;
-    }
-
 }

+ 1 - 3
src/main/java/com/jkcredit/invoice/credit/dto/CardChangeDto.java

@@ -1,7 +1,5 @@
 package com.jkcredit.invoice.credit.dto;
 
-import com.jkcredit.invoice.common.BaseEntity;
-
 import java.util.ArrayList;
 
 /**
@@ -13,7 +11,7 @@ public class CardChangeDto {
      */
     private String customerId;
     /**
-     *原公司编号
+     * 原公司编号
      */
     private String companyNum;
 

+ 14 - 16
src/main/java/com/jkcredit/invoice/credit/interserver/CustomerInterLowerService.java

@@ -5,40 +5,38 @@ import com.jkcredit.invoice.common.DataResult;
 public interface CustomerInterLowerService {
 
     /**
-    * @Description 自有车、无车 客户企业备案接口;
-    * @Author  mashengyi
-    * @Date   2022/2/8 18:00
-    * @Param
-    * @Return
-    * @Exception
-    *
-    */
-    DataResult customeInterRec(String appKey, String api, String data,String requestid);
+     * @Description 自有车、无车 客户企业备案接口;
+     * @Author mashengyi
+     * @Date 2022/2/8 18:00
+     * @Param
+     * @Return
+     * @Exception
+     */
+    DataResult customeInterRec(String appKey, String api, String data, String requestid);
 
     /**
      * @Description //自有车、无车 客户企业查询接口;
-     * @Author  mashengyi
-     * @Date   2022/2/8 18:00
+     * @Author mashengyi
+     * @Date 2022/2/8 18:00
      * @Param
      * @Return
      * @Exception
-     *
      */
-    DataResult customeInterRecQuery(String appKey, String api, String data,String requestid);
+    DataResult customeInterRecQuery(String appKey, String api, String data, String requestid);
 
     /**
      * @Description //无车 自有车协议上传
-     * @Author  mashengyi
-     * @Date   2022/2/8 18:00
+     * @Author mashengyi
+     * @Date 2022/2/8 18:00
      * @Param
      * @Return
      * @Exception
-     *
      */
     DataResult customeProtocolUpLoad(String appKey, String api, String data, String requestid);
 
     /**
      * 自有车 无车、协议上传状态查询
+     *
      * @param appKey
      * @param api
      * @param data

+ 102 - 113
src/main/java/com/jkcredit/invoice/credit/interserver/CustomerInterLowerServiceImpl.java

@@ -27,33 +27,26 @@ import static com.jkcredit.invoice.common.CommonConst.COMPUTE;
 public class CustomerInterLowerServiceImpl implements CustomerInterLowerService {
 
 
-
+    private static final String PDF = "pdf";
     @Autowired
     CustomeLowerService lowerService;
-
     @Autowired
     CustomerService customerService;
-
-
     @Autowired
     CustomerMapper customerMapper;
-
-
     @Autowired
     CustomerRecMapper customerRecMapper;
 
-    private static final String PDF = "pdf";
-
-
     /**
      * 无车 自有车 企业注册
+     *
      * @param appKey
      * @param api
      * @param data
      * @return
      */
     @Override
-    public DataResult customeInterRec(String appKey, String api, String data,String requestid) {
+    public DataResult customeInterRec(String appKey, String api, String data, String requestid) {
         long costtimestart = System.currentTimeMillis();
 
         DataResult result = new DataResult();
@@ -63,14 +56,14 @@ public class CustomerInterLowerServiceImpl implements CustomerInterLowerService
         result.setMsg("无法认证");
 
         try {
-            log.info("[-CustomerInterLowerServiceImpl.customeInterRec-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
+            log.info("[-CustomerInterLowerServiceImpl.customeInterRec-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
             JSONObject jsonObject = JSONObject.parseObject(data);
 
-            Integer interType =  0;//0-接口 1-平台 3.手工录入
+            Integer interType = 0;//0-接口 1-平台 3.手工录入
 
-            String  name = jsonObject.getString("name");//公司名称 companyName
-            String  taxpayerCode = jsonObject.getString("taxplayerCode");//企业税号 companyReferencenum
-            String  customerName = appKey;//客户名称
+            String name = jsonObject.getString("name");//公司名称 companyName
+            String taxpayerCode = jsonObject.getString("taxplayerCode");//企业税号 companyReferencenum
+            String customerName = appKey;//客户名称
 
             Customer cust = customerMapper.selectByCustomerName(customerName);
 
@@ -78,7 +71,7 @@ public class CustomerInterLowerServiceImpl implements CustomerInterLowerService
              * 所属类型:
              *1-行业用户  2-自营平台 3-合作商户
              */
-            Integer  companyType = jsonObject.getInteger("companyType");
+            Integer companyType = jsonObject.getInteger("companyType");
             /**
              * 运用类型:
              * 1-快递
@@ -89,22 +82,21 @@ public class CustomerInterLowerServiceImpl implements CustomerInterLowerService
              6-其他
              * 运营范围
              */
-            Integer  operatingRangeType = jsonObject.getInteger("operatingRangeType");
-            String  contact = jsonObject.getString("contact");//联系人
-            String  tel = jsonObject.getString("tel");//联系人电话
-            String  emergencyContact = jsonObject.getString("emergencyContact");//紧急联系人  companyLeader
-            String  emergencyTel = jsonObject.getString("emergencyTel");//紧急联系人电话 companyLeaderPhone
+            Integer operatingRangeType = jsonObject.getInteger("operatingRangeType");
+            String contact = jsonObject.getString("contact");//联系人
+            String tel = jsonObject.getString("tel");//联系人电话
+            String emergencyContact = jsonObject.getString("emergencyContact");//紧急联系人  companyLeader
+            String emergencyTel = jsonObject.getString("emergencyTel");//紧急联系人电话 companyLeaderPhone
 
-            String  buyerName = jsonObject.getString("buyerName");//购方客户名称
-            String  buyerTaxpayerCode = jsonObject.getString("buyerTaxpayerCode");//购方税号
-            String  buyerAddr = jsonObject.getString("buyerAddr");//购方单位地址
-            String  buyerTel = jsonObject.getString("buyerTel");//购方电话
-            String  buyerBank = jsonObject.getString("buyerBank");//购方开户行
-            String  buyerBankAccount = jsonObject.getString("buyerBankAccount");//购方银行账号
+            String buyerName = jsonObject.getString("buyerName");//购方客户名称
+            String buyerTaxpayerCode = jsonObject.getString("buyerTaxpayerCode");//购方税号
+            String buyerAddr = jsonObject.getString("buyerAddr");//购方单位地址
+            String buyerTel = jsonObject.getString("buyerTel");//购方电话
+            String buyerBank = jsonObject.getString("buyerBank");//购方开户行
+            String buyerBankAccount = jsonObject.getString("buyerBankAccount");//购方银行账号
 
 
-
-            if(StringUtils.isEmpty(data)|| null == jsonObject
+            if (StringUtils.isEmpty(data) || null == jsonObject
                     || StringUtils.isEmpty(name)
                     || StringUtils.isEmpty(taxpayerCode)
                     || StringUtils.isEmpty(customerName)
@@ -120,8 +112,8 @@ public class CustomerInterLowerServiceImpl implements CustomerInterLowerService
                     || StringUtils.isEmpty(buyerTel)
                     || StringUtils.isEmpty(buyerBank)
                     || StringUtils.isEmpty(buyerBankAccount)
-                    ){
-                return  result;
+            ) {
+                return result;
             }
 
             CustomerRec customerRec = getCustomerRec(interType, name, taxpayerCode, customerName, cust, companyType, operatingRangeType, contact, tel, buyerAddr, buyerTel, buyerBank, buyerBankAccount);
@@ -144,21 +136,21 @@ public class CustomerInterLowerServiceImpl implements CustomerInterLowerService
                 + (costtimeend - costtimestart));
 
         //返回成功
-        if(null != rs && rs.getCode() == 0){
+        if (null != rs && rs.getCode() == 0) {
 
-            RespR rs1 =  customerService.customeRec(customerRec);
+            RespR rs1 = customerService.customeRec(customerRec);
             log.info("[-CustomerInterLowerServiceImpl.customeInterRecRc1-] result is "
                     + rs1.toString() + ", request is " + data + " ,costtime="
                     + (System.currentTimeMillis() - costtimestart));
 
 
-            if(null != rs1 && rs1.getCode() == 0){
+            if (null != rs1 && rs1.getCode() == 0) {
                 result.setData(1);
                 result.setCode(200);
                 result.setMsg(rs1.getMsg());
                 return result;
 
-            }else {
+            } else {
                 result.setData(3);
                 result.setCode(200);
                 result.setMsg(rs1.getMsg());
@@ -193,13 +185,14 @@ public class CustomerInterLowerServiceImpl implements CustomerInterLowerService
 
     /**
      * 无车 自有车企业查询
+     *
      * @param appKey
      * @param api
      * @param data
      * @return
      */
     @Override
-    public DataResult customeInterRecQuery(String appKey, String api, String data,String requestid) {
+    public DataResult customeInterRecQuery(String appKey, String api, String data, String requestid) {
 
         long costtimestart = System.currentTimeMillis();
 
@@ -211,56 +204,55 @@ public class CustomerInterLowerServiceImpl implements CustomerInterLowerService
         result.setMsg("无法认证");
 
         try {
-            log.info("[-CustomerInterLowerServiceImpl.customeInterRecQuery-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
-        JSONObject jsonObject = JSONObject.parseObject(data);
-        String companyName =  jsonObject.getString("companyName");//企业名称
-        String taxpayerCode = jsonObject.getString("taxplayerCode");//企业税号
-        if(StringUtils.isEmpty(data)|| null == jsonObject){
-            return  result;
-        }
-        if( StringUtils.isEmpty(companyName) && StringUtils.isEmpty(taxpayerCode)){
+            log.info("[-CustomerInterLowerServiceImpl.customeInterRecQuery-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
+            JSONObject jsonObject = JSONObject.parseObject(data);
+            String companyName = jsonObject.getString("companyName");//企业名称
+            String taxpayerCode = jsonObject.getString("taxplayerCode");//企业税号
+            if (StringUtils.isEmpty(data) || null == jsonObject) {
+                return result;
+            }
+            if (StringUtils.isEmpty(companyName) && StringUtils.isEmpty(taxpayerCode)) {
 
-            result.setMsg("查询错误");
-            result.setCode(9998);
-            return  result;
-         }
+                result.setMsg("查询错误");
+                result.setCode(9998);
+                return result;
+            }
 
-        CustomerRec customerRec = new CustomerRec();
-        customerRec.setCompanyName(companyName);
-        customerRec.setCompanyReferencenum(taxpayerCode);
-        RespR rs = customerService.customerRecQuery(customerRec);
-        long costtimeend = System.currentTimeMillis();
-        log.info("[-CustomerInterLowerServiceImpl.customeInterRecQuery-] result is "
+            CustomerRec customerRec = new CustomerRec();
+            customerRec.setCompanyName(companyName);
+            customerRec.setCompanyReferencenum(taxpayerCode);
+            RespR rs = customerService.customerRecQuery(customerRec);
+            long costtimeend = System.currentTimeMillis();
+            log.info("[-CustomerInterLowerServiceImpl.customeInterRecQuery-] result is "
                     + rs.toString() + ", request is " + data + " ,costtime="
                     + (costtimeend - costtimestart));
-        if(null != rs && rs.getCode() == 0){
-           result.setData(1);
-           result.setCode(200);
-           result.setMsg(rs.getData().toString());
-           return result;
-        } else {
-            result.setData(3);
-            result.setCode(200);
-            result.setMsg(rs.getMsg());
-            return result;
-        }
+            if (null != rs && rs.getCode() == 0) {
+                result.setData(1);
+                result.setCode(200);
+                result.setMsg(rs.getData().toString());
+                return result;
+            } else {
+                result.setData(3);
+                result.setCode(200);
+                result.setMsg(rs.getMsg());
+                return result;
+            }
         } catch (Exception e) {
             log.error("[-CustomerInterLowerServiceImpl.customeInterRecQuery-] get httpclient exception is "
-                            + e + ", request is " + data);
+                    + e + ", request is " + data);
         }
         return result;
     }
 
 
     /**
-    * @Description  协议上传接口
-    * @Author  mashengyi
-    * @Date   2022/3/27 22:51
-    * @Param
-    * @Return
-    * @Exception
-    *
-    */
+     * @Description 协议上传接口
+     * @Author mashengyi
+     * @Date 2022/3/27 22:51
+     * @Param
+     * @Return
+     * @Exception
+     */
     @Override
     public DataResult customeProtocolUpLoad(String appKey, String api, String data, String requestid) {
         long costtimestart = System.currentTimeMillis();
@@ -270,61 +262,61 @@ public class CustomerInterLowerServiceImpl implements CustomerInterLowerService
         result.setRequestid(requestid);
         result.setMsg("无法认证");
         try {
-            log.info("[-CustomerInterLowerServiceImpl.customeProtocolUpLoad-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
+            log.info("[-CustomerInterLowerServiceImpl.customeProtocolUpLoad-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
             JSONObject jsonObject = JSONObject.parseObject(data);
-            String companyNum =  jsonObject.getString("companyNum");//公司编号
+            String companyNum = jsonObject.getString("companyNum");//公司编号
             String serviceStartTime = jsonObject.getString("serviceStartTime");//服务开始时间
             String serviceEndTime = jsonObject.getString("serviceEndTime");//服务结束时间
             String contractFileName = jsonObject.getString("contractFileName");//协议文件名
             String base64Str = jsonObject.getString("base64Str");//上传文件转换的base64
             Integer serviceType = jsonObject.getInteger("serviceType");//协议类型
-            if(StringUtils.isEmpty(data)|| null == jsonObject){
-                return  result;
+            if (StringUtils.isEmpty(data) || null == jsonObject) {
+                return result;
             }
-            if( StringUtils.isEmpty(companyNum) || StringUtils.isEmpty(serviceStartTime)
+            if (StringUtils.isEmpty(companyNum) || StringUtils.isEmpty(serviceStartTime)
                     || StringUtils.isEmpty(serviceEndTime)
                     || StringUtils.isEmpty(contractFileName)
                     || StringUtils.isEmpty(base64Str)
-                    || null == serviceType){
-                return  result;
+                    || null == serviceType) {
+                return result;
             }
-            if(!DateUtil.isValidDate(serviceStartTime)){
+            if (!DateUtil.isValidDate(serviceStartTime)) {
                 result.setMsg("日期格式有误");
-                return  result;
+                return result;
             }
-            if(!DateUtil.isValidDate(serviceEndTime)){
+            if (!DateUtil.isValidDate(serviceEndTime)) {
                 result.setMsg("日期格式有误");
-                return  result;
+                return result;
             }
             CustomerRec customerRec2 = new CustomerRec();
             customerRec2.setCustomerName(appKey);
             customerRec2.setCompanyNum(companyNum);
             CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyNum(customerRec2);
-            if (null == customerRec1){
+            if (null == customerRec1) {
                 result.setMsg("企业还未备案成功!");
                 return result;
             }
-            if (null != customerRec1 && customerRec1.getRecStatus() != 1){
+            if (null != customerRec1 && customerRec1.getRecStatus() != 1) {
                 result.setMsg("企业还未备案成功!");
                 return result;
             }
             if (null != customerRec1
                     && StringUtils.isNotBlank(customerRec1.getServiceEndTime())
                     //如果协议到期时间超过60天,协议上传成功不允许重新上传协议
-                    && DateUtil.daysBetween(customerRec1.getServiceEndTime(),new Date()) > 60
-                    && customerRec1.getContractSuc() == 1){
+                    && DateUtil.daysBetween(customerRec1.getServiceEndTime(), new Date()) > 60
+                    && customerRec1.getContractSuc() == 1) {
                 result.setMsg("协议已上传成功,审批中,请勿重复上传协议!");
                 return result;
             }
-            String fileType = contractFileName.substring(contractFileName.lastIndexOf(".") + 1, contractFileName.length()).toLowerCase();
-            if(!PDF.equals(fileType)){
+            String fileType = contractFileName.substring(contractFileName.lastIndexOf(".") + 1).toLowerCase();
+            if (!PDF.equals(fileType)) {
                 result.setMsg("必须是pdf文件!");
-                return  result;
+                return result;
             }
             int base64StrLength = base64Str.length();
-            if(COMPUTE < base64StrLength){
+            if (COMPUTE < base64StrLength) {
                 result.setMsg("pdf不可超过10M!");
-                return  result;
+                return result;
             }
             return getDataResult(appKey, data, costtimestart, result, companyNum, serviceStartTime, serviceEndTime, contractFileName, base64Str, serviceType);
         } catch (Exception e) {
@@ -353,7 +345,7 @@ public class CustomerInterLowerServiceImpl implements CustomerInterLowerService
         log.info("[-CustomerInterLowerServiceImpl.customeProtocolUpLoad-] result is "
                 + rs.toString() + ", request is " + data + " ,costtime="
                 + (costtimeend - costtimestart));
-        if(null != rs && rs.getCode() == 0){
+        if (null != rs && rs.getCode() == 0) {
             result.setData(1);
             result.setCode(200);
             result.setMsg(rs.getMsg());
@@ -368,13 +360,12 @@ public class CustomerInterLowerServiceImpl implements CustomerInterLowerService
 
 
     /**
-     * @Description  自有车 无车、协议上传状态查询
-     * @Author  mashengyi
-     * @Date   2022/3/27 22:51
+     * @Description 自有车 无车、协议上传状态查询
+     * @Author mashengyi
+     * @Date 2022/3/27 22:51
      * @Param
      * @Return
      * @Exception
-     *
      */
     @Override
     public DataResult customeProtocolStatus(String appKey, String api, String data, String requestid) {
@@ -388,30 +379,28 @@ public class CustomerInterLowerServiceImpl implements CustomerInterLowerService
         result.setMsg("无法认证");
 
         try {
-            log.info("[-CustomerInterLowerServiceImpl.customeProtocolStatus-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
+            log.info("[-CustomerInterLowerServiceImpl.customeProtocolStatus-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
             JSONObject jsonObject = JSONObject.parseObject(data);
-            String companyNum =  jsonObject.getString("companyNum");//公司编号
+            String companyNum = jsonObject.getString("companyNum");//公司编号
 
-            if(StringUtils.isEmpty(data)|| null == jsonObject){
-                return  result;
+            if (StringUtils.isEmpty(data) || null == jsonObject) {
+                return result;
             }
-            if( StringUtils.isEmpty(companyNum)){
-                return  result;
+            if (StringUtils.isEmpty(companyNum)) {
+                return result;
             }
 
 
-
-
             CustomerRec customerRec2 = new CustomerRec();
             customerRec2.setCustomerName(appKey);
             customerRec2.setCompanyNum(companyNum);
             CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyNum(customerRec2);
-            if (null == customerRec1){
+            if (null == customerRec1) {
                 result.setMsg("企业还未备案成功!");
                 return result;
             }
 
-            if (null != customerRec1 && customerRec1.getRecStatus() != 1){
+            if (null != customerRec1 && customerRec1.getRecStatus() != 1) {
                 result.setMsg("企业还未备案成功!");
                 return result;
             }
@@ -427,19 +416,19 @@ public class CustomerInterLowerServiceImpl implements CustomerInterLowerService
             log.info("[-CustomerInterLowerServiceImpl.customeProtocolStatus-] result is "
                     + rs.toString() + ", request is " + data + " ,costtime="
                     + (costtimeend - costtimestart));
-            if(null != rs && rs.getCode() == 0 && 0 == Integer.parseInt(rs.getData().toString())){
+            if (null != rs && rs.getCode() == 0 && 0 == Integer.parseInt(rs.getData().toString())) {
                 result.setData(3);
                 result.setCode(200);
                 result.setMsg("协议上传状态查询失败,请联系管理员处理");
                 return result;
-            } else if(null != rs && rs.getCode() == 0 && 0 != Integer.parseInt(rs.getData().toString())){
+            } else if (null != rs && rs.getCode() == 0 && 0 != Integer.parseInt(rs.getData().toString())) {
                 result.setData(1);
                 result.setCode(200);
                 JSONObject jb = new JSONObject();
-                jb.put("status",rs.getData().toString());
+                jb.put("status", rs.getData().toString());
                 result.setMsg(jb.toString());
                 return result;
-            }else {
+            } else {
                 result.setData(3);
                 result.setCode(200);
                 result.setMsg("无法认证");

+ 220 - 250
src/main/java/com/jkcredit/invoice/credit/interserver/NoCarInterServiceImpl.java

@@ -32,44 +32,80 @@ import java.util.List;
 
 import static com.jkcredit.invoice.common.CommonConst.*;
 import static java.util.stream.Collectors.toList;
+
 @Service("noCarInterService")
 @Slf4j
 public class NoCarInterServiceImpl implements NoCarInterService {
-    
 
-    @Autowired
-    private NoCarService noCarService;
+
     @Autowired
     NoCarBillWayImportService noCarWaybillMapperImprt;
-
     @Autowired
     CustomerCarRecMapper customerCarRecMapper;
-
     @Autowired
     NoCarWaybillMapper noCarWaybillMapper;
     @Autowired
     CustomerRecService customerRecMapper;
-
-
     @Autowired
     BillInvoiceMapper billInvoiceMapper;
-
-
     @Autowired
     CustomerMapper customerMapper;
-
     @Autowired
     ParamService paramService;
+    @Autowired
+    private NoCarService noCarService;
+
+    public static void main(String[] args) {
+        List<String> list1 = new ArrayList<String>();
+        list1.add("1");
+        list1.add("2");
+        list1.add("3");
+        list1.add("5");
+        list1.add("6");
+
+        List<String> list2 = new ArrayList<String>();
+        list2.add("2");
+        list2.add("3");
+        list2.add("7");
+        list2.add("8");
+
+        // 交集
+        List<String> intersection = list1.stream().filter(item -> list2.contains(item)).collect(toList());
+        System.out.println("---交集 intersection---");
+        intersection.parallelStream().forEach(System.out::println);
+
+        // 差集 (list1 - list2)
+        List<String> reduce1 = list1.stream().filter(item -> !list2.contains(item)).collect(toList());
+        System.out.println("---差集 reduce1 (list1 - list2)---");
+        reduce1.parallelStream().forEach(System.out::println);    // 并集
+        List<String> listAll = list1.parallelStream().collect(toList());
+        List<String> listAll2 = list2.parallelStream().collect(toList());
+        listAll.addAll(listAll2);
+        System.out.println("---并集 listAll---");
+        listAll.parallelStream().forEachOrdered(System.out::println);
+
+        // 去重并集
+        List<String> listAllDistinct = listAll.stream().distinct().collect(toList());
+        System.out.println("---得到去重并集 listAllDistinct---");
+        listAllDistinct.parallelStream().forEachOrdered(System.out::println);
+
+        System.out.println("---原来的List1---");
+        list1.parallelStream().forEachOrdered(System.out::println);
+        System.out.println("---原来的List2---");
+        list2.parallelStream().forEachOrdered(System.out::println);
+
+    }
 
     /**
      * 无车 车辆备案接口
+     *
      * @param appKey
      * @param api
      * @param data
      * @return
      */
     @Override
-    public DataResult customerCarRec(String appKey, String api, String data,String requestid) {
+    public DataResult customerCarRec(String appKey, String api, String data, String requestid) {
 
         long costtimestart = System.currentTimeMillis();
 
@@ -81,40 +117,40 @@ public class NoCarInterServiceImpl implements NoCarInterService {
         result.setMsg("无法认证");
 
         try {
-            log.info("[-NoCarInterServiceImpl.customerCarRec-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
+            log.info("[-NoCarInterServiceImpl.customerCarRec-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
             JSONObject jsonObject = JSONObject.parseObject(data);
-            String companyName =  jsonObject.getString("companyName");//企业名称 选输
-            String plateNumber =  jsonObject.getString("plateNumber");//plateNumber 必输
-            String plateColor =  jsonObject.getString("plateColor");//plateColor 必输
-            if(StringUtils.isEmpty(data)|| null == jsonObject || StringUtils.isEmpty(plateNumber)
+            String companyName = jsonObject.getString("companyName");//企业名称 选输
+            String plateNumber = jsonObject.getString("plateNumber");//plateNumber 必输
+            String plateColor = jsonObject.getString("plateColor");//plateColor 必输
+            if (StringUtils.isEmpty(data) || null == jsonObject || StringUtils.isEmpty(plateNumber)
                     || StringUtils.isEmpty(plateColor)
 
-            ){
+            ) {
                 result.setMsg("必传参数有空值");
-                return  result;
+                return result;
             }
 
 
             List<CustomerCarRec> customerCarRecList = new ArrayList<CustomerCarRec>();
             CustomerCarRec customerCarRec = new CustomerCarRec();
-                customerCarRec.setCustomerName(appKey);
-                Customer cust = customerMapper.selectByCustomerName(appKey);
-
-                CustomerRec customerRec = new CustomerRec();
-                customerRec.setCustomerName(appKey);
-                customerRec.setCompanyName(cust.getCompany());
-                CustomerRec customerRec1 =  customerRecMapper.selectByCustomerNameAndCompanyConcat(customerRec);
-                if(null == customerRec1){
-                    result.setMsg("该客户: "+appKey+" 未备案企业");
-                    return result;
-                }
-                customerCarRec.setCompanyName(customerRec1.getCompanyName());
-                customerCarRec.setCustomerName(customerRec1.getCustomerName());
+            customerCarRec.setCustomerName(appKey);
+            Customer cust = customerMapper.selectByCustomerName(appKey);
+
+            CustomerRec customerRec = new CustomerRec();
+            customerRec.setCustomerName(appKey);
+            customerRec.setCompanyName(cust.getCompany());
+            CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyConcat(customerRec);
+            if (null == customerRec1) {
+                result.setMsg("该客户: " + appKey + " 未备案企业");
+                return result;
+            }
+            customerCarRec.setCompanyName(customerRec1.getCompanyName());
+            customerCarRec.setCustomerName(customerRec1.getCustomerName());
             customerCarRec.setBusinessType("2");//无车
             customerCarRec.setCarColor(plateColor);
             customerCarRec.setCarNum(plateNumber);
             customerCarRec.setInterType(0);
-            if(SELF_CAR.equals(customerCarRec.getCarColor())){
+            if (SELF_CAR.equals(customerCarRec.getCarColor())) {
                 customerCarRec.setServiceOperation(1);//默认运营车辆
             }
 
@@ -125,7 +161,7 @@ public class NoCarInterServiceImpl implements NoCarInterService {
             log.info("[-NoCarInterServiceImpl.customerCarRec-] result is "
                     + rs.toString() + ", request is " + data + " ,costtime="
                     + (costtimeend - costtimestart));
-            if(null != rs && rs.getCode() == 0){
+            if (null != rs && rs.getCode() == 0) {
                 result.setData(1);
                 result.setCode(200);
                 result.setMsg(rs.getData().toString());
@@ -143,17 +179,16 @@ public class NoCarInterServiceImpl implements NoCarInterService {
         return result;
     }
 
-
-
     /**
      * 无车 车辆备案查询接口
+     *
      * @param appKey
      * @param api
      * @param data
      * @return
      */
     @Override
-    public DataResult customeRecUpperQuery(String appKey, String api, String data,String requestid) {
+    public DataResult customeRecUpperQuery(String appKey, String api, String data, String requestid) {
 
         long costtimestart = System.currentTimeMillis();
 
@@ -165,17 +200,17 @@ public class NoCarInterServiceImpl implements NoCarInterService {
         result.setMsg("无法认证");
 
         try {
-            log.info("[-NoCarInterServiceImpl.customeRecUpperQuery-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
+            log.info("[-NoCarInterServiceImpl.customeRecUpperQuery-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
             JSONObject jsonObject = JSONObject.parseObject(data);
-            String waybillSource =  jsonObject.getString("waybillSource");//备案来源 选输
-            String plateNumber =  jsonObject.getString("plateNumber");//plateNumber 必输
-            String plateColor =  jsonObject.getString("plateColor");//plateColor 必输
-            if(StringUtils.isEmpty(data)|| null == jsonObject || StringUtils.isEmpty(plateNumber)
+            String waybillSource = jsonObject.getString("waybillSource");//备案来源 选输
+            String plateNumber = jsonObject.getString("plateNumber");//plateNumber 必输
+            String plateColor = jsonObject.getString("plateColor");//plateColor 必输
+            if (StringUtils.isEmpty(data) || null == jsonObject || StringUtils.isEmpty(plateNumber)
                     || StringUtils.isEmpty(plateColor)
 
-            ){
+            ) {
                 result.setMsg("必传参数有空值");
-                return  result;
+                return result;
             }
 
 
@@ -193,14 +228,14 @@ public class NoCarInterServiceImpl implements NoCarInterService {
             log.info("[-NoCarInterServiceImpl.customeRecUpperQuery-] result is "
                     + rs.toString() + ", request is " + data + " ,costtime="
                     + (costtimeend - costtimestart));
-            if(null != rs && rs.getCode() == 0){
+            if (null != rs && rs.getCode() == 0) {
                 result.setData(1);
                 result.setCode(200);
                 result.setMsg(rs.getData().toString());
                 JSONObject jb = JSONObject.parseObject(rs.getData().toString());
                 result.setData(1);
                 result.setMsg("车辆已备案");
-                if(null == jb.getJSONArray(RESULT) || jb.getJSONArray(RESULT).size() == 0){
+                if (null == jb.getJSONArray(RESULT) || jb.getJSONArray(RESULT).size() == 0) {
                     result.setData(2);
                     result.setMsg("车辆未备案");
                 }
@@ -218,19 +253,16 @@ public class NoCarInterServiceImpl implements NoCarInterService {
         return result;
     }
 
-
-
-
-
     /**
      * 无车 实时运单开始指令接口
+     *
      * @param appKey
      * @param api
      * @param data
      * @return
      */
     @Override
-    public DataResult noCarBillStart(String appKey, String api, String data,String requestid) {
+    public DataResult noCarBillStart(String appKey, String api, String data, String requestid) {
         long costtimestart = System.currentTimeMillis();
         DataResult result = new DataResult();
         result.setData(3);
@@ -238,19 +270,19 @@ public class NoCarInterServiceImpl implements NoCarInterService {
         result.setRequestid(requestid);
         result.setMsg("无法认证");
         try {
-            log.info("[-NoCarInterServiceImpl.noCarBillStart-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
+            log.info("[-NoCarInterServiceImpl.noCarBillStart-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
             JSONObject jsonObject = JSONObject.parseObject(data);
-            String num =  jsonObject.getString("num");//运单编号 必选
-            String plateNumber =  jsonObject.getString("plateNumber");//车牌号 必选
-            String plateColor =  jsonObject.getString("plateColor");//车牌颜色 必选
-            String startTime =  jsonObject.getString("startTime");//运单开始时间 必选
-            String sourceAddr =  jsonObject.getString("sourceAddr");//运单开始地址 必选
-            String destAddr =  jsonObject.getString("destAddr");//运单目的地址 必选
-            String predictEndTime =  jsonObject.getString("predictEndTime");//运单预计完成时间 必选
-            Integer fee =  jsonObject.getInteger("fee");//运单费用 必选
-            Integer titleType =  jsonObject.getInteger("titleType");//发票抬头类型 必选
-            String taxplayerCode =  jsonObject.getString("taxplayerCode");//税号 必选
-            if(StringUtils.isEmpty(data)|| null == jsonObject
+            String num = jsonObject.getString("num");//运单编号 必选
+            String plateNumber = jsonObject.getString("plateNumber");//车牌号 必选
+            String plateColor = jsonObject.getString("plateColor");//车牌颜色 必选
+            String startTime = jsonObject.getString("startTime");//运单开始时间 必选
+            String sourceAddr = jsonObject.getString("sourceAddr");//运单开始地址 必选
+            String destAddr = jsonObject.getString("destAddr");//运单目的地址 必选
+            String predictEndTime = jsonObject.getString("predictEndTime");//运单预计完成时间 必选
+            Integer fee = jsonObject.getInteger("fee");//运单费用 必选
+            Integer titleType = jsonObject.getInteger("titleType");//发票抬头类型 必选
+            String taxplayerCode = jsonObject.getString("taxplayerCode");//税号 必选
+            if (StringUtils.isEmpty(data) || null == jsonObject
                     || StringUtils.isEmpty(num)
                     || StringUtils.isEmpty(plateNumber)
                     || StringUtils.isEmpty(plateColor)
@@ -262,24 +294,24 @@ public class NoCarInterServiceImpl implements NoCarInterService {
                     || null == titleType
                     || StringUtils.isEmpty(taxplayerCode)
 
-            ){
+            ) {
                 result.setMsg("必传参数有空值");
-                return  result;
+                return result;
             }
-            if(!DateUtil.isValidDate(startTime)){
+            if (!DateUtil.isValidDate(startTime)) {
                 result.setMsg("日期格式有误");
-                return  result;
+                return result;
             }
-            if(!DateUtil.isValidDate(predictEndTime)){
+            if (!DateUtil.isValidDate(predictEndTime)) {
                 result.setMsg("日期格式有误");
-                return  result;
+                return result;
             }
             CustomerRec customerRec = new CustomerRec();
             customerRec.setCustomerName(appKey);
             customerRec.setCompanyReferencenum(taxplayerCode);
             customerRec = customerRecMapper.selectByCustomerNameAndCompanyReference(customerRec);
-            if(customerRec == null || customerRec.getRecStatus()!=1){
-                result.setMsg("客户:"+appKey+";税号"+taxplayerCode+"未在平台备案成功,请先做备案");
+            if (customerRec == null || customerRec.getRecStatus() != 1) {
+                result.setMsg("客户:" + appKey + ";税号" + taxplayerCode + "未在平台备案成功,请先做备案");
                 return result;
             }
             NoCarWayBill noCarWayBill = new NoCarWayBill();
@@ -320,14 +352,14 @@ public class NoCarInterServiceImpl implements NoCarInterService {
     private DataResult getDataResult(String data, long costtimestart, DataResult result, NoCarWayBill noCarWayBill, List<CustomerCarRec> customerCarRecs, CustomerCarRec customerCarRec) {
         //先查询上游是否已经备案
         RespR<VehicleQueryResponse> respRquery = noCarService.customerCarRecQueryUpper(customerCarRec);
-        if(respRquery.getCode() == 1 || respRquery.getData() == null || respRquery.getData().getResult() == null || respRquery.getData().getResult().size()<=0){
+        if (respRquery.getCode() == 1 || respRquery.getData() == null || respRquery.getData().getResult() == null || respRquery.getData().getResult().size() <= 0) {
             customerCarRecs.add(customerCarRec);
             RespR respR = noCarService.customerCarRec(customerCarRecs);
-            if(respR.getCode() ==1){
+            if (respR.getCode() == 1) {
                 noCarWayBill.setFailReason(respR.getMsg());
                 noCarWayBill.setBillwayStatus(-2);
                 insertOrUpdateBillStart(noCarWayBill);
-                result.setMsg("车牌号备案失败,失败原因:"+respR.getMsg());
+                result.setMsg("车牌号备案失败,失败原因:" + respR.getMsg());
                 return result;
             }
         }
@@ -336,7 +368,7 @@ public class NoCarInterServiceImpl implements NoCarInterService {
         log.info("[-NoCarInterServiceImpl.noCarBillStart-] result is "
                 + rs.toString() + ", request is " + data + " ,costtime="
                 + (costtimeend - costtimestart));
-        if(null != rs && rs.getCode() == 0){
+        if (null != rs && rs.getCode() == 0) {
             result.setData(1);
             result.setCode(200);
             result.setMsg(rs.getData().toString());
@@ -349,16 +381,16 @@ public class NoCarInterServiceImpl implements NoCarInterService {
         }
     }
 
-
     /**
      * 无车 实时运单结束指令接口
+     *
      * @param appKey
      * @param api
      * @param data
      * @return
      */
     @Override
-    public DataResult noCarBillEnd(String appKey, String api, String data,String requestid) {
+    public DataResult noCarBillEnd(String appKey, String api, String data, String requestid) {
 
         long costtimestart = System.currentTimeMillis();
 
@@ -370,23 +402,23 @@ public class NoCarInterServiceImpl implements NoCarInterService {
         result.setMsg("无法认证");
 
         try {
-            log.info("[-NoCarInterServiceImpl.noCarBillEnd-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
+            log.info("[-NoCarInterServiceImpl.noCarBillEnd-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
             JSONObject jsonObject = JSONObject.parseObject(data);
-            String num =  jsonObject.getString("num");//运单号 必输
-            String realDestAddr =  jsonObject.getString("realDestAddr");//运单实际目的地址 必输
-            String endTime =  jsonObject.getString("endTime");//运单实际结束时间 必输
-            if(StringUtils.isEmpty(data)|| null == jsonObject || StringUtils.isEmpty(num)
+            String num = jsonObject.getString("num");//运单号 必输
+            String realDestAddr = jsonObject.getString("realDestAddr");//运单实际目的地址 必输
+            String endTime = jsonObject.getString("endTime");//运单实际结束时间 必输
+            if (StringUtils.isEmpty(data) || null == jsonObject || StringUtils.isEmpty(num)
                     || StringUtils.isEmpty(realDestAddr)
                     || StringUtils.isEmpty(endTime)
 
-            ){
+            ) {
                 result.setMsg("必传参数有空值");
-                return  result;
+                return result;
             }
 
-            if(!DateUtil.isValidDate(endTime)){
+            if (!DateUtil.isValidDate(endTime)) {
                 result.setMsg("日期格式有误");
-                return  result;
+                return result;
             }
 
 
@@ -402,7 +434,7 @@ public class NoCarInterServiceImpl implements NoCarInterService {
             log.info("[-NoCarInterServiceImpl.noCarBillEnd-] result is "
                     + rs.toString() + ", request is " + data + " ,costtime="
                     + (costtimeend - costtimestart));
-            if(null != rs && rs.getCode() == 0){
+            if (null != rs && rs.getCode() == 0) {
                 result.setData(1);
                 result.setCode(200);
                 result.setMsg(rs.getData().toString());
@@ -420,18 +452,16 @@ public class NoCarInterServiceImpl implements NoCarInterService {
         return result;
     }
 
-
-
-
     /**
      * 无车 历史运单开始指令接口
+     *
      * @param appKey
      * @param api
      * @param data
      * @return
      */
     @Override
-    public DataResult noCarHisWaybillStart(String appKey, String api, String data,String requestid) {
+    public DataResult noCarHisWaybillStart(String appKey, String api, String data, String requestid) {
         long costtimestart = System.currentTimeMillis();
         DataResult result = new DataResult();
         result.setData(3);
@@ -439,19 +469,19 @@ public class NoCarInterServiceImpl implements NoCarInterService {
         result.setRequestid(requestid);
         result.setMsg("无法认证");
         try {
-            log.info("[-NoCarInterServiceImpl.noCarHisWaybillStart-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data + " ,requestid=" +requestid);
+            log.info("[-NoCarInterServiceImpl.noCarHisWaybillStart-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
             JSONObject jsonObject = JSONObject.parseObject(data);
-            String num =  jsonObject.getString("num");//运单编号 必选
-            String plateNumber =  jsonObject.getString("plateNumber");//车牌号 必选
-            String plateColor =  jsonObject.getString("plateColor");//车牌颜色 必选
-            String startTime =  jsonObject.getString("startTime");//运单开始时间 必选
-            String sourceAddr =  jsonObject.getString("sourceAddr");//运单开始地址 必选
-            String destAddr =  jsonObject.getString("destAddr");//运单目的地址 必选
-            String predictEndTime =  jsonObject.getString("predictEndTime");//运单预计完成时间 必选
-            Integer fee =  jsonObject.getInteger("fee");//运单费用 必选
-            Integer titleType =  jsonObject.getInteger("titleType");//发票抬头类型 必选
-            String taxplayerCode =  jsonObject.getString("taxplayerCode");//税号 必选
-            if(StringUtils.isEmpty(data)|| null == jsonObject
+            String num = jsonObject.getString("num");//运单编号 必选
+            String plateNumber = jsonObject.getString("plateNumber");//车牌号 必选
+            String plateColor = jsonObject.getString("plateColor");//车牌颜色 必选
+            String startTime = jsonObject.getString("startTime");//运单开始时间 必选
+            String sourceAddr = jsonObject.getString("sourceAddr");//运单开始地址 必选
+            String destAddr = jsonObject.getString("destAddr");//运单目的地址 必选
+            String predictEndTime = jsonObject.getString("predictEndTime");//运单预计完成时间 必选
+            Integer fee = jsonObject.getInteger("fee");//运单费用 必选
+            Integer titleType = jsonObject.getInteger("titleType");//发票抬头类型 必选
+            String taxplayerCode = jsonObject.getString("taxplayerCode");//税号 必选
+            if (StringUtils.isEmpty(data) || null == jsonObject
                     || StringUtils.isEmpty(num)
                     || StringUtils.isEmpty(plateNumber)
                     || StringUtils.isEmpty(plateColor)
@@ -462,24 +492,24 @@ public class NoCarInterServiceImpl implements NoCarInterService {
                     || null == fee
                     || null == titleType
                     || StringUtils.isEmpty(taxplayerCode)
-            ){
+            ) {
                 result.setMsg("有空的必填运单要素,请检查");
-                return  result;
+                return result;
             }
-            if(!DateUtil.isValidDate(startTime)){
+            if (!DateUtil.isValidDate(startTime)) {
                 result.setMsg("日期格式有误");
-                return  result;
+                return result;
             }
-            if(!DateUtil.isValidDate(predictEndTime)){
+            if (!DateUtil.isValidDate(predictEndTime)) {
                 result.setMsg("日期格式有误");
-                return  result;
+                return result;
             }
             CustomerRec customerRec = new CustomerRec();
             customerRec.setCustomerName(appKey);
             customerRec.setCompanyReferencenum(taxplayerCode);
             customerRec = customerRecMapper.selectByCustomerNameAndCompanyReference(customerRec);
-            if(customerRec == null){
-                result.setMsg("客户:"+appKey+";税号"+taxplayerCode+"未在平台备案成功,请先做备案");
+            if (customerRec == null) {
+                result.setMsg("客户:" + appKey + ";税号" + taxplayerCode + "未在平台备案成功,请先做备案");
                 return result;
             }
             NoCarWayBill noCarWayBill = new NoCarWayBill();
@@ -512,11 +542,11 @@ public class NoCarInterServiceImpl implements NoCarInterService {
             noCarWayBill.setTitleType(2);
             //先查询上游是否已经备案
             RespR<VehicleQueryResponse> respRquery = noCarService.customerCarRecQueryUpper(customerCarRec);
-            if(respRquery.getCode() == 1 || respRquery.getData() == null || respRquery.getData().getResult() == null || respRquery.getData().getResult().size()<=0){
+            if (respRquery.getCode() == 1 || respRquery.getData() == null || respRquery.getData().getResult() == null || respRquery.getData().getResult().size() <= 0) {
                 customerCarRecs.add(customerCarRec);
                 RespR respR = noCarService.customerCarRec(customerCarRecs);
-                if(respR.getCode() ==1){
-                    result.setMsg("车牌号备案失败,失败原因:"+respR.getMsg());
+                if (respR.getCode() == 1) {
+                    result.setMsg("车牌号备案失败,失败原因:" + respR.getMsg());
                     noCarWayBill.setFailReason(respR.getMsg());
                     noCarWayBill.setBillwayStatus(-2);
                     insertOrUpdateBillStart(noCarWayBill);
@@ -528,7 +558,7 @@ public class NoCarInterServiceImpl implements NoCarInterService {
             log.info("[-NoCarInterServiceImpl.noCarHisWaybillStart-] result is "
                     + rs.toString() + ", request is " + data + " ,costtime="
                     + (costtimeend - costtimestart));
-            if(null != rs && rs.getCode() == 0){
+            if (null != rs && rs.getCode() == 0) {
                 result.setData(1);
                 result.setCode(200);
                 result.setMsg(rs.getData().toString());
@@ -547,30 +577,29 @@ public class NoCarInterServiceImpl implements NoCarInterService {
     }
 
     //插入或者更新运单
-    public void insertOrUpdateBillStart(NoCarWayBill noCarWayBill){
+    public void insertOrUpdateBillStart(NoCarWayBill noCarWayBill) {
         noCarWayBill.setIntfaceStartTime(DateUtil.getCurrentDateStr());
         noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
         NoCarWayBill curr = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
-        if(null == curr){
+        if (null == curr) {
             noCarWaybillMapper.insert(noCarWayBill);
-        }else{
-            if(curr.getBillwayStatus()<1){
+        } else {
+            if (curr.getBillwayStatus() < 1) {
                 noCarWaybillMapper.updateByBillNum(noCarWayBill);
             }
         }
     }
 
-
-
     /**
      * 无车 历史运单结束指令接口
+     *
      * @param appKey
      * @param api
      * @param data
      * @return
      */
     @Override
-    public DataResult noCarHisWaybillEnd(String appKey, String api, String data,String requestid) {
+    public DataResult noCarHisWaybillEnd(String appKey, String api, String data, String requestid) {
 
         long costtimestart = System.currentTimeMillis();
 
@@ -582,25 +611,24 @@ public class NoCarInterServiceImpl implements NoCarInterService {
         result.setMsg("无法认证");
 
         try {
-            log.info("[-NoCarInterServiceImpl.noCarHisWaybillEnd-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
+            log.info("[-NoCarInterServiceImpl.noCarHisWaybillEnd-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
             JSONObject jsonObject = JSONObject.parseObject(data);
-            String num =  jsonObject.getString("num");//运单号 必输
-            String realDestAddr =  jsonObject.getString("realDestAddr");//运单实际目的地址 必输
-            String endTime =  jsonObject.getString("endTime");//运单实际结束时间 必输
-            if(StringUtils.isEmpty(data)|| null == jsonObject || StringUtils.isEmpty(num)
+            String num = jsonObject.getString("num");//运单号 必输
+            String realDestAddr = jsonObject.getString("realDestAddr");//运单实际目的地址 必输
+            String endTime = jsonObject.getString("endTime");//运单实际结束时间 必输
+            if (StringUtils.isEmpty(data) || null == jsonObject || StringUtils.isEmpty(num)
                     || StringUtils.isEmpty(realDestAddr)
                     || StringUtils.isEmpty(endTime)
 
-            ){
+            ) {
                 result.setMsg("有空的必填运单要素,请检查");
-                return  result;
+                return result;
             }
 
 
-
-            if(!DateUtil.isValidDate(endTime)){
+            if (!DateUtil.isValidDate(endTime)) {
                 result.setMsg("日期格式有误");
-                return  result;
+                return result;
             }
 
 
@@ -616,7 +644,7 @@ public class NoCarInterServiceImpl implements NoCarInterService {
             log.info("[-NoCarInterServiceImpl.noCarHisWaybillEnd-] result is "
                     + rs.toString() + ", request is " + data + " ,costtime="
                     + (costtimeend - costtimestart));
-            if(null != rs && rs.getCode() == 0){
+            if (null != rs && rs.getCode() == 0) {
                 result.setData(1);
                 result.setCode(200);
                 result.setMsg(rs.getData().toString());
@@ -634,18 +662,16 @@ public class NoCarInterServiceImpl implements NoCarInterService {
         return result;
     }
 
-
-
-
     /**
      * 无车 运单号查询发票数据
+     *
      * @param appKey
      * @param api
      * @param data
      * @return
      */
     @Override
-    public DataResult noCarVoiceQuery(String appKey, String api, String data,String requestid) {
+    public DataResult noCarVoiceQuery(String appKey, String api, String data, String requestid) {
 
         long costtimestart = System.currentTimeMillis();
 
@@ -657,48 +683,48 @@ public class NoCarInterServiceImpl implements NoCarInterService {
         result.setMsg("无法认证");
 
         try {
-            log.info("[-NoCarInterServiceImpl.noCarVoiceQuery-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
+            log.info("[-NoCarInterServiceImpl.noCarVoiceQuery-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
             JSONObject jsonObject = JSONObject.parseObject(data);
-            String num =  jsonObject.getString("num");//运单号 必输
-            if(StringUtils.isEmpty(data)|| null == jsonObject || StringUtils.isEmpty(num)
+            String num = jsonObject.getString("num");//运单号 必输
+            if (StringUtils.isEmpty(data) || null == jsonObject || StringUtils.isEmpty(num)
 
-            ){
+            ) {
                 result.setMsg("有空的必填运单要素,请检查");
-                return  result;
+                return result;
             }
 
-            NoCarWayBill noCarWayBill1 =null ;
+            NoCarWayBill noCarWayBill1 = null;
             try {
                 noCarWayBill1 = noCarWaybillMapper.selectByBillNum(num);
-            }catch (Exception e){
-                log.info("xuyaoshanchuyundan:"+num);
+            } catch (Exception e) {
+                log.info("xuyaoshanchuyundan:" + num);
                 result.setMsg("平台运单号存在多条,请联系管理员删除无效运单");
                 return result;
             }
-            if (null == noCarWayBill1){
-               noCarWayBill1 = new NoCarWayBill();
-               noCarWayBill1.setBillNum(num);
-               noCarWayBill1.setInterType(0);
-               noCarWayBill1.setBillwayStatus(-5);
+            if (null == noCarWayBill1) {
+                noCarWayBill1 = new NoCarWayBill();
+                noCarWayBill1.setBillNum(num);
+                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 (noCarWayBill1.getInterType() == REC_STATUS_WAIT || (noCarWayBill1.getBillwayStatus() < REC_STATUS_UN && noCarWayBill1.getFailReason() != null && noCarWayBill1.getFailReason().contains(XY_WAYBILL_HISTORY_END))) {
                 noCarWayBill1.setBillwayStatus(-5);
             }
             noCarWayBill1.setCustomerName(appKey);
             noCarWayBill1.setCompanyName(noCarWayBill1.getCompanyName());
-            RespR rs = noCarService.getInvoiceByWayBillNumReal(noCarWayBill1,true);
+            RespR rs = noCarService.getInvoiceByWayBillNumReal(noCarWayBill1, true);
             long costtimeend = System.currentTimeMillis();
             log.info("[-NoCarInterServiceImpl.noCarVoiceQuery-] result is "
                     + rs.toString() + ", request is " + data + " ,costtime="
                     + (costtimeend - costtimestart));
-            if(null != rs && rs.getCode() == 0){
+            if (null != rs && rs.getCode() == 0) {
                 result.setData(1);
                 result.setCode(200);
                 result.setMsg(rs.getData().toString());
                 return result;
             } else {
                 result.setData(3);
-                if(NOT_FOUND.equals(rs.getMsg())){
+                if (NOT_FOUND.equals(rs.getMsg())) {
                     result.setData(2);
                 }
                 result.setCode(200);
@@ -712,21 +738,16 @@ public class NoCarInterServiceImpl implements NoCarInterService {
         return result;
     }
 
-
-
-
-
-
-
     /**
      * 无车  获取未查询过发票的运单编号
+     *
      * @param appKey
      * @param api
      * @param data
      * @return
      */
     @Override
-    public DataResult noCarNoVoiceQuery(String appKey, String api, String data,String requestid) {
+    public DataResult noCarNoVoiceQuery(String appKey, String api, String data, String requestid) {
 
         long costtimestart = System.currentTimeMillis();
 
@@ -738,11 +759,11 @@ public class NoCarInterServiceImpl implements NoCarInterService {
         result.setMsg("无法认证");
 
         try {
-            log.info("[-NoCarInterServiceImpl.noCarNoVoiceQuery-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
+            log.info("[-NoCarInterServiceImpl.noCarNoVoiceQuery-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
 
-            String param = paramService.getParamsByParamName("FIND_NO_SEARCH_NUM_ON_OFF").getParamValue();;
+            String param = paramService.getParamsByParamName("FIND_NO_SEARCH_NUM_ON_OFF").getParamValue();
 
-            if(!StringUtils.equals(ONE,param)){
+            if (!StringUtils.equals(ONE, param)) {
                 result.setMsg("获取未查询过发票的运单编号接口已关闭");
                 return result;
             }
@@ -751,14 +772,14 @@ public class NoCarInterServiceImpl implements NoCarInterService {
             List<NoCarWayBill> noCarWayBills = noCarWaybillMapper.getNoCarNoVoiceQuery(appKey);
             List<String> list1 = new ArrayList<String>();
 
-            for (NoCarWayBill noCarWayBill:noCarWayBills
-                 ) {
+            for (NoCarWayBill noCarWayBill : noCarWayBills
+            ) {
                 list1.add(noCarWayBill.getBillNum());
 
             }
-            List<BillInvoice>  billInvoices =  billInvoiceMapper.selectNoCarNoVoiceQuery(appKey);
+            List<BillInvoice> billInvoices = billInvoiceMapper.selectNoCarNoVoiceQuery(appKey);
             List<String> list2 = new ArrayList<String>();
-            for (BillInvoice billInvoice:billInvoices
+            for (BillInvoice billInvoice : billInvoices
             ) {
                 list2.add(billInvoice.getWaybillNum());
 
@@ -770,7 +791,7 @@ public class NoCarInterServiceImpl implements NoCarInterService {
             log.info("[-NoCarInterServiceImpl.noCarNoVoiceQuery-] result is "
                     + reduce1.toString() + ", request is " + data + " ,costtime="
                     + (costtimeend - costtimestart));
-            if(null != reduce1 && reduce1.size() > 0){
+            if (null != reduce1 && reduce1.size() > 0) {
                 result.setData(1);
                 result.setCode(200);
                 result.setMsg(JSONArray.fromObject(reduce1).toString());
@@ -788,19 +809,16 @@ public class NoCarInterServiceImpl implements NoCarInterService {
         return result;
     }
 
-
-
-
-
     /**
      * 无车  账户余额查询接口
+     *
      * @param appKey
      * @param api
      * @param data
      * @return
      */
     @Override
-    public DataResult balanceQuery(String appKey, String api, String data,String requestid) {
+    public DataResult balanceQuery(String appKey, String api, String data, String requestid) {
 
         long costtimestart = System.currentTimeMillis();
 
@@ -812,23 +830,22 @@ public class NoCarInterServiceImpl implements NoCarInterService {
         result.setMsg("无法认证");
 
         try {
-            log.info("[-NoCarInterServiceImpl.balanceQuery-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
+            log.info("[-NoCarInterServiceImpl.balanceQuery-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
 
 
             Customer customer = customerMapper.selectByCustomerName(appKey);
 
 
-
             long costtimeend = System.currentTimeMillis();
             log.info("[-NoCarInterServiceImpl.balanceQuery-] result is "
                     + customer.toString() + ", request is " + data + " ,costtime="
                     + (costtimeend - costtimestart));
-            if(null != customer){
+            if (null != customer) {
                 result.setData(1);
                 result.setCode(200);
                 JSONObject jb = new JSONObject();
-                jb.put("balance",customer.getAccountBalance());
-                jb.put("lastDeductionTime",customer.getInvoiceTime());
+                jb.put("balance", customer.getAccountBalance());
+                jb.put("lastDeductionTime", customer.getInvoiceTime());
                 result.setMsg(jb.toString());
                 return result;
             } else {
@@ -844,18 +861,16 @@ public class NoCarInterServiceImpl implements NoCarInterService {
         return result;
     }
 
-
-
-
     /**
      * 无车  红冲发票查询接口
+     *
      * @param appKey
      * @param api
      * @param data
      * @return
      */
     @Override
-    public DataResult redInkInvoiceQuery(String appKey, String api, String data,String requestid) {
+    public DataResult redInkInvoiceQuery(String appKey, String api, String data, String requestid) {
         long costtimestart = System.currentTimeMillis();
 
         DataResult result = new DataResult();
@@ -866,24 +881,24 @@ public class NoCarInterServiceImpl implements NoCarInterService {
         result.setMsg("无法认证");
 
         try {
-            log.info("[-NoCarInterServiceImpl.redInkInvoiceQuery-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
+            log.info("[-NoCarInterServiceImpl.redInkInvoiceQuery-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
             JSONObject jsonObject = JSONObject.parseObject(data);
-            String taxplayerCode =  jsonObject.getString("taxplayerCode");//企业税号 必输
+            String taxplayerCode = jsonObject.getString("taxplayerCode");//企业税号 必输
             String month = jsonObject.getString("month");//开票月份 样例:yyyy-MM   必输
             Long pageNo = jsonObject.getLong("pageNo");//查询第几页  示例1,2,3,4…
             Long pageSize = jsonObject.getLong("pageSize");//查询第几页  示例1,2,3,4… 没有就默认1000
 
-            if(StringUtils.isEmpty(data)|| null == jsonObject){
-                return  result;
+            if (StringUtils.isEmpty(data) || null == jsonObject) {
+                return result;
             }
-            if(StringUtils.isEmpty(taxplayerCode) || StringUtils.isEmpty(month) || null == pageNo ||pageNo<1){
-                return  result;
+            if (StringUtils.isEmpty(taxplayerCode) || StringUtils.isEmpty(month) || null == pageNo || pageNo < 1) {
+                return result;
             }
 
 
-            if (null == DateUtil.parseDate(month)){
+            if (null == DateUtil.parseDate(month)) {
                 result.setMsg("日期格式不正确!");
-                return  result;
+                return result;
             }
             HCInvoiceQueryVo hcInvoiceQueryVo = new HCInvoiceQueryVo();
             hcInvoiceQueryVo.setBuyerTaxpayerCode(taxplayerCode);
@@ -895,7 +910,7 @@ public class NoCarInterServiceImpl implements NoCarInterService {
             log.info("[-NoCarInterServiceImpl.redInkInvoiceQuery-] result is "
                     + rs.toString() + ", request is " + data + " ,costtime="
                     + (costtimeend - costtimestart));
-            if(null != rs && rs.getCode() == 0){
+            if (null != rs && rs.getCode() == 0) {
                 result.setData(1);
                 result.setCode(200);
                 result.setMsg(JSON.toJSONString(rs.getData()));
@@ -914,61 +929,16 @@ public class NoCarInterServiceImpl implements NoCarInterService {
         return result;
     }
 
-
-    public static void main(String[] args) {
-            List<String> list1 = new ArrayList<String>();
-            list1.add("1");
-            list1.add("2");
-            list1.add("3");
-            list1.add("5");
-            list1.add("6");
-
-            List<String> list2 = new ArrayList<String>();
-            list2.add("2");
-            list2.add("3");
-            list2.add("7");
-            list2.add("8");
-
-            // 交集
-            List<String> intersection = list1.stream().filter(item -> list2.contains(item)).collect(toList());
-            System.out.println("---交集 intersection---");
-            intersection.parallelStream().forEach(System.out :: println);
-
-            // 差集 (list1 - list2)
-            List<String> reduce1 = list1.stream().filter(item -> !list2.contains(item)).collect(toList());
-            System.out.println("---差集 reduce1 (list1 - list2)---");
-            reduce1.parallelStream().forEach(System.out :: println);    // 并集
-            List<String> listAll = list1.parallelStream().collect(toList());
-            List<String> listAll2 = list2.parallelStream().collect(toList());
-            listAll.addAll(listAll2);
-            System.out.println("---并集 listAll---");
-            listAll.parallelStream().forEachOrdered(System.out :: println);
-
-            // 去重并集
-            List<String> listAllDistinct = listAll.stream().distinct().collect(toList());
-            System.out.println("---得到去重并集 listAllDistinct---");
-            listAllDistinct.parallelStream().forEachOrdered(System.out :: println);
-
-            System.out.println("---原来的List1---");
-            list1.parallelStream().forEachOrdered(System.out :: println);
-            System.out.println("---原来的List2---");
-            list2.parallelStream().forEachOrdered(System.out :: println);
-
-    }
-
-
-
-
-
     /**
      * 无车 运单号查询发票数据
+     *
      * @param appKey
      * @param api
      * @param data
      * @return
      */
     @Override
-    public DataResult noCarVoiceOwnerQuery(String appKey, String api, String data,String requestid) {
+    public DataResult noCarVoiceOwnerQuery(String appKey, String api, String data, String requestid) {
 
         long costtimestart = System.currentTimeMillis();
 
@@ -980,43 +950,43 @@ public class NoCarInterServiceImpl implements NoCarInterService {
         result.setMsg("无法认证");
 
         try {
-            log.info("[-NoCarInterServiceImpl.noCarVoiceOwnerQuery-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
+            log.info("[-NoCarInterServiceImpl.noCarVoiceOwnerQuery-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
             JSONObject jsonObject = JSONObject.parseObject(data);
-            String num =  jsonObject.getString("num");//运单号 必输
-            if(StringUtils.isEmpty(data)|| null == jsonObject || StringUtils.isEmpty(num)
+            String num = jsonObject.getString("num");//运单号 必输
+            if (StringUtils.isEmpty(data) || null == jsonObject || StringUtils.isEmpty(num)
 
-            ){
+            ) {
                 result.setMsg("有空的必填运单要素,请检查");
-                return  result;
+                return result;
             }
 
-            NoCarWayBill noCarWayBill1 =null ;
+            NoCarWayBill noCarWayBill1 = null;
             try {
                 noCarWayBill1 = noCarWaybillMapper.selectByBillNum(num);
-            }catch (Exception e){
-                log.info("xuyaoshanchuyundannoCarVoiceOwnerQuery:"+num);
+            } catch (Exception e) {
+                log.info("xuyaoshanchuyundannoCarVoiceOwnerQuery:" + num);
                 result.setMsg("平台运单号存在多条,请联系管理员删除无效运单");
                 return result;
             }
-            if (null == noCarWayBill1){
+            if (null == noCarWayBill1) {
                 noCarWayBill1 = new NoCarWayBill();
                 noCarWayBill1.setBillNum(num);
             }
             noCarWayBill1.setInterType(3);
 
-            RespR rs = noCarService.getInvoiceByWayBillOwnerNumReal(noCarWayBill1,false);
+            RespR rs = noCarService.getInvoiceByWayBillOwnerNumReal(noCarWayBill1, false);
             long costtimeend = System.currentTimeMillis();
             log.info("[-NoCarInterServiceImpl.noCarVoiceOwnerQuery-] result is "
                     + rs.toString() + ", request is " + data + " ,costtime="
                     + (costtimeend - costtimestart));
-            if(null != rs && rs.getCode() == 0){
+            if (null != rs && rs.getCode() == 0) {
                 result.setData(1);
                 result.setCode(200);
                 result.setMsg(rs.getData().toString());
                 return result;
             } else {
                 result.setData(3);
-                if(NOT_FOUND.equals(rs.getMsg())){
+                if (NOT_FOUND.equals(rs.getMsg())) {
                     result.setData(2);
                 }
                 result.setCode(200);

+ 192 - 205
src/main/java/com/jkcredit/invoice/credit/interserver/SelfCarInterServiceImpl.java

@@ -38,6 +38,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
 
     /**
      * 自有车 用户卡列表查询接口
+     *
      * @param appKey
      * @param api
      * @param data
@@ -56,24 +57,24 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
         result.setMsg("无法认证");
 
         try {
-        log.info("[-SelfCarInterServiceImpl.customerETCQuery-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
-        JSONObject jsonObject = JSONObject.parseObject(data);
-        String companyNum =  jsonObject.getString("companyNum");//企业编号 必输
-        String cardId = jsonObject.getString("cardId");//卡号  非必输
-        String plateNum = jsonObject.getString("plateNum");//车牌号 非必输
-        Integer plateColor = jsonObject.getInteger("plateColor");//车牌颜色 非必输
-        if(StringUtils.isEmpty(data)|| null == jsonObject || StringUtils.isEmpty(companyNum)){
-            result.setData(3);
-            result.setMsg("请输入必输项!");
-            return  result;
-        }
+            log.info("[-SelfCarInterServiceImpl.customerETCQuery-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
+            JSONObject jsonObject = JSONObject.parseObject(data);
+            String companyNum = jsonObject.getString("companyNum");//企业编号 必输
+            String cardId = jsonObject.getString("cardId");//卡号  非必输
+            String plateNum = jsonObject.getString("plateNum");//车牌号 非必输
+            Integer plateColor = jsonObject.getInteger("plateColor");//车牌颜色 非必输
+            if (StringUtils.isEmpty(data) || null == jsonObject || StringUtils.isEmpty(companyNum)) {
+                result.setData(3);
+                result.setMsg("请输入必输项!");
+                return result;
+            }
 
-        CustomerRec customerRec = new CustomerRec();
-        customerRec.setCustomerName(appKey);
-        customerRec.setCompanyNum(companyNum);
-        customerRec.setInterType(0);
-        CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyNum(customerRec);
-            if (null == customerRec1){
+            CustomerRec customerRec = new CustomerRec();
+            customerRec.setCustomerName(appKey);
+            customerRec.setCompanyNum(companyNum);
+            customerRec.setInterType(0);
+            CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyNum(customerRec);
+            if (null == customerRec1) {
                 result.setCode(200);
                 result.setMsg("该企业编号在平台中不存在,请联系管理员核实!");
                 return result;
@@ -85,49 +86,47 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
             etcQueryVo.setPlateNum(plateNum);//车牌号 非必输
             etcQueryVo.setCardId(cardId);//卡号 非必输
             etcQueryVo.setPlateColor(plateColor);//车牌颜色 非必输
-        RespR rs = selfCarService.getEtcInfo(etcQueryVo);
-        long costtimeend = System.currentTimeMillis();
-        log.info("[-SelfCarInterServiceImpl.customerETCQuery-] result is "
+            RespR rs = selfCarService.getEtcInfo(etcQueryVo);
+            long costtimeend = System.currentTimeMillis();
+            log.info("[-SelfCarInterServiceImpl.customerETCQuery-] result is "
                     + rs.toString() + ", request is " + data + " ,costtime="
                     + (costtimeend - costtimestart));
-        if(null != rs && rs.getCode() == 0){
-           result.setData(1);
-           result.setCode(200);
-
-           result.setMsg(rs.getData().toString());
-           return result;
-        } else {
-            if(rs!=null && rs.getCode() == TWO_NUM){
-                result.setData(2);
+            if (null != rs && rs.getCode() == 0) {
+                result.setData(1);
+                result.setCode(200);
+
+                result.setMsg(rs.getData().toString());
+                return result;
+            } else {
+                if (rs != null && rs.getCode() == TWO_NUM) {
+                    result.setData(2);
+                    result.setCode(200);
+                    result.setMsg("未查得");
+                    return result;
+                }
+                result.setData(3);
                 result.setCode(200);
-                result.setMsg("未查得");
+                result.setMsg(rs.getMsg());
                 return result;
             }
-            result.setData(3);
-            result.setCode(200);
-            result.setMsg(rs.getMsg());
-            return result;
-        }
         } catch (Exception e) {
             log.error("[-SelfCarInterServiceImpl.customerETCQuery-] get httpclient exception is "
-                            + e + ", request is " + data);
+                    + e + ", request is " + data);
         }
         return result;
     }
 
 
-
-
-
     /**
      * 自有车 卡信息查询接口
+     *
      * @param appKey
      * @param api
      * @param data
      * @return
      */
     @Override
-    public DataResult customerQueryEtcInfo(String appKey, String api, String data,String requestid) {
+    public DataResult customerQueryEtcInfo(String appKey, String api, String data, String requestid) {
 
         long costtimestart = System.currentTimeMillis();
 
@@ -139,16 +138,16 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
         result.setMsg("无法认证");
 
         try {
-            log.info("[-SelfCarInterServiceImpl.customerQueryEtcInfo-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
+            log.info("[-SelfCarInterServiceImpl.customerQueryEtcInfo-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
             JSONObject jsonObject = JSONObject.parseObject(data);
-            String companyNum =  jsonObject.getString("companyNum");//企业编号 必输
+            String companyNum = jsonObject.getString("companyNum");//企业编号 必输
             JSONArray vehicleList = jsonObject.getJSONArray("vehicleList");//车牌的json字符串 必输
-            if(StringUtils.isEmpty(data)|| null == jsonObject || StringUtils.isEmpty(companyNum)
+            if (StringUtils.isEmpty(data) || null == jsonObject || StringUtils.isEmpty(companyNum)
                     || null == vehicleList
-                     ){
+            ) {
                 result.setCode(200);
                 result.setMsg("必传参数有为空情况,请核实后再试");
-                return  result;
+                return result;
             }
 
             CustomerRec customerRec = new CustomerRec();
@@ -156,7 +155,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
             customerRec.setCompanyNum(companyNum);
             CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyNum(customerRec);
 
-            if (null == customerRec1){
+            if (null == customerRec1) {
                 result.setMsg("该企业编号在平台中不存在,请联系管理员核实!");
                 return result;
             }
@@ -166,15 +165,15 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
             etcQueryVo.setCompanyName(customerRec1.getCompanyName());//企业名称
 
             List<CarVo> cards = new ArrayList<CarVo>();
-            for(int i=0;i<vehicleList.size();i++) {
+            for (int i = 0; i < vehicleList.size(); i++) {
                 JSONObject jb = vehicleList.getJSONObject(i);
                 String plateNum = jb.getString("plateNum");//车牌号
                 Integer plateColor = jb.getInteger("plateColor");//车牌颜色
-                if(null == jb || StringUtils.isEmpty(plateNum)
+                if (null == jb || StringUtils.isEmpty(plateNum)
                         || null == plateColor
-                ){
+                ) {
                     result.setMsg("参数格式错误");
-                    return  result;
+                    return result;
                 }
 
                 CarVo carVo = new CarVo();
@@ -189,7 +188,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
             log.info("[-SelfCarInterServiceImpl.customerQueryEtcInfo-] result is "
                     + rs.toString() + ", request is " + data + " ,costtime="
                     + (costtimeend - costtimestart));
-            if(null != rs && rs.getCode() == 0){
+            if (null != rs && rs.getCode() == 0) {
                 result.setData(1);
                 result.setCode(200);
                 result.setMsg(rs.getData().toString());
@@ -198,7 +197,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
                 result.setData(3);
                 result.setCode(200);
                 result.setMsg(rs.getMsg());
-                if(NOT_FOUND . equals(rs.getMsg())){
+                if (NOT_FOUND.equals(rs.getMsg())) {
                     result.setData(2);
                 }
                 return result;
@@ -211,11 +210,9 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
     }
 
 
-
-
-
     /**
      * 自有车下发短信通知接口
+     *
      * @param appKey
      * @param api
      * @param data
@@ -234,26 +231,26 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
         result.setMsg("无法认证");
 
         try {
-            log.info("[-SelfCarInterServiceImpl.customerETCRec-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
+            log.info("[-SelfCarInterServiceImpl.customerETCRec-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
             JSONObject jsonObject = JSONObject.parseObject(data);
-            String companyNum =  jsonObject.getString("companyNum");//企业编号 必输
-            String mobile =  jsonObject.getString("mobile");//企业预留手机号 必输
+            String companyNum = jsonObject.getString("companyNum");//企业编号 必输
+            String mobile = jsonObject.getString("mobile");//企业预留手机号 必输
             JSONArray cardIdList = jsonObject.getJSONArray("cardIdList");//ETC卡编号列表 必输
-            if(StringUtils.isEmpty(data)|| null == jsonObject || StringUtils.isEmpty(companyNum)
+            if (StringUtils.isEmpty(data) || null == jsonObject || StringUtils.isEmpty(companyNum)
                     || StringUtils.isEmpty(mobile)
                     || null == cardIdList
 
-            ){
+            ) {
                 result.setCode(200);
                 result.setMsg("必传参数有为空情况,请核实后再试");
-                return  result;
+                return result;
             }
 
             CustomerRec customerRec = new CustomerRec();
             customerRec.setCustomerName(appKey);
             customerRec.setCompanyNum(companyNum);
             CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyNum(customerRec);
-            if (null == customerRec1){
+            if (null == customerRec1) {
                 result.setCode(200);
                 result.setMsg("该企业编号在平台中不存在,请联系管理员核实!");
                 return result;
@@ -263,15 +260,15 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
             etcQueryVo.setCompanyName(customerRec1.getCompanyName());//企业名称
             etcQueryVo.setMobile(mobile);//企业预留手机号
             List<CarVo> cards = new ArrayList<CarVo>();
-            for(int i=0;i<cardIdList.size();i++) {
+            for (int i = 0; i < cardIdList.size(); i++) {
                 JSONObject jb = cardIdList.getJSONObject(i);
                 String cardId = jb.getString("cardId");//用户卡Id
 
-                if(null == jb || StringUtils.isEmpty(cardId)
-                ){
+                if (null == jb || StringUtils.isEmpty(cardId)
+                ) {
                     result.setCode(200);
                     result.setMsg("用户卡为空!");
-                    return  result;
+                    return result;
                 }
 
 
@@ -285,7 +282,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
             log.info("[-SelfCarInterServiceImpl.customerETCRec-] result is "
                     + rs.toString() + ", request is " + data + " ,costtime="
                     + (costtimeend - costtimestart));
-            if(null != rs && rs.getCode() == 0){
+            if (null != rs && rs.getCode() == 0) {
                 result.setData(1);
                 result.setCode(200);
                 result.setMsg(rs.getData().toString());
@@ -304,10 +301,9 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
     }
 
 
-
-
     /**
      * 自有车 卡绑定接口 渠道调用此接口,上传用户收到的短信验证码
+     *
      * @param appKey
      * @param api
      * @param data
@@ -326,31 +322,31 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
         result.setMsg("无法认证");
 
         try {
-            log.info("[-SelfCarInterServiceImpl.customerETCRecValid-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
+            log.info("[-SelfCarInterServiceImpl.customerETCRecValid-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
             JSONObject jsonObject = JSONObject.parseObject(data);
-            String companyNum =  jsonObject.getString("companyNum");//企业编号 必输
-            String mobile =  jsonObject.getString("mobile");//企业预留手机号 必输
-            String validCode =  jsonObject.getString("validCode");//验证码 必输
-            if(StringUtils.isEmpty(data)|| null == jsonObject || StringUtils.isEmpty(companyNum)
+            String companyNum = jsonObject.getString("companyNum");//企业编号 必输
+            String mobile = jsonObject.getString("mobile");//企业预留手机号 必输
+            String validCode = jsonObject.getString("validCode");//验证码 必输
+            if (StringUtils.isEmpty(data) || null == jsonObject || StringUtils.isEmpty(companyNum)
                     || StringUtils.isEmpty(mobile)
                     || StringUtils.isEmpty(validCode)
 
-            ){
+            ) {
                 result.setCode(200);
                 result.setMsg("必传参数有为空情况,请核实后再试");
-                return  result;
+                return result;
             }
 
             CustomerRec customerRec = new CustomerRec();
             customerRec.setCustomerName(appKey);
             customerRec.setCompanyNum(companyNum);
             CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyNum(customerRec);
-            if (null == customerRec1){
+            if (null == customerRec1) {
                 result.setCode(200);
                 result.setMsg("该企业编号在平台中不存在,请联系管理员核实!");
                 return result;
             }
-            EtcValidVo etcValidVo  = new EtcValidVo();
+            EtcValidVo etcValidVo = new EtcValidVo();
             etcValidVo.setCustomerName(appKey);
             etcValidVo.setCompanyName(customerRec1.getCompanyName());
             etcValidVo.setValidCode(validCode);
@@ -362,7 +358,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
             log.info("[-SelfCarInterServiceImpl.customerETCRecValid-] result is "
                     + rs.toString() + ", request is " + data + " ,costtime="
                     + (costtimeend - costtimestart));
-            if(null != rs && rs.getCode() == 0){
+            if (null != rs && rs.getCode() == 0) {
                 result.setData(1);
                 result.setCode(200);
                 result.setMsg(rs.getData().toString());
@@ -381,18 +377,16 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
     }
 
 
-
-
-
     /**
      * 自有车 交易查询接口 渠道通过此接口可以查询单张卡连续90天内的交易(待开票、开票中、已开票)
+     *
      * @param appKey
      * @param api
      * @param data
      * @return
      */
     @Override
-    public DataResult getTradeList(String appKey, String api, String data,String requestid) {
+    public DataResult getTradeList(String appKey, String api, String data, String requestid) {
 
         long costtimestart = System.currentTimeMillis();
 
@@ -404,45 +398,45 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
         result.setMsg("无法认证");
 
         try {
-            log.info("[-SelfCarInterServiceImpl.getTradeList-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
+            log.info("[-SelfCarInterServiceImpl.getTradeList-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
             JSONObject jsonObject = JSONObject.parseObject(data);
-            String companyNum =  jsonObject.getString("companyNum");//企业编号 必输
-            String cardId =  jsonObject.getString("cardId");//卡号 必输
-            Integer tradeStatus =  jsonObject.getInteger("tradeStatus");//交易状态 必输
-            String startExTime =  jsonObject.getString("startExTime");//开始时间 必输
-            String endExTime =  jsonObject.getString("endExTime");//结束时间 必输
-            if(StringUtils.isEmpty(data)|| null == jsonObject || StringUtils.isEmpty(companyNum)
+            String companyNum = jsonObject.getString("companyNum");//企业编号 必输
+            String cardId = jsonObject.getString("cardId");//卡号 必输
+            Integer tradeStatus = jsonObject.getInteger("tradeStatus");//交易状态 必输
+            String startExTime = jsonObject.getString("startExTime");//开始时间 必输
+            String endExTime = jsonObject.getString("endExTime");//结束时间 必输
+            if (StringUtils.isEmpty(data) || null == jsonObject || StringUtils.isEmpty(companyNum)
                     || StringUtils.isEmpty(cardId)
                     || null == tradeStatus
                     || StringUtils.isEmpty(startExTime)
                     || StringUtils.isEmpty(endExTime)
 
-            ){
+            ) {
                 result.setCode(200);
                 result.setMsg("必传参数有为空情况,请核实后再试");
-                return  result;
+                return result;
             }
 
-            if(!DateUtil.isValidDate(startExTime)){
+            if (!DateUtil.isValidDate(startExTime)) {
                 result.setMsg("日期格式有误");
-                return  result;
+                return result;
             }
 
-            if(!DateUtil.isValidDate(endExTime)){
+            if (!DateUtil.isValidDate(endExTime)) {
                 result.setMsg("日期格式有误");
-                return  result;
+                return result;
             }
 
             CustomerRec customerRec = new CustomerRec();
             customerRec.setCustomerName(appKey);
             customerRec.setCompanyNum(companyNum);
             CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyNum(customerRec);
-            if (null == customerRec1){
+            if (null == customerRec1) {
                 result.setCode(200);
                 result.setMsg("该企业编号在平台中不存在,请联系管理员核实!");
                 return result;
             }
-            TradeRequestVo tradeRequestVo  = new TradeRequestVo();
+            TradeRequestVo tradeRequestVo = new TradeRequestVo();
             tradeRequestVo.setCustomerName(appKey);
             tradeRequestVo.setCompanyName(customerRec1.getCompanyName());
             tradeRequestVo.setStartTime(DateUtil.getDistanceHoursFormat(startExTime));
@@ -451,7 +445,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
             tradeRequestVo.setTradeStatus(tradeStatus);
             tradeRequestVo.setInterType(0);//0 接口
 
-            if(tradeRequestVo.getTradeStatus() ==null){
+            if (tradeRequestVo.getTradeStatus() == null) {
                 tradeRequestVo.setTradeStatus(1);
                 RespR<List<CardTradeModel>> respRbefore = selfCarService.getTradeList(tradeRequestVo);
                 tradeRequestVo.setTradeStatus(2);
@@ -460,13 +454,13 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
                 RespR<List<CardTradeModel>> tradeList = selfCarService.getTradeList(tradeRequestVo);
                 //合并展示
                 List<CardTradeModel> cardTradeModels = new ArrayList<>();
-                if(respRbefore.getCode() == 0){
+                if (respRbefore.getCode() == 0) {
                     cardTradeModels.addAll(respRbefore.getData());
                 }
-                if(listRespR.getCode() == 0){
+                if (listRespR.getCode() == 0) {
                     cardTradeModels.addAll(listRespR.getData());
                 }
-                if(tradeList.getCode() == 0){
+                if (tradeList.getCode() == 0) {
                     cardTradeModels.addAll(tradeList.getData());
                 }
 
@@ -480,14 +474,14 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
             log.info("[-SelfCarInterServiceImpl.getTradeList-] result is "
                     + rs.toString() + ", request is " + data + " ,costtime="
                     + (costtimeend - costtimestart));
-            if(null != rs && rs.getCode() == 0){
+            if (null != rs && rs.getCode() == 0) {
                 result.setData(1);
                 result.setCode(200);
                 result.setMsg(rs.getData().toString());
                 return result;
             } else {
                 result.setData(3);
-                if(NOT_FOUND . equals(rs.getMsg())){
+                if (NOT_FOUND.equals(rs.getMsg())) {
                     result.setData(2);
                 }
                 result.setCode(200);
@@ -502,17 +496,16 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
     }
 
 
-
-
     /**
      * 自有车 交易查询接口 渠道通过此接口可以查询单张卡连续90天内的交易(待开票、开票中、已开票)
+     *
      * @param appKey
      * @param api
      * @param data
      * @return
      */
     @Override
-    public DataResult applInvoice(String appKey, String api, String data,String requestid) {
+    public DataResult applInvoice(String appKey, String api, String data, String requestid) {
 
         long costtimestart = System.currentTimeMillis();
 
@@ -524,31 +517,31 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
         result.setMsg("无法认证");
 
         try {
-            log.info("[-SelfCarInterServiceImpl.applInvoice-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
+            log.info("[-SelfCarInterServiceImpl.applInvoice-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
             JSONObject jsonObject = JSONObject.parseObject(data);
-            String companyNum =  jsonObject.getString("companyNum");//企业编号 必输
-            String cardId =  jsonObject.getString("cardId");//卡号 必输
+            String companyNum = jsonObject.getString("companyNum");//企业编号 必输
+            String cardId = jsonObject.getString("cardId");//卡号 必输
             JSONArray tradeIdModel = jsonObject.getJSONArray("tradeIdModel");//交易ID集合 必输
 
-            if(StringUtils.isEmpty(data)|| null == jsonObject || StringUtils.isEmpty(companyNum)
+            if (StringUtils.isEmpty(data) || null == jsonObject || StringUtils.isEmpty(companyNum)
                     || StringUtils.isEmpty(cardId)
                     || null == tradeIdModel
-            ){
+            ) {
                 result.setCode(200);
                 result.setMsg("必传参数有为空情况,请核实后再试");
-                return  result;
+                return result;
             }
 
             CustomerRec customerRec = new CustomerRec();
             customerRec.setCustomerName(appKey);
             customerRec.setCompanyNum(companyNum);
             CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyNum(customerRec);
-            if (null == customerRec1 ){
+            if (null == customerRec1) {
                 result.setCode(200);
                 result.setMsg("该企业编号在平台中不存在,请联系管理员核实!");
                 return result;
             }
-            InvoiceApplVo invoiceApplVo  = new InvoiceApplVo();
+            InvoiceApplVo invoiceApplVo = new InvoiceApplVo();
             invoiceApplVo.setCustomerName(appKey);
             invoiceApplVo.setCompanyName(customerRec1.getCompanyName());
             invoiceApplVo.setCardId(cardId);
@@ -556,12 +549,12 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
 
 
             List<String> tradeIds = new ArrayList<String>();
-            for(int i=0;i<tradeIdModel.size();i++) {
+            for (int i = 0; i < tradeIdModel.size(); i++) {
                 JSONObject jb = tradeIdModel.getJSONObject(i);
                 String tradeId = jb.getString("tradeId");//交易ID
-                if(null == jb || StringUtils.isEmpty(tradeId)
-                ){
-                    return  result;
+                if (null == jb || StringUtils.isEmpty(tradeId)
+                ) {
+                    return result;
                 }
                 tradeIds.add(tradeId);
             }
@@ -572,7 +565,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
             log.info("[-SelfCarInterServiceImpl.applInvoice-] result is "
                     + rs.toString() + ", request is " + data + " ,costtime="
                     + (costtimeend - costtimestart));
-            if(null != rs && rs.getCode() == 0){
+            if (null != rs && rs.getCode() == 0) {
                 result.setData(1);
                 result.setCode(200);
                 result.setMsg(rs.getData().toString());
@@ -603,30 +596,30 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
         result.setMsg("无法认证");
 
         try {
-            log.info("[-SelfCarInterServiceImpl.getSelfCarInvoicesByAppl-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
+            log.info("[-SelfCarInterServiceImpl.getSelfCarInvoicesByAppl-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
             JSONObject jsonObject = JSONObject.parseObject(data);
-            String companyNum =  jsonObject.getString("companyNum");//企业编号 必输
-            String cardId =  jsonObject.getString("cardId");//卡号 必输
-            String applyId =  jsonObject.getString("applyId");//申请id 必输
-            if(StringUtils.isEmpty(data)|| null == jsonObject || StringUtils.isEmpty(companyNum)
+            String companyNum = jsonObject.getString("companyNum");//企业编号 必输
+            String cardId = jsonObject.getString("cardId");//卡号 必输
+            String applyId = jsonObject.getString("applyId");//申请id 必输
+            if (StringUtils.isEmpty(data) || null == jsonObject || StringUtils.isEmpty(companyNum)
                     || StringUtils.isEmpty(cardId)
                     || StringUtils.isEmpty(applyId)
-                    ){
+            ) {
                 result.setCode(200);
                 result.setMsg("必传参数有为空情况,请核实后再试");
-                return  result;
+                return result;
             }
 
             CustomerRec customerRec = new CustomerRec();
             customerRec.setCustomerName(appKey);
             customerRec.setCompanyNum(companyNum);
             CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyNum(customerRec);
-            if (null == customerRec1){
+            if (null == customerRec1) {
                 result.setCode(200);
                 result.setMsg("该企业编号在平台中不存在,请联系管理员核实!");
                 return result;
             }
-            ApplQueryInvVo applQueryInvVo  = new ApplQueryInvVo();
+            ApplQueryInvVo applQueryInvVo = new ApplQueryInvVo();
             applQueryInvVo.setApplId(applyId);
             applQueryInvVo.setEtcNum(cardId);
             applQueryInvVo.setCompanyNum(companyNum);
@@ -635,14 +628,14 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
             log.info("[-SelfCarInterServiceImpl.getSelfCarInvoicesByAppl-] result is "
                     + rs.toString() + ", request is " + data + " ,costtime="
                     + (costtimeend - costtimestart));
-            if(null != rs && rs.getCode() == 0){
+            if (null != rs && rs.getCode() == 0) {
                 result.setData(1);
                 result.setCode(200);
                 result.setMsg(rs.getMsg());
                 return result;
             } else {
                 result.setData(3);
-                if(NOT_FOUND .equals (rs.getMsg())){
+                if (NOT_FOUND.equals(rs.getMsg())) {
                     result.setData(2);
                 }
                 result.setCode(200);
@@ -658,13 +651,14 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
 
     /**
      * 自有车 已开发票查询接口 渠道通过此接口可以根据该公司绑定的单张卡查询此卡在某个月开具的发票
+     *
      * @param appKey
      * @param api
      * @param data
      * @return
      */
     @Override
-    public DataResult getSelfCarInvoicesByTime(String appKey, String api, String data,String requestid) {
+    public DataResult getSelfCarInvoicesByTime(String appKey, String api, String data, String requestid) {
 
         long costtimestart = System.currentTimeMillis();
 
@@ -676,62 +670,62 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
         result.setMsg("无法认证");
 
         try {
-            log.info("[-SelfCarInterServiceImpl.getSelfCarInvoicesByTime-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
+            log.info("[-SelfCarInterServiceImpl.getSelfCarInvoicesByTime-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
             JSONObject jsonObject = JSONObject.parseObject(data);
-            String companyNum =  jsonObject.getString("companyNum");//企业编号 必输
-            String cardId =  jsonObject.getString("cardId");//卡号 必输
-            String startInvoiceMakeTime =  jsonObject.getString("startInvoiceMakeTime");//开始时间 必输
-            String endInvoiceMakeTime =  jsonObject.getString("endInvoiceMakeTime");//结束时间 必输
-            if(StringUtils.isEmpty(data)|| null == jsonObject || StringUtils.isEmpty(companyNum)
+            String companyNum = jsonObject.getString("companyNum");//企业编号 必输
+            String cardId = jsonObject.getString("cardId");//卡号 必输
+            String startInvoiceMakeTime = jsonObject.getString("startInvoiceMakeTime");//开始时间 必输
+            String endInvoiceMakeTime = jsonObject.getString("endInvoiceMakeTime");//结束时间 必输
+            if (StringUtils.isEmpty(data) || null == jsonObject || StringUtils.isEmpty(companyNum)
                     || StringUtils.isEmpty(cardId)
                     || StringUtils.isEmpty(startInvoiceMakeTime)
                     || StringUtils.isEmpty(endInvoiceMakeTime)
 
-            ){
+            ) {
                 result.setCode(200);
                 result.setMsg("必传参数有为空情况,请核实后再试");
-                return  result;
+                return result;
             }
 
-            if(!DateUtil.isValidDate(startInvoiceMakeTime)){
+            if (!DateUtil.isValidDate(startInvoiceMakeTime)) {
                 result.setMsg("日期格式有误");
-                return  result;
+                return result;
             }
 
-            if(!DateUtil.isValidDate(endInvoiceMakeTime)){
+            if (!DateUtil.isValidDate(endInvoiceMakeTime)) {
                 result.setMsg("日期格式有误");
-                return  result;
+                return result;
             }
 
             CustomerRec customerRec = new CustomerRec();
             customerRec.setCustomerName(appKey);
             customerRec.setCompanyNum(companyNum);
             CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyNum(customerRec);
-            if (null == customerRec1){
+            if (null == customerRec1) {
                 result.setCode(200);
                 result.setMsg("该企业编号在平台中不存在,请联系管理员核实!");
                 return result;
             }
-            SelfCarDueQueryVo selfCarDueQueryVo  = new SelfCarDueQueryVo();
+            SelfCarDueQueryVo selfCarDueQueryVo = new SelfCarDueQueryVo();
             selfCarDueQueryVo.setCustomername(appKey);
             selfCarDueQueryVo.setCompanyName(customerRec1.getCompanyName());
             selfCarDueQueryVo.setCardId(cardId);
             selfCarDueQueryVo.setStartTime(startInvoiceMakeTime);
             selfCarDueQueryVo.setEndTime(endInvoiceMakeTime);
 
-            RespR rs = selfCarService.getSelfCarInvoicesByTime(selfCarDueQueryVo,customerRec1);
+            RespR rs = selfCarService.getSelfCarInvoicesByTime(selfCarDueQueryVo, customerRec1);
             long costtimeend = System.currentTimeMillis();
             log.info("[-SelfCarInterServiceImpl.getSelfCarInvoicesByTime-] result is "
                     + rs.toString() + ", request is " + data + " ,costtime="
                     + (costtimeend - costtimestart));
-            if(null != rs && rs.getCode() == 0){
+            if (null != rs && rs.getCode() == 0) {
                 result.setData(1);
                 result.setCode(200);
                 result.setMsg(rs.getMsg());
                 return result;
             } else {
                 result.setData(3);
-                if(NOT_FOUND .equals (rs.getMsg())){
+                if (NOT_FOUND.equals(rs.getMsg())) {
                     result.setData(2);
                 }
                 result.setCode(200);
@@ -746,18 +740,16 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
     }
 
 
-
-
-
     /**
      * 自有车 发票下载 渠道通过此接口可以下载某公司某个月份开具的发票。
+     *
      * @param appKey
      * @param api
      * @param data
      * @return
      */
     @Override
-    public DataResult getSelfCarInvoicePackage(String appKey, String api, String data,String requestid) {
+    public DataResult getSelfCarInvoicePackage(String appKey, String api, String data, String requestid) {
 
         long costtimestart = System.currentTimeMillis();
 
@@ -769,29 +761,29 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
         result.setMsg("无法认证");
 
         try {
-            log.info("[-SelfCarInterServiceImpl.getSelfCarInvoicePackage-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
+            log.info("[-SelfCarInterServiceImpl.getSelfCarInvoicePackage-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
             JSONObject jsonObject = JSONObject.parseObject(data);
-            String companyNum =  jsonObject.getString("companyNum");//企业编号 必输
-            String makeMonth =  jsonObject.getString("makeMonth");//发票开具月份 必输
-            if(StringUtils.isEmpty(data)|| null == jsonObject || StringUtils.isEmpty(companyNum)
+            String companyNum = jsonObject.getString("companyNum");//企业编号 必输
+            String makeMonth = jsonObject.getString("makeMonth");//发票开具月份 必输
+            if (StringUtils.isEmpty(data) || null == jsonObject || StringUtils.isEmpty(companyNum)
                     || StringUtils.isEmpty(makeMonth)
 
-            ){
+            ) {
                 result.setCode(200);
                 result.setMsg("必传参数有为空情况,请核实后再试");
-                return  result;
+                return result;
             }
 
             CustomerRec customerRec = new CustomerRec();
             customerRec.setCustomerName(appKey);
             customerRec.setCompanyNum(companyNum);
             CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyNum(customerRec);
-            if (null == customerRec1){
+            if (null == customerRec1) {
                 result.setCode(200);
                 result.setMsg("该企业编号在平台中不存在,请联系管理员核实!");
                 return result;
             }
-            InvoicePackageVo invoicePackageVo  = new InvoicePackageVo();
+            InvoicePackageVo invoicePackageVo = new InvoicePackageVo();
             invoicePackageVo.setCustomerName(appKey);
             invoicePackageVo.setCompanyName(customerRec1.getCompanyName());
             invoicePackageVo.setMonth(makeMonth);
@@ -801,14 +793,14 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
             log.info("[-SelfCarInterServiceImpl.getSelfCarInvoicePackage-] result is "
                     + rs.toString() + ", request is " + data + " ,costtime="
                     + (costtimeend - costtimestart));
-            if(null != rs && rs.getCode() == 0){
+            if (null != rs && rs.getCode() == 0) {
                 result.setData(1);
                 result.setCode(200);
                 result.setMsg(rs.getData().toString());
                 return result;
             } else {
                 result.setData(3);
-                if(NOT_FOUND .equals (rs.getMsg())){
+                if (NOT_FOUND.equals(rs.getMsg())) {
                     result.setData(2);
                 }
 
@@ -824,18 +816,16 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
     }
 
 
-
-
-
     /**
      * 自有车 卡解绑接口
+     *
      * @param appKey
      * @param api
      * @param data
      * @return
      */
     @Override
-    public DataResult customerCarUnRec(String appKey, String api, String data,String requestid) {
+    public DataResult customerCarUnRec(String appKey, String api, String data, String requestid) {
 
         long costtimestart = System.currentTimeMillis();
 
@@ -847,28 +837,28 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
         result.setMsg("无法认证");
 
         try {
-            log.info("[-SelfCarInterServiceImpl.customerCarUnRec-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
+            log.info("[-SelfCarInterServiceImpl.customerCarUnRec-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
             JSONObject jsonObject = JSONObject.parseObject(data);
-            String companyNum =  jsonObject.getString("companyNum");//企业编号 必输
-            String cardId =  jsonObject.getString("cardId");//Etc卡号 必输
-            if(StringUtils.isEmpty(data)|| null == jsonObject || StringUtils.isEmpty(companyNum)
+            String companyNum = jsonObject.getString("companyNum");//企业编号 必输
+            String cardId = jsonObject.getString("cardId");//Etc卡号 必输
+            if (StringUtils.isEmpty(data) || null == jsonObject || StringUtils.isEmpty(companyNum)
                     || StringUtils.isEmpty(cardId)
 
-            ){
-                return  result;
+            ) {
+                return result;
             }
 
             CustomerRec customerRec = new CustomerRec();
             customerRec.setCustomerName(appKey);
             customerRec.setCompanyNum(companyNum);
             CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyNum(customerRec);
-            if (null == customerRec1){
+            if (null == customerRec1) {
                 result.setMsg("该企业编号未注册企业!");
                 return result;
             }
             List<CustomerCarRec> customerCarRecList = new ArrayList<CustomerCarRec>();
 
-            CustomerCarRec customerCarRec  = new CustomerCarRec();
+            CustomerCarRec customerCarRec = new CustomerCarRec();
             customerCarRec.setCustomerName(appKey);
             customerCarRec.setCompanyName(customerRec1.getCompanyName());
             customerCarRec.setEtcNum(cardId);
@@ -879,7 +869,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
             log.info("[-SelfCarInterServiceImpl.customerCarUnRec-] result is "
                     + rs.toString() + ", request is " + data + " ,costtime="
                     + (costtimeend - costtimestart));
-            if(null != rs && rs.getCode() == 0){
+            if (null != rs && rs.getCode() == 0) {
                 result.setData(1);
                 result.setCode(200);
                 result.setMsg(rs.getData().toString());
@@ -907,22 +897,21 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
         result.setMsg("无法认证");
 
         try {
-            log.info("[-SelfCarInterServiceImpl.customerCarUnRec-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
+            log.info("[-SelfCarInterServiceImpl.customerCarUnRec-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
 
-            CardChangeQueryDto cardChangeQueryDto = JSON.parseObject(data,CardChangeQueryDto.class);
+            CardChangeQueryDto cardChangeQueryDto = JSON.parseObject(data, CardChangeQueryDto.class);
 
-            if(cardChangeQueryDto == null || StringUtils.isEmpty(cardChangeQueryDto.getCompanyNum())
-                    || StringUtils.isEmpty(cardChangeQueryDto.getApplyId()) || StringUtils.isEmpty(cardChangeQueryDto.getCardId()))
-            {
+            if (cardChangeQueryDto == null || StringUtils.isEmpty(cardChangeQueryDto.getCompanyNum())
+                    || StringUtils.isEmpty(cardChangeQueryDto.getApplyId()) || StringUtils.isEmpty(cardChangeQueryDto.getCardId())) {
                 result.setMsg("必传参数不足");
-                return  result;
+                return result;
             }
 
             CustomerRec customerRec = new CustomerRec();
             customerRec.setCustomerName(appKey);
             customerRec.setCompanyNum(cardChangeQueryDto.getCompanyNum());
             CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyNum(customerRec);
-            if (null == customerRec1){
+            if (null == customerRec1) {
                 result.setMsg("该企业编号未注册企业!");
                 return result;
             }
@@ -931,7 +920,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
             log.info("[-SelfCarInterServiceImpl.customerCarUnRec-] result is "
                     + rs.toString() + ", request is " + data + " ,costtime="
                     + (costtimeend - costtimestart));
-            if(null != rs && rs.getCode() == 0){
+            if (null != rs && rs.getCode() == 0) {
                 result.setData(1);
                 result.setCode(200);
                 result.setMsg(rs.getData().toString());
@@ -939,7 +928,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
             } else {
                 result.setData(3);
                 result.setCode(200);
-                result.setMsg(rs==null?"结果为空":rs.getMsg());
+                result.setMsg(rs == null ? "结果为空" : rs.getMsg());
                 return result;
             }
         } catch (Exception e) {
@@ -959,23 +948,22 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
         result.setMsg("无法认证");
 
         try {
-            log.info("[-SelfCarInterServiceImpl.customerCarUnRec-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
+            log.info("[-SelfCarInterServiceImpl.customerCarUnRec-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
 
-            CardChangeDto cardChangeDto = JSON.parseObject(data,CardChangeDto.class);
+            CardChangeDto cardChangeDto = JSON.parseObject(data, CardChangeDto.class);
 
-            if(cardChangeDto == null || StringUtils.isEmpty(cardChangeDto.getCompanyNum())
-                    || StringUtils.isEmpty(cardChangeDto.getTargetCompanyNum()) || cardChangeDto.getCardIdList()==null
-                    || cardChangeDto.getCardIdList().size()==0)
-            {
+            if (cardChangeDto == null || StringUtils.isEmpty(cardChangeDto.getCompanyNum())
+                    || StringUtils.isEmpty(cardChangeDto.getTargetCompanyNum()) || cardChangeDto.getCardIdList() == null
+                    || cardChangeDto.getCardIdList().size() == 0) {
                 result.setMsg("必传参数不足");
-                return  result;
+                return result;
             }
 
             CustomerRec customerRec = new CustomerRec();
             customerRec.setCustomerName(appKey);
             customerRec.setCompanyNum(cardChangeDto.getCompanyNum());
             CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyNum(customerRec);
-            if (null == customerRec1){
+            if (null == customerRec1) {
                 result.setMsg("该企业编号未注册企业!");
                 return result;
             }
@@ -986,7 +974,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
             log.info("[-SelfCarInterServiceImpl.customerCarUnRec-] result is "
                     + rs.toString() + ", request is " + data + " ,costtime="
                     + (costtimeend - costtimestart));
-            if(null != rs && rs.getCode() == 0){
+            if (null != rs && rs.getCode() == 0) {
                 result.setData(1);
                 result.setCode(200);
                 result.setMsg(rs.getData().toString());
@@ -1005,7 +993,6 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
     }
 
 
-
     @Override
     public DataResult tradeApplyQuery(String appKey, String api, String data, String requestid) {
         long costtimestart = System.currentTimeMillis();
@@ -1018,18 +1005,18 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
         result.setMsg("无法认证");
 
         try {
-            log.info("[-SelfCarInterServiceImpl.tradeApplyQuery-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
+            log.info("[-SelfCarInterServiceImpl.tradeApplyQuery-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
             JSONObject jsonObject = JSONObject.parseObject(data);
-            String companyNum =  jsonObject.getString("companyNum");//企业编号 必输 不超过32个字符
-            String cardId =  jsonObject.getString("cardId");//卡号 必输 20位数字字符
-            String tradeId =  jsonObject.getString("tradeId");//交易ID 必输 字符串
-            if(StringUtils.isEmpty(data)|| null == jsonObject || StringUtils.isEmpty(companyNum)
+            String companyNum = jsonObject.getString("companyNum");//企业编号 必输 不超过32个字符
+            String cardId = jsonObject.getString("cardId");//卡号 必输 20位数字字符
+            String tradeId = jsonObject.getString("tradeId");//交易ID 必输 字符串
+            if (StringUtils.isEmpty(data) || null == jsonObject || StringUtils.isEmpty(companyNum)
                     || StringUtils.isEmpty(cardId)
                     || StringUtils.isEmpty(tradeId)
-            ){
+            ) {
                 result.setCode(200);
                 result.setMsg("必传参数有为空情况,请核实后再试");
-                return  result;
+                return result;
             }
 
 
@@ -1037,13 +1024,13 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
             customerRec.setCustomerName(appKey);
             customerRec.setCompanyNum(companyNum);
             CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyNum(customerRec);
-            if (null == customerRec1){
+            if (null == customerRec1) {
                 result.setCode(200);
                 result.setMsg("该企业编号在平台中不存在,请联系管理员核实!");
                 return result;
             }
 
-            TradeApplyQueryInvVo tradeApplyQueryInvVo  = new TradeApplyQueryInvVo();
+            TradeApplyQueryInvVo tradeApplyQueryInvVo = new TradeApplyQueryInvVo();
             tradeApplyQueryInvVo.setCompanyNum(companyNum);
             tradeApplyQueryInvVo.setCardId(cardId);
             tradeApplyQueryInvVo.setTradeId(tradeId);
@@ -1054,7 +1041,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
             log.info("[-SelfCarInterServiceImpl.tradeApplyQuery-] result is "
                     + rs.toString() + ", request is " + data + " ,costtime="
                     + (costtimeend - costtimestart));
-            if(null != rs && rs.getCode() == 0){
+            if (null != rs && rs.getCode() == 0) {
                 result.setData(1);
                 result.setCode(200);
                 result.setMsg(rs.getData().toString());

+ 14 - 3
src/main/java/com/jkcredit/invoice/mapper/binvoce/BillInvoiceMapper.java

@@ -12,9 +12,10 @@ import java.util.List;
 import java.util.Map;
 
 @Repository
-public interface BillInvoiceMapper extends BaseMapper<BillInvoice>{
+public interface BillInvoiceMapper extends BaseMapper<BillInvoice> {
     /**
      * 分页查询所有运单发票
+     *
      * @param page
      * @param billInvoice
      * @return
@@ -23,13 +24,15 @@ public interface BillInvoiceMapper extends BaseMapper<BillInvoice>{
 
     /**
      * 条件查询所有运单发票
+     *
      * @param record
      * @return
      */
-    BillInvoice selectAllByPageByBillInvoice( BillInvoice record);
+    BillInvoice selectAllByPageByBillInvoice(BillInvoice record);
 
     /**
      * 插入发票
+     *
      * @param record
      * @return
      */
@@ -38,6 +41,7 @@ public interface BillInvoiceMapper extends BaseMapper<BillInvoice>{
 
     /**
      * 更新发票
+     *
      * @param record
      * @return
      */
@@ -45,6 +49,7 @@ public interface BillInvoiceMapper extends BaseMapper<BillInvoice>{
 
     /**
      * 根据发票代码更新发票
+     *
      * @param record
      * @return
      */
@@ -52,6 +57,7 @@ public interface BillInvoiceMapper extends BaseMapper<BillInvoice>{
 
     /**
      * 查询发票列表
+     *
      * @param wayBillNum
      * @return
      */
@@ -59,6 +65,7 @@ public interface BillInvoiceMapper extends BaseMapper<BillInvoice>{
 
     /**
      * 根据运单号删除发票
+     *
      * @param wayBillNum
      * @return
      */
@@ -66,6 +73,7 @@ public interface BillInvoiceMapper extends BaseMapper<BillInvoice>{
 
     /**
      * 根据运单号查询发票
+     *
      * @param wayBillNum
      * @return
      */
@@ -73,13 +81,15 @@ public interface BillInvoiceMapper extends BaseMapper<BillInvoice>{
 
     /**
      * 发票统计汇总
+     *
      * @param billInvoice
      * @return
      */
-    Map<String,String> findInvoiceStatics(@Param("billInvoice") BillInvoice billInvoice);
+    Map<String, String> findInvoiceStatics(@Param("billInvoice") BillInvoice billInvoice);
 
     /**
      * 根据客户名称查询所有发票
+     *
      * @param customerName
      * @return
      */
@@ -87,6 +97,7 @@ public interface BillInvoiceMapper extends BaseMapper<BillInvoice>{
 
     /**
      * 更新计费明细
+     *
      * @param companyVo
      * @return
      */

+ 3 - 2
src/main/java/com/jkcredit/invoice/mapper/binvoce/HcInvoiceMapper.java

@@ -8,12 +8,12 @@ import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
-import java.util.Map;
 
 @Repository
-public interface HcInvoiceMapper extends BaseMapper<HcInvoice>{
+public interface HcInvoiceMapper extends BaseMapper<HcInvoice> {
     /**
      * 插入红冲发票
+     *
      * @param hcInvoice
      * @return
      */
@@ -21,6 +21,7 @@ public interface HcInvoiceMapper extends BaseMapper<HcInvoice>{
 
     /**
      * 根据月份删除
+     *
      * @param yearMonth
      * @return
      */

+ 4 - 1
src/main/java/com/jkcredit/invoice/mapper/binvoce/SelfCarApplMapper.java

@@ -8,10 +8,13 @@ import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
+
 @Repository
-public interface SelfCarApplMapper  extends BaseMapper<SelfCarAppl> {
+public interface SelfCarApplMapper extends BaseMapper<SelfCarAppl> {
     IPage<List<SelfCarAppl>> selectAllByPage(Page page, @Param("selfCarAppl") SelfCarAppl selfCarAppl);
+
     List<SelfCarAppl> selectAllNoRec();
+
     @Override
     int insert(SelfCarAppl record);
 }

+ 4 - 0
src/main/java/com/jkcredit/invoice/mapper/binvoce/SelfCarInvoiceMapper.java

@@ -9,6 +9,7 @@ import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
+
 @Repository
 public interface SelfCarInvoiceMapper extends BaseMapper<SelfCarInvoice> {
     IPage<List<SelfCarInvoice>> selectAllByPage(Page page, @Param("selfCarInvoice") SelfCarInvoice selfCarInvoice);
@@ -19,9 +20,12 @@ public interface SelfCarInvoiceMapper extends BaseMapper<SelfCarInvoice> {
     int updateByPrimaryKey(SelfCarInvoice record);
 
     List<SelfCarInvoice> selectByTrade(String tradeId);
+
     List<SelfCarInvoice> selectByCardId(String cardId);
 
     List<SelfCarInvoice> selectByTradeAndInvoiceMakeTime(SelfCarInvoice record);
+
     List<SelfCarInvoice> selectByCodeAndNum(SelfCarInvoice record);
+
     int upDateCompany(CompanyVo companyVo);
 }

+ 1 - 1
src/main/java/com/jkcredit/invoice/mapper/calculateinfor/NoCarCalculateInforMapper.java

@@ -20,7 +20,7 @@ public interface NoCarCalculateInforMapper extends BaseMapper<NoCarCalculateInfo
 
     NoCarCalculateInfor selectByTradeId(String tradeId);
 
-    List<Map<String,String>> selectforStatis(@Param("calculateInfor") NoCarCalculateInfor record);
+    List<Map<String, String>> selectforStatis(@Param("calculateInfor") NoCarCalculateInfor record);
 
     int upDateCompany(CompanyVo companyVo);
 }

+ 1 - 1
src/main/java/com/jkcredit/invoice/mapper/calculateinfor/SelfCarCalculateInforMapper.java

@@ -20,7 +20,7 @@ public interface SelfCarCalculateInforMapper extends BaseMapper<SelfCarCalculate
 
     SelfCarCalculateInfor selectByEtcAndTime(SelfCarCalculateInfor selfCarCalculateInfor);
 
-    List<Map<String,String>> findSelfcarCalculateInfoSta(SelfCarCalculateInfor selfCarCalculateInfor);
+    List<Map<String, String>> findSelfcarCalculateInfoSta(SelfCarCalculateInfor selfCarCalculateInfor);
 
     int upDateCompany(CompanyVo companyVo);
 }

+ 18 - 0
src/main/java/com/jkcredit/invoice/mapper/customer/CustomerCarRecMapper.java

@@ -24,6 +24,7 @@ public interface CustomerCarRecMapper extends BaseMapper<CustomerCarRec> {
 
     /**
      * 客户注册信息按条件新增
+     *
      * @param record
      * @return
      */
@@ -31,6 +32,7 @@ public interface CustomerCarRecMapper extends BaseMapper<CustomerCarRec> {
 
     /**
      * 根据Appkey查询客户注册信息列表
+     *
      * @param customerName
      * @return
      */
@@ -38,6 +40,7 @@ public interface CustomerCarRecMapper extends BaseMapper<CustomerCarRec> {
 
     /**
      * 根据ect卡号查询客户列表
+     *
      * @param etcNum
      * @return
      */
@@ -45,6 +48,7 @@ public interface CustomerCarRecMapper extends BaseMapper<CustomerCarRec> {
 
     /**
      * 根据ect卡号查询客户列表 (防止事物问题)
+     *
      * @param etcNum
      * @return
      */
@@ -52,6 +56,7 @@ public interface CustomerCarRecMapper extends BaseMapper<CustomerCarRec> {
 
     /**
      * 根据车牌号查询无车客户列表
+     *
      * @param carNum
      * @return
      */
@@ -59,6 +64,7 @@ public interface CustomerCarRecMapper extends BaseMapper<CustomerCarRec> {
 
     /**
      * 根据车牌号查询自有车客户列表 只查询注册成功客户
+     *
      * @param carNum
      * @return
      */
@@ -66,6 +72,7 @@ public interface CustomerCarRecMapper extends BaseMapper<CustomerCarRec> {
 
     /**
      * 根据车牌号查询自有车客户列表
+     *
      * @param carNum
      * @return
      */
@@ -73,6 +80,7 @@ public interface CustomerCarRecMapper extends BaseMapper<CustomerCarRec> {
 
     /**
      * 更新自有车客户信息
+     *
      * @param record
      * @return
      */
@@ -80,6 +88,7 @@ public interface CustomerCarRecMapper extends BaseMapper<CustomerCarRec> {
 
     /**
      * 更新客户信息
+     *
      * @param record
      * @return
      */
@@ -87,6 +96,7 @@ public interface CustomerCarRecMapper extends BaseMapper<CustomerCarRec> {
 
     /**
      * 根据etc卡号更新无车客户信息
+     *
      * @param record
      * @return
      */
@@ -94,6 +104,7 @@ public interface CustomerCarRecMapper extends BaseMapper<CustomerCarRec> {
 
     /**
      * 更新客户信息
+     *
      * @param record
      * @return
      */
@@ -101,6 +112,7 @@ public interface CustomerCarRecMapper extends BaseMapper<CustomerCarRec> {
 
     /**
      * 根据etc卡号更新成功过的客户信息
+     *
      * @param record
      * @return
      */
@@ -108,12 +120,14 @@ public interface CustomerCarRecMapper extends BaseMapper<CustomerCarRec> {
 
     /**
      * 查询所有客户列表
+     *
      * @return
      */
     List<CustomerCarRec> selectAllBindEtcNoGetInvoice();
 
     /**
      * 客户列表分页查询
+     *
      * @param page
      * @param customerCarRec
      * @return
@@ -122,6 +136,7 @@ public interface CustomerCarRecMapper extends BaseMapper<CustomerCarRec> {
 
     /**
      * 根据企业名称更新客户列表
+     *
      * @param companyVo
      * @return
      */
@@ -129,6 +144,7 @@ public interface CustomerCarRecMapper extends BaseMapper<CustomerCarRec> {
 
     /**
      * 根据企业编码更新客户列表
+     *
      * @param companyVo
      * @return
      */
@@ -136,6 +152,7 @@ public interface CustomerCarRecMapper extends BaseMapper<CustomerCarRec> {
 
     /**
      * 根据企业名称查询所有自有车企业列表
+     *
      * @param companyName
      * @return
      */
@@ -143,6 +160,7 @@ public interface CustomerCarRecMapper extends BaseMapper<CustomerCarRec> {
 
     /**
      * 根据etc卡号删除客户列表
+     *
      * @param etcNum
      */
     void deleteByEtcCard(String etcNum);

+ 4 - 1
src/main/java/com/jkcredit/invoice/mapper/customer/CustomerChangeInfoMapper.java

@@ -1,4 +1,5 @@
 package com.jkcredit.invoice.mapper.customer;
+
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -14,6 +15,8 @@ public interface CustomerChangeInfoMapper extends BaseMapper<CustomerEtcChangeIn
     void insertCardChangeInfo(CustomerEtcChangeInfo custometEtcChangeInfo);
 
     void insertChangeCard(@Param("applyId") String applyId, @Param("cardId") String cardId);
-    List<Map<String,String>> selectChangeCards(String applyId);
+
+    List<Map<String, String>> selectChangeCards(String applyId);
+
     IPage<List<CustomerEtcChangeInfo>> selectAllByPage(Page page, @Param("custometEtcChangeInfo") CustomerEtcChangeInfo custometEtcChangeInfo);
 }

+ 7 - 2
src/main/java/com/jkcredit/invoice/mapper/customer/CustomerMapper.java

@@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
+
 @Repository
 public interface CustomerMapper extends BaseMapper<Customer> {
     int deleteByPrimaryKey(Integer id);
@@ -19,14 +20,18 @@ public interface CustomerMapper extends BaseMapper<Customer> {
 
     Customer selectByPrimaryKey(Integer id);
 
-    Customer selectByCustomerName(String  customerName);
-    Customer selectByCustomerNameForLock(String  customerName);
+    Customer selectByCustomerName(String customerName);
+
+    Customer selectByCustomerNameForLock(String customerName);
+
     int updateByPrimaryKeySelective(Customer record);
 
     int updateByPrimaryKey(Customer record);
 
     IPage<List<Customer>> selectAllByPage(Page page, @Param("customer") Customer customer);
+
     IPage<List<Customer>> selectAllByPageForNoMoney(Page page, @Param("customer") Customer customer);
+
     IPage<List<Customer>> selectAllByPageForNoMoneyByZero(Page page, @Param("customer") Customer customer);
 
 

+ 16 - 2
src/main/java/com/jkcredit/invoice/mapper/customer/CustomerRecMapper.java

@@ -3,7 +3,6 @@ package com.jkcredit.invoice.mapper.customer;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.jkcredit.invoice.model.entity.customer.CustomerCarRec;
 import com.jkcredit.invoice.model.entity.customer.CustomerRec;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
@@ -16,23 +15,35 @@ public interface CustomerRecMapper extends BaseMapper<CustomerRec> {
 
     @Override
     int insert(CustomerRec record);
+
     int updateByCompany(CustomerRec customerRec);
+
     int insertSelective(CustomerRec record);
 
     CustomerRec selectByPrimaryKey(String id);
+
     CustomerRec selectByPrimaryKeyHasBase64(Integer id);
+
     CustomerRec selectByPrimaryKeyHasNoLocalBase64(Integer id);
+
     List<CustomerRec> selectByCustomerName(String customerName);
+
     List<CustomerRec> selectByCustomerNameAll(String customerName);
+
     List<CustomerRec> selectByCustomerNameCpAll(@Param("customerRec") CustomerRec record);
+
     CustomerRec selectByCustomerNameAndCompany(CustomerRec record);
+
     CustomerRec selectByCustomerNameAndCompanyConcat(CustomerRec record);
+
     CustomerRec selectByCustomerNameAndCompanyReference(CustomerRec record);
+
     CustomerRec selectByCustomerNameAndCompanyReferenceAll(CustomerRec record);
 
     List<CustomerRec> selectByCompanyReference(String companyReference);
 
     List<CustomerRec> selectByCompanyName(String comapanyName);
+
     //根据客户名称和 企业编码查询唯一数据
     CustomerRec selectByCustomerNameAndCompanyNum(CustomerRec record);
 
@@ -42,17 +53,20 @@ public interface CustomerRecMapper extends BaseMapper<CustomerRec> {
 
 
     List<CustomerRec> selectByCompanyNum(CustomerRec record);
+
     int updateByPrimaryKeySelective(CustomerRec record);
+
     int updateByPrimaryKeySelectiveUpload(CustomerRec record);
 
     int updateByPrimaryKey(CustomerRec record);
+
     IPage<List<CustomerRec>> selectAllByPage(Page page, @Param("customerRec") CustomerRec customerRec);
 
 
     IPage<List<CustomerRec>> selectAllByPageWarning(Page page, @Param("customerRec") CustomerRec customerRec);
 
 
-    List<CustomerRec> selectAllByPageExport( @Param("customerRec") CustomerRec customerRec);
+    List<CustomerRec> selectAllByPageExport(@Param("customerRec") CustomerRec customerRec);
 
     List<CustomerRec> selectAllNoCarComapany();
 

+ 3 - 4
src/main/java/com/jkcredit/invoice/mapper/manager/ParamMapper.java

@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.apache.ibatis.annotations.Param;
 
-
 import java.util.List;
 
 /**
@@ -20,7 +19,7 @@ public interface ParamMapper extends BaseMapper<com.jkcredit.invoice.model.entit
     /**
      * 分页查询参数信息
      *
-     * @param page    分页
+     * @param page  分页
      * @param param 查询参数
      * @return list
      */
@@ -36,11 +35,11 @@ public interface ParamMapper extends BaseMapper<com.jkcredit.invoice.model.entit
     com.jkcredit.invoice.model.entity.manager.Param getParamByParamName(String paramName);
 
 
-
     /**
      * 修改参数信息
+     *
      * @param param
      * @return
      */
-    Boolean  updateParam(com.jkcredit.invoice.model.entity.manager.Param param);
+    Boolean updateParam(com.jkcredit.invoice.model.entity.manager.Param param);
 }

+ 8 - 3
src/main/java/com/jkcredit/invoice/mapper/user/UserMapper.java

@@ -30,7 +30,7 @@ public interface UserMapper extends BaseMapper<User> {
     /**
      * 分页查询用户信息(含角色)
      *
-     * @param page    分页
+     * @param page 分页
      * @param user 查询参数
      * @return list
      */
@@ -38,9 +38,11 @@ public interface UserMapper extends BaseMapper<User> {
 
     /**
      * 获取所有用户信息
+     *
      * @return
      */
     List<User> getAllUser();
+
     /**
      * 通过ID查询用户信息
      *
@@ -51,15 +53,16 @@ public interface UserMapper extends BaseMapper<User> {
 
     /**
      * 更新用户密码
+     *
      * @param user
      * @return
      */
     Boolean updatePassword(User user);
 
 
-
     /**
      * 更新锁定状态
+     *
      * @param user
      * @return
      */
@@ -67,14 +70,16 @@ public interface UserMapper extends BaseMapper<User> {
 
     /**
      * 修改用户信息
+     *
      * @param user
      * @return
      */
-    Boolean  updateUserInfo(User user);
+    Boolean updateUserInfo(User user);
 
 
     /**
      * 更新企业编号
+     *
      * @param user
      * @return
      */

+ 2 - 1
src/main/java/com/jkcredit/invoice/mapper/waybill/NoCarWaybillImprtMapper.java

@@ -11,7 +11,7 @@ import org.springframework.stereotype.Repository;
 import java.util.List;
 
 @Repository
-public interface NoCarWaybillImprtMapper extends BaseMapper<NoCarWayBill>{
+public interface NoCarWaybillImprtMapper extends BaseMapper<NoCarWayBill> {
 
     IPage<List<NoCarWayBill>> selectAllByPage(Page page, @Param("noCarWayBill") NoCarWayBill noCarWayBill);
 
@@ -28,5 +28,6 @@ public interface NoCarWaybillImprtMapper extends BaseMapper<NoCarWayBill>{
     List<NoCarWayBill> selectByHisFlagAndBillStatus(NoCarWayBill noCarWayBill);
 
     int upDateCompany(CompanyVo companyVo);
+
     List<NoCarWayBill> getNoCarNoVoiceQuery(String customerName);
 }

+ 8 - 1
src/main/java/com/jkcredit/invoice/mapper/waybill/NoCarWaybillMapper.java

@@ -11,7 +11,7 @@ import org.springframework.stereotype.Repository;
 import java.util.List;
 
 @Repository
-public interface NoCarWaybillMapper extends BaseMapper<NoCarWayBill>{
+public interface NoCarWaybillMapper extends BaseMapper<NoCarWayBill> {
 
     IPage<List<NoCarWayBill>> selectAllByPage(Page page, @Param("noCarWayBill") NoCarWayBill noCarWayBill);
 
@@ -23,13 +23,20 @@ public interface NoCarWaybillMapper extends BaseMapper<NoCarWayBill>{
     int updateByPrimaryKey(NoCarWayBill record);
 
     int updateByBillNum(NoCarWayBill record);
+
     int updateByBillNumTimeRes(NoCarWayBill record);
+
     NoCarWayBill selectByBillNum(String wayBillNum);
+
     List<NoCarWayBill> selectByBillNumForRe(String wayBillNum);
+
     NoCarWayBill selectByBillNumforLock(String wayBillNum);
+
     void deleteNotRightWayBill(String wayBillNum);
+
     List<NoCarWayBill> selectByHisFlagAndBillStatus(NoCarWayBill noCarWayBill);
 
     int upDateCompany(CompanyVo companyVo);
+
     List<NoCarWayBill> getNoCarNoVoiceQuery(String customerName);
 }

+ 6 - 1
src/main/java/com/jkcredit/invoice/mapper/waybill/SellCarTradeMapper.java

@@ -9,6 +9,7 @@ import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
+
 @Repository
 public interface SellCarTradeMapper extends BaseMapper<SelfCarTrade> {
     IPage<List<SelfCarTrade>> selectAllByPage(Page page, @Param("sellCarTrade") SelfCarTrade sellCarTrade);
@@ -21,9 +22,13 @@ public interface SellCarTradeMapper extends BaseMapper<SelfCarTrade> {
     int updateByTradeId(SelfCarTrade record);
 
     List<SelfCarTrade> selectByTradeId(String tradeId);
+
     List<SelfCarTrade> selectByCardIdByStatus(SelfCarTrade record);
+
     List<SelfCarTrade> selectByCardId(String cardId);
-    List<SelfCarTrade> selectByStatus(@Param("status") String status,@Param("company") String company);
+
+    List<SelfCarTrade> selectByStatus(@Param("status") String status, @Param("company") String company);
+
     int upDateCompany(CompanyVo companyVo);
 
 }

+ 3 - 3
src/main/java/com/jkcredit/invoice/model/entity/calculate/NoCarCalculateInfor.java

@@ -11,7 +11,7 @@ public class NoCarCalculateInfor {
      */
     private Long id;
     /**
-     *  交易Id
+     * 交易Id
      */
     private String tradeId;
 
@@ -42,7 +42,7 @@ public class NoCarCalculateInfor {
     private String buyerTaxpayerCode;
 
     /**
-     *开票时间
+     * 开票时间
      */
     private String invoiceMakeTime;
     private String invoiceMakeStart;
@@ -185,7 +185,7 @@ public class NoCarCalculateInfor {
 
     @Override
     public boolean equals(Object o) {
-        if (this == o){
+        if (this == o) {
             return true;
         }
         if (o == null || getClass() != o.getClass()) {

+ 8 - 7
src/main/java/com/jkcredit/invoice/model/entity/customer/Customer.java

@@ -1,10 +1,11 @@
 package com.jkcredit.invoice.model.entity.customer;
+
 public class Customer {
     private int id;
     /**
      * etc收费费用
      */
-    private Double fee =5d;
+    private Double fee = 5d;
 
     //appKey
     private String customerName;
@@ -21,13 +22,13 @@ public class Customer {
 
     private Integer usenumPlat;
 
-    private Double accountBalance =0d;
+    private Double accountBalance = 0d;
     /**
      * 2.无车 0.自有车
      */
     private Integer bussinessType;
 
-    private Integer integrationType=0;
+    private Integer integrationType = 0;
 
     private String firstSign;
     //0 -正常 1-停用
@@ -151,6 +152,10 @@ public class Customer {
         return company;
     }
 
+    public void setCompany(String company) {
+        this.company = company == null ? null : company.trim();
+    }
+
     public Double getFee() {
         return fee;
     }
@@ -159,10 +164,6 @@ public class Customer {
         this.fee = fee;
     }
 
-    public void setCompany(String company) {
-        this.company = company == null ? null : company.trim();
-    }
-
     public String getSubCompany() {
         return subCompany;
     }

+ 5 - 2
src/main/java/com/jkcredit/invoice/model/entity/customer/CustomerCarRec.java

@@ -1,4 +1,5 @@
 package com.jkcredit.invoice.model.entity.customer;
+
 public class CustomerCarRec {
     private String customerName;
 
@@ -9,7 +10,9 @@ public class CustomerCarRec {
     private String businessType;
 
     private String carNum;
-    /**车辆颜色 蓝牌车需要 填运营类型**/
+    /**
+     * 车辆颜色 蓝牌车需要 填运营类型
+     **/
     private String carColor;
     //运营类型,当为蓝牌车时为必填选项
     private Integer serviceOperation;
@@ -32,7 +35,7 @@ public class CustomerCarRec {
      */
     private Integer recStatus = 0;
 
-    private Integer interType =1; //0-接口 1-平台
+    private Integer interType = 1; //0-接口 1-平台
 
     private String failReason;
 

+ 2 - 2
src/main/java/com/jkcredit/invoice/model/entity/customer/CustomerEtcChangeInfo.java

@@ -11,7 +11,7 @@ public class CustomerEtcChangeInfo {
      */
     private String customerId;
     /**
-     *原公司编号
+     * 原公司编号
      */
     private String companyNum;
 
@@ -89,7 +89,7 @@ public class CustomerEtcChangeInfo {
         this.customerId = customerId;
     }
 
-    public  void copyFromChangeDto(CardChangeDto cardChangeDto){
+    public void copyFromChangeDto(CardChangeDto cardChangeDto) {
         this.setCustomerId(cardChangeDto.getCustomerId());
         this.companyName = cardChangeDto.getCompanyName();
         this.companyNum = cardChangeDto.getCompanyNum();

+ 9 - 13
src/main/java/com/jkcredit/invoice/model/entity/customer/CustomerRec.java

@@ -6,13 +6,12 @@ import cn.afterturn.easypoi.excel.annotation.Excel;
  * 客户备案信息
  */
 public class CustomerRec {
-    private Long id;
     /**
      * 客户名称
      */
     @Excel(name = "appKey")
     public String customerName;
-
+    private Long id;
     /**
      * 紧急联系人
      */
@@ -60,11 +59,11 @@ public class CustomerRec {
     private Integer companyType;
     /**
      * 1-快递
-     2-速运
-     3-货运代理
-     4-普通货运
-     5-专线运输
-     6-其他
+     * 2-速运
+     * 3-货运代理
+     * 4-普通货运
+     * 5-专线运输
+     * 6-其他
      * 运营范围
      */
     private Integer operatingRangeType;
@@ -83,7 +82,7 @@ public class CustomerRec {
      */
     private Integer recStatus;
 
-    private Integer interType =1; //0-接口 1-平台
+    private Integer interType = 1; //0-接口 1-平台
 
     /**
      * 业务类型 0 -自有车 1-外协车 2-无车
@@ -104,14 +103,12 @@ public class CustomerRec {
     private String serviceEndTime;
 
 
-
     /**
      * 服务结束时间开始
      */
     private String serviceEndTimeStart;
 
 
-
     /**
      * 服务结束时间结束
      */
@@ -138,7 +135,7 @@ public class CustomerRec {
     /**
      * 1-协议已上传 2-协议未上传
      */
-    private Integer contractSuc =2;
+    private Integer contractSuc = 2;
 
     /**
      * 协议编号 协议上传成功后返回
@@ -146,13 +143,12 @@ public class CustomerRec {
     private String contrantNum;
 
     /**
-     *  企业注册失败原因
+     * 企业注册失败原因
      */
     private String fileMessage;
 
 
     /**
-     *
      * 协议上传状态
      * 1、协议上传失败
      * 2、协议上传成功,审批中

+ 14 - 14
src/main/java/com/jkcredit/invoice/model/entity/invoice/BillInvoice.java

@@ -38,7 +38,7 @@ public class BillInvoice {
     private String invoiceCode;
 
     /**
-     *开票时间
+     * 开票时间
      */
     private String invoiceMakeTime;
 
@@ -46,35 +46,35 @@ public class BillInvoice {
 
     private String invoiceMakeEnd;
     /**
-     *发票url
+     * 发票url
      */
     private String invoiceUrl;
     /**
-     *发票板式文件url
+     * 发票板式文件url
      */
     private String invoiceHtmlUrl;
     /**
-     *入口收费站
+     * 入口收费站
      */
     private String enStation;
     /**
-     *出口收费站
+     * 出口收费站
      */
     private String exStation;
     /**
-     *交易时间
+     * 交易时间
      */
     private String exTime;
     /**
-     *交易金额
+     * 交易金额
      */
     private long fee;
     /**
-     *税额(可抵扣金额)
+     * 税额(可抵扣金额)
      */
     private long totalTaxAmount;
     /**
-     *车牌号
+     * 车牌号
      */
     private String plateNum;
     /**
@@ -100,9 +100,9 @@ public class BillInvoice {
     private List<String> plateNums;
     /**
      * 运单状态  未结束	1
-                开票中	2
-              开票完成	3
-             超时作废	4
+     * 开票中	2
+     * 开票完成	3
+     * 超时作废	4
      */
     private Integer waybillStatus;
     /**
@@ -166,7 +166,7 @@ public class BillInvoice {
      * 开票中	2
      * 开票完成	3
      */
-    private  Integer invoiceStatus;
+    private Integer invoiceStatus;
 
     /**
      * 发票状态信息
@@ -176,7 +176,7 @@ public class BillInvoice {
     /**
      * 对接方式 0 接口 1平台
      */
-    private  Integer interType = 1;
+    private Integer interType = 1;
 
     public Integer getInterType() {
         return interType;

+ 8 - 7
src/main/java/com/jkcredit/invoice/model/entity/invoice/SelfCarAppl.java

@@ -22,37 +22,38 @@ public class SelfCarAppl {
     /**
      * 申请Id
      */
-   private String applId;
+    private String applId;
     /**
      * 发票数量
      */
-   private Integer invoiceCount;
+    private Integer invoiceCount;
 
     /**
      * 发票金额
      */
-   private long invoiceAmount;
+    private long invoiceAmount;
 
     /**
      * 发票税额
      */
-   private long invoiceTaxAmount;
+    private long invoiceTaxAmount;
 
     /**
      * 申请时间
      */
-   private String applTime;
+    private String applTime;
 
     /**
      * 是否已经取票 0 -未取票 1-已经取票
+     *
      * @return
      */
-    private Integer voiceFlag =0;
+    private Integer voiceFlag = 0;
 
     /**
      * 对接方式 0 接口 1平台
      */
-    private  Integer interType = 1;
+    private Integer interType = 1;
 
     public Integer getInterType() {
         return interType;

+ 9 - 9
src/main/java/com/jkcredit/invoice/model/entity/invoice/SelfCarInvoice.java

@@ -39,7 +39,7 @@ public class SelfCarInvoice {
      */
     private String invoiceCode;
     /**
-     *开票时间
+     * 开票时间
      */
     private String invoiceMakeTime;
 
@@ -47,35 +47,35 @@ public class SelfCarInvoice {
 
     private String invoiceMakeEnd;
     /**
-     *发票url
+     * 发票url
      */
     private String invoiceUrl;
     /**
-     *发票板式文件url
+     * 发票板式文件url
      */
     private String invoiceHtmlUrl;
     /**
-     *入口收费站
+     * 入口收费站
      */
     private String enStation;
     /**
-     *出口收费站
+     * 出口收费站
      */
     private String exStation;
     /**
-     *交易时间
+     * 交易时间
      */
     private String exTime;
     /**
-     *交易金额
+     * 交易金额
      */
     private long fee;
     /**
-     *税额(可抵扣金额)
+     * 税额(可抵扣金额)
      */
     private long totalTaxAmount;
     /**
-     *车牌号
+     * 车牌号
      */
     private String plateNum;
     /**

+ 1 - 2
src/main/java/com/jkcredit/invoice/model/entity/manager/Param.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+
 import java.io.Serializable;
 
 /**
@@ -36,7 +37,6 @@ public class Param implements Serializable {
     private String paramValue;
 
 
-
     /**
      * 备注
      */
@@ -44,5 +44,4 @@ public class Param implements Serializable {
     private String paramNote;
 
 
-
 }

+ 1 - 1
src/main/java/com/jkcredit/invoice/model/entity/user/User.java

@@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+
 import java.io.Serializable;
 
 /**
@@ -72,7 +73,6 @@ public class User implements Serializable {
     private String roleName;
 
 
-
     /**
      * 创建时间
      */

+ 10 - 10
src/main/java/com/jkcredit/invoice/model/entity/waybill/NoCarWayBill.java

@@ -8,16 +8,16 @@ import java.util.List;
 /**
  * 无车实体类
  */
-public class NoCarWayBill implements Cloneable{
-    /**
-     * id
-     */
-    private Long id;
+public class NoCarWayBill implements Cloneable {
     /**
      * 客户名称
      */
     public String customerName;
     /**
+     * id
+     */
+    private Long id;
+    /**
      * 公司名称
      */
     private String companyName;
@@ -49,7 +49,7 @@ public class NoCarWayBill implements Cloneable{
      */
     private String startTime;
 
-    @Excel(name = "运单开始时间",format="yyyy-MM-dd HH:mm:ss",databaseFormat = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "运单开始时间", format = "yyyy-MM-dd HH:mm:ss", databaseFormat = "yyyy-MM-dd HH:mm:ss")
     private Date startTimeDate;
     /**
      * 运单开始地址
@@ -77,10 +77,10 @@ public class NoCarWayBill implements Cloneable{
      */
     private String preEndTime;
 
-    @Excel(name = "运单预计完成时间",format="yyyy-MM-dd HH:mm:ss",databaseFormat = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "运单预计完成时间", format = "yyyy-MM-dd HH:mm:ss", databaseFormat = "yyyy-MM-dd HH:mm:ss")
     private Date predictEndTimeDate;
 
-    @Excel(name = "运单实际结束时间",format="yyyy-MM-dd HH:mm:ss",databaseFormat = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "运单实际结束时间", format = "yyyy-MM-dd HH:mm:ss", databaseFormat = "yyyy-MM-dd HH:mm:ss")
     private Date actEndTimeDate;
 
     /**
@@ -125,7 +125,7 @@ public class NoCarWayBill implements Cloneable{
     /**
      * 运单类型 0-实时运单 1-历史运单
      */
-    private Integer hisFlag ;
+    private Integer hisFlag;
 
     /**
      * 行云公司编号
@@ -482,7 +482,7 @@ public class NoCarWayBill implements Cloneable{
 
     @Override
     public NoCarWayBill clone() throws CloneNotSupportedException {
-        return (NoCarWayBill)super.clone();
+        return (NoCarWayBill) super.clone();
     }
 
     public String getDestAddrPre() {

+ 1 - 1
src/main/java/com/jkcredit/invoice/model/entity/waybill/SelfCarTrade.java

@@ -89,7 +89,7 @@ public class SelfCarTrade {
     private String days;
 
 
-    private Integer interType =1; //0-接口 1-平台
+    private Integer interType = 1; //0-接口 1-平台
 
     public Integer getInterType() {
         return interType;

+ 2 - 2
src/main/java/com/jkcredit/invoice/model/vo/SearchInvoiceResultVo.java

@@ -67,7 +67,7 @@ public class SearchInvoiceResultVo extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "车牌号")
     private String plateNum;
 
-//    @Excel(name = "车型")
+    //    @Excel(name = "车型")
     @ApiModelProperty(value = "车型")
     private int vehicleType;
 
@@ -75,7 +75,7 @@ public class SearchInvoiceResultVo extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "运单编号")
     private String waybillNum;
 
-//    @Excel(name = "运单状态")
+    //    @Excel(name = "运单状态")
     @ApiModelProperty(value = "运单状态")
     private int waybillStatus;
 

+ 4 - 1
src/main/java/com/jkcredit/invoice/service/calculateinfor/NoCarCalculateInfoService.java

@@ -3,6 +3,7 @@ package com.jkcredit.invoice.service.calculateinfor;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jkcredit.invoice.model.entity.calculate.NoCarCalculateInfor;
+
 import java.util.List;
 import java.util.Map;
 
@@ -12,6 +13,7 @@ import java.util.Map;
 public interface NoCarCalculateInfoService {
     /**
      * 查询所有计费服务接口
+     *
      * @param page
      * @param calculateInfor
      * @return
@@ -20,8 +22,9 @@ public interface NoCarCalculateInfoService {
 
     /**
      * 查询所有计费统计服务接口
+     *
      * @param calculateInfor
      * @return
      */
-    List<Map<String,String>> findNocarCalculateInfoStatis(NoCarCalculateInfor calculateInfor);
+    List<Map<String, String>> findNocarCalculateInfoStatis(NoCarCalculateInfor calculateInfor);
 }

+ 3 - 1
src/main/java/com/jkcredit/invoice/service/calculateinfor/SelfCarCalculateInfoService.java

@@ -13,6 +13,7 @@ import java.util.Map;
 public interface SelfCarCalculateInfoService {
     /**
      * 查询所有自有车计费服务接口
+     *
      * @param page
      * @param calculateInfor
      * @return
@@ -21,8 +22,9 @@ public interface SelfCarCalculateInfoService {
 
     /**
      * 查询自有车计费统计信息
+     *
      * @param calculateInfor
      * @return
      */
-    List<Map<String,String>> findSelfcarCalculateInfoSta(SelfCarCalculateInfor calculateInfor);
+    List<Map<String, String>> findSelfcarCalculateInfoSta(SelfCarCalculateInfor calculateInfor);
 }

+ 17 - 15
src/main/java/com/jkcredit/invoice/service/calculateinfor/impl/NocarCalculateInfoServiceImpl.java

@@ -1,4 +1,5 @@
 package com.jkcredit.invoice.service.calculateinfor.impl;
+
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -15,33 +16,34 @@ import java.util.Map;
 
 @Service
 /**
-* @Description 无车计费服务
-* @Author  mashengyi
-* @Date   2022/2/8 18:28
-* @Param
-* @Return
-* @Exception
-*
-*/
-public class NocarCalculateInfoServiceImpl extends ServiceImpl<NoCarCalculateInforMapper,NoCarCalculateInfor> implements NoCarCalculateInfoService {
+ * @Description 无车计费服务
+ * @Author mashengyi
+ * @Date 2022/2/8 18:28
+ * @Param
+ * @Return
+ * @Exception
+ *
+ */
+public class NocarCalculateInfoServiceImpl extends ServiceImpl<NoCarCalculateInforMapper, NoCarCalculateInfor> implements NoCarCalculateInfoService {
     @Autowired
     NoCarCalculateInforMapper noCarCalculateInforMapper;
 
     @Autowired
     CustomerMapper customerMapper;
+
     @Override
     public IPage<List<NoCarCalculateInfor>> findByPageAndCalculateInfor(Page page, NoCarCalculateInfor calculateInfor) {
-        return noCarCalculateInforMapper.selectAllByPage(page,calculateInfor);
+        return noCarCalculateInforMapper.selectAllByPage(page, calculateInfor);
     }
 
     @Override
-    public List<Map<String,String>> findNocarCalculateInfoStatis(NoCarCalculateInfor calculateInfor) {
-        List<Map<String,String>> list = noCarCalculateInforMapper.selectforStatis(calculateInfor);
-        for(Map<String,String> map:list){
+    public List<Map<String, String>> findNocarCalculateInfoStatis(NoCarCalculateInfor calculateInfor) {
+        List<Map<String, String>> list = noCarCalculateInforMapper.selectforStatis(calculateInfor);
+        for (Map<String, String> map : list) {
             String customId = map.get("customId");
             Customer customer = customerMapper.selectByCustomerName(customId);
-            if(customer!=null){
-                map.put("customId",customer.getCompany());
+            if (customer != null) {
+                map.put("customId", customer.getCompany());
             }
         }
         return list;

+ 15 - 13
src/main/java/com/jkcredit/invoice/service/calculateinfor/impl/SelfcarCalculateInfoServiceImpl.java

@@ -1,4 +1,5 @@
 package com.jkcredit.invoice.service.calculateinfor.impl;
+
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -14,38 +15,39 @@ import java.util.Map;
 @Service
 
 /**
-* @Description 自有车计费服务
-* @Author  mashengyi
-* @Date   2022/2/8 18:28
-* @Param
-* @Return
-* @Exception
-*
-*/
-public class SelfcarCalculateInfoServiceImpl extends ServiceImpl<SelfCarCalculateInforMapper,SelfCarCalculateInfor> implements SelfCarCalculateInfoService {
+ * @Description 自有车计费服务
+ * @Author mashengyi
+ * @Date 2022/2/8 18:28
+ * @Param
+ * @Return
+ * @Exception
+ *
+ */
+public class SelfcarCalculateInfoServiceImpl extends ServiceImpl<SelfCarCalculateInforMapper, SelfCarCalculateInfor> implements SelfCarCalculateInfoService {
     @Autowired
-    SelfCarCalculateInforMapper carCalculateInforMapper ;
+    SelfCarCalculateInforMapper carCalculateInforMapper;
+
     @Override
     public IPage<List<SelfCarCalculateInfor>> findByPageAndCalculateInfor(Page page, SelfCarCalculateInfor calculateInfor) {
-        return carCalculateInforMapper.selectAllByPage(page,calculateInfor);
+        return carCalculateInforMapper.selectAllByPage(page, calculateInfor);
     }
 
 
     /**
      * 查询自有车计费统计信息
+     *
      * @param calculateInfor
      * @return
      */
     @Override
     public List<Map<String, String>> findSelfcarCalculateInfoSta(SelfCarCalculateInfor calculateInfor) {
-       //1.按企业统计出计费信息条数
+        //1.按企业统计出计费信息条数
 
         //2.按企业统计etc卡数量
 
         //3.通过计费的etc卡数查询对应的交易id数
 
 
-
         return carCalculateInforMapper.findSelfcarCalculateInfoSta(calculateInfor);
     }
 }

+ 1 - 1
src/main/java/com/jkcredit/invoice/service/customer/CustomerChangeInfoService.java

@@ -11,5 +11,5 @@ public interface CustomerChangeInfoService {
 
     IPage findAllCustomerChangeInfo(Page page, CustomerEtcChangeInfo custometEtcChangeInfo);
 
-    List<Map<String,String>> selectChangeCards(String applyId);
+    List<Map<String, String>> selectChangeCards(String applyId);
 }

+ 3 - 1
src/main/java/com/jkcredit/invoice/service/customer/CustomerOperService.java

@@ -8,6 +8,7 @@ public interface CustomerOperService {
 
     /**
      * 查找所有备案信息
+     *
      * @param page
      * @param customerOper
      * @return
@@ -17,9 +18,10 @@ public interface CustomerOperService {
 
     /**
      * 平台上传指令批次信息保存
+     *
      * @param customerName
      * @param operType
      * @return
      */
-    String  saveCustomerOper(String customerName,int operType);
+    String saveCustomerOper(String customerName, int operType);
 }

+ 6 - 1
src/main/java/com/jkcredit/invoice/service/customer/CustomerRecService.java

@@ -9,6 +9,7 @@ import java.util.List;
 public interface CustomerRecService {
     /**
      * 查找所有备案信息
+     *
      * @param page
      * @param customerRec
      * @return
@@ -16,9 +17,9 @@ public interface CustomerRecService {
     IPage findAllCustomerRec(Page page, CustomerRec customerRec);
 
 
-
     /**
      * 查找所有备案信息(备案预警查询)
+     *
      * @param page
      * @param customerRec
      * @return
@@ -28,6 +29,7 @@ public interface CustomerRecService {
 
     /**
      * 客户信息导出
+     *
      * @param customerRec
      * @return
      */
@@ -35,6 +37,7 @@ public interface CustomerRecService {
 
     /**
      * 未在平台备案成功客户查询
+     *
      * @param record
      * @return
      */
@@ -42,6 +45,7 @@ public interface CustomerRecService {
 
     /**
      * 根据企业编码查询客户信息
+     *
      * @param customerRec
      * @return
      */
@@ -49,6 +53,7 @@ public interface CustomerRecService {
 
     /**
      * 根据企业名称查询客户信息
+     *
      * @param customerRec
      * @return
      */

+ 2 - 0
src/main/java/com/jkcredit/invoice/service/customer/CustomerRechargeService.java

@@ -7,6 +7,7 @@ import com.jkcredit.invoice.model.entity.CustomerRecharge;
 public interface CustomerRechargeService {
     /**
      * 查找所有充值信息
+     *
      * @param page
      * @param customerRecharge
      * @return
@@ -16,6 +17,7 @@ public interface CustomerRechargeService {
 
     /**
      * 按照客户维度查询充值信息
+     *
      * @param page
      * @param customerRecharge
      * @return

+ 23 - 7
src/main/java/com/jkcredit/invoice/service/customer/CustomerService.java

@@ -3,17 +3,18 @@ package com.jkcredit.invoice.service.customer;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.jkcredit.invoice.model.entity.customer.Customer;
 import com.jkcredit.invoice.model.entity.CustomerRecharge;
+import com.jkcredit.invoice.model.entity.customer.Customer;
 import com.jkcredit.invoice.model.entity.customer.CustomerRec;
 import com.jkcredit.invoice.util.RespR;
 
 /**
  * 客户操作接口
  */
-public interface CustomerService extends IService<Customer>{
+public interface CustomerService extends IService<Customer> {
     /**
      * 查找所有客户
+     *
      * @param page
      * @param customer
      * @return
@@ -22,13 +23,16 @@ public interface CustomerService extends IService<Customer>{
 
     /**
      * 查找所有客户
+     *
      * @param page
      * @param customer
      * @return
      */
     IPage findAllNomoneyCustomers(Page page, Customer customer);
+
     /**
      * 查找所有客户
+     *
      * @param page
      * @param customer
      * @return
@@ -37,6 +41,7 @@ public interface CustomerService extends IService<Customer>{
 
     /**
      * 查找所有客户
+     *
      * @param customer
      * @return
      */
@@ -44,6 +49,7 @@ public interface CustomerService extends IService<Customer>{
 
     /**
      * 修改用户状态
+     *
      * @param customer
      * @return
      */
@@ -51,6 +57,7 @@ public interface CustomerService extends IService<Customer>{
 
     /**
      * 账号充值
+     *
      * @param customerRecharge
      * @return
      */
@@ -58,28 +65,32 @@ public interface CustomerService extends IService<Customer>{
 
     /**
      * 协议上传
+     *
      * @param customerRec
      * @return
      */
-    RespR  contractAdd(CustomerRec customerRec);
+    RespR contractAdd(CustomerRec customerRec);
 
     /**
      * 协议下载
+     *
      * @param id
      * @return
      */
-    RespR  contractDownload(String id);
+    RespR contractDownload(String id);
 
 
     /**
      * 生成文档下载
+     *
      * @param id
      * @return
      */
-    RespR  generateWordDownload(String id);
+    RespR generateWordDownload(String id);
 
     /**
      * 用户备案
+     *
      * @param customerRec
      * @return
      */
@@ -87,6 +98,7 @@ public interface CustomerService extends IService<Customer>{
 
     /**
      * 查询企业备案信息
+     *
      * @param customerRec
      * @return
      */
@@ -94,16 +106,16 @@ public interface CustomerService extends IService<Customer>{
 
     /**
      * 更新企业备案状态
+     *
      * @param customerRec
      * @return
      */
     RespR updateCustomerRecStatus(CustomerRec customerRec);
 
 
-
-
     /**
      * 修改用户状态
+     *
      * @param customer
      * @return
      */
@@ -111,6 +123,7 @@ public interface CustomerService extends IService<Customer>{
 
     /**
      * 余额校验
+     *
      * @param customerName
      * @return
      */
@@ -119,6 +132,7 @@ public interface CustomerService extends IService<Customer>{
 
     /**
      * 协议上传失败 状态确认
+     *
      * @param customerRec
      * @return
      */
@@ -126,6 +140,7 @@ public interface CustomerService extends IService<Customer>{
 
     /**
      * 协议上传成功,审批中状态确认
+     *
      * @param customerRec
      * @return
      */
@@ -133,6 +148,7 @@ public interface CustomerService extends IService<Customer>{
 
     /**
      * 备案成功状态确认
+     *
      * @param customerRec
      * @return
      */

+ 4 - 3
src/main/java/com/jkcredit/invoice/service/customer/impl/CustomerChangeInfoServiceImpl.java

@@ -13,17 +13,18 @@ import java.util.List;
 import java.util.Map;
 
 @Service("customerChangeInfoService")
-public class CustomerChangeInfoServiceImpl extends ServiceImpl<CustomerChangeInfoMapper,CustomerEtcChangeInfo> implements CustomerChangeInfoService{
+public class CustomerChangeInfoServiceImpl extends ServiceImpl<CustomerChangeInfoMapper, CustomerEtcChangeInfo> implements CustomerChangeInfoService {
 
     @Autowired
     CustomerChangeInfoMapper customerChangeInfoMapper;
+
     @Override
     public IPage findAllCustomerChangeInfo(Page page, CustomerEtcChangeInfo custometEtcChangeInfo) {
-        return customerChangeInfoMapper.selectAllByPage(page,custometEtcChangeInfo);
+        return customerChangeInfoMapper.selectAllByPage(page, custometEtcChangeInfo);
     }
 
     @Override
-    public List<Map<String,String>> selectChangeCards(String applyId) {
+    public List<Map<String, String>> selectChangeCards(String applyId) {
         return customerChangeInfoMapper.selectChangeCards(applyId);
     }
 }

+ 6 - 4
src/main/java/com/jkcredit/invoice/service/customer/impl/CustomerOperServiceImpl.java

@@ -12,12 +12,12 @@ import com.jkcredit.invoice.util.DateUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+
 @Slf4j
 @Service("customerOperService")
-public class CustomerOperServiceImpl extends ServiceImpl<CustomerOperMapper,CustomerOper> implements CustomerOperService {
+public class CustomerOperServiceImpl extends ServiceImpl<CustomerOperMapper, CustomerOper> implements CustomerOperService {
 
 
-    
     @Autowired
     CustomerOperMapper customerOperMapper;
     @Autowired
@@ -25,24 +25,26 @@ public class CustomerOperServiceImpl extends ServiceImpl<CustomerOperMapper,Cust
 
     /**
      * 查找所有备案信息
+     *
      * @param page
      * @param customerOper
      * @return
      */
     @Override
     public IPage findAllCustomerOper(Page page, CustomerOper customerOper) {
-        return customerOperMapper.selectAllByPage(page,customerOper);
+        return customerOperMapper.selectAllByPage(page, customerOper);
     }
 
     /**
      * 平台上传指令批次信息保存
+     *
      * @param customerName
      * @param operType
      * @return
      */
     @Override
     public String saveCustomerOper(String customerName, int operType) {
-        log.info("开始保存批次信息CustomerOperServiceImpl.saveCustomerOper:("+customerName+","+operType+")");
+        log.info("开始保存批次信息CustomerOperServiceImpl.saveCustomerOper:(" + customerName + "," + operType + ")");
         //保存批次信息
         User user = userMapper.getUserByUserName(customerName);
         String batchNumber = "YD" + System.currentTimeMillis();

+ 16 - 6
src/main/java/com/jkcredit/invoice/service/customer/impl/CustomerRecServiceImpl.java

@@ -12,36 +12,39 @@ import org.springframework.stereotype.Service;
 import java.util.List;
 
 @Service("customerRecService")
-public class CustomerRecServiceImpl extends ServiceImpl<CustomerRecMapper,CustomerRec>   implements CustomerRecService{
+public class CustomerRecServiceImpl extends ServiceImpl<CustomerRecMapper, CustomerRec> implements CustomerRecService {
     @Autowired
     CustomerRecMapper customerRecMapper;
 
     /**
      * 查找所有备案信息
+     *
      * @param page
      * @param customerRec
      * @return
      */
     @Override
     public IPage findAllCustomerRec(Page page, CustomerRec customerRec) {
-        return customerRecMapper.selectAllByPage(page,customerRec);
+        return customerRecMapper.selectAllByPage(page, customerRec);
     }
 
 
     /**
      * 查找所有备案信息(备案预警查询)
+     *
      * @param page
      * @param customerRec
      * @return
      */
     @Override
     public IPage findAllCustomerRecWarning(Page page, CustomerRec customerRec) {
-        return customerRecMapper.selectAllByPageWarning(page,customerRec);
+        return customerRecMapper.selectAllByPageWarning(page, customerRec);
     }
 
 
     /**
      * 客户信息导出
+     *
      * @param customerRec
      * @return
      */
@@ -53,35 +56,42 @@ public class CustomerRecServiceImpl extends ServiceImpl<CustomerRecMapper,Custom
 
     /**
      * 未在平台备案成功客户查询
+     *
      * @param record
      * @return
      */
     @Override
     public synchronized CustomerRec selectByCustomerNameAndCompanyReference(CustomerRec record) {
         CustomerRec customerRec = customerRecMapper.selectByCustomerNameAndCompanyReference(record);
-        if(customerRec == null || customerRec.getRecStatus()!=1){customerRec = null;}
+        if (customerRec == null || customerRec.getRecStatus() != 1) {
+            customerRec = null;
+        }
         return customerRec;
     }
 
     /**
      * 根据企业编码查询客户信息
+     *
      * @param record
      * @return
      */
     @Override
     public synchronized CustomerRec selectByCustomerNameAndCompanyNum(CustomerRec record) {
         CustomerRec customerRec = customerRecMapper.selectByCustomerNameAndCompanyNum(record);
-        if(customerRec == null || customerRec.getRecStatus()!=1){customerRec = null;}
+        if (customerRec == null || customerRec.getRecStatus() != 1) {
+            customerRec = null;
+        }
         return customerRec;
     }
 
     /**
      * 根据企业名称查询客户信息
+     *
      * @param record
      * @return
      */
     @Override
-    public  CustomerRec selectByCustomerNameAndCompanyConcat(CustomerRec record) {
+    public CustomerRec selectByCustomerNameAndCompanyConcat(CustomerRec record) {
         return customerRecMapper.selectByCustomerNameAndCompanyConcat(record);
     }
 }

+ 5 - 3
src/main/java/com/jkcredit/invoice/service/customer/impl/CustomerRechargeServiceImpl.java

@@ -10,30 +10,32 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 @Service("customerRechargeService")
-public class CustomerRechargeServiceImpl extends ServiceImpl<CustomerRechargeMapper,CustomerRecharge> implements CustomerRechargeService{
+public class CustomerRechargeServiceImpl extends ServiceImpl<CustomerRechargeMapper, CustomerRecharge> implements CustomerRechargeService {
     @Autowired
     CustomerRechargeMapper customerRechargeMapper;
 
     /**
      * 查找所有充值信息
+     *
      * @param page
      * @param customerRecharge
      * @return
      */
     @Override
     public IPage findAllCustomerRecharge(Page page, CustomerRecharge customerRecharge) {
-        return customerRechargeMapper.selectAllByPage(page,customerRecharge);
+        return customerRechargeMapper.selectAllByPage(page, customerRecharge);
     }
 
 
     /**
      * 按照客户维度查询充值信息
+     *
      * @param page
      * @param customerRecharge
      * @return
      */
     @Override
     public IPage findAllCustomerRechargeMoney(Page page, CustomerRecharge customerRecharge) {
-        return customerRechargeMapper.selectAllByPageMoney(page,customerRecharge);
+        return customerRechargeMapper.selectAllByPageMoney(page, customerRecharge);
     }
 }

+ 65 - 70
src/main/java/com/jkcredit/invoice/service/customer/impl/CustomerServiceImpl.java

@@ -24,11 +24,9 @@ import static com.jkcredit.invoice.common.CommonConst.REC_STATUS_UN;
 
 @Service("customerService")
 @Slf4j
-public class CustomerServiceImpl extends ServiceImpl<CustomerMapper,Customer> implements CustomerService{
+public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> implements CustomerService {
 
 
-    
-    
     @Autowired
     CustomerMapper customerMapper;
 
@@ -43,62 +41,63 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper,Customer> im
 
     @Autowired
     CustomerService customerService;
+
     @Override
     public IPage findAllCustomers(Page page, Customer customer) {
-        return baseMapper.selectAllByPage(page,customer);
+        return baseMapper.selectAllByPage(page, customer);
     }
 
     @Override
     public IPage findAllNomoneyCustomers(Page page, Customer customer) {
-        return customerMapper.selectAllByPageForNoMoney(page,customer);
+        return customerMapper.selectAllByPageForNoMoney(page, customer);
     }
 
 
-
     @Override
     public IPage findAllNomoneyCustomersByZero(Page page, Customer customer) {
-        return customerMapper.selectAllByPageForNoMoneyByZero(page,customer);
+        return customerMapper.selectAllByPageForNoMoneyByZero(page, customer);
     }
 
     @Override
     public Boolean addCustomers(Customer customer) {
-        log.info("开始添加客户信息:CustomerServiceImpl.addCustomers{}",customer);
+        log.info("开始添加客户信息:CustomerServiceImpl.addCustomers{}", customer);
         customer.setFirstSign(DateUtil.getCurrentDateStr());
-        if(customerMapper.selectByCustomerName(customer.getCustomerName())!=null){
+        if (customerMapper.selectByCustomerName(customer.getCustomerName()) != null) {
             return false;
-        };
-        return customerMapper.insert(customer)>0;
+        }
+        return customerMapper.insert(customer) > 0;
     }
 
     @Override
     public Boolean updateCustomer(Customer customer) {
-       return  customerMapper.updateByPrimaryKeySelective(customer)>0;
+        return customerMapper.updateByPrimaryKeySelective(customer) > 0;
     }
 
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Boolean customRecharge(CustomerRecharge customerRecharge) {
-        log.info("开始充值:CustomerServiceImpl.customRecharge{}",customerRecharge);
-        if(null == customerRecharge.getRechargeMony() || "".equals(customerRecharge.getRechargeMony())){
+        log.info("开始充值:CustomerServiceImpl.customRecharge{}", customerRecharge);
+        if (null == customerRecharge.getRechargeMony() || "".equals(customerRecharge.getRechargeMony())) {
             log.error("充值失败:CustomerServiceImpl.getRechargeMony:" + customerRecharge.getRechargeMony());
             return false;
         }
         Customer customer = customerMapper.selectByCustomerName(customerRecharge.getCustomerName());
-        Double currentMoney = MathUtil.add(customer.getAccountBalance(),customerRecharge.getRechargeMony());
+        Double currentMoney = MathUtil.add(customer.getAccountBalance(), customerRecharge.getRechargeMony());
         customer.setAccountBalance(currentMoney);
         customerMapper.updateByPrimaryKeySelective(customer);
         customerRecharge.setRechargeTime(DateUtil.getCurrentDateStr());
         customerRecharge.setBeforeMony(customer.getAccountBalance());
         customerRecharge.setCompanyName(customer.getCompany());
         customerRechargeMapper.insert(customerRecharge);
-        log.info("充值结束:CustomerServiceImpl.customRecharge{}",customerRecharge);
+        log.info("充值结束:CustomerServiceImpl.customRecharge{}", customerRecharge);
         return true;
     }
+
     @Override
-    public RespR contractAdd(CustomerRec customerRec){
-        log.info("开始上传协议:CustomerServiceImpl.contractAdd{}",customerRec);
-        if(customerRec.getRecStatus().intValue() == REC_STATUS_UN){
-            return new RespR(false,"无法上传协议,未注册");
+    public RespR contractAdd(CustomerRec customerRec) {
+        log.info("开始上传协议:CustomerServiceImpl.contractAdd{}", customerRec);
+        if (customerRec.getRecStatus().intValue() == REC_STATUS_UN) {
+            return new RespR(false, "无法上传协议,未注册");
         }
         B2bContractAddRequest b2bContractAddRequest = new B2bContractAddRequest();
         b2bContractAddRequest.setCompanyNum(customerRec.getCompanyNum());
@@ -108,12 +107,12 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper,Customer> im
         b2bContractAddRequest.setContractFileName(customerRec.getContractFileName());
         b2bContractAddRequest.setBase64Str(customerRec.getBase64Str());
         RespR<B2bContractAddResponse> responseRespR = commInterFace.b2bContractAdd(b2bContractAddRequest);
-        if(responseRespR.getCode() == 1){
-            log.info("协议上传失败:CustomerServiceImpl.contractAdd{}---msg{}",customerRec,responseRespR.getMsg());
+        if (responseRespR.getCode() == 1) {
+            log.info("协议上传失败:CustomerServiceImpl.contractAdd{}---msg{}", customerRec, responseRespR.getMsg());
             //解决下游客户传递企业注册信息未传递协议信息时,备案文档无法下载问题,可以由业务人员在协议信息中补填协议信息,进行备案文档下载
             //失败后不再更新数据库信息
-            return new RespR(false,responseRespR.getMsg());
-        }else{
+            return new RespR(false, responseRespR.getMsg());
+        } else {
             log.info("协议上传成功:CustomerServiceImpl.contractAdd");
             customerRec.setContractSuc(1);
             customerRec.setContrantNum(responseRespR.getData().getContrantNum());
@@ -124,28 +123,26 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper,Customer> im
     }
 
 
-
-
-
     @Override
-    public RespR contractStatusFail(CustomerRec customerRec){
-        log.info("协议上传失败状态确认:CustomerServiceImpl.contractStatusFail{}",customerRec);
+    public RespR contractStatusFail(CustomerRec customerRec) {
+        log.info("协议上传失败状态确认:CustomerServiceImpl.contractStatusFail{}", customerRec);
 
-        if(customerRec.getRecStatus().intValue() == REC_STATUS_UN){
-            return new RespR(false,"无法更新协议状态,还未注册");
+        if (customerRec.getRecStatus().intValue() == REC_STATUS_UN) {
+            return new RespR(false, "无法更新协议状态,还未注册");
         }
         //协议上传失败状态
-       customerRec.setContractStatus(1);
-       customerRecMapper.updateContractStatus(customerRec);
+        customerRec.setContractStatus(1);
+        customerRecMapper.updateContractStatus(customerRec);
 
-       return new RespR("协议上传失败状态操作完成");
+        return new RespR("协议上传失败状态操作完成");
     }
+
     @Override
-    public RespR contractStatusProcess(CustomerRec customerRec){
-        log.info("协议上传成功,审批中状态确认:CustomerServiceImpl.contractStatusProcess{}",customerRec);
+    public RespR contractStatusProcess(CustomerRec customerRec) {
+        log.info("协议上传成功,审批中状态确认:CustomerServiceImpl.contractStatusProcess{}", customerRec);
 
-        if(customerRec.getRecStatus().intValue() == REC_STATUS_UN){
-            return new RespR(false,"无法更新协议状态,还未注册");
+        if (customerRec.getRecStatus().intValue() == REC_STATUS_UN) {
+            return new RespR(false, "无法更新协议状态,还未注册");
         }
         //协议上传成功,审批中状态
         customerRec.setContractStatus(2);
@@ -153,12 +150,13 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper,Customer> im
 
         return new RespR("协议上传成功,审批中状态操作完成");
     }
+
     @Override
-    public RespR contractStatusSuccess(CustomerRec customerRec){
-        log.info("备案成功状态确认:CustomerServiceImpl.contractStatusSuccess{}",customerRec);
+    public RespR contractStatusSuccess(CustomerRec customerRec) {
+        log.info("备案成功状态确认:CustomerServiceImpl.contractStatusSuccess{}", customerRec);
 
-        if(customerRec.getRecStatus().intValue() == REC_STATUS_UN){
-            return new RespR(false,"无法更新协议状态,还未注册");
+        if (customerRec.getRecStatus().intValue() == REC_STATUS_UN) {
+            return new RespR(false, "无法更新协议状态,还未注册");
         }
         //备案成功状态
         customerRec.setContractStatus(3);
@@ -173,7 +171,6 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper,Customer> im
     }
 
 
-
     @Override
     public RespR generateWordDownload(String id) {
         CustomerRec customerRec = customerRecMapper.selectByPrimaryKeyHasNoLocalBase64(Integer.valueOf(id));
@@ -181,23 +178,23 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper,Customer> im
     }
 
     @Override
-    public RespR customeRec(CustomerRec customerRec){
-        log.info("开始客户注册:CustomerServiceImpl.customeRec{}",customerRec);
+    public RespR customeRec(CustomerRec customerRec) {
+        log.info("开始客户注册:CustomerServiceImpl.customeRec{}", customerRec);
         CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyReference(customerRec);
-        if(null != customerRec1){
-            return new RespR(false,"客户已经备案成功,无需备案");
+        if (null != customerRec1) {
+            return new RespR(false, "客户已经备案成功,无需备案");
         }
         customerRecMapper.updateByPrimaryKeySelective(customerRec);
         CompanyAddRequest companyAddRequest = buildCompany(customerRec);
-        log.info("开始客户上游注册:CustomerServiceImpl.customeRec{}",customerRec);
+        log.info("开始客户上游注册:CustomerServiceImpl.customeRec{}", customerRec);
         //注册企业
         RespR<CompanyAddResponse> respR = commInterFace.addCompany(companyAddRequest);
-        if(respR.getCode() == 1){
-            log.info("客户上游注册失败:CustomerServiceImpl.customeRec{},msg{}",customerRec,respR.getMsg());
+        if (respR.getCode() == 1) {
+            log.info("客户上游注册失败:CustomerServiceImpl.customeRec{},msg{}", customerRec, respR.getMsg());
             customerRec.setRecStatus(2);
             customerRec.setFileMessage(respR.getMsg());
             customerRecMapper.updateByPrimaryKeySelective(customerRec);
-            return new RespR(false,respR.getMsg());
+            return new RespR(false, respR.getMsg());
         }
         log.info("客户上游注册成功:CustomerServiceImpl.customeRec{}");
         CompanyAddResponse response = respR.getData();
@@ -208,10 +205,10 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper,Customer> im
         customerRec.setCompanyNum(companyNum);
         customerRecMapper.updateByCompany(customerRec);
         //contractAdd(customerRec);
-        return new RespR(true,respR.getData().toString());
-    };
+        return new RespR(true, respR.getData().toString());
+    }
 
-    private CompanyAddRequest buildCompany(CustomerRec customerRec){
+    private CompanyAddRequest buildCompany(CustomerRec customerRec) {
         CompanyAddRequest companyAddRequest = new CompanyAddRequest();
         companyAddRequest.setName(customerRec.getCompanyName());
         companyAddRequest.setTaxpayerCode(customerRec.getCompanyReferencenum());
@@ -228,54 +225,52 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper,Customer> im
         companyAddRequest.setEmergencyTel(customerRec.getCompanyLeaderPhone());
         companyAddRequest.setEmergencyContact(customerRec.getCompanyLeader());
         companyAddRequest.setCompanyType(customerRec.getCompanyType());
-        return  companyAddRequest;
-    };
+        return companyAddRequest;
+    }
 
     @Override
     public RespR customerRecQuery(CustomerRec customerRec) {
-        log.info("查询注册信息:CustomerServiceImpl.customerRecQuery{}",customerRec);
+        log.info("查询注册信息:CustomerServiceImpl.customerRecQuery{}", customerRec);
         CompanyQueryRequest companyQueryRequest = new CompanyQueryRequest();
         companyQueryRequest.setCompanyName(customerRec.getCompanyName());
         companyQueryRequest.setTaxpaterCode(customerRec.getCompanyReferencenum());
         RespR<CompanyQueryResponse> responseRespR = commInterFace.companyQuery(companyQueryRequest);
-        if(responseRespR.getCode() == 1){
-            return new RespR(false,responseRespR.getMsg());
-        }else{
+        if (responseRespR.getCode() == 1) {
+            return new RespR(false, responseRespR.getMsg());
+        } else {
             return new RespR(responseRespR.getData().getItems());
         }
     }
 
     @Override
     public RespR updateCustomerRecStatus(CustomerRec customerRec) {
-        log.info("更新注册信息:CustomerServiceImpl.customerRecQuery{}",customerRec);
+        log.info("更新注册信息:CustomerServiceImpl.customerRecQuery{}", customerRec);
         CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompany(customerRec);
         customerRec1.setRecStatus(customerRec.getRecStatus());
         int i = customerRecMapper.updateByPrimaryKey(customerRec1);
-        if(i<=0){
-            log.info("更新注册信息失败:CustomerServiceImpl.customerRecQuery{}",customerRec);
+        if (i <= 0) {
+            log.info("更新注册信息失败:CustomerServiceImpl.customerRecQuery{}", customerRec);
             return new RespR(false);
         }
-        log.info("更新注册信息成功:CustomerServiceImpl.customerRecQuery{}",customerRec);
+        log.info("更新注册信息成功:CustomerServiceImpl.customerRecQuery{}", customerRec);
         return new RespR(true);
     }
 
     @Override
     public Customer getCustomerByAppKeyAndAppSecret(Customer customer) {
-        return customerMapper.selectByAppKeyAndAppSecret( customer.getCustomerName(), customer.getAppSecret());
+        return customerMapper.selectByAppKeyAndAppSecret(customer.getCustomerName(), customer.getAppSecret());
     }
 
     /**
      * 余额校验
+     *
      * @param customerName
      * @return
      */
     @Override
     public boolean checkMoneyEnough(String customerName) {
         Customer customer = customerMapper.selectByCustomerName(customerName);
-        log.info("客户余额查询:CustomerServiceImpl.checkMoneyEnough{}",customer);
-        if(customer== null || customer.getAccountBalance()<=0){
-            return false;
-        }
-        return true;
+        log.info("客户余额查询:CustomerServiceImpl.checkMoneyEnough{}", customer);
+        return customer != null && customer.getAccountBalance() > 0;
     }
 }

+ 4 - 2
src/main/java/com/jkcredit/invoice/service/lowerservice/CheckHasAuthRole.java

@@ -6,15 +6,17 @@ public interface CheckHasAuthRole {
 
     /**
      * 公司角色校验
+     *
      * @param user
      * @param company
      */
-    public void checkCompanyRole(User user,String company);
+    void checkCompanyRole(User user, String company);
 
     /**
      * 客户角色校验
+     *
      * @param user
      * @param customerName
      */
-    public void checkCustomerRole(User user,String customerName);
+    void checkCustomerRole(User user, String customerName);
 }

+ 5 - 0
src/main/java/com/jkcredit/invoice/service/lowerservice/CustomeLowerService.java

@@ -11,6 +11,7 @@ import java.util.List;
 public interface CustomeLowerService {
     /**
      * 客户备案
+     *
      * @param customerRecs
      * @return
      */
@@ -18,6 +19,7 @@ public interface CustomeLowerService {
 
     /**
      * 客户备案列表查询(本地库)
+     *
      * @param customerRec
      * @return
      */
@@ -25,6 +27,7 @@ public interface CustomeLowerService {
 
     /**
      * 客户备案查询(本地库)
+     *
      * @param customerRec
      * @return
      */
@@ -33,6 +36,7 @@ public interface CustomeLowerService {
 
     /**
      * 协议上传 上传到本地库
+     *
      * @param customerRecs
      * @return
      */
@@ -41,6 +45,7 @@ public interface CustomeLowerService {
 
     /**
      * 协议上传状态查询(本地库)
+     *
      * @param customerRec
      * @return
      */

+ 16 - 2
src/main/java/com/jkcredit/invoice/service/lowerservice/NoCarService.java

@@ -14,6 +14,7 @@ import java.util.List;
 public interface NoCarService {
     /**
      * 车辆备案
+     *
      * @param customerCarRec
      * @return
      */
@@ -21,53 +22,61 @@ public interface NoCarService {
 
     /**
      * 车辆备案查询查上游
+     *
      * @param customerCarRec
      * @return
      */
     RespR customerCarRecQueryUpper(CustomerCarRec customerCarRec);
 
 
-
     /**
      * 无车车辆备案查询
+     *
      * @param customerCarRec
      * @return
      */
     RespR customerCarRecQuery(CustomerCarRec customerCarRec);
+
     /**
      * 运单指令开始
+     *
      * @return
      */
     RespR noCarWaybillStart(NoCarWayBill noCarWayBill);
 
     /**
      * 运单指令结束
+     *
      * @return
      */
     RespR noCarWaybillEnd(NoCarWayBill noCarWayBill);
 
     /**
      * 历史运单指令开始
+     *
      * @return
      */
     RespR noCarHisWaybillStart(NoCarWayBill noCarWayBill);
 
     /**
      * 历史运单指令结束
+     *
      * @return
      */
     RespR noCarHisWaybillEnd(NoCarWayBill noCarWayBill);
 
     /**
      * 获取发票和运单状态 true 实时 false 走本地
+     *
      * @param noCarWayBill
      * @param isInterface
      * @return
      */
-    RespR getInvoiceByWayBillNumReal(NoCarWayBill noCarWayBill,boolean isInterface);
+    RespR getInvoiceByWayBillNumReal(NoCarWayBill noCarWayBill, boolean isInterface);
 
     /**
      * 红冲发票查询
+     *
      * @param hcInvoiceQueryVo
      * @return
      */
@@ -75,6 +84,7 @@ public interface NoCarService {
 
     /**
      * 红冲发票查询接口
+     *
      * @param hcInvoiceQueryVo
      * @return
      */
@@ -82,6 +92,7 @@ public interface NoCarService {
 
     /**
      * 红冲发票更新
+     *
      * @param hcInvoiceQueryVo
      * @return
      */
@@ -90,6 +101,7 @@ public interface NoCarService {
 
     /**
      * 月账单查询
+     *
      * @param monthAccountQueryVo
      * @return
      */
@@ -97,6 +109,7 @@ public interface NoCarService {
 
     /**
      * 月账单查询更新
+     *
      * @param monthAccountQueryVo
      * @return
      */
@@ -104,6 +117,7 @@ public interface NoCarService {
 
     /**
      * 获取发票和运单状态 true 实时 false 走本地 自用,不对外
+     *
      * @param noCarWayBill1
      * @param b
      * @return

+ 11 - 3
src/main/java/com/jkcredit/invoice/service/lowerservice/SelfCarServiceL.java

@@ -27,25 +27,28 @@ public interface SelfCarServiceL {
 
     /**
      * 开票申请接口
+     *
      * @param invoiceApplVo
      * @return
      */
     RespR<String> applInvoice(InvoiceApplVo invoiceApplVo);
 
     /**
-     *按申请id取发票
+     * 按申请id取发票
      */
     RespR<List<B2BInvoiceQueryByApplyModel>> getSelfCarInvoicesByApplyIds(ApplQueryInvVo applQueryInvVo);
 
     /**
-     *已开发票查询接口
+     * 已开发票查询接口
      */
     RespR<List<B2BInvoiceListModel>> getSelfCarInvoicesByTime(SelfCarDueQueryVo selfCarDueQueryVo, CustomerRec customerRec);
 
 
-    RespR<List<B2bInvoicePackageModel>>  getInvoicePackge(InvoicePackageVo invoicePackageVo);
+    RespR<List<B2bInvoicePackageModel>> getInvoicePackge(InvoicePackageVo invoicePackageVo);
+
     /**
      * 根据车牌获取ETC卡信息
+     *
      * @param etcQueryVo
      * @return
      */
@@ -53,12 +56,15 @@ public interface SelfCarServiceL {
 
     /**
      * etc备案查询
+     *
      * @param etcBindVo
      * @return
      */
     RespR queryEtcInfo(EtcBindVo etcBindVo);
+
     /**
      * ETC备案
+     *
      * @param
      * @return
      */
@@ -67,6 +73,7 @@ public interface SelfCarServiceL {
 
     /**
      * ETC校验
+     *
      * @param
      * @return
      */
@@ -74,6 +81,7 @@ public interface SelfCarServiceL {
 
     /**
      * 车辆解绑
+     *
      * @param customerCarRec
      * @return
      */

+ 8 - 7
src/main/java/com/jkcredit/invoice/service/lowerservice/impl/CheckHasAuthRoleImpl.java

@@ -9,29 +9,30 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 @Service("checkHasAuthRole")
-public class CheckHasAuthRoleImpl implements CheckHasAuthRole{
+public class CheckHasAuthRoleImpl implements CheckHasAuthRole {
     @Autowired
     CustomerRecMapper customerRecMapper;
+
     @Override
     public void checkCompanyRole(User user, String companyName) {
-        if(AuthenticationInterceptor.AUTH_ADMIN.equals(user.getRoleId())){
-            return ;
+        if (AuthenticationInterceptor.AUTH_ADMIN.equals(user.getRoleId())) {
+            return;
         }
         CustomerRec customerRecPa = new CustomerRec();
         customerRecPa.setCustomerName(user.getUserName());
         customerRecPa.setCompanyName(companyName);
         CustomerRec customerRec = customerRecMapper.selectByCustomerNameAndCompany(customerRecPa);
-        if(customerRec == null){
+        if (customerRec == null) {
             throw new RuntimeException("非法的资源请求");
         }
     }
 
     @Override
     public void checkCustomerRole(User currentUser, String customerName) {
-        if(AuthenticationInterceptor.AUTH_ADMIN.equals(currentUser.getRoleId())){
-            return ;
+        if (AuthenticationInterceptor.AUTH_ADMIN.equals(currentUser.getRoleId())) {
+            return;
         }
-        if(!currentUser.getUserName().equals(customerName)){
+        if (!currentUser.getUserName().equals(customerName)) {
             throw new RuntimeException("非法的资源请求");
         }
     }

+ 68 - 66
src/main/java/com/jkcredit/invoice/service/lowerservice/impl/CustomerLowerServiceImpl.java

@@ -37,7 +37,7 @@ import static com.jkcredit.invoice.common.WarnMessageConst.PROTOCOL_UPLOAD_INFO_
 @Slf4j
 public class CustomerLowerServiceImpl implements CustomeLowerService {
 
-    
+
     @Autowired
     CustomerMapper customerMapper;
 
@@ -85,35 +85,37 @@ public class CustomerLowerServiceImpl implements CustomeLowerService {
 
     @Override
     public RespR customeRec(List<CustomerRec> customerRecs) {
-        log.info("客户备案信息:CustomerLowerServiceImpl.customeRec{}",customerRecs);
-        if(customerRecs==null || customerRecs.size()<=0){return new RespR(false,FILING_INFORMATION_IS_EMPTY_MESSAGE);};
+        log.info("客户备案信息:CustomerLowerServiceImpl.customeRec{}", customerRecs);
+        if (customerRecs == null || customerRecs.size() <= 0) {
+            return new RespR(false, FILING_INFORMATION_IS_EMPTY_MESSAGE);
+        }
         StringBuffer res = new StringBuffer();
         customerRecs.stream().forEach(customerRec -> {
             Customer customer = customerMapper.selectByCustomerName(customerRec.getCustomerName());
-            if(customer == null || customer.getAccstatus()!=0){
-                res.append("#"+customerRec.getCustomerName()+"不存在或已经停用;#");
+            if (customer == null || customer.getAccstatus() != 0) {
+                res.append("#" + customerRec.getCustomerName() + "不存在或已经停用;#");
                 return;
             }
-            if(!customer.getBussinessType().equals(Integer.parseInt(customerRec.getBussinessType()))){
-                res.append("#"+customerRec.getCompanyName()+"业务类型有误;#");
+            if (!customer.getBussinessType().equals(Integer.parseInt(customerRec.getBussinessType()))) {
+                res.append("#" + customerRec.getCompanyName() + "业务类型有误;#");
                 return;
             }
-            if(org.apache.commons.lang3.StringUtils.isNotBlank(customerRec.getBase64Str())){
-                 int length = customerRec.getBase64Str().length() / 1024 / 1024;
-                 if(length >= 1){
-                     res.append("#"+customerRec.getCompanyName()+"备案信息协议文件不能大于1M;#");
-                     return;
-                 }
+            if (org.apache.commons.lang3.StringUtils.isNotBlank(customerRec.getBase64Str())) {
+                int length = customerRec.getBase64Str().length() / 1024 / 1024;
+                if (length >= 1) {
+                    res.append("#" + customerRec.getCompanyName() + "备案信息协议文件不能大于1M;#");
+                    return;
+                }
             }
-            if(StringUtils.isEmpty(customerRec.getCompanyName()) || StringUtils.isEmpty(customerRec.getCompanyReferencenum())){
+            if (StringUtils.isEmpty(customerRec.getCompanyName()) || StringUtils.isEmpty(customerRec.getCompanyReferencenum())) {
                 res.append("企业备案名称或税号为空");
                 return;
             }
-            if(NO_CAR.equals(customerRec.getBussinessType()) && customerRec.getCompanyType() != REC_STATUS_WAIT){
+            if (NO_CAR.equals(customerRec.getBussinessType()) && customerRec.getCompanyType() != REC_STATUS_WAIT) {
                 res.append("#无车公司类型必须为合作商户#");
                 return;
             }
-            if(SELF_CAR.equals(customerRec.getBussinessType()) && customerRec.getCompanyType() != REC_STATUS_SUC){
+            if (SELF_CAR.equals(customerRec.getBussinessType()) && customerRec.getCompanyType() != REC_STATUS_SUC) {
                 res.append("#自有车公司类型必须为行业用户#");
                 return;
             }
@@ -121,39 +123,39 @@ public class CustomerLowerServiceImpl implements CustomeLowerService {
             customerRec.setRecStatus(0);
             //主动查询上游接口,如果已经备案则更新
             RespR respR = customerService.customerRecQuery(customerRec);
-            if(respR.getCode() == 0){
-               List<B2bCompanyModel> b2bCompanyModels = (List<B2bCompanyModel>)respR.getData();
-               if(b2bCompanyModels.size()>=1){
-                   b2bCompanyModels.forEach(b2bCompanyModel->{
-                       if(b2bCompanyModel.getCompanyType().equals(customerRec.getCompanyType())){
-                           customerRec.setCompanyNum(b2bCompanyModel.getCompanyNum());
-                           customerRec.setCompanyType(b2bCompanyModel.getCompanyType());
-                           customerRec.setCompanyName(b2bCompanyModel.getCompanyName());
-                           customerRec.setRecStatus(1);
-                       }
-                   });
-               }else{
-                   log.info("AAAAAAAAAAA"+customerRec.getCompanyName()+b2bCompanyModels.size());
-               }
+            if (respR.getCode() == 0) {
+                List<B2bCompanyModel> b2bCompanyModels = (List<B2bCompanyModel>) respR.getData();
+                if (b2bCompanyModels.size() >= 1) {
+                    b2bCompanyModels.forEach(b2bCompanyModel -> {
+                        if (b2bCompanyModel.getCompanyType().equals(customerRec.getCompanyType())) {
+                            customerRec.setCompanyNum(b2bCompanyModel.getCompanyNum());
+                            customerRec.setCompanyType(b2bCompanyModel.getCompanyType());
+                            customerRec.setCompanyName(b2bCompanyModel.getCompanyName());
+                            customerRec.setRecStatus(1);
+                        }
+                    });
+                } else {
+                    log.info("AAAAAAAAAAA" + customerRec.getCompanyName() + b2bCompanyModels.size());
+                }
             }
             customerRecInsertOrUpdate(customerRec, customer);
-            try{
+            try {
                 String mail = paramService.getParamsByParamName("MAILTO").getParamValue();
                 sendMailService.sendMail(mail,
-                        mailTemp.replace("${a}",customer.getCustomerName())
-                                .replace("${b}",customer.getCompany())
-                                 .replace("${c}",customerRec.getCompanyName()),customerRec.getCompanyName());
-            }catch (Exception e){
+                        mailTemp.replace("${a}", customer.getCustomerName())
+                                .replace("${b}", customer.getCompany())
+                                .replace("${c}", customerRec.getCompanyName()), customerRec.getCompanyName());
+            } catch (Exception e) {
                 e.printStackTrace();
             }
 
         });
-        if(StringUtils.isEmpty(res.toString())){
-            log.info("客户备案成功:CustomerLowerServiceImpl.customeRec{}",customerRecs);
-            return new RespR(true,"成功");
-        }else{
-            log.info("客户备案失败信息:CustomerLowerServiceImpl.customeRec{},msg{}",customerRecs,res.toString());
-            return new RespR(false,res.toString());
+        if (StringUtils.isEmpty(res.toString())) {
+            log.info("客户备案成功:CustomerLowerServiceImpl.customeRec{}", customerRecs);
+            return new RespR(true, "成功");
+        } else {
+            log.info("客户备案失败信息:CustomerLowerServiceImpl.customeRec{},msg{}", customerRecs, res.toString());
+            return new RespR(false, res.toString());
         }
 
     }
@@ -163,20 +165,20 @@ public class CustomerLowerServiceImpl implements CustomeLowerService {
         CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyReferenceAll(customerRec);
         customerRec.setCreatetime(DateUtil.getCurrentDateStr());
         customerRec.setCompanyBelongName(customer.getCompany());
-        if(customerRec1 == null){
+        if (customerRec1 == null) {
             customerRecMapper.insert(customerRec);
-        }else{
-            if(customerRec1.getCompanyName()!=null && !customerRec1.getCompanyName().equals(customerRec.getCompanyName())){
+        } else {
+            if (customerRec1.getCompanyName() != null && !customerRec1.getCompanyName().equals(customerRec.getCompanyName())) {
                 CompanyVo companyVo = new CompanyVo();
                 companyVo.setNewCompanyName(customerRec.getCompanyName());
                 companyVo.setOldCompanyName(customerRec1.getCompanyName());
-                if(SELF_CAR.equals(customerRec.getBussinessType())){
+                if (SELF_CAR.equals(customerRec.getBussinessType())) {
                     //自有车需要更新 各个表的企业名称
                     selfCarCalculateInforMapper.upDateCompany(companyVo);
                     selfCarInvoiceMapper.upDateCompany(companyVo);
                     sellCarTradeMapper.upDateCompany(companyVo);
                     customerCarRecMapper.upDateCompanySelf(companyVo);
-                }else if(NO_CAR.equals(customerRec.getBussinessType())){
+                } else if (NO_CAR.equals(customerRec.getBussinessType())) {
                     //无车需要跟新各个表的企业名称
                     customerCarRecMapper.upDateCompanyNo(companyVo);
                     billInvoiceMapper.upDateCompany(companyVo);
@@ -188,8 +190,8 @@ public class CustomerLowerServiceImpl implements CustomeLowerService {
             customerRec.setId(customerRec1.getId());
             customerRec.setContractSuc(customerRec1.getContractSuc());
             customerRec.setContrantNum(customerRec1.getContrantNum());
-            customerRec.setContractFileName(customerRec.getContractFileName()==null?customerRec1.getContractFileName():customerRec.getContractFileName());
-            customerRec.setBase64Str(customerRec.getBase64Str()==null?customerRec1.getBase64Str():customerRec.getBase64Str());
+            customerRec.setContractFileName(customerRec.getContractFileName() == null ? customerRec1.getContractFileName() : customerRec.getContractFileName());
+            customerRec.setBase64Str(customerRec.getBase64Str() == null ? customerRec1.getBase64Str() : customerRec.getBase64Str());
             customerRecMapper.updateByPrimaryKey(customerRec);
         }
     }
@@ -199,6 +201,7 @@ public class CustomerLowerServiceImpl implements CustomeLowerService {
 
         return new RespR(customerRecMapper.selectByCustomerNameCpAll(customerRec));
     }
+
     @Override
     public RespR customeRecQuery(CustomerRec customerRec) {
 
@@ -213,18 +216,17 @@ public class CustomerLowerServiceImpl implements CustomeLowerService {
     }
 
 
-
-
-
     @Override
     public RespR customeRecUpload(List<CustomerRec> customerRecs) {
-        log.info("客户协议上传信息:CustomerLowerServiceImpl.customeRecUpload{}",customerRecs);
-        if(customerRecs==null || customerRecs.size()<=0){return new RespR(false,PROTOCOL_UPLOAD_INFO_IS_EMPTY_MESSAGE);};
+        log.info("客户协议上传信息:CustomerLowerServiceImpl.customeRecUpload{}", customerRecs);
+        if (customerRecs == null || customerRecs.size() <= 0) {
+            return new RespR(false, PROTOCOL_UPLOAD_INFO_IS_EMPTY_MESSAGE);
+        }
         StringBuffer res = new StringBuffer();
         customerRecs.stream().forEach(customerRec -> {
             Customer customer = customerMapper.selectByCustomerName(customerRec.getCustomerName());
-            if(customer == null || customer.getAccstatus()!=0){
-                res.append("#"+customerRec.getCustomerName()+"不存在或已经停用;#");
+            if (customer == null || customer.getAccstatus() != 0) {
+                res.append("#" + customerRec.getCustomerName() + "不存在或已经停用;#");
                 return;
             }
 
@@ -234,22 +236,22 @@ public class CustomerLowerServiceImpl implements CustomeLowerService {
             customerRecMapper.updateByPrimaryKeySelectiveUpload(customerRec);
 
 
-            try{
+            try {
                 String mail = paramService.getParamsByParamName("MAILTO").getParamValue();
                 sendMailService.sendMail(mail,
-                        mailProtocolTemp.replace("${a}",customer.getCustomerName())
-                                .replace("${b}",customer.getCompany())
-                                .replace("${c}",customerRec1.getCompanyName()),customerRec1.getCompanyName());
-            }catch (Exception e){
+                        mailProtocolTemp.replace("${a}", customer.getCustomerName())
+                                .replace("${b}", customer.getCompany())
+                                .replace("${c}", customerRec1.getCompanyName()), customerRec1.getCompanyName());
+            } catch (Exception e) {
                 e.printStackTrace();
             }
         });
-        if(StringUtils.isEmpty(res.toString())){
-            log.info("客户协议上传成功信息" + ":CustomerLowerServiceImpl.customeRecUpload{}",customerRecs);
-            return new RespR(true,"协议上传成功");
-        }else{
-            log.info("客户协议上传失败信息:CustomerLowerServiceImpl.customeRecUpload{},msg{}",customerRecs,res.toString());
-            return new RespR(false,res.toString());
+        if (StringUtils.isEmpty(res.toString())) {
+            log.info("客户协议上传成功信息" + ":CustomerLowerServiceImpl.customeRecUpload{}", customerRecs);
+            return new RespR(true, "协议上传成功");
+        } else {
+            log.info("客户协议上传失败信息:CustomerLowerServiceImpl.customeRecUpload{},msg{}", customerRecs, res.toString());
+            return new RespR(false, res.toString());
         }
 
     }

Різницю між файлами не показано, бо вона завелика
+ 268 - 257
src/main/java/com/jkcredit/invoice/service/lowerservice/impl/NoCarServiceImpl.java


+ 185 - 176
src/main/java/com/jkcredit/invoice/service/lowerservice/impl/SelfCarServiceLImpl.java

@@ -39,6 +39,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 import java.util.ArrayList;
 import java.util.List;
+
 @Service
 @Slf4j
 public class SelfCarServiceLImpl implements SelfCarServiceL {
@@ -60,26 +61,29 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
     SelfCarCalculateInforMapper calculateInforMapper;
     @Autowired
     CustomerService customerService;
+    @Autowired
+    CustomerChangeInfoMapper customerChangeInfoMapper;
+
     @Override
-    @Transactional(isolation= Isolation.READ_COMMITTED)
+    @Transactional(isolation = Isolation.READ_COMMITTED)
     public RespR<List<CardTradeModel>> getTradeList(TradeRequestVo tradeRequestVo) {
-        log.info("获取交易开始SelfCarServiceLImpl.getTradeList{}",tradeRequestVo);
+        log.info("获取交易开始SelfCarServiceLImpl.getTradeList{}", tradeRequestVo);
         Customer customer = customerMapper.selectByCustomerName(tradeRequestVo.getCustomerName());
-        if(customer == null || customer.getAccstatus().intValue() == 1){
-            log.info("获取交易失败SelfCarServiceLImpl.getTradeList{},msg{}",tradeRequestVo,"客户已经停用");
-            return new RespR(false,"客户已经停用");
+        if (customer == null || customer.getAccstatus().intValue() == 1) {
+            log.info("获取交易失败SelfCarServiceLImpl.getTradeList{},msg{}", tradeRequestVo, "客户已经停用");
+            return new RespR(false, "客户已经停用");
         }
-        if(StringUtils.isEmpty(tradeRequestVo.getStartTime()) || StringUtils.isEmpty(tradeRequestVo.getEndTime())){
-            log.info("获取交易失败SelfCarServiceLImpl.getTradeList{},msg{}",tradeRequestVo,"时间为空");
-            return new RespR(false,"时间为空");
+        if (StringUtils.isEmpty(tradeRequestVo.getStartTime()) || StringUtils.isEmpty(tradeRequestVo.getEndTime())) {
+            log.info("获取交易失败SelfCarServiceLImpl.getTradeList{},msg{}", tradeRequestVo, "时间为空");
+            return new RespR(false, "时间为空");
         }
         CustomerRec customerRec = new CustomerRec();
         customerRec.setCustomerName(tradeRequestVo.getCustomerName());
         customerRec.setCompanyName(tradeRequestVo.getCompanyName());
         customerRec = customerRecMapper.selectByCustomerNameAndCompany(customerRec);
-        if(customerRec == null || customerRec.getRecStatus().intValue() !=1 ){
-            log.info("获取交易失败SelfCarServiceLImpl.getTradeList{},msg{}",tradeRequestVo,"客户未备案");
-            return new RespR(false,"客户未备案");
+        if (customerRec == null || customerRec.getRecStatus().intValue() != 1) {
+            log.info("获取交易失败SelfCarServiceLImpl.getTradeList{},msg{}", tradeRequestVo, "客户未备案");
+            return new RespR(false, "客户未备案");
         }
         CardTradeRequest cardTradeRequest = new CardTradeRequest();
         cardTradeRequest.setCardId(tradeRequestVo.getEtcId());
@@ -88,19 +92,19 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
         cardTradeRequest.setEndExTime(DateUtil.dateFormate(tradeRequestVo.getEndTime()));
         cardTradeRequest.setTradeStatus(tradeRequestVo.getTradeStatus());
         RespR<CardTradeResponse> resp = selfCarInterface.cardTrade(cardTradeRequest);
-        if(resp.getCode() == 1){
-            log.info("获取交易失败SelfCarServiceLImpl.getTradeList{},msg{}",tradeRequestVo,resp.getMsg());
-            return new RespR(false,resp.getMsg());
-        }else{
+        if (resp.getCode() == 1) {
+            log.info("获取交易失败SelfCarServiceLImpl.getTradeList{},msg{}", tradeRequestVo, resp.getMsg());
+            return new RespR(false, resp.getMsg());
+        } else {
             CardTradeResponse cardTradeResponse = resp.getData();
-            List<CardTradeModel> result  = cardTradeResponse.getResult();
+            List<CardTradeModel> result = cardTradeResponse.getResult();
             //对不存在的tradeId入表
-            if(result!=null && result.size()>0){
+            if (result != null && result.size() > 0) {
                 customerCarRecMapper.selectByEtcForLock(tradeRequestVo.getEtcId());
                 SelfCarTrade selfCarTrade;
-                for(CardTradeModel cardTradeModel:result){
-                    List<SelfCarTrade> selfCarTrades =  sellCarTradeMapper.selectByTradeId(cardTradeModel.getTradeId());
-                    if(selfCarTrades == null || selfCarTrades.size()<=0){
+                for (CardTradeModel cardTradeModel : result) {
+                    List<SelfCarTrade> selfCarTrades = sellCarTradeMapper.selectByTradeId(cardTradeModel.getTradeId());
+                    if (selfCarTrades == null || selfCarTrades.size() <= 0) {
                         selfCarTrade = new SelfCarTrade();
                         selfCarTrade.setInterType(tradeRequestVo.getInterType());
                         selfCarTrade.setCustomId(customerRec.getCustomerName());
@@ -113,17 +117,17 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
                         selfCarTrade.setFee(cardTradeModel.getFee());
                         selfCarTrade.setStatus(tradeRequestVo.getTradeStatus());
                         sellCarTradeMapper.insert(selfCarTrade);
-                    }else{
+                    } else {
                         selfCarTrade = selfCarTrades.get(0);
-                        if(!selfCarTrade.getStatus().equals(tradeRequestVo.getTradeStatus()) ){
+                        if (!selfCarTrade.getStatus().equals(tradeRequestVo.getTradeStatus())) {
                             selfCarTrade.setStatus(tradeRequestVo.getTradeStatus());
                             selfCarTrade.setInterType(tradeRequestVo.getInterType());
                             sellCarTradeMapper.updateByTradeId(selfCarTrade);
                         }
                     }
-                };
-            }else {
-                return new RespR(false,"未查得");
+                }
+            } else {
+                return new RespR(false, "未查得");
             }
 
             return new RespR(result);
@@ -132,25 +136,25 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
     }
 
     @Override
-    @Transactional(isolation= Isolation.READ_COMMITTED)
+    @Transactional(isolation = Isolation.READ_COMMITTED)
     public RespR<String> applInvoice(InvoiceApplVo invoiceApplVo) {
-        log.info("申请开票开始SelfCarServiceLImpl.applInvoice{}",invoiceApplVo);
-        if(!customerService.checkMoneyEnough(invoiceApplVo.getCustomerName())){
-            log.info("申请开票失败SelfCarServiceLImpl.applInvoice{},msg{}",invoiceApplVo,"余额不足");
-            return new RespR(false,"余额不足");
+        log.info("申请开票开始SelfCarServiceLImpl.applInvoice{}", invoiceApplVo);
+        if (!customerService.checkMoneyEnough(invoiceApplVo.getCustomerName())) {
+            log.info("申请开票失败SelfCarServiceLImpl.applInvoice{},msg{}", invoiceApplVo, "余额不足");
+            return new RespR(false, "余额不足");
         }
         Customer customer = customerMapper.selectByCustomerName(invoiceApplVo.getCustomerName());
-        if(customer == null || customer.getAccstatus().intValue() == 1){
-            log.info("申请开票失败SelfCarServiceLImpl.applInvoice{},msg{}",invoiceApplVo,"客户已经停用");
-            return new RespR(false,"客户已经停用");
+        if (customer == null || customer.getAccstatus().intValue() == 1) {
+            log.info("申请开票失败SelfCarServiceLImpl.applInvoice{},msg{}", invoiceApplVo, "客户已经停用");
+            return new RespR(false, "客户已经停用");
         }
         CustomerRec customerRec = new CustomerRec();
         customerRec.setCustomerName(invoiceApplVo.getCustomerName());
         customerRec.setCompanyName(invoiceApplVo.getCompanyName());
         customerRec = customerRecMapper.selectByCustomerNameAndCompany(customerRec);
-        if(customerRec == null || customerRec.getRecStatus().intValue() !=1 ){
-            log.info("申请开票失败SelfCarServiceLImpl.applInvoice{},msg{}",invoiceApplVo,"客户未备案");
-            return new RespR(false,"客户未备案");
+        if (customerRec == null || customerRec.getRecStatus().intValue() != 1) {
+            log.info("申请开票失败SelfCarServiceLImpl.applInvoice{},msg{}", invoiceApplVo, "客户未备案");
+            return new RespR(false, "客户未备案");
         }
 
         B2BInvoiceApplyRequest b2bInvoiceApplyRequest = new B2BInvoiceApplyRequest();
@@ -158,20 +162,20 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
         b2bInvoiceApplyRequest.setCompanyNum(customerRec.getCompanyNum());
         List<B2BInvoiceApplyModel> applyModels = new ArrayList<>();
         List<String> tradeIds = invoiceApplVo.getTradeIds();
-        if(tradeIds == null || tradeIds.size()<=0){
-            return new RespR(false,"没有交易Id");
+        if (tradeIds == null || tradeIds.size() <= 0) {
+            return new RespR(false, "没有交易Id");
         }
-        for(String tradeId:tradeIds){
+        for (String tradeId : tradeIds) {
             B2BInvoiceApplyModel applyModel = new B2BInvoiceApplyModel();
             applyModel.setTradeId(tradeId);
             applyModels.add(applyModel);
         }
         b2bInvoiceApplyRequest.setTradeIdModel(applyModels);
         RespR<B2BInvoiceApplyResponse> respR = selfCarInterface.b2Binvoiceapply(b2bInvoiceApplyRequest);
-        if(respR.getCode()==1){
-            log.info("申请开票失败SelfCarServiceLImpl.applInvoice{},msg{}",invoiceApplVo,respR.getMsg());
-            return new RespR(false,respR.getMsg());
-        }else{
+        if (respR.getCode() == 1) {
+            log.info("申请开票失败SelfCarServiceLImpl.applInvoice{},msg{}", invoiceApplVo, respR.getMsg());
+            return new RespR(false, respR.getMsg());
+        } else {
             B2BInvoiceApplyResponse data = respR.getData();
             SelfCarAppl selfCarAppl = new SelfCarAppl();
             selfCarAppl.setApplId(data.getApplyId());
@@ -186,10 +190,12 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
             selfCarApplMapper.insert(selfCarAppl);
             double needFee = 0;
             //更新交易id申请开票时间,并将转态改为开票中
-            for(String tradeId : tradeIds){
+            for (String tradeId : tradeIds) {
                 List<SelfCarTrade> selfCarTrades = sellCarTradeMapper.selectByTradeId(tradeId);
-                if(selfCarTrades == null || selfCarTrades.size() == 0){continue;}
-                SelfCarTrade selfCarTrade =  selfCarTrades.get(0);
+                if (selfCarTrades == null || selfCarTrades.size() == 0) {
+                    continue;
+                }
+                SelfCarTrade selfCarTrade = selfCarTrades.get(0);
                 selfCarTrade.setStatus(2);
                 selfCarTrade.setAclTime(DateUtil.getCurrentDateStr());
                 selfCarTrade.setApplId(data.getApplyId());
@@ -201,19 +207,19 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
                 carCalculateInfor.setCompanyNum(customerRec.getCompanyNum());
                 carCalculateInfor.setCompanyName(customerRec.getCompanyName());//公司名称
                 carCalculateInfor.setCompanyLongName(customerRec.getCompanyBelongName());//主体名称
-                carCalculateInfor.setCalTime(StringUtils.substring(selfCarTrade.getExTime(),0,7));
+                carCalculateInfor.setCalTime(StringUtils.substring(selfCarTrade.getExTime(), 0, 7));
                 carCalculateInfor.setFee(customer.getFee());
                 carCalculateInfor.setCompanyReferencenum(customerRec.getCompanyReferencenum());
                 carCalculateInfor.setEtcNum(selfCarTrade.getCardId());
-                if(calculateInforMapper.selectByEtcAndTime(carCalculateInfor) == null){
-                    needFee = MathUtil.add(needFee,carCalculateInfor.getFee());
+                if (calculateInforMapper.selectByEtcAndTime(carCalculateInfor) == null) {
+                    needFee = MathUtil.add(needFee, carCalculateInfor.getFee());
                     calculateInforMapper.insert(carCalculateInfor);
                 }
             }
             customer = customerMapper.selectByCustomerNameForLock(invoiceApplVo.getCustomerName());
             //客户统一扣费
             customer.setInvoiceTime(DateUtil.getCurrentDateStr());
-            customer.setAccountBalance(MathUtil.sub(customer.getAccountBalance(),needFee));
+            customer.setAccountBalance(MathUtil.sub(customer.getAccountBalance(), needFee));
             customerMapper.updateByPrimaryKeySelective(customer);
             return new RespR(respR.getData());
         }
@@ -222,24 +228,25 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
 
     @Override
     public RespR<List<B2BInvoiceQueryByApplyModel>> getSelfCarInvoicesByApplyIds(ApplQueryInvVo applQueryInvVo) {
-        log.info("申请开票开始SelfCarServiceLImpl.getSelfCarInvoicesByApplyIds{}",applQueryInvVo);
+        log.info("申请开票开始SelfCarServiceLImpl.getSelfCarInvoicesByApplyIds{}", applQueryInvVo);
         B2BInvoiceQueryByApplyRequest applyRequest = new B2BInvoiceQueryByApplyRequest();
         applyRequest.setCardId(applQueryInvVo.getEtcNum());
         applyRequest.setCompanyNum(applQueryInvVo.getCompanyNum());
         applyRequest.setApplyId(applQueryInvVo.getApplId());
         RespR<B2BInvoiceQueryByApplyResponse> responseRespR = selfCarInterface.b2bContractQuery(applyRequest);
         //返回相应的发票
-        if(responseRespR.getCode() == 1){
-            log.info("申请开票失败SelfCarServiceLImpl.getSelfCarInvoicesByApplyIds{},msg{}",applQueryInvVo,responseRespR.getMsg());
-            return new RespR(false,responseRespR.getMsg());
-        }else{
-            return new RespR(responseRespR.getData().getResult(),responseRespR.getData().getResult().toString());
+        if (responseRespR.getCode() == 1) {
+            log.info("申请开票失败SelfCarServiceLImpl.getSelfCarInvoicesByApplyIds{},msg{}", applQueryInvVo, responseRespR.getMsg());
+            return new RespR(false, responseRespR.getMsg());
+        } else {
+            return new RespR(responseRespR.getData().getResult(), responseRespR.getData().getResult().toString());
         }
 
     }
+
     @Override
-    public RespR<List<B2BInvoiceListModel>> getSelfCarInvoicesByTime(SelfCarDueQueryVo selfCarDueQueryVo,CustomerRec customerRec) {
-        log.info("申请开票开始SelfCarServiceLImpl.getSelfCarInvoicesByTime{}",selfCarDueQueryVo);
+    public RespR<List<B2BInvoiceListModel>> getSelfCarInvoicesByTime(SelfCarDueQueryVo selfCarDueQueryVo, CustomerRec customerRec) {
+        log.info("申请开票开始SelfCarServiceLImpl.getSelfCarInvoicesByTime{}", selfCarDueQueryVo);
         B2BInvoiceQueryRequest request = new B2BInvoiceQueryRequest();
         request.setCompanyNum(customerRec.getCompanyNum());
         request.setCardId(selfCarDueQueryVo.getCardId());
@@ -247,16 +254,16 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
         request.setEndInvoiceMakeTime(DateUtil.dateFormate(selfCarDueQueryVo.getEndTime()));
 
         RespR<B2BInvoiceQueryResponse> responseRespR = selfCarInterface.b2Binvoicequery(request);
-        if(responseRespR.getCode() == 1){
-            log.info("申请开票失败SelfCarServiceLImpl.getSelfCarInvoicesByTime{},msg{}",selfCarDueQueryVo,responseRespR.getMsg());
-            return new RespR(false,responseRespR.getMsg());
-        }else{
+        if (responseRespR.getCode() == 1) {
+            log.info("申请开票失败SelfCarServiceLImpl.getSelfCarInvoicesByTime{},msg{}", selfCarDueQueryVo, responseRespR.getMsg());
+            return new RespR(false, responseRespR.getMsg());
+        } else {
             B2BInvoiceQueryResponse respData = responseRespR.getData();
             List<B2BInvoiceListModel> dataResult = respData.getResult();
-            if(dataResult!=null && dataResult.size()>0){
-                for(B2BInvoiceListModel listModel :dataResult){
+            if (dataResult != null && dataResult.size() > 0) {
+                for (B2BInvoiceListModel listModel : dataResult) {
                     SelfCarInvoice selfCarInvoice = new SelfCarInvoice();
-                    BeanUtils.copyProperties(listModel ,selfCarInvoice);
+                    BeanUtils.copyProperties(listModel, selfCarInvoice);
                     selfCarInvoice.setInvoiceMakeTime(DateUtil.tTimeToDate(selfCarInvoice.getInvoiceMakeTime()));
                     selfCarInvoice.setExTime(DateUtil.tTimeToDate(selfCarInvoice.getExTime()));
                     selfCarInvoice.setCustomerName(selfCarDueQueryVo.getCustomername());
@@ -264,49 +271,49 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
                     selfCarInvoice.setBuyerTaxpayerCode(customerRec.getCompanyReferencenum());
                     selfCarInvoice.setBuyerName(customerRec.getCompanyName());
                     selfCarInvoice.setCompanyNum(customerRec.getCompanyNum());
-                    selfCarInvoice.setEnStation(listModel .getEnStationName());
-                    selfCarInvoice.setExStation(listModel .getExStationName());
+                    selfCarInvoice.setEnStation(listModel.getEnStationName());
+                    selfCarInvoice.setExStation(listModel.getExStationName());
                     List<SelfCarInvoice> selfCarInvoice1 = selfCarInvoiceMapper.selectByCodeAndNum(selfCarInvoice);
-                    if(selfCarInvoice1==null || selfCarInvoice1.size()<=0){
+                    if (selfCarInvoice1 == null || selfCarInvoice1.size() <= 0) {
                         selfCarInvoiceMapper.insert(selfCarInvoice);
                     }
                 }
-            }else{
-                return new RespR(false,"未查得");
+            } else {
+                return new RespR(false, "未查得");
             }
-            return new RespR(dataResult,responseRespR.getData().getResult().toString());
+            return new RespR(dataResult, responseRespR.getData().getResult().toString());
         }
     }
 
     @Override
     public RespR<List<B2bInvoicePackageModel>> getInvoicePackge(InvoicePackageVo invoicePackageVo) {
-        log.info("申请开票开始SelfCarServiceLImpl.getInvoicePackge{}",invoicePackageVo);
+        log.info("申请开票开始SelfCarServiceLImpl.getInvoicePackge{}", invoicePackageVo);
         Customer customer = customerMapper.selectByCustomerName(invoicePackageVo.getCustomerName());
-        if(customer == null || customer.getAccstatus().intValue() == 1){
-            return new RespR(false,"客户已经停用");
+        if (customer == null || customer.getAccstatus().intValue() == 1) {
+            return new RespR(false, "客户已经停用");
         }
-        if(!customerService.checkMoneyEnough(invoicePackageVo.getCustomerName())){
-            return new RespR(false,"余额不足");
+        if (!customerService.checkMoneyEnough(invoicePackageVo.getCustomerName())) {
+            return new RespR(false, "余额不足");
         }
         CustomerRec customerRec = new CustomerRec();
         customerRec.setCustomerName(invoicePackageVo.getCustomerName());
         customerRec.setCompanyName(invoicePackageVo.getCompanyName());
         customerRec = customerRecMapper.selectByCustomerNameAndCompany(customerRec);
-        if(customerRec == null || customerRec.getRecStatus().intValue() !=1 ){
-            return new RespR(false,"客户未备案");
+        if (customerRec == null || customerRec.getRecStatus().intValue() != 1) {
+            return new RespR(false, "客户未备案");
         }
 
         B2bInvoicePackageRequest b2bInvoicePackageRequest = new B2bInvoicePackageRequest();
         b2bInvoicePackageRequest.setCompanyNum(customerRec.getCompanyNum());
         b2bInvoicePackageRequest.setMakeMonth(invoicePackageVo.getMonth());
         RespR<B2bInvoicePackageResponse> b2bInvoicePackageResponseRespR = selfCarInterface.b2bInvoicePackage(b2bInvoicePackageRequest);
-        if(b2bInvoicePackageResponseRespR.getCode() == 1){
-            log.info("申请开票失败SelfCarServiceLImpl.getInvoicePackge{},msg{}",invoicePackageVo,b2bInvoicePackageResponseRespR.getMsg());
-            return new RespR(false,b2bInvoicePackageResponseRespR.getMsg());
-        }else{
+        if (b2bInvoicePackageResponseRespR.getCode() == 1) {
+            log.info("申请开票失败SelfCarServiceLImpl.getInvoicePackge{},msg{}", invoicePackageVo, b2bInvoicePackageResponseRespR.getMsg());
+            return new RespR(false, b2bInvoicePackageResponseRespR.getMsg());
+        } else {
 
-            if(b2bInvoicePackageResponseRespR.getData().getResult()==null || b2bInvoicePackageResponseRespR.getData().getResult().size()<=0){
-                return new RespR (false,"未查得");
+            if (b2bInvoicePackageResponseRespR.getData().getResult() == null || b2bInvoicePackageResponseRespR.getData().getResult().size() <= 0) {
+                return new RespR(false, "未查得");
             }
             return new RespR(b2bInvoicePackageResponseRespR.getData().getResult());
         }
@@ -314,17 +321,17 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
 
     @Override
     public RespR getEtcInfo(EtcQueryVo etcQueryVo) {
-        log.info("获取etc信息:SelfCarServiceLImpl.getEtcInfo{}",etcQueryVo);
+        log.info("获取etc信息:SelfCarServiceLImpl.getEtcInfo{}", etcQueryVo);
         Customer customer = customerMapper.selectByCustomerName(etcQueryVo.getCustomerName());
-        if(customer == null || customer.getAccstatus().intValue() == 1){
-            return new RespR(false,"客户已经停用");
+        if (customer == null || customer.getAccstatus().intValue() == 1) {
+            return new RespR(false, "客户已经停用");
         }
         CustomerRec customerRec = new CustomerRec();
         customerRec.setCustomerName(etcQueryVo.getCustomerName());
         customerRec.setCompanyName(etcQueryVo.getCompanyName());
         customerRec = customerRecMapper.selectByCustomerNameAndCompany(customerRec);
-        if(customerRec == null || customerRec.getRecStatus().intValue() !=1 ){
-            return new RespR(false,"客户未备案");
+        if (customerRec == null || customerRec.getRecStatus().intValue() != 1) {
+            return new RespR(false, "客户未备案");
         }
         CardBindQueryListToBRequest list = new CardBindQueryListToBRequest();
         list.setCompanyNum(customerRec.getCompanyNum());//企业编号,必输
@@ -332,31 +339,32 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
         list.setPlateNum(etcQueryVo.getPlateNum());//车牌号,非必输
         list.setPalteColor(etcQueryVo.getPlateColor());//车牌颜色.非必输
         RespR<CardBindQueryListToBResponse> respR = selfCarInterface.cardBindQueryListToB(list);
-        if(respR.getCode() == 1){
-            log.info("获取etc信息失败:SelfCarServiceLImpl.getEtcInfo{},msg{}",etcQueryVo,respR.getMsg());
-            return new RespR(false,respR.getMsg());
+        if (respR.getCode() == 1) {
+            log.info("获取etc信息失败:SelfCarServiceLImpl.getEtcInfo{},msg{}", etcQueryVo, respR.getMsg());
+            return new RespR(false, respR.getMsg());
         }
         return new RespR(respR.getData().getResult());
     }
+
     @Override
-    public RespR queryEtcInfo(EtcBindVo etcBindVo){
-        log.info("获取etc信息:SelfCarServiceLImpl.queryEtcInfo{}",etcBindVo);
+    public RespR queryEtcInfo(EtcBindVo etcBindVo) {
+        log.info("获取etc信息:SelfCarServiceLImpl.queryEtcInfo{}", etcBindVo);
         StringBuffer res = new StringBuffer();
-        if(etcBindVo== null || etcBindVo.getCards() ==null || etcBindVo.getCards().size()<=0){
-            return new RespR(false,"无备案Etc");
+        if (etcBindVo == null || etcBindVo.getCards() == null || etcBindVo.getCards().size() <= 0) {
+            return new RespR(false, "无备案Etc");
         }
         Customer customer = customerMapper.selectByCustomerName(etcBindVo.getCustomerName());
-        if(customer == null || customer.getAccstatus()!=0){
-            res.append("#客户:"+etcBindVo.getCustomerName()+"不存在或状态异常");
-            return new RespR(false,res.toString());
+        if (customer == null || customer.getAccstatus() != 0) {
+            res.append("#客户:" + etcBindVo.getCustomerName() + "不存在或状态异常");
+            return new RespR(false, res.toString());
         }
         CustomerRec customerRecP = new CustomerRec();
         customerRecP.setCustomerName(etcBindVo.getCustomerName());
         customerRecP.setCompanyName(etcBindVo.getCompanyName());
         CustomerRec customerRec = customerRecMapper.selectByCustomerNameAndCompany(customerRecP);
-        if(customerRec == null || customerRec.getRecStatus()!=1){
-            res.append("#客户:"+etcBindVo.getCustomerName()+"企业:"+etcBindVo.getCompanyName()+"请先备案");
-            return new RespR(false,res.toString());
+        if (customerRec == null || customerRec.getRecStatus() != 1) {
+            res.append("#客户:" + etcBindVo.getCustomerName() + "企业:" + etcBindVo.getCompanyName() + "请先备案");
+            return new RespR(false, res.toString());
         }
         CardQueryCardToBRequest request = new CardQueryCardToBRequest();
         request.setCompanyNum(customerRec.getCompanyNum());
@@ -369,40 +377,42 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
         });
         request.setVehicleList(models);
         RespR<CardQueryCardToBResponse> respR = selfCarInterface.cardQueryCardToB(request);
-        if(respR.getCode() == 1){
-            log.info("获取etc信息失败:SelfCarServiceLImpl.queryEtcInfo{},msg{}",etcBindVo,respR.getMsg());
-            return new RespR(false,respR.getMsg());
+        if (respR.getCode() == 1) {
+            log.info("获取etc信息失败:SelfCarServiceLImpl.queryEtcInfo{},msg{}", etcBindVo, respR.getMsg());
+            return new RespR(false, respR.getMsg());
         }
-        if(respR.getData().getResult() == null || respR.getData().getResult().size()<=0){
-            log.info("获取etc信息失败:SelfCarServiceLImpl.queryEtcInfo{},msg{}",etcBindVo,"没有etc卡");
-            return new RespR(false,"未查得");
+        if (respR.getData().getResult() == null || respR.getData().getResult().size() <= 0) {
+            log.info("获取etc信息失败:SelfCarServiceLImpl.queryEtcInfo{},msg{}", etcBindVo, "没有etc卡");
+            return new RespR(false, "未查得");
         }
         return new RespR(respR.getData().getResult());
 
     }
+
     @Override
     public RespR customerEtcRec(EtcBindVo etcBindVo) {
-        log.info("etc注册:SelfCarServiceLImpl.customerEtcRec{}",etcBindVo);
-        if(etcBindVo== null || etcBindVo.getCards() ==null || etcBindVo.getCards().size()<=0){
-            return new RespR(false,"无备案Etc");
+        log.info("etc注册:SelfCarServiceLImpl.customerEtcRec{}", etcBindVo);
+        if (etcBindVo == null || etcBindVo.getCards() == null || etcBindVo.getCards().size() <= 0) {
+            return new RespR(false, "无备案Etc");
         }
         StringBuffer res = new StringBuffer();
         Customer customer = customerMapper.selectByCustomerName(etcBindVo.getCustomerName());
-        if(customer == null || customer.getAccstatus()!=0){
-            res.append("#客户:"+etcBindVo.getCustomerName()+"不存在或状态异常");
-            return new RespR(false,res.toString());
+        if (customer == null || customer.getAccstatus() != 0) {
+            res.append("#客户:" + etcBindVo.getCustomerName() + "不存在或状态异常");
+            return new RespR(false, res.toString());
         }
         CustomerRec customerRecP = new CustomerRec();
         customerRecP.setCustomerName(etcBindVo.getCustomerName());
         customerRecP.setCompanyName(etcBindVo.getCompanyName());
         CustomerRec customerRec = customerRecMapper.selectByCustomerNameAndCompany(customerRecP);
-        if(customerRec == null || customerRec.getRecStatus()!=1){
-            res.append("#客户:"+etcBindVo.getCustomerName()+"企业:"+etcBindVo.getCompanyName()+"请先备案");
-            return new RespR(false,res.toString());
+        if (customerRec == null || customerRec.getRecStatus() != 1) {
+            res.append("#客户:" + etcBindVo.getCustomerName() + "企业:" + etcBindVo.getCompanyName() + "请先备案");
+            return new RespR(false, res.toString());
         }
-        return recEtc(etcBindVo,customerRec);
+        return recEtc(etcBindVo, customerRec);
     }
-    public RespR recEtc(EtcBindVo etcBindVo,CustomerRec customerRec){
+
+    public RespR recEtc(EtcBindVo etcBindVo, CustomerRec customerRec) {
         CardQueryCardToBRequest request = new CardQueryCardToBRequest();
         request.setCompanyNum(customerRec.getCompanyNum());
         List<CardBindingToBModel> models = new ArrayList<>();
@@ -416,52 +426,53 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
         binding.setCompanyNum(customerRec.getCompanyNum());
         binding.setCardIdList(models);
         RespR<CardBindingToBResponse> respR1 = selfCarInterface.cardBindingToB(binding);
-        if(respR1.getCode() == 1){
-            log.info("etc注册失败:SelfCarServiceLImpl.customerEtcRec{},msg{}",etcBindVo,respR1.getMsg());
-            return new RespR(false,respR1.getMsg());
-        }else{
+        if (respR1.getCode() == 1) {
+            log.info("etc注册失败:SelfCarServiceLImpl.customerEtcRec{},msg{}", etcBindVo, respR1.getMsg());
+            return new RespR(false, respR1.getMsg());
+        } else {
             return new RespR(respR1.getData());
         }
     }
 
-    public void updateetcrec(CustomerCarRec customerCarRec){
+    public void updateetcrec(CustomerCarRec customerCarRec) {
         //根据车牌号查询是新增还是更新
-        log.info("检验成功入库参数{}",customerCarRec);
+        log.info("检验成功入库参数{}", customerCarRec);
         CustomerCarRec customerCarRec1 = customerCarRecMapper.selectByEtc(customerCarRec.getEtcNum());
         if (customerCarRec1 == null) {
-            log.info("检验成功入库新增参数{}",customerCarRec);
+            log.info("检验成功入库新增参数{}", customerCarRec);
             customerCarRecMapper.insert(customerCarRec);
         } else {
-            log.info("检验成功入库更新参数{}",customerCarRec);
+            log.info("检验成功入库更新参数{}", customerCarRec);
             customerCarRecMapper.updateEtcByPrimaryKey(customerCarRec);
         }
     }
+
     @Override
     public RespR customerEtcRecValid(EtcValidVo etcValidVo) {
-        log.info("etc注册校验:SelfCarServiceLImpl.customerEtcRecValid{}",etcValidVo);
+        log.info("etc注册校验:SelfCarServiceLImpl.customerEtcRecValid{}", etcValidVo);
         StringBuffer res = new StringBuffer();
         Customer customer = customerMapper.selectByCustomerName(etcValidVo.getCustomerName());
-        if(customer == null || customer.getAccstatus()!=0){
-            res.append("#客户:"+etcValidVo.getCustomerName()+"不存在或状态异常");
-            return new RespR(false,res.toString());
+        if (customer == null || customer.getAccstatus() != 0) {
+            res.append("#客户:" + etcValidVo.getCustomerName() + "不存在或状态异常");
+            return new RespR(false, res.toString());
         }
         CustomerRec customerRecP = new CustomerRec();
         customerRecP.setCustomerName(etcValidVo.getCustomerName());
         customerRecP.setCompanyName(etcValidVo.getCompanyName());
         CustomerRec customerRec = customerRecMapper.selectByCustomerNameAndCompany(customerRecP);
-        if(customerRec == null || customerRec.getRecStatus()!=1){
-            res.append("#客户:"+etcValidVo.getCustomerName()+"企业:"+etcValidVo.getCompanyName()+"请先备案");
-            return new RespR(false,res.toString());
+        if (customerRec == null || customerRec.getRecStatus() != 1) {
+            res.append("#客户:" + etcValidVo.getCustomerName() + "企业:" + etcValidVo.getCompanyName() + "请先备案");
+            return new RespR(false, res.toString());
         }
         CardValidCodeToBRequest request = new CardValidCodeToBRequest();
         request.setCompanyNum(customerRec.getCompanyNum());
         request.setMobile(etcValidVo.getMobile());
         request.setValidCode(etcValidVo.getValidCode());
         RespR<CardValidCodeToBResponse> respR = selfCarInterface.cardValidCodeToB(request);
-        if(respR.getCode() == 1){
-            log.info("etc注册校验失败:SelfCarServiceLImpl.customerEtcRecValid{},msg",etcValidVo,respR.getMsg());
-            return new RespR(false,respR.getMsg());
-        }else{
+        if (respR.getCode() == 1) {
+            log.info("etc注册校验失败:SelfCarServiceLImpl.customerEtcRecValid{},msg", etcValidVo, respR.getMsg());
+            return new RespR(false, respR.getMsg());
+        } else {
             /**
              * 绑定的etc卡入库
              */
@@ -473,7 +484,7 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
                 customerCarRec.setCompanyNum(customerRec.getCompanyNum());
                 customerCarRec.setCarNum(model.getPlateNum());
                 customerCarRec.setEtcNum(model.getCardId());
-                customerCarRec.setCarColor(model.getPlateColor()+"");
+                customerCarRec.setCarColor(model.getPlateColor() + "");
                 customerCarRec.setRecStatus(CommonConstants.REC_STATUS_SUC);
                 customerCarRec.setSuccTime(DateUtil.getCurrentDateStr());
                 customerCarRec.setCustPhone(etcValidVo.getMobile());
@@ -483,44 +494,45 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
             return new RespR(respR.getData().getResult().toString());
         }
     }
+
     @Override
     public RespR customerCarUnRec(List<CustomerCarRec> customerCarRecs) {
-        log.info("etc解绑:SelfCarServiceLImpl.customerCarUnRec{}",customerCarRecs);
-        if(customerCarRecs==null || customerCarRecs.size()<=0){
-            return new RespR(false,"无解绑信息");
+        log.info("etc解绑:SelfCarServiceLImpl.customerCarUnRec{}", customerCarRecs);
+        if (customerCarRecs == null || customerCarRecs.size() <= 0) {
+            return new RespR(false, "无解绑信息");
         }
 
         StringBuffer res = new StringBuffer();
         String resRespon = "";
         try {
-            for(CustomerCarRec customerCarRec:customerCarRecs){
+            for (CustomerCarRec customerCarRec : customerCarRecs) {
                 CustomerRec customerRecP = new CustomerRec();
                 customerRecP.setCustomerName(customerCarRec.getCustomerName());
                 customerRecP.setCompanyName(customerCarRec.getCompanyName());
                 CustomerRec customerRec = customerRecMapper.selectByCustomerNameAndCompany(customerRecP);
-                if("0".equals(customerRec.getBussinessType())){
+                if ("0".equals(customerRec.getBussinessType())) {
                     customerCarRec.setRecStatus(2);
                     customerCarRecMapper.updateEtcByPrimaryKeySelective(customerCarRec);
                 }
             }
-            if(org.springframework.util.StringUtils.isEmpty(res.toString())){
+            if (org.springframework.util.StringUtils.isEmpty(res.toString())) {
                 return new RespR(resRespon);
-            }else{
-                return new RespR(false,res.toString());
+            } else {
+                return new RespR(false, res.toString());
             }
 
-        }catch (Exception e){
-            return new RespR(false,e.getMessage());
+        } catch (Exception e) {
+            return new RespR(false, e.getMessage());
         }
 
     }
 
     @Override
     public RespR customerCardChange(CardChangeDto cardChangeDto) {
-        CardChangeTitleRequest cardChangeTitleRequest  = new CardChangeTitleRequest();
+        CardChangeTitleRequest cardChangeTitleRequest = new CardChangeTitleRequest();
         List<String> cards = cardChangeDto.getCardIdList();
         List<CardBindingToBModel> models = new ArrayList<>();
-        for(String card:cards){
+        for (String card : cards) {
             CardBindingToBModel model = new CardBindingToBModel();
             model.setCardId(card);
             models.add(model);
@@ -530,32 +542,29 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
         cardChangeTitleRequest.setTargetCompanyNum(cardChangeDto.getTargetCompanyNum());
 
         RespR<CardChangeTitleResponse> respR = selfCarInterface.changeCardTile(cardChangeTitleRequest);
-        if(respR.getCode() == 1){
-            log.info("etc换绑失败:SelfCarServiceLImpl.customerCardChange{},msg",cardChangeDto,respR.getMsg());
-            return new RespR(false,respR.getMsg());
-        }else{
+        if (respR.getCode() == 1) {
+            log.info("etc换绑失败:SelfCarServiceLImpl.customerCardChange{},msg", cardChangeDto, respR.getMsg());
+            return new RespR(false, respR.getMsg());
+        } else {
 
-            try{
+            try {
                 String applyId = respR.getData().getApplyId();
                 //1.删除etc绑卡信息
-                cards.stream().forEach(card->{
+                cards.stream().forEach(card -> {
                     customerCarRecMapper.deleteByEtcCard(card);
-                    customerChangeInfoMapper.insertChangeCard(applyId,card);
+                    customerChangeInfoMapper.insertChangeCard(applyId, card);
                 });
                 //2.换绑信息入库
                 CustomerEtcChangeInfo custometEtcChangeInfo = new CustomerEtcChangeInfo();
                 custometEtcChangeInfo.copyFromChangeDto(cardChangeDto);
                 custometEtcChangeInfo.setApplyId(applyId);
                 customerChangeInfoMapper.insertCardChangeInfo(custometEtcChangeInfo);
-            }catch (Exception e){
-               log.info("customerCardChange:{0}",e.getMessage());
+            } catch (Exception e) {
+                log.info("customerCardChange:{0}", e.getMessage());
             }
             return new RespR(respR.getData());
         }
     }
-    @Autowired
-    CustomerChangeInfoMapper customerChangeInfoMapper;
-
 
     @Override
     public RespR customerCardChangeQuery(CardChangeQueryDto cardChangeQueryDto) {
@@ -564,10 +573,10 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
         cardChangeQueryRequest.setCardId(cardChangeQueryDto.getCardId());
         cardChangeQueryRequest.setCompanyNum(cardChangeQueryDto.getCompanyNum());
         RespR<CardChangeQueryResponse> respR = selfCarInterface.queryChangeCard(cardChangeQueryRequest);
-        if(respR.getCode() == 1){
-            log.info("etc换绑失败:SelfCarServiceLImpl.customerCardChange{},msg",cardChangeQueryDto,respR.getMsg());
-            return new RespR(false,respR.getMsg());
-        }else{
+        if (respR.getCode() == 1) {
+            log.info("etc换绑失败:SelfCarServiceLImpl.customerCardChange{},msg", cardChangeQueryDto, respR.getMsg());
+            return new RespR(false, respR.getMsg());
+        } else {
             return new RespR(respR.getData());
         }
     }
@@ -581,10 +590,10 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
         tradeApplyQueryRequest.setTradeId(tradeApplyQueryInvVo.getTradeId());
         RespR<TradeApplyQueryResponse> respR = selfCarInterface.queryApplyQueryByTradeId(tradeApplyQueryRequest);
 
-        if(respR.getCode() == 1){
-            log.info("自有车 按交易查申请接口查询失败:SelfCarServiceLImpl.getApplyQueryByTradeId{},msg",tradeApplyQueryInvVo,respR.getMsg());
-            return new RespR(false,respR.getMsg());
-        }else{
+        if (respR.getCode() == 1) {
+            log.info("自有车 按交易查申请接口查询失败:SelfCarServiceLImpl.getApplyQueryByTradeId{},msg", tradeApplyQueryInvVo, respR.getMsg());
+            return new RespR(false, respR.getMsg());
+        } else {
             return new RespR(respR.getData());
         }
 
@@ -598,16 +607,16 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
         List<TradeApplyQueryResponse> result = new ArrayList<>();
 
 
-        for(TradeApplyQueryInvVo tradeApplyQueryInvVo:tradeApplyQueryInvVos){
+        for (TradeApplyQueryInvVo tradeApplyQueryInvVo : tradeApplyQueryInvVos) {
             TradeApplyQueryRequest tradeApplyQueryRequest = new TradeApplyQueryRequest();
             tradeApplyQueryRequest.setCompanyNum(tradeApplyQueryInvVo.getCompanyNum());
             tradeApplyQueryRequest.setCardId(tradeApplyQueryInvVo.getCardId());
             tradeApplyQueryRequest.setTradeId(tradeApplyQueryInvVo.getTradeId());
             RespR<TradeApplyQueryResponse> respR = selfCarInterface.queryApplyQueryByTradeId(tradeApplyQueryRequest);
-            if(respR.getCode() == 1){
-                log.info("自有车 按交易查申请接口查询失败:SelfCarServiceLImpl.getApplyQueryByTradeId{},msg",tradeApplyQueryInvVo,respR.getMsg());
-                return new RespR(false,respR.getMsg());
-            } else{
+            if (respR.getCode() == 1) {
+                log.info("自有车 按交易查申请接口查询失败:SelfCarServiceLImpl.getApplyQueryByTradeId{},msg", tradeApplyQueryInvVo, respR.getMsg());
+                return new RespR(false, respR.getMsg());
+            } else {
                 TradeApplyQueryResponse tradeApplyQueryResponse = new TradeApplyQueryResponse();
                 tradeApplyQueryResponse.setCardId(respR.getData().getCardId());
                 tradeApplyQueryResponse.setApplyId(respR.getData().getApplyId());

+ 1 - 3
src/main/java/com/jkcredit/invoice/service/lowerservice/vo/EtcQueryVo.java

@@ -24,13 +24,11 @@ public class EtcQueryVo {
     private String cardId;
 
     /**
-     *  车牌颜色
+     * 车牌颜色
      */
     private Integer plateColor;
 
 
-
-
     public String getCustomerName() {
         return customerName;
     }

+ 1 - 1
src/main/java/com/jkcredit/invoice/service/lowerservice/vo/EtcValidVo.java

@@ -25,7 +25,7 @@ public class EtcValidVo {
     private String validCode;
 
 
-    private Integer interType =1; //0-接口 1-平台
+    private Integer interType = 1; //0-接口 1-平台
 
 
     public String getMobile() {

+ 1 - 1
src/main/java/com/jkcredit/invoice/service/lowerservice/vo/InvoiceApplVo.java

@@ -27,7 +27,7 @@ public class InvoiceApplVo {
     /**
      * 对接方式 0 接口 1平台
      */
-    private  Integer interType = 1;
+    private Integer interType = 1;
 
     public Integer getInterType() {
         return interType;

+ 1 - 1
src/main/java/com/jkcredit/invoice/service/lowerservice/vo/MonthAccountQueryVo.java

@@ -14,7 +14,7 @@ public class MonthAccountQueryVo {
     private String tradeMonth;
 
     //交易来源
-    private int waybillSource =1;
+    private int waybillSource = 1;
 
     //页码
     private int pageNo;

+ 1 - 1
src/main/java/com/jkcredit/invoice/service/lowerservice/vo/TradeApplyQueryInvVo.java

@@ -4,7 +4,7 @@ import cn.com.taiji.sdk.model.comm.protocol.tts.trade.service.TradeApplyQueryRes
 
 import java.util.List;
 
-public class TradeApplyQueryInvVo{
+public class TradeApplyQueryInvVo {
 
 
     /**

+ 3 - 7
src/main/java/com/jkcredit/invoice/service/manager/ParamService.java

@@ -17,14 +17,14 @@ public interface ParamService extends IService<Param> {
 
     /**
      * 分页查询用户信息(含有角色信息)
-     * @param page    分页对象
+     *
+     * @param page  分页对象
      * @param param 参数列表
      * @return
      */
     IPage getParamWithRolePage(Page page, Param param);
 
 
-
     /**
      * 通过参数名称查询参数信息
      *
@@ -34,7 +34,6 @@ public interface ParamService extends IService<Param> {
     Param getParamsByParamName(String paramName);
 
 
-
     /**
      * 保存参数信息
      *
@@ -44,16 +43,13 @@ public interface ParamService extends IService<Param> {
     Boolean saveParam(Param param);
 
 
-
-
     /**
      * 修改参数信息
+     *
      * @param param
      * @return
      */
     RespR<Boolean> updateParam(Param param);
 
 
-
-
 }

+ 1 - 5
src/main/java/com/jkcredit/invoice/service/manager/impl/ParamServiceImpl.java

@@ -21,7 +21,6 @@ import org.springframework.transaction.annotation.Transactional;
 public class ParamServiceImpl extends ServiceImpl<ParamMapper, Param> implements ParamService {
 
 
-
     @Override
     public IPage getParamWithRolePage(Page page, Param param) {
         return baseMapper.getParamsPage(page, param);
@@ -33,7 +32,6 @@ public class ParamServiceImpl extends ServiceImpl<ParamMapper, Param> implements
     }
 
 
-
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Boolean saveParam(Param param) {
@@ -42,10 +40,8 @@ public class ParamServiceImpl extends ServiceImpl<ParamMapper, Param> implements
     }
 
 
-
-
     @Override
-    public RespR<Boolean> updateParam(Param param){
+    public RespR<Boolean> updateParam(Param param) {
         return new RespR<>(baseMapper.updateParam(param));
     }
 

+ 1 - 3
src/main/java/com/jkcredit/invoice/service/nocar/HcInvoiceService.java

@@ -3,13 +3,11 @@ package com.jkcredit.invoice.service.nocar;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jkcredit.invoice.model.entity.invoice.HcInvoice;
-import com.jkcredit.invoice.model.entity.waybill.NoCarWayBill;
-
-import java.util.List;
 
 public interface HcInvoiceService {
     /**
      * 查询所有红冲发票接口
+     *
      * @param page
      * @param hcInvoice
      * @return

+ 5 - 2
src/main/java/com/jkcredit/invoice/service/nocar/NoCarBillWayImportService.java

@@ -3,13 +3,13 @@ package com.jkcredit.invoice.service.nocar;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jkcredit.invoice.model.entity.waybill.NoCarWayBill;
-import com.jkcredit.invoice.util.RespR;
 
 import java.util.List;
 
 public interface NoCarBillWayImportService {
     /**
      * 查询所有运单号接口
+     *
      * @param page
      * @param noCarWayBill
      * @return
@@ -18,6 +18,7 @@ public interface NoCarBillWayImportService {
 
     /**
      * 查询所有异常运单号接口
+     *
      * @param page
      * @param noCarWayBill
      * @return
@@ -26,15 +27,17 @@ public interface NoCarBillWayImportService {
 
     /**
      * 客户端导入指令保存
+     *
      * @param record
      */
     void insertImport(NoCarWayBill record);
 
     /**
      * 根据异常信息 更新运单数据
+     *
      * @param status
      * @param msg
      * @param noCarWayBill
      */
-    void updateBillway(int status,String msg,NoCarWayBill noCarWayBill);
+    void updateBillway(int status, String msg, NoCarWayBill noCarWayBill);
 }

+ 9 - 3
src/main/java/com/jkcredit/invoice/service/nocar/NoCarBillWayService.java

@@ -10,6 +10,7 @@ import java.util.List;
 public interface NoCarBillWayService {
     /**
      * 查询所有运单号接口
+     *
      * @param page
      * @param noCarWayBill
      * @return
@@ -18,6 +19,7 @@ public interface NoCarBillWayService {
 
     /**
      * 查询所有异常运单号接口
+     *
      * @param page
      * @param noCarWayBill
      * @return
@@ -26,27 +28,31 @@ public interface NoCarBillWayService {
 
     /**
      * 批量导入运单数据
+     *
      * @param noCarWayBills
      * @return
      */
-    RespR batchBillWayStart(List<NoCarWayBill> noCarWayBills,String customerName);
+    RespR batchBillWayStart(List<NoCarWayBill> noCarWayBills, String customerName);
 
     /**
      * 批量结束运单数据
+     *
      * @param noCarWayBills
      * @return
      */
-    RespR batchBillWayEnd(List<NoCarWayBill> noCarWayBills,String customerName);
+    RespR batchBillWayEnd(List<NoCarWayBill> noCarWayBills, String customerName);
 
     /**
      * 批量历史运单数据操作
+     *
      * @param noCarWayBills
      * @return
      */
-    RespR batchHsitoryBillWay(List<NoCarWayBill> noCarWayBills,String customerName);
+    RespR batchHsitoryBillWay(List<NoCarWayBill> noCarWayBills, String customerName);
 
     /**
      * 查询运单导入记录
+     *
      * @param list
      * @return
      */

+ 1 - 3
src/main/java/com/jkcredit/invoice/service/nocar/NoCarRecService.java

@@ -12,6 +12,7 @@ import java.util.List;
 public interface NoCarRecService {
     /**
      * 查询无车自有车备案接口
+     *
      * @param page
      * @param customerCarRec
      * @return
@@ -19,7 +20,4 @@ public interface NoCarRecService {
     IPage<List<CustomerCarRec>> findByPageAndCarRec(Page page, CustomerCarRec customerCarRec);
 
 
-
-
-
 }

+ 4 - 3
src/main/java/com/jkcredit/invoice/service/nocar/NocarInvoiceService.java

@@ -3,7 +3,6 @@ package com.jkcredit.invoice.service.nocar;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jkcredit.invoice.model.entity.invoice.BillInvoice;
-import com.jkcredit.invoice.model.entity.waybill.NoCarWayBill;
 import com.jkcredit.invoice.util.RespR;
 
 import java.util.List;
@@ -15,6 +14,7 @@ import java.util.Map;
 public interface NocarInvoiceService {
     /**
      * 查询所有发票接口
+     *
      * @param page
      * @param billInvoice
      * @return
@@ -23,15 +23,16 @@ public interface NocarInvoiceService {
 
     /**
      * 查询无车发票统计数据库信息
+     *
      * @param billInvoice
      * @return
      */
-    Map<String,String> findInvoiceStatics(BillInvoice billInvoice);
-
+    Map<String, String> findInvoiceStatics(BillInvoice billInvoice);
 
 
     /**
      * 批量查询所有发票接口
+     *
      * @param billInvoices
      * @return
      */

+ 3 - 3
src/main/java/com/jkcredit/invoice/service/nocar/impl/HcInvoiceServiceImpl.java

@@ -9,13 +9,13 @@ import com.jkcredit.invoice.service.nocar.HcInvoiceService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.List;
 @Service
-public class HcInvoiceServiceImpl extends ServiceImpl<HcInvoiceMapper,HcInvoice> implements HcInvoiceService{
+public class HcInvoiceServiceImpl extends ServiceImpl<HcInvoiceMapper, HcInvoice> implements HcInvoiceService {
     @Autowired
     HcInvoiceMapper hcInvoiceMapper;
+
     @Override
     public IPage<HcInvoice> findByPageAndWayBill(Page page, HcInvoice hcInvoice) {
-        return hcInvoiceMapper.selectAllByPage(page,hcInvoice);
+        return hcInvoiceMapper.selectAllByPage(page, hcInvoice);
     }
 }

+ 6 - 4
src/main/java/com/jkcredit/invoice/service/nocar/impl/NoCarBillWayImportServiceImpl.java

@@ -12,22 +12,24 @@ import org.springframework.stereotype.Service;
 import java.util.List;
 
 @Service
-public class NoCarBillWayImportServiceImpl extends ServiceImpl<NoCarWaybillImprtMapper,NoCarWayBill> implements NoCarBillWayImportService{
+public class NoCarBillWayImportServiceImpl extends ServiceImpl<NoCarWaybillImprtMapper, NoCarWayBill> implements NoCarBillWayImportService {
 
 
     @Autowired
     NoCarWaybillImprtMapper noCarWaybillMapperImprt;
+
     @Override
     public IPage<List<NoCarWayBill>> findByPageAndWayBill(Page page, NoCarWayBill noCarWayBill) {
-        return noCarWaybillMapperImprt.selectAllByPage(page,noCarWayBill);
+        return noCarWaybillMapperImprt.selectAllByPage(page, noCarWayBill);
     }
 
     @Override
     public IPage<List<NoCarWayBill>> findByPageAndWayBillException(Page page, NoCarWayBill noCarWayBill) {
-        return noCarWaybillMapperImprt.selectAllByPageException(page,noCarWayBill);
+        return noCarWaybillMapperImprt.selectAllByPageException(page, noCarWayBill);
     }
+
     @Override
-    public void updateBillway(int status, String msg, NoCarWayBill noCarWayBill){
+    public void updateBillway(int status, String msg, NoCarWayBill noCarWayBill) {
         noCarWayBill.setFailReason(msg);
         noCarWayBill.setBillwayStatus(status);
         noCarWaybillMapperImprt.updateByBillNum(noCarWayBill);

+ 137 - 139
src/main/java/com/jkcredit/invoice/service/nocar/impl/NoCarBillWayServiceImpl.java

@@ -32,9 +32,9 @@ import static com.jkcredit.invoice.common.CommonConst.*;
 
 @Service
 @Slf4j
-public class NoCarBillWayServiceImpl extends ServiceImpl<NoCarWaybillMapper,NoCarWayBill> implements NoCarBillWayService{
+public class NoCarBillWayServiceImpl extends ServiceImpl<NoCarWaybillMapper, NoCarWayBill> implements NoCarBillWayService {
 
-   public  static ExecutorService executorService = ThreadPoolFactory.getThreadPool("batchBillWayStart",5,10);
+    public static ExecutorService executorService = ThreadPoolFactory.getThreadPool("batchBillWayStart", 5, 10);
 
     @Autowired
     NoCarWaybillMapper noCarWaybillMapper;
@@ -56,130 +56,132 @@ public class NoCarBillWayServiceImpl extends ServiceImpl<NoCarWaybillMapper,NoCa
 
     @Autowired
     NoCarBillWayImportService noCarWaybillMapperImprt;
+
     @Override
     public IPage<List<NoCarWayBill>> findByPageAndWayBill(Page page, NoCarWayBill noCarWayBill) {
-        return noCarWaybillMapper.selectAllByPage(page,noCarWayBill);
+        return noCarWaybillMapper.selectAllByPage(page, noCarWayBill);
     }
 
     @Override
     public IPage<List<NoCarWayBill>> findByPageAndWayBillException(Page page, NoCarWayBill noCarWayBill) {
-        return noCarWaybillMapper.selectAllByPageException(page,noCarWayBill);
+        return noCarWaybillMapper.selectAllByPageException(page, noCarWayBill);
     }
+
     //插入或者更新运单
-    public void insertOrUpdateBillStart(NoCarWayBill noCarWayBill){
+    public void insertOrUpdateBillStart(NoCarWayBill noCarWayBill) {
         noCarWayBill.setIntfaceStartTime(DateUtil.getCurrentDateStr());
         noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
         NoCarWayBill curr = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
-        if(curr == null){
+        if (curr == null) {
             noCarWaybillMapper.insert(noCarWayBill);
-        }else{
-            if(curr.getBillwayStatus()<1) {
+        } else {
+            if (curr.getBillwayStatus() < 1) {
                 noCarWaybillMapper.updateByBillNum(noCarWayBill);
             }
         }
     }
+
     @Override
-    public RespR batchBillWayStart(List<NoCarWayBill> noCarWayBills,String customerName) {
-        log.info("开始平台指令上传NoCarBillWayServiceImpl.batchBillWayStart,上传数量"+noCarWayBills.size());
-        if(!customerService.checkMoneyEnough(customerName)){
-            return new RespR(false,"余额不足");
+    public RespR batchBillWayStart(List<NoCarWayBill> noCarWayBills, String customerName) {
+        log.info("开始平台指令上传NoCarBillWayServiceImpl.batchBillWayStart,上传数量" + noCarWayBills.size());
+        if (!customerService.checkMoneyEnough(customerName)) {
+            return new RespR(false, "余额不足");
         }
         StringBuffer stringBuffer = new StringBuffer();
         //保存批次号信息
-        String batchNumber = customerOperService.saveCustomerOper(customerName,1);
-        executorService.execute(()->{
+        String batchNumber = customerOperService.saveCustomerOper(customerName, 1);
+        executorService.execute(() -> {
             noCarWayBills.parallelStream().forEach(noCarWayBill -> {
-            //根据税号,查询备案企业
-            CustomerRec customerRec = new CustomerRec();
-            customerRec.setCustomerName(customerName);
-            customerRec.setCompanyReferencenum(noCarWayBill.getTaxplayerCode());
-            noCarWayBill.setBatchNum(batchNumber);
-            noCarWayBill.setCustomerName(customerName);
-            noCarWayBill.setBillwayStatus(-2);
-            noCarWayBill.setHisFlag(0);
-            noCarWayBill.setIntfaceStartTime(DateUtil.getCurrentDateStr());
-            noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
-            noCarWaybillMapperImprt.insertImport(noCarWayBill);
-            customerRec = customerRecMapper.selectByCustomerNameAndCompanyReference(customerRec);
-            if(customerRec == null){
-                noCarWaybillMapperImprt.updateBillway(-2,"企业税号未备案",noCarWayBill);
-                noCarWayBill.setFailReason("企业税号未备案");
-                noCarWayBill.setBillwayStatus(-2);
-                insertOrUpdateBillStart(noCarWayBill);
-                stringBuffer.append("#").append(noCarWayBill.getBillNum()).append(":").append("企业税号未备案#");
-                return;
-            }
-            noCarWayBill.setCompanyName(customerRec.getCompanyName());
-            noCarWayBill.setCompanyNum(customerRec.getCompanyNum());
-            if(DateUtil.getDistanceHours(noCarWayBill.getStartTime(),new Date())< INTONE){
-                noCarWaybillMapperImprt.updateBillway(-2,"失败,运单开始时间超72小时#",noCarWayBill);
+                //根据税号,查询备案企业
+                CustomerRec customerRec = new CustomerRec();
+                customerRec.setCustomerName(customerName);
+                customerRec.setCompanyReferencenum(noCarWayBill.getTaxplayerCode());
+                noCarWayBill.setBatchNum(batchNumber);
+                noCarWayBill.setCustomerName(customerName);
                 noCarWayBill.setBillwayStatus(-2);
-                noCarWayBill.setFailReason("失败,运单开始时间超72小时");
-                insertOrUpdateBillStart(noCarWayBill);
-                return;
-
-            }
-            //1.查询是否有车辆备案
-            CustomerCarRec customerCarRec;
-
-            //2.无车车辆备案时进行车辆备案
-
-            List<CustomerCarRec> customerCarRecs = new ArrayList<>();
-            customerCarRec = new CustomerCarRec();
-            customerCarRec.setCompanyName(noCarWayBill.getCompanyName());
-            customerCarRec.setCarNum(noCarWayBill.getPlateNum());
-            customerCarRec.setCarColor(noCarWayBill.getPlateColor());
-            customerCarRec.setCustomerName(customerName);
-            customerCarRec.setInterType(1);
-            customerCarRec.setCompanyNum(customerRec.getCompanyNum());
-            customerCarRec.setBusinessType("2");
-            customerCarRec.setServiceOperation(1);//默认运营车辆
-            noCarWayBill.setTitleType(2);
-            //先查询上游是否已经备案
-            RespR<VehicleQueryResponse> respRquery = noCarService.customerCarRecQueryUpper(customerCarRec);
-            if(respRquery.getCode() == 1 || respRquery.getData() == null || respRquery.getData().getResult() == null || respRquery.getData().getResult().size()<=0){
-                customerCarRecs.add(customerCarRec);
-                RespR respR = noCarService.customerCarRec(customerCarRecs);
-                if(respR.getCode() ==1){
-                    stringBuffer.append("#").append(noCarWayBill.getBillNum()).append(":").append(respR.getMsg()).append("#");
-                    noCarWaybillMapperImprt.updateBillway(-2,respR.getMsg(),noCarWayBill);
+                noCarWayBill.setHisFlag(0);
+                noCarWayBill.setIntfaceStartTime(DateUtil.getCurrentDateStr());
+                noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
+                noCarWaybillMapperImprt.insertImport(noCarWayBill);
+                customerRec = customerRecMapper.selectByCustomerNameAndCompanyReference(customerRec);
+                if (customerRec == null) {
+                    noCarWaybillMapperImprt.updateBillway(-2, "企业税号未备案", noCarWayBill);
+                    noCarWayBill.setFailReason("企业税号未备案");
                     noCarWayBill.setBillwayStatus(-2);
-                    noCarWayBill.setFailReason(respR.getMsg());
                     insertOrUpdateBillStart(noCarWayBill);
+                    stringBuffer.append("#").append(noCarWayBill.getBillNum()).append(":").append("企业税号未备案#");
                     return;
                 }
-            }
+                noCarWayBill.setCompanyName(customerRec.getCompanyName());
+                noCarWayBill.setCompanyNum(customerRec.getCompanyNum());
+                if (DateUtil.getDistanceHours(noCarWayBill.getStartTime(), new Date()) < INTONE) {
+                    noCarWaybillMapperImprt.updateBillway(-2, "失败,运单开始时间超72小时#", noCarWayBill);
+                    noCarWayBill.setBillwayStatus(-2);
+                    noCarWayBill.setFailReason("失败,运单开始时间超72小时");
+                    insertOrUpdateBillStart(noCarWayBill);
+                    return;
 
+                }
+                //1.查询是否有车辆备案
+                CustomerCarRec customerCarRec;
+
+                //2.无车车辆备案时进行车辆备案
+
+                List<CustomerCarRec> customerCarRecs = new ArrayList<>();
+                customerCarRec = new CustomerCarRec();
+                customerCarRec.setCompanyName(noCarWayBill.getCompanyName());
+                customerCarRec.setCarNum(noCarWayBill.getPlateNum());
+                customerCarRec.setCarColor(noCarWayBill.getPlateColor());
+                customerCarRec.setCustomerName(customerName);
+                customerCarRec.setInterType(1);
+                customerCarRec.setCompanyNum(customerRec.getCompanyNum());
+                customerCarRec.setBusinessType("2");
+                customerCarRec.setServiceOperation(1);//默认运营车辆
+                noCarWayBill.setTitleType(2);
+                //先查询上游是否已经备案
+                RespR<VehicleQueryResponse> respRquery = noCarService.customerCarRecQueryUpper(customerCarRec);
+                if (respRquery.getCode() == 1 || respRquery.getData() == null || respRquery.getData().getResult() == null || respRquery.getData().getResult().size() <= 0) {
+                    customerCarRecs.add(customerCarRec);
+                    RespR respR = noCarService.customerCarRec(customerCarRecs);
+                    if (respR.getCode() == 1) {
+                        stringBuffer.append("#").append(noCarWayBill.getBillNum()).append(":").append(respR.getMsg()).append("#");
+                        noCarWaybillMapperImprt.updateBillway(-2, respR.getMsg(), noCarWayBill);
+                        noCarWayBill.setBillwayStatus(-2);
+                        noCarWayBill.setFailReason(respR.getMsg());
+                        insertOrUpdateBillStart(noCarWayBill);
+                        return;
+                    }
+                }
 
 
-            //3.进行上传
-            RespR respR = noCarService.noCarWaybillStart(noCarWayBill);
-            if (respR.getCode() == 1){
-                noCarWaybillMapperImprt.updateBillway(-2,respR.getMsg(),noCarWayBill);
-                stringBuffer.append("#").append(noCarWayBill.getBillNum()).append(":").append(respR.getMsg()).append("#");
-            }else{
-                noCarWaybillMapperImprt.updateBillway(1,"",noCarWayBill);
-                return;
-            }
+                //3.进行上传
+                RespR respR = noCarService.noCarWaybillStart(noCarWayBill);
+                if (respR.getCode() == 1) {
+                    noCarWaybillMapperImprt.updateBillway(-2, respR.getMsg(), noCarWayBill);
+                    stringBuffer.append("#").append(noCarWayBill.getBillNum()).append(":").append(respR.getMsg()).append("#");
+                } else {
+                    noCarWaybillMapperImprt.updateBillway(1, "", noCarWayBill);
+                    return;
+                }
 
+            });
+            log.error("开始平台指令上传失败NoCarBillWayServiceImpl.batchBillWayStart:{}", stringBuffer.toString());
         });
-        log.error("开始平台指令上传失败NoCarBillWayServiceImpl.batchBillWayStart:{}",stringBuffer.toString());
-        });
-        return new RespR("批次号:"+batchNumber);
+        return new RespR("批次号:" + batchNumber);
     }
 
     @Override
-    public RespR batchHsitoryBillWay(List<NoCarWayBill> noCarWayBills, String customerName){
-        if(!customerService.checkMoneyEnough(customerName)){
-            return new RespR(false,"余额不足");
+    public RespR batchHsitoryBillWay(List<NoCarWayBill> noCarWayBills, String customerName) {
+        if (!customerService.checkMoneyEnough(customerName)) {
+            return new RespR(false, "余额不足");
         }
         StringBuffer stringBuffer = new StringBuffer();
         //保存批次号信息
-        String batchNumber = customerOperService.saveCustomerOper(customerName,3);
-        executorService.execute(()->{
+        String batchNumber = customerOperService.saveCustomerOper(customerName, 3);
+        executorService.execute(() -> {
             noCarWayBills.parallelStream().forEach(noCarWayBill -> {
                 try {
-                    log.info("开始处理历史运单:"+noCarWayBill.getBillNum());
+                    log.info("开始处理历史运单:" + noCarWayBill.getBillNum());
                     //根据税号,查询备案企业
                     CustomerRec customerRec = new CustomerRec();
                     customerRec.setCustomerName(customerName);
@@ -194,9 +196,9 @@ public class NoCarBillWayServiceImpl extends ServiceImpl<NoCarWaybillMapper,NoCa
                     noCarWayBill.setHisFlag(1);
                     noCarWayBill.setCustomerName(customerName);
                     noCarWaybillMapperImprt.insertImport(noCarWayBill);
-                    if(customerRec == null || customerRec.getRecStatus()!=1){
+                    if (customerRec == null || customerRec.getRecStatus() != 1) {
                         stringBuffer.append("#").append(noCarWayBill.getBillNum()).append(":").append("企业税号未备案#");
-                        noCarWaybillMapperImprt.updateBillway(-2,"企业税号未备案#",noCarWayBill);
+                        noCarWaybillMapperImprt.updateBillway(-2, "企业税号未备案#", noCarWayBill);
                         noCarWayBill.setBillwayStatus(-2);
                         noCarWayBill.setFailReason("企业税号未备案");
                         insertOrUpdateBillStart(noCarWayBill);
@@ -204,20 +206,20 @@ public class NoCarBillWayServiceImpl extends ServiceImpl<NoCarWaybillMapper,NoCa
                     }
                     noCarWayBill.setCompanyName(customerRec.getCompanyName());
                     noCarWayBill.setCompanyNum(customerRec.getCompanyNum());
-                    if(DateUtil.getDistanceDays(noCarWayBill.getStartTime(),new Date()) > INTTOW){
-                        log.info("历史运单开始上传失败:NoCarServiceImpl.noCarHisWaybillStart{},msg{}",noCarWayBill,"必须是二十天前的运单");
+                    if (DateUtil.getDistanceDays(noCarWayBill.getStartTime(), new Date()) > INTTOW) {
+                        log.info("历史运单开始上传失败:NoCarServiceImpl.noCarHisWaybillStart{},msg{}", noCarWayBill, "必须是二十天前的运单");
                         noCarWayBill.setBillwayStatus(-2);
                         noCarWayBill.setFailReason("失败,运单未满20天时效");
-                        noCarWaybillMapperImprt.updateBillway(-2,"失败,运单未满20天时效#",noCarWayBill);
+                        noCarWaybillMapperImprt.updateBillway(-2, "失败,运单未满20天时效#", noCarWayBill);
                         insertOrUpdateBillStart(noCarWayBill);
                         return;
                     }
-                    if(DateUtil.getDistanceHours(noCarWayBill.getStartTime(),DateUtil.stringToDate(noCarWayBill.getPredictEndTime()))< INTTHREE){
+                    if (DateUtil.getDistanceHours(noCarWayBill.getStartTime(), DateUtil.stringToDate(noCarWayBill.getPredictEndTime())) < INTTHREE) {
                         noCarWayBill.setBillwayStatus(-2);
                         noCarWayBill.setFailReason("运单已经超时,请拆分");
                         insertOrUpdateBillStart(noCarWayBill);
-                        noCarWaybillMapperImprt.updateBillway(-2,"运单已经超时,请拆分#",noCarWayBill);
-                        log.info("运单结束失败:NoCarServiceImpl.noCarWaybillStart{},msg{}",noCarWayBill,"运单已经超时,请拆分");
+                        noCarWaybillMapperImprt.updateBillway(-2, "运单已经超时,请拆分#", noCarWayBill);
+                        log.info("运单结束失败:NoCarServiceImpl.noCarWaybillStart{},msg{}", noCarWayBill, "运单已经超时,请拆分");
                         return;
                     }
                     //1.查询是否有车辆备案 /
@@ -235,11 +237,11 @@ public class NoCarBillWayServiceImpl extends ServiceImpl<NoCarWaybillMapper,NoCa
                     customerCarRec.setServiceOperation(1);//默认运营车辆
                     //先查询上游是否已经备案
                     RespR<VehicleQueryResponse> respRquery = noCarService.customerCarRecQueryUpper(customerCarRec);
-                    if(respRquery.getCode() == 1 || respRquery.getData() == null || respRquery.getData().getResult() == null || respRquery.getData().getResult().size()<=0){
+                    if (respRquery.getCode() == 1 || respRquery.getData() == null || respRquery.getData().getResult() == null || respRquery.getData().getResult().size() <= 0) {
                         customerCarRecs.add(customerCarRec);
                         RespR respR = noCarService.customerCarRec(customerCarRecs);
-                        if(respR.getCode() ==1){
-                            noCarWaybillMapperImprt.updateBillway(-2,respR.getMsg(),noCarWayBill);
+                        if (respR.getCode() == 1) {
+                            noCarWaybillMapperImprt.updateBillway(-2, respR.getMsg(), noCarWayBill);
                             stringBuffer.append("#").append(noCarWayBill.getBillNum()).append(":").append(respR.getMsg()).append("#");
                             noCarWayBill.setBillwayStatus(-2);
                             noCarWayBill.setFailReason(respR.getMsg());
@@ -249,62 +251,61 @@ public class NoCarBillWayServiceImpl extends ServiceImpl<NoCarWaybillMapper,NoCa
                     }
 
 
-
                     //3.kais指令上传
                     NoCarWayBill noCarWayBillClo = null;
-                    try{
+                    try {
                         noCarWayBillClo = noCarWayBill.clone();
-                    }catch (Exception e){
+                    } catch (Exception e) {
                         e.printStackTrace();
                         noCarWayBillClo = noCarWayBill;
                     }
 
                     RespR respR = noCarService.noCarHisWaybillStart(noCarWayBill);
-                    if (respR.getCode() == 1){
+                    if (respR.getCode() == 1) {
                         stringBuffer.append("#").append(noCarWayBill.getBillNum()).append(":").append(respR.getMsg()).append("#");
-                        noCarWaybillMapperImprt.updateBillway(-2,respR.getMsg(),noCarWayBill);
+                        noCarWaybillMapperImprt.updateBillway(-2, respR.getMsg(), noCarWayBill);
                         noCarWayBill.setBillwayStatus(-2);
                         noCarWayBill.setFailReason(respR.getMsg());
                         insertOrUpdateBillStart(noCarWayBill);
-                        log.info(noCarWayBill.getBillNum()+"#开始指令失败"+respR.getMsg());
-                    }else{
-                        log.info(noCarWayBill.getBillNum()+"#开始指令成功"+respR.getMsg());
+                        log.info(noCarWayBill.getBillNum() + "#开始指令失败" + respR.getMsg());
+                    } else {
+                        log.info(noCarWayBill.getBillNum() + "#开始指令成功" + respR.getMsg());
                         //3.kais指令上传
                         respR = noCarService.noCarHisWaybillEnd(noCarWayBillClo);
 
-                        if(respR.getCode() == 1){
-                            noCarWaybillMapperImprt.updateBillway(-3,respR.getMsg(),noCarWayBill);
-                            log.info(noCarWayBill.getBillNum()+"#结束指令失败"+respR.getMsg());
+                        if (respR.getCode() == 1) {
+                            noCarWaybillMapperImprt.updateBillway(-3, respR.getMsg(), noCarWayBill);
+                            log.info(noCarWayBill.getBillNum() + "#结束指令失败" + respR.getMsg());
                             stringBuffer.append("#").append(noCarWayBill.getBillNum()).append(":").append(respR.getMsg()).append("#");
-                        }else{
-                            noCarWaybillMapperImprt.updateBillway(2,respR.getMsg(),noCarWayBill);
-                            log.info(noCarWayBill.getBillNum()+"#结束指令成功"+respR.getMsg());
+                        } else {
+                            noCarWaybillMapperImprt.updateBillway(2, respR.getMsg(), noCarWayBill);
+                            log.info(noCarWayBill.getBillNum() + "#结束指令成功" + respR.getMsg());
                         }
                     }
-                    log.info("kai shi chu li li si yun dan"+noCarWayBill.getBillNum());
-                }catch (Exception e){
+                    log.info("kai shi chu li li si yun dan" + noCarWayBill.getBillNum());
+                } catch (Exception e) {
                     e.printStackTrace();
                 }
 
 
             });
-            if(!StringUtils.isEmpty(stringBuffer.toString())){
+            if (!StringUtils.isEmpty(stringBuffer.toString())) {
                 log.error(stringBuffer.toString());
             }
         });
-        return new RespR("批次号:"+batchNumber);
+        return new RespR("批次号:" + batchNumber);
     }
 
     @Override
     public RespR batchBillWayEnd(List<NoCarWayBill> noCarWayBills, String customerName) {
-        log.error("结束平台指令上传数量NoCarBillWayServiceImpl.batchBillWayEnd:{}",noCarWayBills.size());
-        if(!customerService.checkMoneyEnough(customerName)){
-            return new RespR(false,"余额不足");
+        log.error("结束平台指令上传数量NoCarBillWayServiceImpl.batchBillWayEnd:{}", noCarWayBills.size());
+        if (!customerService.checkMoneyEnough(customerName)) {
+            return new RespR(false, "余额不足");
         }
         StringBuffer stringBuffer = new StringBuffer();
         //保存批次号信息
-        String batchNumber = customerOperService.saveCustomerOper(customerName,2);
-        executorService.execute(()->{
+        String batchNumber = customerOperService.saveCustomerOper(customerName, 2);
+        executorService.execute(() -> {
             noCarWayBills.parallelStream().forEach(noCarWayBill -> {
                 try {
                     noCarWayBill.setBatchNum(batchNumber);
@@ -315,42 +316,39 @@ public class NoCarBillWayServiceImpl extends ServiceImpl<NoCarWaybillMapper,NoCa
                     noCarWaybillMapperImprt.insertImport(noCarWayBill);
                     RespR respR = noCarService.noCarWaybillEnd(noCarWayBill);
                     noCarWayBill.setBillNum(batchNumber);
-                    if (respR.getCode() == 1){
-                        noCarWaybillMapperImprt.updateBillway(-2,respR.getMsg(),noCarWayBill);
+                    if (respR.getCode() == 1) {
+                        noCarWaybillMapperImprt.updateBillway(-2, respR.getMsg(), noCarWayBill);
                         stringBuffer.append("#").append(noCarWayBill.getBillNum()).append(":").append(respR.getMsg()).append("#");
-                    }else{
-                        noCarWaybillMapperImprt.updateBillway(2,respR.getMsg(),noCarWayBill);
+                    } else {
+                        noCarWaybillMapperImprt.updateBillway(2, respR.getMsg(), noCarWayBill);
                     }
-                }catch (Exception e){
+                } catch (Exception e) {
                     e.printStackTrace();
                 }
 
             });
 
-            if(!StringUtils.isEmpty(stringBuffer.toString())){
-                log.error("开始平台指令上传失败NoCarBillWayServiceImpl.batchBillWayEnd:{}",stringBuffer.toString());
+            if (!StringUtils.isEmpty(stringBuffer.toString())) {
+                log.error("开始平台指令上传失败NoCarBillWayServiceImpl.batchBillWayEnd:{}", stringBuffer.toString());
             }
         });
-        return new RespR("批次号:"+batchNumber);
+        return new RespR("批次号:" + batchNumber);
     }
 
 
-
-
-
     @Override
     public RespR findImportNocarBillWay(List<NoCarWayBill> noCarWayBills) {
-        if(noCarWayBills ==null || 0 == noCarWayBills.size()){
-            return new RespR<>("失败","0");
+        if (noCarWayBills == null || 0 == noCarWayBills.size()) {
+            return new RespR<>("失败", "0");
         }
         List<NoCarWayBill> noCarWayBillsTmp = new ArrayList<NoCarWayBill>();
-        for (NoCarWayBill noCarWayBill:noCarWayBills) {
-            if(StringUtils.isEmpty(noCarWayBill.getBillNum()) ){
-                return new RespR<>("失败","0");
+        for (NoCarWayBill noCarWayBill : noCarWayBills) {
+            if (StringUtils.isEmpty(noCarWayBill.getBillNum())) {
+                return new RespR<>("失败", "0");
             }
-            NoCarWayBill bill =  noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
+            NoCarWayBill bill = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
             noCarWayBillsTmp.add(bill);
         }
-        return new RespR<>(noCarWayBillsTmp,"1");
+        return new RespR<>(noCarWayBillsTmp, "1");
     }
 }

+ 34 - 33
src/main/java/com/jkcredit/invoice/service/nocar/impl/NoCarRecServiceImpl.java

@@ -23,80 +23,81 @@ import java.util.List;
 import static com.jkcredit.invoice.common.CommonConst.SELF_CAR;
 
 @Service
-public class NoCarRecServiceImpl extends ServiceImpl<CustomerCarRecMapper,CustomerCarRec> implements NoCarRecService {
+public class NoCarRecServiceImpl extends ServiceImpl<CustomerCarRecMapper, CustomerCarRec> implements NoCarRecService {
     @Autowired
     CustomerCarRecMapper customerCarRecMapper;
     @Autowired
     CustomerRecMapper customerRecMapper;
     @Autowired
     SelfCarInterface selfCarInterface;
+
     @Override
     public IPage<List<CustomerCarRec>> findByPageAndCarRec(Page page, CustomerCarRec customerCarRec) {
-        if(SELF_CAR.equals(customerCarRec.getBusinessType()) && !StringUtils.isEmpty(customerCarRec.getCarNum())){
+        if (SELF_CAR.equals(customerCarRec.getBusinessType()) && !StringUtils.isEmpty(customerCarRec.getCarNum())) {
             CustomerRec customerRec = new CustomerRec();
             customerRec.setCompanyName(customerCarRec.getCompanyName());
             customerRec.setCustomerName(customerCarRec.getCustomerName());
             customerRec = customerRecMapper.selectByCustomerNameAndCompany(customerRec);
-            if(customerRec != null){
+            if (customerRec != null) {
                 List<CustomerCarRec> customerCarRecs = customerCarRecMapper.selectAllEtcBySelfCarNum(customerCarRec.getCarNum());
                 CardBindQueryListToBRequest bRequest = new CardBindQueryListToBRequest();
                 bRequest.setPlateNum(customerCarRec.getCarNum());
                 bRequest.setCompanyNum(customerRec.getCompanyNum());
                 RespR<CardBindQueryListToBResponse> responseRespR = selfCarInterface.cardBindQueryListToB(bRequest);
-                if(responseRespR.getCode() !=1){
+                if (responseRespR.getCode() != 1) {
                     List<CardBindQueryListToBModel> bModels = responseRespR.getData().getResult();
-                    if(bModels!=null && bModels.size()>0){
-                        if(customerCarRecs!=null && customerCarRecs.size()>0){
+                    if (bModels != null && bModels.size() > 0) {
+                        if (customerCarRecs != null && customerCarRecs.size() > 0) {
                             customerCarRecs.forEach(customerCarRec1 -> {
                                 boolean has = false;
-                                for(CardBindQueryListToBModel bModel :bModels){
-                                    if(bModel .getCardId().equals(customerCarRec1.getEtcNum())){
+                                for (CardBindQueryListToBModel bModel : bModels) {
+                                    if (bModel.getCardId().equals(customerCarRec1.getEtcNum())) {
                                         has = true;
                                         customerCarRec1.setCompanyName(customerCarRec.getCompanyName());
-                                        if(customerCarRec1.getCompanyNum()!=null && !customerCarRec1.getCompanyNum().equals(bModel .getCompanyNum())) {
+                                        if (customerCarRec1.getCompanyNum() != null && !customerCarRec1.getCompanyNum().equals(bModel.getCompanyNum())) {
                                             customerCarRec1.setSuccTime(DateUtil.getCurrentDateStr());
                                         }
-                                        customerCarRec1.setCompanyNum(bModel .getCompanyNum());
+                                        customerCarRec1.setCompanyNum(bModel.getCompanyNum());
                                         customerCarRec1.setCarNum(customerCarRec.getCarNum());
-                                        customerCarRec1.setCarColor(bModel .getPlateColor()+"");
+                                        customerCarRec1.setCarColor(bModel.getPlateColor() + "");
                                         customerCarRec1.setRecStatus(1);
                                         customerCarRecMapper.updateEtcByPrimaryKeySelective(customerCarRec1);
                                     }
                                 }
-                                if(!has){
+                                if (!has) {
                                     customerCarRec1.setRecStatus(2);
                                     customerCarRecMapper.updateEtcByPrimaryKeySelective(customerCarRec1);
                                 }
                             });
                         }
-                        for(CardBindQueryListToBModel bModel :bModels){
+                        for (CardBindQueryListToBModel bModel : bModels) {
                             boolean has = false;
-                            if(customerCarRecs != null && customerCarRecs.size()>0){
-                                for(CustomerCarRec customerCarRec1:customerCarRecs){
+                            if (customerCarRecs != null && customerCarRecs.size() > 0) {
+                                for (CustomerCarRec customerCarRec1 : customerCarRecs) {
 
-                                    if(bModel .getCardId().equals(customerCarRec1.getEtcNum())){
+                                    if (bModel.getCardId().equals(customerCarRec1.getEtcNum())) {
                                         has = true;
                                     }
                                 }
                             }
-                           if(!has){
-                               CustomerCarRec customerCarRecDb = new CustomerCarRec();
-                               customerCarRecDb.setInterType(1);
-                               customerCarRecDb.setCompanyNum(bModel .getCompanyNum());
-                               customerCarRecDb.setCarNum(bModel .getPlateNum());
-                               customerCarRecDb.setBusinessType("0");
-                               customerCarRecDb.setCustomerName(customerCarRec.getCustomerName());
-                               customerCarRecDb.setSuccTime(DateUtil.getCurrentDateStr());
-                               customerCarRecDb.setCompanyName(customerRec.getCompanyName());
-                               customerCarRecDb.setEtcNum(bModel .getCardId());
-                               customerCarRecDb.setCarColor(bModel .getPlateColor()+"");
-                               customerCarRecDb.setRecStatus(1);
-                               customerCarRecMapper.insert(customerCarRecDb);
-                           }
+                            if (!has) {
+                                CustomerCarRec customerCarRecDb = new CustomerCarRec();
+                                customerCarRecDb.setInterType(1);
+                                customerCarRecDb.setCompanyNum(bModel.getCompanyNum());
+                                customerCarRecDb.setCarNum(bModel.getPlateNum());
+                                customerCarRecDb.setBusinessType("0");
+                                customerCarRecDb.setCustomerName(customerCarRec.getCustomerName());
+                                customerCarRecDb.setSuccTime(DateUtil.getCurrentDateStr());
+                                customerCarRecDb.setCompanyName(customerRec.getCompanyName());
+                                customerCarRecDb.setEtcNum(bModel.getCardId());
+                                customerCarRecDb.setCarColor(bModel.getPlateColor() + "");
+                                customerCarRecDb.setRecStatus(1);
+                                customerCarRecMapper.insert(customerCarRecDb);
+                            }
                         }
-                    }else{
+                    } else {
                         //车牌下的卡都更新为注销
-                        if(customerCarRecs!=null && customerCarRecs.size()>0){
+                        if (customerCarRecs != null && customerCarRecs.size() > 0) {
                             customerCarRecs.forEach(customerCarRec1 -> {
                                 customerCarRec1.setRecStatus(2);
                                 customerCarRecMapper.updateEtcByPrimaryKeySelective(customerCarRec1);
@@ -106,7 +107,7 @@ public class NoCarRecServiceImpl extends ServiceImpl<CustomerCarRecMapper,Custom
                 }
             }
         }
-        return customerCarRecMapper.selectAllByPage(page,customerCarRec);
+        return customerCarRecMapper.selectAllByPage(page, customerCarRec);
     }
 
 }

+ 17 - 17
src/main/java/com/jkcredit/invoice/service/nocar/impl/NocarInvoiceServiceImpl.java

@@ -16,13 +16,13 @@ import java.util.List;
 import java.util.Map;
 
 @Service
-public class NocarInvoiceServiceImpl extends ServiceImpl<BillInvoiceMapper,BillInvoice> implements NocarInvoiceService{
+public class NocarInvoiceServiceImpl extends ServiceImpl<BillInvoiceMapper, BillInvoice> implements NocarInvoiceService {
     @Autowired
     BillInvoiceMapper billInvoiceMapper;
 
     @Override
     public IPage<List<BillInvoice>> findByPageAndInvoice(Page page, BillInvoice billInvoice) {
-        return billInvoiceMapper.selectAllByPage(page,billInvoice);
+        return billInvoiceMapper.selectAllByPage(page, billInvoice);
     }
 
     @Override
@@ -32,29 +32,29 @@ public class NocarInvoiceServiceImpl extends ServiceImpl<BillInvoiceMapper,BillI
 
     @Override
     public RespR findImportNocarInvoices(List<BillInvoice> billInvoices) {
-        if(billInvoices ==null || 0 == billInvoices.size()){
-            return new RespR<>("失败","0");
+        if (billInvoices == null || 0 == billInvoices.size()) {
+            return new RespR<>("失败", "0");
         }
 
         List<BillInvoice> billInvoicesTmp = new ArrayList<BillInvoice>();
-        for (BillInvoice billInvoice:billInvoices) {
-            if(StringUtils.isNotEmpty(billInvoice.getWaybillNum()) && StringUtils.isEmpty(billInvoice.getInvoiceNum())
-                    &&  StringUtils.isEmpty(billInvoice.getInvoiceCode())){
-                List<BillInvoice> bills =  billInvoiceMapper.selectByBillNum(billInvoice.getWaybillNum());
+        for (BillInvoice billInvoice : billInvoices) {
+            if (StringUtils.isNotEmpty(billInvoice.getWaybillNum()) && StringUtils.isEmpty(billInvoice.getInvoiceNum())
+                    && StringUtils.isEmpty(billInvoice.getInvoiceCode())) {
+                List<BillInvoice> bills = billInvoiceMapper.selectByBillNum(billInvoice.getWaybillNum());
                 billInvoicesTmp.addAll(bills);
-            }else if(StringUtils.isNotEmpty(billInvoice.getWaybillNum()) && StringUtils.isNotEmpty(billInvoice.getInvoiceNum())
-                    &&  StringUtils.isNotEmpty(billInvoice.getInvoiceCode())){
-                BillInvoice bill =  billInvoiceMapper.selectAllByPageByBillInvoice(billInvoice);
+            } else if (StringUtils.isNotEmpty(billInvoice.getWaybillNum()) && StringUtils.isNotEmpty(billInvoice.getInvoiceNum())
+                    && StringUtils.isNotEmpty(billInvoice.getInvoiceCode())) {
+                BillInvoice bill = billInvoiceMapper.selectAllByPageByBillInvoice(billInvoice);
                 billInvoicesTmp.add(bill);
-            }else if(StringUtils.isEmpty(billInvoice.getWaybillNum()) && StringUtils.isNotEmpty(billInvoice.getInvoiceNum())
-                    &&  StringUtils.isNotEmpty(billInvoice.getInvoiceCode())){
-                BillInvoice bill =  billInvoiceMapper.selectAllByPageByBillInvoice(billInvoice);
+            } else if (StringUtils.isEmpty(billInvoice.getWaybillNum()) && StringUtils.isNotEmpty(billInvoice.getInvoiceNum())
+                    && StringUtils.isNotEmpty(billInvoice.getInvoiceCode())) {
+                BillInvoice bill = billInvoiceMapper.selectAllByPageByBillInvoice(billInvoice);
                 billInvoicesTmp.add(bill);
-            }else{
-                return new RespR<>("失败","0");
+            } else {
+                return new RespR<>("失败", "0");
             }
 
         }
-        return new RespR<>(billInvoicesTmp,"1");
+        return new RespR<>(billInvoicesTmp, "1");
     }
 }

+ 0 - 0
src/main/java/com/jkcredit/invoice/service/selfcar/SelfCarApplyService.java


Деякі файли не було показано, через те що забагато файлів було змінено