Ver código fonte

分支切换20210616

mashengyi 3 anos atrás
commit
30aad1615a
100 arquivos alterados com 6715 adições e 0 exclusões
  1. 243 0
      pom.xml
  2. 17 0
      src/main/java/com/jkcredit/invoice/SysInvoiceApplication.java
  3. 14 0
      src/main/java/com/jkcredit/invoice/annotation/CurrentUser.java
  4. 15 0
      src/main/java/com/jkcredit/invoice/annotation/LoginRequired.java
  5. 75 0
      src/main/java/com/jkcredit/invoice/annotation/annotationDes/AuthenticationInterceptor.java
  6. 31 0
      src/main/java/com/jkcredit/invoice/annotation/annotationDes/CurrentUserMethodArgumentResolver.java
  7. 462 0
      src/main/java/com/jkcredit/invoice/async/CarFreeBillAsync.java
  8. 52 0
      src/main/java/com/jkcredit/invoice/common/BaseEntity.java
  9. 256 0
      src/main/java/com/jkcredit/invoice/common/CommonConstants.java
  10. 33 0
      src/main/java/com/jkcredit/invoice/config/CorsConfig.java
  11. 49 0
      src/main/java/com/jkcredit/invoice/config/DruidConfiguration.java
  12. 50 0
      src/main/java/com/jkcredit/invoice/config/GlobalExceptionHandler.java
  13. 81 0
      src/main/java/com/jkcredit/invoice/config/InvoiceWebMvcConfigurer.java
  14. 58 0
      src/main/java/com/jkcredit/invoice/config/JacksonConfig.java
  15. 39 0
      src/main/java/com/jkcredit/invoice/config/MybatisPlusConfigurer.java
  16. 56 0
      src/main/java/com/jkcredit/invoice/config/RedisConfig.java
  17. 20 0
      src/main/java/com/jkcredit/invoice/config/RestTemplateConfig.java
  18. 45 0
      src/main/java/com/jkcredit/invoice/config/SwaggerConfig.java
  19. 62 0
      src/main/java/com/jkcredit/invoice/consumer/B2bChargeConsumer.java
  20. 71 0
      src/main/java/com/jkcredit/invoice/consumer/ChargeConsumer.java
  21. 69 0
      src/main/java/com/jkcredit/invoice/controller/AutoBillController.java
  22. 45 0
      src/main/java/com/jkcredit/invoice/controller/B2bInvoiceApplyController.java
  23. 41 0
      src/main/java/com/jkcredit/invoice/controller/B2bInvoicePackageController.java
  24. 38 0
      src/main/java/com/jkcredit/invoice/controller/B2bInvoiceQueryController.java
  25. 42 0
      src/main/java/com/jkcredit/invoice/controller/BatchController.java
  26. 58 0
      src/main/java/com/jkcredit/invoice/controller/BillEstimateController.java
  27. 45 0
      src/main/java/com/jkcredit/invoice/controller/BillEstimateResultController.java
  28. 73 0
      src/main/java/com/jkcredit/invoice/controller/CarEtcCardController.java
  29. 136 0
      src/main/java/com/jkcredit/invoice/controller/CarFreeCarrierBillController.java
  30. 72 0
      src/main/java/com/jkcredit/invoice/controller/CarFreeCarrierRegisterController.java
  31. 54 0
      src/main/java/com/jkcredit/invoice/controller/CardTradeController.java
  32. 74 0
      src/main/java/com/jkcredit/invoice/controller/Customer/CustomerController.java
  33. 65 0
      src/main/java/com/jkcredit/invoice/controller/InvoiceController.java
  34. 85 0
      src/main/java/com/jkcredit/invoice/controller/NumInvoiceController.java
  35. 69 0
      src/main/java/com/jkcredit/invoice/controller/PackageFileController.java
  36. 40 0
      src/main/java/com/jkcredit/invoice/controller/RechargeController.java
  37. 33 0
      src/main/java/com/jkcredit/invoice/controller/RoleController.java
  38. 102 0
      src/main/java/com/jkcredit/invoice/controller/SearchInvoiceResultController.java
  39. 147 0
      src/main/java/com/jkcredit/invoice/controller/TempController.java
  40. 76 0
      src/main/java/com/jkcredit/invoice/controller/service/LowerServiceController.java
  41. 62 0
      src/main/java/com/jkcredit/invoice/controller/user/AuthenticationController.java
  42. 129 0
      src/main/java/com/jkcredit/invoice/controller/user/UserController.java
  43. 26 0
      src/main/java/com/jkcredit/invoice/mapper/B2bInvoiceApplyMapper.java
  44. 28 0
      src/main/java/com/jkcredit/invoice/mapper/B2bInvoicePackageMapper.java
  45. 39 0
      src/main/java/com/jkcredit/invoice/mapper/B2bInvoiceQueryMapper.java
  46. 27 0
      src/main/java/com/jkcredit/invoice/mapper/BatchMapper.java
  47. 39 0
      src/main/java/com/jkcredit/invoice/mapper/CarEtcCardMapper.java
  48. 43 0
      src/main/java/com/jkcredit/invoice/mapper/CarFreeCarrierBillEndMapper.java
  49. 127 0
      src/main/java/com/jkcredit/invoice/mapper/CarFreeCarrierBillStartMapper.java
  50. 54 0
      src/main/java/com/jkcredit/invoice/mapper/CarFreeCarrierRegisterMapper.java
  51. 41 0
      src/main/java/com/jkcredit/invoice/mapper/CardTradeMapper.java
  52. 7 0
      src/main/java/com/jkcredit/invoice/mapper/ChargeMapper.java
  53. 7 0
      src/main/java/com/jkcredit/invoice/mapper/ConsumeQueueMapper.java
  54. 22 0
      src/main/java/com/jkcredit/invoice/mapper/CustomerCarRecMapper.java
  55. 28 0
      src/main/java/com/jkcredit/invoice/mapper/CustomerMapper.java
  56. 24 0
      src/main/java/com/jkcredit/invoice/mapper/CustomerRecMapper.java
  57. 19 0
      src/main/java/com/jkcredit/invoice/mapper/CustomerRechargeMapper.java
  58. 40 0
      src/main/java/com/jkcredit/invoice/mapper/InvoiceMapper.java
  59. 26 0
      src/main/java/com/jkcredit/invoice/mapper/NumInvoiceMapper.java
  60. 13 0
      src/main/java/com/jkcredit/invoice/mapper/RealChargeMapper.java
  61. 27 0
      src/main/java/com/jkcredit/invoice/mapper/RechargeMapper.java
  62. 13 0
      src/main/java/com/jkcredit/invoice/mapper/RoleMapper.java
  63. 13 0
      src/main/java/com/jkcredit/invoice/mapper/SearchInvoiceDataMapper.java
  64. 73 0
      src/main/java/com/jkcredit/invoice/mapper/SearchInvoiceResultMapper.java
  65. 7 0
      src/main/java/com/jkcredit/invoice/mapper/SearchInvoiceResultTempMapper.java
  66. 80 0
      src/main/java/com/jkcredit/invoice/mapper/UserMapper.java
  67. 74 0
      src/main/java/com/jkcredit/invoice/model/entity/B2bInvoiceApply.java
  68. 74 0
      src/main/java/com/jkcredit/invoice/model/entity/B2bInvoicePackage.java
  69. 167 0
      src/main/java/com/jkcredit/invoice/model/entity/B2bInvoiceQuery.java
  70. 35 0
      src/main/java/com/jkcredit/invoice/model/entity/Batch.java
  71. 76 0
      src/main/java/com/jkcredit/invoice/model/entity/BillEstimate.java
  72. 46 0
      src/main/java/com/jkcredit/invoice/model/entity/BillEstimateResult.java
  73. 103 0
      src/main/java/com/jkcredit/invoice/model/entity/BillRelationEstimate.java
  74. 91 0
      src/main/java/com/jkcredit/invoice/model/entity/CarEtcCard.java
  75. 89 0
      src/main/java/com/jkcredit/invoice/model/entity/CarFreeCarrierBillEnd.java
  76. 193 0
      src/main/java/com/jkcredit/invoice/model/entity/CarFreeCarrierBillStart.java
  77. 71 0
      src/main/java/com/jkcredit/invoice/model/entity/CarFreeCarrierRegister.java
  78. 15 0
      src/main/java/com/jkcredit/invoice/model/entity/Card.java
  79. 86 0
      src/main/java/com/jkcredit/invoice/model/entity/CardTrade.java
  80. 26 0
      src/main/java/com/jkcredit/invoice/model/entity/Charge.java
  81. 40 0
      src/main/java/com/jkcredit/invoice/model/entity/ConsumeQueue.java
  82. 125 0
      src/main/java/com/jkcredit/invoice/model/entity/Customer.java
  83. 114 0
      src/main/java/com/jkcredit/invoice/model/entity/CustomerCarRec.java
  84. 158 0
      src/main/java/com/jkcredit/invoice/model/entity/CustomerRec.java
  85. 45 0
      src/main/java/com/jkcredit/invoice/model/entity/CustomerRecharge.java
  86. 83 0
      src/main/java/com/jkcredit/invoice/model/entity/Invoice.java
  87. 44 0
      src/main/java/com/jkcredit/invoice/model/entity/NumInvoice.java
  88. 17 0
      src/main/java/com/jkcredit/invoice/model/entity/Plate.java
  89. 36 0
      src/main/java/com/jkcredit/invoice/model/entity/RealCharge.java
  90. 39 0
      src/main/java/com/jkcredit/invoice/model/entity/Recharge.java
  91. 28 0
      src/main/java/com/jkcredit/invoice/model/entity/Role.java
  92. 100 0
      src/main/java/com/jkcredit/invoice/model/entity/SearchInvoiceData.java
  93. 47 0
      src/main/java/com/jkcredit/invoice/model/entity/SearchInvoiceMsg.java
  94. 116 0
      src/main/java/com/jkcredit/invoice/model/entity/SearchInvoiceResult.java
  95. 116 0
      src/main/java/com/jkcredit/invoice/model/entity/SearchInvoiceResultTemp.java
  96. 87 0
      src/main/java/com/jkcredit/invoice/model/entity/User.java
  97. 20 0
      src/main/java/com/jkcredit/invoice/model/entity/WayBillTest.java
  98. 131 0
      src/main/java/com/jkcredit/invoice/model/vo/CarFreeCarrierBillVo.java
  99. 116 0
      src/main/java/com/jkcredit/invoice/model/vo/SearchInvoiceResultVo.java
  100. 0 0
      src/main/java/com/jkcredit/invoice/producer/B2bChargeProducer.java

+ 243 - 0
pom.xml

@@ -0,0 +1,243 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.1.5.RELEASE</version>
+        <relativePath/> <!-- lookup parent from repository -->
+    </parent>
+    <groupId>com.jkcredit.invoice</groupId>
+    <artifactId>sys_invoice</artifactId>
+    <version>1.0</version>
+    <name>sys_invoice</name>
+    <description>Demo project for Spring Boot</description>
+
+    <properties>
+        <java.version>1.8</java.version>
+        <hutool.version>4.4.3</hutool.version>
+        <mybatis-plus.version>3.1.0</mybatis-plus.version>
+        <mysql.version>8.0.15</mysql.version>
+        <redis.version>2.1.3.RELEASE</redis.version>
+        <swagger.version>2.9.2</swagger.version>
+        <maven.compiler.source>1.8</maven.compiler.source>
+        <maven.compiler.target>1.8</maven.compiler.target>
+
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-aop</artifactId>
+        </dependency>
+
+        <!--mybatis-plus插件-->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <version>${mybatis-plus.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>${mysql.version}</version>
+        </dependency>
+
+        <!--hutool-->
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>${hutool.version}</version>
+        </dependency>
+
+        <!--redis-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+            <version>${redis.version}</version>
+        </dependency>
+
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>1.1.10</version>
+        </dependency>
+
+        <!--server-api-->
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>javax.servlet-api</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+            <version>${swagger.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-quartz</artifactId>
+        </dependency>
+
+<!--        <dependency>-->
+<!--            <groupId>io.springfox</groupId>-->
+<!--            <artifactId>springfox-swagger-ui</artifactId>-->
+<!--            <version>${swagger.version}</version>-->
+<!--        </dependency>-->
+
+        <dependency>
+            <groupId>com.github.caspar-chen</groupId>
+            <artifactId>swagger-ui-layer</artifactId>
+            <version>1.1.3</version>
+        </dependency>
+
+<!--        &lt;!&ndash;web 模块&ndash;&gt;-->
+<!--        <dependency>-->
+<!--            <groupId>org.springframework.boot</groupId>-->
+<!--            <artifactId>spring-boot-starter-web</artifactId>-->
+<!--            <exclusions>-->
+<!--                &lt;!&ndash;排除tomcat依赖&ndash;&gt;-->
+<!--                <exclusion>-->
+<!--                    <artifactId>spring-boot-starter-tomcat</artifactId>-->
+<!--                    <groupId>org.springframework.boot</groupId>-->
+<!--                </exclusion>-->
+<!--            </exclusions>-->
+<!--        </dependency>-->
+<!--        &lt;!&ndash;undertow容器&ndash;&gt;-->
+<!--        <dependency>-->
+<!--            <groupId>org.springframework.boot</groupId>-->
+<!--            <artifactId>spring-boot-starter-undertow</artifactId>-->
+<!--        </dependency>-->
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi</artifactId>
+            <version>3.15</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml</artifactId>
+            <version>3.15</version>
+        </dependency>
+        <!-- https://mvnrepository.com/artifact/org.apache.poi/poi-scratchpad -->
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-scratchpad</artifactId>
+            <version>3.15</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.auth0</groupId>
+            <artifactId>java-jwt</artifactId>
+            <version>3.0.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+            <version>2.6</version>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.6</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <version>21.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>cn.afterturn</groupId>
+            <artifactId>easypoi-spring-boot-starter</artifactId>
+            <version>3.3.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-amqp</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-core</artifactId>
+            <version>1.1.7</version>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-access</artifactId>
+            <version>1.1.7</version>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <version>1.1.7</version>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.58</version>
+        </dependency>
+
+        <dependency>
+            <groupId>joda-time</groupId>
+            <artifactId>joda-time</artifactId>
+            <version>2.9.2</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+           <!-- <plugin>
+                <groupId>org.mybatis.generator</groupId>
+                <artifactId>mybatis-generator-maven-plugin</artifactId>
+                <version>1.3.2</version>
+                <configuration>
+                    <configurationFile>src/main/resources/generatorConfig.xml</configurationFile>
+                    <verbose>true</verbose>
+                    <overwrite>true</overwrite>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>Generate MyBatis Artifacts</id>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.mybatis.generator</groupId>
+                        <artifactId>mybatis-generator-core</artifactId>
+                        <version>1.3.2</version>
+                    </dependency>
+                </dependencies>
+            </plugin>-->
+        </plugins>
+    </build>
+
+</project>

+ 17 - 0
src/main/java/com/jkcredit/invoice/SysInvoiceApplication.java

@@ -0,0 +1,17 @@
+package com.jkcredit.invoice;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.annotation.EnableScheduling;
+
+@EnableAsync
+@EnableScheduling
+@SpringBootApplication
+public class SysInvoiceApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(SysInvoiceApplication.class, args);
+    }
+
+}

+ 14 - 0
src/main/java/com/jkcredit/invoice/annotation/CurrentUser.java

@@ -0,0 +1,14 @@
+package com.jkcredit.invoice.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 在Controller的方法参数中使用此注解,该方法在映射时会注入当前登录的User对象
+ */
+@Target(ElementType.PARAMETER)          // 可用在方法的参数上
+@Retention(RetentionPolicy.RUNTIME)     // 运行时有效
+public @interface CurrentUser {
+}

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

@@ -0,0 +1,15 @@
+package com.jkcredit.invoice.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 在需要登录验证的Controller的方法上使用此注解
+ */
+@Target({ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface LoginRequired {
+}
+

+ 75 - 0
src/main/java/com/jkcredit/invoice/annotation/annotationDes/AuthenticationInterceptor.java

@@ -0,0 +1,75 @@
+package com.jkcredit.invoice.annotation.annotationDes;
+
+import cn.hutool.json.JSONUtil;
+import com.jkcredit.invoice.annotation.LoginRequired;
+import com.jkcredit.invoice.common.CommonConstants;
+import com.jkcredit.invoice.model.entity.User;
+import com.jkcredit.invoice.service.UserService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.web.method.HandlerMethod;
+import org.springframework.web.servlet.HandlerInterceptor;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.lang.reflect.Method;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-05-29 13:52
+ * @version: V1.0
+ **/
+@Slf4j
+public class AuthenticationInterceptor implements HandlerInterceptor {
+    @Autowired
+    private UserService userService;
+    @Autowired
+    private RedisTemplate redisTemplate;
+
+    @Override
+    public boolean preHandle(HttpServletRequest request,
+                             HttpServletResponse response, Object handler) {
+        // 如果不是映射到方法直接通过
+        if (!(handler instanceof HandlerMethod)) {
+            return true;
+        }
+        HandlerMethod handlerMethod = (HandlerMethod) handler;
+        Method method = handlerMethod.getMethod();
+
+        // 判断接口是否需要登录
+        LoginRequired methodAnnotation = method.getAnnotation(LoginRequired.class);
+        // 有 @LoginRequired 注解,需要认证
+        if (methodAnnotation != null) {
+            // 执行认证 从 http 请求头中取出 token
+            String token = request.getHeader("token");
+            if (token == null) {
+                throw new RuntimeException("无token,请重新登录");
+            }
+
+            if (!redisTemplate.hasKey("user:token:" + token)) {
+                throw new RuntimeException("token已过期,请重新登录");
+            }
+            User user = JSONUtil.toBean(redisTemplate.opsForValue().get(CommonConstants.TOKEN_KEY + token).toString(), User.class);
+            if (user == null) {
+                throw new RuntimeException("用户不存在,请重新登录");
+            }
+            request.setAttribute("currentUser", user);
+            return true;
+        }
+        return true;
+    }
+
+    @Override
+    public void postHandle(HttpServletRequest request,
+                           HttpServletResponse response, Object handler,
+                           ModelAndView modelAndView) {
+    }
+
+    @Override
+    public void afterCompletion(HttpServletRequest request,
+                                HttpServletResponse response, Object handler, Exception ex) {
+    }
+}

+ 31 - 0
src/main/java/com/jkcredit/invoice/annotation/annotationDes/CurrentUserMethodArgumentResolver.java

@@ -0,0 +1,31 @@
+package com.jkcredit.invoice.annotation.annotationDes;
+
+import com.jkcredit.invoice.annotation.CurrentUser;
+import com.jkcredit.invoice.model.entity.User;
+import org.springframework.core.MethodParameter;
+import org.springframework.web.bind.support.WebDataBinderFactory;
+import org.springframework.web.context.request.NativeWebRequest;
+import org.springframework.web.context.request.RequestAttributes;
+import org.springframework.web.method.support.HandlerMethodArgumentResolver;
+import org.springframework.web.method.support.ModelAndViewContainer;
+import org.springframework.web.multipart.support.MissingServletRequestPartException;
+
+/**
+ *  增加方法注入,将含有 @CurrentUser 注解的方法参数注入当前登录用户
+ */
+public class CurrentUserMethodArgumentResolver implements HandlerMethodArgumentResolver {
+    @Override
+    public boolean supportsParameter(MethodParameter parameter) {
+        return parameter.getParameterType().isAssignableFrom(User.class)
+                && parameter.hasParameterAnnotation(CurrentUser.class);
+    }
+
+    @Override
+    public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
+        User user = (User) webRequest.getAttribute("currentUser", RequestAttributes.SCOPE_REQUEST);
+        if (user != null) {
+            return user;
+        }
+        throw new MissingServletRequestPartException("currentUser");
+    }
+}

+ 462 - 0
src/main/java/com/jkcredit/invoice/async/CarFreeBillAsync.java

@@ -0,0 +1,462 @@
+package com.jkcredit.invoice.async;
+
+import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
+import com.jkcredit.invoice.common.CommonConstants;
+import com.jkcredit.invoice.model.entity.*;
+import com.jkcredit.invoice.model.vo.CarFreeCarrierBillVo;
+import com.jkcredit.invoice.service.CarFreeCarrierBillEndService;
+import com.jkcredit.invoice.service.CarFreeCarrierBillStartService;
+import com.jkcredit.invoice.service.InvoiceService;
+import com.jkcredit.invoice.util.DateUtil;
+import com.jkcredit.invoice.util.HttpUtil;
+import com.jkcredit.invoice.util.ReadExcelUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.joda.time.DateTime;
+import org.joda.time.format.DateTimeFormat;
+import org.joda.time.format.DateTimeFormatter;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.*;
+
+/**
+ * @description: 异步处理运单
+ * @author: sunzhaoning
+ * @create: 2019-07-04 14:13
+ * @version: V1.0
+ **/
+@Component
+@Slf4j
+public class CarFreeBillAsync {
+
+    @Autowired
+    private InvoiceService invoiceService;
+
+    @Autowired
+    private CarFreeCarrierBillStartService carFreeCarrierBillStartService;
+
+    @Autowired
+    private CarFreeCarrierBillEndService carFreeCarrierBillEndService;
+
+    @Autowired
+    private HttpUtil httpUtil;
+
+    @Autowired
+    private RedisTemplate redisTemplate;
+
+    /**
+     * 异步处理历史运单
+     *
+     * @param list
+     * @param user
+     * @param id
+     * @param batchNumber
+     */
+    @Async
+    public void historyBill(List<CarFreeCarrierBillVo> list, User user, String id, String batchNumber,
+                            Map<String, String> registerFailedMap) {
+        log.info("批量导入历史运单异步接口接收到的数据:{}", JSON.toJSONString(list));
+        DateTimeFormatter sdf = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
+
+        Map<String, Integer> startBillResult = new HashMap<>();
+        if (null != list) {
+            list.stream().forEach(c -> {
+                Integer isSuccess = startBill(c, CommonConstants.WAY_BILL_HISTORY_START_API, registerFailedMap, user, id, batchNumber);
+                startBillResult.put(c.getNum(), isSuccess);
+            });
+        }
+
+        if (null != list) {
+            list.stream().forEach(c -> {
+                DateTime endDateTime = new DateTime(c.getEndTime());
+                String endTime = endDateTime.toString(sdf);
+
+                //构建运单结束实体
+                CarFreeCarrierBillEnd carFreeCarrierBillEnd = new CarFreeCarrierBillEnd();
+
+                if (startBillResult.get(c.getNum()) == 1) {
+                    // isSuccess == 1 历史运单开始指令成功
+
+                    Map<String, Object> endMap = new HashMap<>(8);
+                    endMap.put("num", c.getNum());
+                    endMap.put("realDestAddr", c.getDestAddr());
+                    endMap.put("endTime", DateUtil.dateToTime(endTime));
+                    //调用接口
+                String endResult = httpUtil.getCheckResult(endMap, CommonConstants.WAY_BILL_HISTORY_END_API);
+                    //测试用 不能提交!!!
+//                    String endResult = "{\n" +
+//                            "    \"data\": 1,\n" +
+//                            "    \"code\": 200,\n" +
+//                            "    \"requestid\": \"20190429094207829,503b6b8d-ce1b-4d8f-82a0-1b5b9f6c5792\",\n" +
+//                            "    \"msg\": \"{\\\"info\\\":\\\"成功\\\",\\\"receiveTime\\\":\\\"2019-04-29T09:50:16\\\"}\"\n" +
+//                            "}";
+                    log.info("历史运单结束接口返回:{},请求参数:{}", endResult, JSON.toJSONString(endMap));
+                    //转换结果为jsonobject
+                    JSONObject endResultJson = JSON.parseObject(endResult);
+                    //获取返回data值
+                    String endDataCode = endResultJson.getString("data");
+                    //判断返回值是否为1 如果是1 设置状态为成功
+                    if ("1".equals(endDataCode)) {
+                        carFreeCarrierBillEnd.setIsSuccess(CommonConstants.SUCCESS);
+                    } else {
+                        //设置失败
+                        log.info(endResultJson.getString("msg"));
+                        carFreeCarrierBillEnd.setIsSuccess(CommonConstants.ERROR);
+                        if (StringUtils.isNotBlank(endResultJson.getString("msg"))) {
+                            carFreeCarrierBillEnd.setErrorMsg(endResultJson.getString("msg").replace("\n", ""));
+                        } else {
+                            carFreeCarrierBillEnd.setErrorMsg("上传失败!");
+                        }
+                    }
+                } else {
+                    // isSuccess == 2 历史运单开始指令失败
+                    carFreeCarrierBillEnd.setIsSuccess(CommonConstants.ERROR);
+                    carFreeCarrierBillEnd.setErrorMsg("上传失败:运单开始指令上传失败");
+                }
+
+                carFreeCarrierBillEnd.setNum(c.getNum());
+                carFreeCarrierBillEnd.setRealDestAddr(c.getDestAddr());
+                carFreeCarrierBillEnd.setEndTime(endTime);
+                carFreeCarrierBillEnd.setBatchId(id);
+                carFreeCarrierBillEnd.setBatchNumber(batchNumber);
+                carFreeCarrierBillEnd.setUserId(user.getId());
+                carFreeCarrierBillEnd.setUserName(user.getUserName());
+                carFreeCarrierBillEnd.setUserCompany(user.getCompany());
+                carFreeCarrierBillEnd.setUserPhone(user.getPhone());
+                carFreeCarrierBillEnd.setCreateTime(System.currentTimeMillis());
+                carFreeCarrierBillEnd.setIsHistory(CommonConstants.ERROR);
+                //判断运单结束是否成功
+                if (StrUtil.equals(CommonConstants.SUCCESS.toString(), carFreeCarrierBillEnd.getIsSuccess().toString())) {
+                    //设置运单状态已完结
+                    carFreeCarrierBillStartService.updateStatusAndBatchId(c.getNum(), CommonConstants.FINISHED, id);
+                }
+                //插入运单结束信息
+                carFreeCarrierBillEndService.save(carFreeCarrierBillEnd);
+            });
+        }
+    }
+
+
+    /**
+     * 异步处理实时运单开始
+     *
+     * @param list
+     * @param user
+     * @param id
+     * @param batchNumber
+     */
+    @Async
+    public void startBill(List<CarFreeCarrierBillVo> list, User user, String id, String batchNumber,
+                          Map<String, String> registerFailedMap) {
+        log.info("批量导入实时运单异步接口接收到的数据:{}", JSON.toJSONString(list));
+        DateTimeFormatter sdf = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
+        //线程分割数
+        int count = 0;
+        //获取list大小
+        int listSize = list.size();
+        if (listSize <= 100) {
+            count = 20;
+        } else if (listSize <= 1000 && listSize > 100) {
+            count = 50;
+        } else if (listSize <= 12000 && listSize > 1000) {
+            count = 120;
+        } else if (listSize <= 20000 && listSize > 12000) {
+            count = 150;
+        } else if (listSize <= 30000 && listSize > 20000) {
+            count = 300;
+        } else {
+            count = 500;
+        }
+        //线程数
+        int threadSize = (listSize / count) + 1;
+
+        ThreadFactory namedThreadFactory = new ThreadFactoryBuilder().setNameFormat("thread-billStart-%d").build();
+        ExecutorService executor = new ThreadPoolExecutor(threadSize, threadSize, 200L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(), namedThreadFactory);
+
+        CountDownLatch countDownLatch = new CountDownLatch(threadSize);
+
+        List<CarFreeCarrierBillVo> newList;
+        for (int i = 0; i < threadSize; i++) {
+            if ((i + 1) == threadSize) {
+                int startIndex = (i * count);
+                int endIndex = list.size();
+                newList = list.subList(startIndex, endIndex);
+            } else {
+                int startIndex = i * count;
+                int endIndex = (i + 1) * count;
+                newList = list.subList(startIndex, endIndex);
+            }
+
+            List<CarFreeCarrierBillVo> finalNewList = newList;
+            executor.execute(new Thread(() -> {
+                if (null != finalNewList) {
+                    finalNewList.stream().forEach(c -> {
+                        startBill(c, CommonConstants.WAY_BILL_START_API, registerFailedMap, user, id, batchNumber);
+                    });
+                }
+                countDownLatch.countDown();
+            }));
+
+        }
+
+        try {
+            countDownLatch.await();
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+
+        executor.shutdown();
+    }
+
+
+    private Integer startBill(CarFreeCarrierBillVo carFreeCarrierBillVo, String api, Map<String, String> registerFailedMap,
+                           User user, String id, String batchNumber) {
+        DateTimeFormatter sdf = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
+        Invoice invoice = invoiceService.getInvoiceByDutyParagraph(carFreeCarrierBillVo.getTaxPlayerCode());
+        CarFreeCarrierBillStart carFreeCarrierBillStart = new CarFreeCarrierBillStart();
+        DateTime startDateTime = new DateTime(carFreeCarrierBillVo.getStartTime());
+        String startTime = startDateTime.toString(sdf);
+
+        DateTime endDateTime = new DateTime(carFreeCarrierBillVo.getEndTime());
+        String endTime = endDateTime.toString(sdf);
+
+        if (registerFailedMap.containsKey(carFreeCarrierBillVo.getPlateNumber())
+                && carFreeCarrierBillVo.getPlateColor().equals(registerFailedMap.get(carFreeCarrierBillVo.getPlateNumber()))) {
+            //设置失败
+            log.info("运单号:{},运单开始失败原因:车辆备案失败", carFreeCarrierBillVo.getNum());
+            carFreeCarrierBillStart.setIsSuccess(CommonConstants.ERROR);
+            carFreeCarrierBillStart.setErrorMsg("车辆备案失败");
+        } else {
+            //构建运单开始实体
+            Map<String, Object> startMap = new HashMap<>(16);
+//            startMap.put("companyNum", "10004616");
+            startMap.put("num", carFreeCarrierBillVo.getNum());
+            startMap.put("plateNumber", carFreeCarrierBillVo.getPlateNumber());
+            startMap.put("plateColor", carFreeCarrierBillVo.getPlateColor());
+            startMap.put("startTime", DateUtil.dateToTime(startTime));
+            startMap.put("sourceAddr", carFreeCarrierBillVo.getSourceAddr());
+            startMap.put("destAddr", carFreeCarrierBillVo.getDestAddr());
+            startMap.put("predictEndTime", DateUtil.dateToTime(endTime));
+            startMap.put("fee", ReadExcelUtil.bigDecimalToLong(carFreeCarrierBillVo.getFee()));
+            startMap.put("titleType", 2);
+            startMap.put("taxplayerCode", carFreeCarrierBillVo.getTaxPlayerCode());
+
+            //调用接口
+            String startMResult = httpUtil.getCheckResult(startMap, api);
+            // 测试用 不可提交
+//            String startMResult = "{\n" +
+//                    "    \"data\": 1,\n" +
+//                    "    \"code\": 200,\n" +
+//                    "    \"requestid\": \"20190429094207829,503b6b8d-ce1b-4d8f-82a0-1b5b9f6c5792\",\n" +
+//                    "    \"msg\": \"{\\\"info\\\":\\\"成功\\\",\\\"receiveTime\\\":\\\"2019-04-29T09:50:16\\\"}\"\n" +
+//                    "}";
+            log.info("运单开始接口返回:{},请求参数:{}", startMResult, JSON.toJSONString(startMap));
+            //转换结果为jsonobject
+            JSONObject startResultJson = JSON.parseObject(startMResult);
+            //获取返回data值
+            String dataCode = startResultJson.getString("data");
+            //判断返回值是否为1 如果是1 设置状态为成功
+            if ("1".equals(dataCode)) {
+                carFreeCarrierBillStart.setIsSuccess(CommonConstants.SUCCESS);
+            } else {
+                //设置失败
+                log.info(startResultJson.getString("msg"));
+                carFreeCarrierBillStart.setIsSuccess(CommonConstants.ERROR);
+
+                if (StringUtils.isNotBlank(startResultJson.getString("msg"))) {
+                    carFreeCarrierBillStart.setErrorMsg(startResultJson.getString("msg").replace("\n", ""));
+                } else {
+                    carFreeCarrierBillStart.setErrorMsg("上传失败,请重试");
+                }
+            }
+        }
+
+        carFreeCarrierBillStart.setNum(carFreeCarrierBillVo.getNum());
+        carFreeCarrierBillStart.setPlateNumber(carFreeCarrierBillVo.getPlateNumber());
+        carFreeCarrierBillStart.setPlateColor(carFreeCarrierBillVo.getPlateColor());
+        carFreeCarrierBillStart.setStartTime(startTime);
+        carFreeCarrierBillStart.setSourceAddr(carFreeCarrierBillVo.getSourceAddr());
+        carFreeCarrierBillStart.setDestAddr(carFreeCarrierBillVo.getDestAddr());
+        carFreeCarrierBillStart.setPredictEndTime(endTime);
+        carFreeCarrierBillStart.setFee(ReadExcelUtil.bigDecimalToLong(carFreeCarrierBillVo.getFee()));
+        carFreeCarrierBillStart.setTitleType(2);
+        carFreeCarrierBillStart.setTaxPlayerCode(carFreeCarrierBillVo.getTaxPlayerCode());
+        carFreeCarrierBillStart.setName(invoice.getCompany());
+        carFreeCarrierBillStart.setAddress(invoice.getAddress());
+        carFreeCarrierBillStart.setTel(invoice.getBuyerTel());
+        carFreeCarrierBillStart.setBank(invoice.getBankAddress());
+        carFreeCarrierBillStart.setBankAccount(invoice.getBankNumber());
+        carFreeCarrierBillStart.setBatchId(id);
+        carFreeCarrierBillStart.setBatchNumber(batchNumber);
+        carFreeCarrierBillStart.setUserId(user.getId());
+        carFreeCarrierBillStart.setUserName(user.getUserName());
+        carFreeCarrierBillStart.setUserCompany(user.getCompany());
+        carFreeCarrierBillStart.setUserPhone(user.getPhone());
+        carFreeCarrierBillStart.setCreateTime(System.currentTimeMillis());
+        carFreeCarrierBillStart.setStatus(CommonConstants.BILL_ERROR);
+        if (api.equals(CommonConstants.WAY_BILL_HISTORY_START_API)) {
+            carFreeCarrierBillStart.setIsHistory(2);
+        } else {
+            carFreeCarrierBillStart.setIsHistory(1);
+        }
+
+        if (CommonConstants.AUTO_INVOICE.equals(carFreeCarrierBillVo.getAutoFlag())) {
+            carFreeCarrierBillStart.setAutoFlag(CommonConstants.AUTO_INVOICE);
+        }
+        //判断运单开始状态是否成功
+        if (StrUtil.equals(carFreeCarrierBillStart.getIsSuccess().toString(), CommonConstants.SUCCESS.toString())) {
+            //设置运单状态为未完结
+            carFreeCarrierBillStart.setStatus(CommonConstants.UNFINISHED);
+        }
+        //插入运单开始信息
+        carFreeCarrierBillStartService.save(carFreeCarrierBillStart);
+
+        return carFreeCarrierBillStart.getIsSuccess();
+    }
+    /**
+     * 异步处理实时运单结束
+     *
+     * @param list
+     * @param user
+     * @param id
+     * @param batchNumber
+     */
+    @Async
+    public void endBill(List<CarFreeCarrierBillEnd> list, User user, String id, String batchNumber) {
+        log.info("批量导入结束运单异步接口接收到的数据:{}", JSON.toJSONString(list));
+
+        DateTimeFormatter sdf = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
+        //线程分割数
+        int count = 0;
+        //获取list大小
+        int listSize = list.size();
+        if (listSize <= 100) {
+            count = 20;
+        } else if (listSize <= 1000 && listSize > 100) {
+            count = 50;
+        } else if (listSize <= 12000 && listSize > 1000) {
+            count = 120;
+        } else if (listSize <= 20000 && listSize > 12000) {
+            count = 150;
+        } else if (listSize <= 30000 && listSize > 20000) {
+            count = 300;
+        } else {
+            count = 500;
+        }
+        //线程数
+        int threadSize = (listSize / count) + 1;
+
+        ThreadFactory namedThreadFactory = new ThreadFactoryBuilder().setNameFormat("thread-billEnd-%d").build();
+        ExecutorService executor = new ThreadPoolExecutor(threadSize, threadSize, 200L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(), namedThreadFactory);
+
+        CountDownLatch countDownLatch = new CountDownLatch(threadSize);
+        List<CarFreeCarrierBillEnd> newList;
+        for (int i = 0; i < threadSize; i++) {
+            if ((i + 1) == threadSize) {
+                int startIndex = (i * count);
+                int endIndex = list.size();
+                newList = list.subList(startIndex, endIndex);
+            } else {
+                int startIndex = i * count;
+                int endIndex = (i + 1) * count;
+                newList = list.subList(startIndex, endIndex);
+            }
+
+            List<CarFreeCarrierBillEnd> finalNewList = newList;
+            executor.execute(new Thread(() -> {
+                if (null != finalNewList) {
+                    finalNewList.stream().forEach(c -> {
+                        String redisKey = CommonConstants.NUM_KEY_END + c.getNum();
+                        if (redisTemplate.hasKey(redisKey)) {
+                            log.info("实时运单结束,运单号:{},已存在", c.getNum());
+                        } else {
+                            DateTime endDateTime = new DateTime(c.getBillEndTime());
+                            String endTime = endDateTime.toString(sdf);
+
+                            //构建运单结束实体
+                            CarFreeCarrierBillEnd carFreeCarrierBillEnd = new CarFreeCarrierBillEnd();
+                            Map<String, Object> endMap = new HashMap<>(8);
+                            endMap.put("companyNum", "10004616");
+                            endMap.put("num", c.getNum());
+                            endMap.put("realDestAddr", c.getRealDestAddr());
+                            endMap.put("endTime", DateUtil.dateToTime(endTime));
+//                        endMap.put("invoiceTime", c.getInvoiceTime());
+                            //调用接口
+                            String endResult = httpUtil.getCheckResult(endMap, CommonConstants.WAY_BILL_END_API);
+                            // todo 测试后删除
+//                            String endResult = "{\n" +
+//                                    "    \"data\": 1,\n" +
+//                                    "    \"code\": 200,\n" +
+//                                    "    \"requestid\": \"20190429094207829,503b6b8d-ce1b-4d8f-82a0-1b5b9f6c5792\",\n" +
+//                                    "    \"msg\": \"{\\\"info\\\":\\\"成功\\\",\\\"receiveTime\\\":\\\"2019-04-29T09:50:16\\\"}\"\n" +
+//                                    "}";
+                            log.info("运单结束接口返回:{},请求参数:{},结束时间是:{}", endResult, JSON.toJSONString(endMap),endTime);
+                            //转换结果为jsonobject
+                            JSONObject endResultJson = JSON.parseObject(endResult);
+                            //获取返回data值
+                            String endDataCode = endResultJson.getString("data");
+                            //判断返回值是否为1 如果是1 设置状态为成功
+                            if ("1".equals(endDataCode)) {
+                                //设置状态为成功
+                                carFreeCarrierBillEnd.setIsSuccess(CommonConstants.SUCCESS);
+                                redisTemplate.opsForValue().set(redisKey, JSON.toJSONString(c));
+                            } else {
+                                //设置失败
+                                log.info(endResultJson.getString("msg"));
+                                carFreeCarrierBillEnd.setIsSuccess(CommonConstants.ERROR);
+                            }
+                            carFreeCarrierBillEnd.setInvoiceTime(c.getInvoiceTime());
+                            carFreeCarrierBillEnd.setNum(c.getNum());
+                            carFreeCarrierBillEnd.setEndTime(endTime);
+                            carFreeCarrierBillEnd.setRealDestAddr(c.getRealDestAddr());
+                            carFreeCarrierBillEnd.setBatchId(id);
+                            carFreeCarrierBillEnd.setBatchNumber(batchNumber);
+                            carFreeCarrierBillEnd.setUserId(user.getId());
+                            carFreeCarrierBillEnd.setUserName(user.getUserName());
+                            carFreeCarrierBillEnd.setUserCompany(user.getCompany());
+                            carFreeCarrierBillEnd.setUserPhone(user.getPhone());
+                            carFreeCarrierBillEnd.setCreateTime(System.currentTimeMillis());
+                            //设置运单是否为历史运单
+                            carFreeCarrierBillEnd.setIsHistory(CommonConstants.SUCCESS);
+                            //判断运单结束是否成功
+                            if (carFreeCarrierBillEnd.getIsSuccess().equals(CommonConstants.SUCCESS)) {
+                                try {
+                                    //设置运单状态已完结
+                                    carFreeCarrierBillStartService.updateStatus(c.getNum(), CommonConstants.FINISHED);
+                                } catch (Exception e) {
+                                    log.error("运单状态更新失败:{}", e.getMessage());
+                                }
+                            }
+                            //插入运单结束信息
+                            try {
+                                carFreeCarrierBillEndService.save(carFreeCarrierBillEnd);
+                            } catch (Exception e) {
+                                log.error("运单状态插入失败:{}", e.getMessage());
+                            }
+                        }
+                    });
+                }
+                countDownLatch.countDown();
+            }));
+        }
+
+        try {
+            countDownLatch.await();
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+
+        executor.shutdown();
+    }
+}

+ 52 - 0
src/main/java/com/jkcredit/invoice/common/BaseEntity.java

@@ -0,0 +1,52 @@
+package com.jkcredit.invoice.common;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-05-30 09:09
+ * @version: V1.0
+ **/
+@Data
+public class BaseEntity {
+
+    /**
+     * 用户id
+     */
+    @ApiModelProperty(value = "用户id")
+    private Integer userId;
+
+
+    /**
+     * 用户名
+     */
+    @ApiModelProperty(value = "用户名")
+    private String userName;
+
+
+    /**
+     * 用户所在公司
+     */
+    @ApiModelProperty(value = "用户所在公司")
+    private String userCompany;
+
+
+    /**
+     * 用户手机号
+     */
+    @ApiModelProperty(value = "用户手机号")
+    private String userPhone;
+
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty(value = "创建时间")
+    private Long createTime;
+
+    /**
+     * 更新时间
+     */
+    private Long updateTime;
+}

+ 256 - 0
src/main/java/com/jkcredit/invoice/common/CommonConstants.java

@@ -0,0 +1,256 @@
+package com.jkcredit.invoice.common;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019/5/29 18:20 AM
+ * @version: V1.0
+ **/
+public interface CommonConstants {
+
+    String TOKEN_KEY = "user:token:";
+
+    String B2B_CHARGE_KEY = "b2b:charge:";
+
+    /**
+     * 发票信息key
+     */
+    String NUM_FIND_INVOICE_KEY = "num:find:invoice";
+
+    /**
+     * 发票交易id key
+     */
+    String TRANSACTION_ID_KEY = "num:transactionId:invoice";
+
+    /**
+     * 成功
+     */
+    Integer SUCCESS = 1;
+
+    /**
+     * 失败
+     */
+    Integer ERROR = 2;
+
+    /**
+     * 自动开票
+     */
+    Integer AUTO_INVOICE = 1;
+
+    /**
+     * 不自动开票
+     */
+    Integer NOT_AUTO_INVOICE = 2;
+
+    /**
+     * 已备案
+     */
+    Integer ALREADY_REGISTER = 3;
+
+    /**
+     * 查询结果为空
+     */
+    Integer NULL = 3;
+
+    /**
+     * 未完结
+     */
+    Integer UNFINISHED = 1;
+
+    /**
+     * 完结
+     */
+    Integer FINISHED = 2;
+
+    /**
+     * 开票中
+     */
+    Integer INVOICE_PROCESS = 4;
+
+    /**
+     * 开票完成
+     */
+    Integer INVOICE_FINISHED = 3;
+
+    /**
+     * 运单错误
+     */
+    Integer BILL_ERROR = 9;
+
+    /**
+     * 车辆备案
+     */
+    Integer VEHICLE_REGISTER = 1;
+
+    /**
+     * 运单开始
+     */
+    Integer WAY_BILL_START = 2;
+
+    /**
+     * 运单开始
+     */
+    Integer WAY_BILL_END = 5;
+
+    /**
+     * 历史运单开始
+     */
+    Integer WAY_BILL_HISTORY_START = 3;
+
+    /**
+     * 发票查询
+     */
+    Integer WAY_BILL_NUM_FIND_INVOICE = 4;
+
+    /**
+     * 模板路径
+     */
+//    String BASE_PATH = "/Users/Administrator/Desktop/excel";
+    String BASE_PATH = "/home/invoiceSrv/app/bin";
+
+    /**
+     * 打包发票下载路径
+     */
+    String PACKAGE_BASE_PATH = "/home/invoiceSrv/app/bin/package";
+
+    /**
+     * 模板路径
+     */
+    String TEMPLATE_PATH = "/classes/static/templates/excel/";
+
+    /**
+     * 备案API
+     */
+    String VEHICLE_REGISTER_API = "VEHICLE_REGISTER";
+
+    /**
+     * 运单开始API
+     */
+    String WAY_BILL_START_API = "WAY_BILL_START";
+
+    /**
+     * 运单结束API
+     */
+    String WAY_BILL_END_API = "WAY_BILL_END";
+
+    /**
+     * 历史运单开始API
+     */
+    String WAY_BILL_HISTORY_START_API = "WAY_BILL_HISTORY_START";
+
+    /**
+     * 历史运单结束API
+     */
+    String WAY_BILL_HISTORY_END_API = "WAY_BILL_HISTORY_END";
+
+    /**
+     * 运单号查询运单API
+     */
+    String WAY_BILL_NUM_FIND_INVOICE_API = "WAY_BILL_NUM_FIND_INVOICE";
+
+    /**
+     * 企业查询api
+     */
+    String COMPANY_QUERY_V1_API = "COMPANY_QUERY_V1";
+
+    /**
+     * 企业新增api
+     */
+    String COMPANY_ADD_V1_API = "COMPANY_ADD_V1";
+
+    /**
+     * 用户卡查询api
+     */
+    String CARD_QUERY_CARD_V1_API = "CARD_QUERY_CARD_V1";
+
+    /**
+     * 卡绑定接口api
+     */
+    String CARD_BINDING_V1_API = "CARD_BINDING_V1";
+
+    /**
+     * 卡验证码接口api
+     */
+    String CARD_VALID_CODE_V1_API = "CARD_VALID_CODE_V1";
+
+    /**
+     * 申请开票api
+     */
+    String B2B_INVOICE_APPLY_V1_API = "B2B_INVOICE_APPLY_V1";
+
+    /**
+     * 交易查询接口api
+     */
+    String CARD_TRADE_V1_API = "CARD_TRADE_V1";
+
+    /**
+     * 已开票接口api
+     */
+    String B2B_INVOICE_QUERY_V1_API = "B2B_INVOICE_QUERY_V1";
+
+    /**
+     * 发票打包接口api
+     */
+    String B2B_INVOICE_PACKAGE_V1_API = "B2B_INVOICE_PACKAGE_V1";
+
+    /**
+     * 历史运单开始运单号key
+     */
+    String HISTORY_NUM_KEY_START = "waybill:history:num:start:";
+
+    /**
+     * 历史运单结束运单号key
+     */
+    String HISTORY_NUM_KEY_END = "waybill:history:num:end:";
+
+    /**
+     * 运单结束运单号key
+     */
+    String NUM_KEY_END = "waybill:num:end:";
+
+    /**
+     * 运单开始运单号key
+     */
+    String NUM_KEY = "waybill:num:start:";
+
+    /**
+     * 运单预估结果key
+     */
+    String BILL_ESTIMATE_KEY = "bill:estimate:";
+
+    /**
+     * 计费队列
+     */
+    String CHARGE_QUEUE = "charge_queue";
+
+    /**
+     * b2b计费队列
+     */
+    String B2B_CHARGE_QUEUE = "b2b_charge_queue";
+
+    /**
+     * 计费交换机
+     */
+    String CHARGE_EXCHANGE = "charge_exchange";
+
+    /**
+     * b2b计费交换机
+     */
+    String B2B_CHARGE_EXCHANGE = "b2b_charge_exchange";
+
+
+    /**
+     * 待开票
+     */
+    Integer NO_TRADE_STATUS = 1;
+
+    /**
+     * 开票中
+     */
+    Integer IN_TRADE_STATUS = 2;
+
+    /**
+     * 开票完成
+     */
+    Integer FINISH_TRADE_STATUS = 2;
+}

+ 33 - 0
src/main/java/com/jkcredit/invoice/config/CorsConfig.java

@@ -0,0 +1,33 @@
+package com.jkcredit.invoice.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.cors.CorsConfiguration;
+import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
+import org.springframework.web.filter.CorsFilter;
+
+/**
+ * 处理跨域
+ * @author sunzhaoning
+ */
+@Configuration
+public class CorsConfig {
+
+    private CorsConfiguration buildConfig() {
+        CorsConfiguration corsConfiguration = new CorsConfiguration();
+        // 1允许任何域名使用
+        corsConfiguration.addAllowedOrigin("*");
+        // 2允许任何头
+        corsConfiguration.addAllowedHeader("*");
+        // 3允许任何方法(post、get等)
+        corsConfiguration.addAllowedMethod("*");
+        return corsConfiguration;  
+    }  
+  
+    @Bean
+    public CorsFilter corsFilter() {
+        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
+        source.registerCorsConfiguration("/**", buildConfig());
+        return new CorsFilter(source);
+    }  
+}

+ 49 - 0
src/main/java/com/jkcredit/invoice/config/DruidConfiguration.java

@@ -0,0 +1,49 @@
+package com.jkcredit.invoice.config;
+
+import com.alibaba.druid.support.http.StatViewServlet;
+import com.alibaba.druid.support.http.WebStatFilter;
+import org.springframework.boot.web.servlet.FilterRegistrationBean;
+import org.springframework.boot.web.servlet.ServletRegistrationBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019/11/5 10:18 上午
+ * @version: V1.0
+ **/
+@Configuration
+public class DruidConfiguration {
+
+    @Bean
+    public ServletRegistrationBean druidStatViewServle() {
+        //注册服务
+        ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean(
+                new StatViewServlet(), "/druid/*");
+        // 白名单(为空表示,所有的都可以访问,多个IP的时候用逗号隔开)
+        servletRegistrationBean.addInitParameter("allow", "106.38.102.246,127.0.0.1");
+        // IP黑名单 (存在共同时,deny优先于allow)
+        servletRegistrationBean.addInitParameter("deny", "127.0.0.2");
+        // 设置登录的用户名和密码
+        servletRegistrationBean.addInitParameter("loginUsername", "jkxy");
+        servletRegistrationBean.addInitParameter("loginPassword", "jkxy@2019");
+        // 是否能够重置数据.
+        servletRegistrationBean.addInitParameter("resetEnable", "false");
+        return servletRegistrationBean;
+    }
+
+    @Bean
+    public FilterRegistrationBean druidStatFilter() {
+        FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(
+                new WebStatFilter());
+        // 添加过滤规则
+        filterRegistrationBean.addUrlPatterns("/*");
+        // 添加不需要忽略的格式信息
+        filterRegistrationBean.addInitParameter("exclusions",
+                "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*");
+        System.out.println("druid初始化成功!");
+        return filterRegistrationBean;
+
+    }
+}

+ 50 - 0
src/main/java/com/jkcredit/invoice/config/GlobalExceptionHandler.java

@@ -0,0 +1,50 @@
+package com.jkcredit.invoice.config;
+
+import com.jkcredit.invoice.util.RespR;
+import lombok.extern.slf4j.Slf4j;
+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 java.util.List;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-05-29 13:43
+ * @version: V1.0
+ **/
+@Slf4j
+@RestControllerAdvice
+public class GlobalExceptionHandler {
+
+    /**
+     * 全局异常
+     * @param e
+     * @return RespR
+     */
+    @ExceptionHandler(Exception.class)
+    @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
+    public RespR exception(Exception e) {
+        log.error("全局异常信息,异常信息为:{}", e.getMessage(), e);
+        return new RespR<>(e);
+    }
+
+    /**
+     * validation Exception
+     * @param exception
+     * @return RespR
+     */
+    @ExceptionHandler({MethodArgumentNotValidException.class, BindException.class})
+    @ResponseStatus(HttpStatus.BAD_REQUEST)
+    public RespR bodyValidExceptionHandler(MethodArgumentNotValidException exception) {
+        List<FieldError> fieldErrors = exception.getBindingResult().getFieldErrors();
+        RespR result = new RespR();
+        result.setMsg(fieldErrors.get(0).getDefaultMessage());
+        log.warn(fieldErrors.get(0).getDefaultMessage());
+        return result;
+    }
+
+}

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

@@ -0,0 +1,81 @@
+package com.jkcredit.invoice.config;
+
+import com.jkcredit.invoice.annotation.annotationDes.AuthenticationInterceptor;
+import com.jkcredit.invoice.annotation.annotationDes.CurrentUserMethodArgumentResolver;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.method.support.HandlerMethodArgumentResolver;
+import org.springframework.web.servlet.config.annotation.*;
+
+import java.util.List;
+
+/**
+ * @description: 添加拦截器
+ * @author: sunzhaoning
+ * @create: 2019/3/1 10:51 AM
+ * @version: V1.0
+ **/
+@Configuration
+public class InvoiceWebMvcConfigurer extends WebMvcConfigurationSupport {
+
+    /**
+     * 支持跨域访问
+     * @param registry
+     */
+    @Override
+    public void addCorsMappings(CorsRegistry registry) {
+        registry.addMapping("/**")
+                .allowedOrigins("*")
+                .allowedMethods("POST", "GET", "PUT", "OPTIONS", "DELETE")
+                .allowCredentials(true);
+    }
+    /**
+     * 发现如果继承了WebMvcConfigurationSupport,则在yml中配置的相关内容会失效。
+     * 需要重新指定静态资源
+     * @param registry
+     */
+    @Override
+    public void addResourceHandlers(ResourceHandlerRegistry registry) {
+        registry.addResourceHandler("/**").addResourceLocations("classpath:/static/");
+        registry.addResourceHandler("docs.html")
+                .addResourceLocations("classpath:/META-INF/resources/");
+        registry.addResourceHandler("/webjars/**")
+                .addResourceLocations("classpath:/META-INF/resources/webjars/");
+        registry.addResourceHandler("/static/**")
+                .addResourceLocations("file://home/invoiceSrv/app/bin/static");
+
+        super.addResourceHandlers(registry);
+    }
+
+    @Override
+    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
+        argumentResolvers.add(currentUserMethodArgumentResolver());
+        super.addArgumentResolvers(argumentResolvers);
+    }
+
+    @Override
+    public void addInterceptors(InterceptorRegistry registry) {
+        // 拦截所有请求,通过判断是否有 @LoginRequired 注解 决定是否需要登录
+        registry.addInterceptor(authenticationInterceptor())
+                .addPathPatterns("/**");
+        super.addInterceptors(registry);
+    }
+
+    @Bean
+    public CurrentUserMethodArgumentResolver currentUserMethodArgumentResolver() {
+        return new CurrentUserMethodArgumentResolver();
+    }
+
+    @Bean
+    public AuthenticationInterceptor authenticationInterceptor() {
+        return new AuthenticationInterceptor();
+    }
+
+    /**
+     * 配置servlet处理
+     */
+    @Override
+    public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
+        configurer.enable();
+    }
+}

+ 58 - 0
src/main/java/com/jkcredit/invoice/config/JacksonConfig.java

@@ -0,0 +1,58 @@
+package com.jkcredit.invoice.config;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
+import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
+import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
+import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer;
+import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
+import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
+import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
+import org.springframework.boot.autoconfigure.AutoConfigureBefore;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.format.DateTimeFormatter;
+
+/**
+ * @description: 时间日期处理
+ * @author: sunzhaoning
+ * @create: 2019/3/13 4:07 PM
+ * @version: V1.0
+ **/
+@Configuration
+@ConditionalOnClass(ObjectMapper.class)
+@AutoConfigureBefore(JacksonAutoConfiguration.class)
+public class JacksonConfig {
+
+    /**
+     * 针对JDK 1.8的日期时间格式特殊处理
+     *
+     * @return ObjectMapper
+     */
+    @Bean
+    public ObjectMapper getObjectMapper() {
+        ObjectMapper objectMapper = new ObjectMapper();
+        JavaTimeModule javaTimeModule = new JavaTimeModule();
+        javaTimeModule.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+        javaTimeModule.addSerializer(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
+        javaTimeModule.addSerializer(LocalTime.class, new LocalTimeSerializer(DateTimeFormatter.ofPattern("HH:mm:ss")));
+        javaTimeModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+        javaTimeModule.addDeserializer(LocalDate.class, new LocalDateDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
+        javaTimeModule.addDeserializer(LocalTime.class, new LocalTimeDeserializer(DateTimeFormatter.ofPattern("HH:mm:ss")));
+        // javaTimeModule只能手动注册,参考https://github.com/FasterXML/jackson-modules-java8
+        objectMapper.registerModule(javaTimeModule);
+        // 忽略json字符串中不识别的属性
+        objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+        // 忽略无法转换的对象
+        objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
+        return objectMapper;
+    }
+}

+ 39 - 0
src/main/java/com/jkcredit/invoice/config/MybatisPlusConfigurer.java

@@ -0,0 +1,39 @@
+package com.jkcredit.invoice.config;
+
+import com.baomidou.mybatisplus.core.injector.ISqlInjector;
+import com.baomidou.mybatisplus.extension.injector.LogicSqlInjector;
+import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019/2/28 9:06 AM
+ * @version: V1.0
+ **/
+@Configuration
+@MapperScan("com.jkcredit.invoice.mapper")
+public class MybatisPlusConfigurer {
+    /**
+     * 分页插件
+     *
+     * @return PaginationInterceptor
+     */
+    @Bean
+    public PaginationInterceptor paginationInterceptor() {
+        return new PaginationInterceptor();
+    }
+
+
+    /**
+     * 逻辑删除
+     *
+     * @return
+     */
+    @Bean
+    public ISqlInjector sqlInjector() {
+        return new LogicSqlInjector();
+    }
+}

+ 56 - 0
src/main/java/com/jkcredit/invoice/config/RedisConfig.java

@@ -0,0 +1,56 @@
+package com.jkcredit.invoice.config;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.PropertyAccessor;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import lombok.AllArgsConstructor;
+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.serializer.Jackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+
+/**
+ * @description: redis配置类
+ * @author: sunzhaoning
+ * @create: 2019/2/28 9:16 AM
+ * @version: V1.0
+ **/
+@EnableCaching
+@Configuration
+@AllArgsConstructor
+public class RedisConfig {
+    
+    private final RedisConnectionFactory factory;
+
+    @Bean
+    public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) {
+        RedisTemplate<Object, Object> redisTemplate = new RedisTemplate<>();
+        redisTemplate.setConnectionFactory(redisConnectionFactory);
+
+
+        // 使用Jackson2JsonRedisSerialize 替换默认序列化
+        @SuppressWarnings("rawtypes")
+        Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class);
+
+
+        ObjectMapper objectMapper = new ObjectMapper();
+        objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
+        objectMapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+
+
+        jackson2JsonRedisSerializer.setObjectMapper(objectMapper);
+
+
+        // 设置value的序列化规则和 key的序列化规则
+        redisTemplate.setValueSerializer(jackson2JsonRedisSerializer);
+        redisTemplate.setKeySerializer(new StringRedisSerializer());
+        redisTemplate.afterPropertiesSet();
+        return redisTemplate;
+    }
+
+}
+

+ 20 - 0
src/main/java/com/jkcredit/invoice/config/RestTemplateConfig.java

@@ -0,0 +1,20 @@
+package com.jkcredit.invoice.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019/3/1 9:00 AM
+ * @version: V1.0
+ **/
+@Configuration
+public class RestTemplateConfig {
+
+    @Bean
+    public RestTemplate restTemplate() {
+        return new RestTemplate();
+    }
+}

+ 45 - 0
src/main/java/com/jkcredit/invoice/config/SwaggerConfig.java

@@ -0,0 +1,45 @@
+package com.jkcredit.invoice.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.context.request.async.DeferredResult;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+/**
+ * @description: Swagger生成api文档
+ * @author: sunzhaoning
+ * @create: 2019/3/1 10:49 AM
+ * @version: V1.0
+ **/
+@EnableSwagger2
+@Configuration
+public class SwaggerConfig {
+
+    @Bean
+    public Docket ProductApi() {
+        return new Docket(DocumentationType.SWAGGER_2)
+                .genericModelSubstitutes(DeferredResult.class)
+                .useDefaultResponseMessages(false)
+                .forCodeGeneration(false)
+                .pathMapping("/")
+                .select()
+                .apis(RequestHandlerSelectors.basePackage("com.jkcredit.invoice.controller"))
+                .build()
+                .apiInfo(productApiInfo());
+    }
+
+    private ApiInfo productApiInfo() {
+        ApiInfo apiInfo = new ApiInfo("ETC开票系统数据接口文档",
+                "ETC开票系统接口",
+                "1.0.0",
+                "API TERMS URL",
+                "szn@jkcredit.com",
+                "交科信用管理有限公司",
+                "http://www.jkcredit.com");
+        return apiInfo;
+    }
+}

+ 62 - 0
src/main/java/com/jkcredit/invoice/consumer/B2bChargeConsumer.java

@@ -0,0 +1,62 @@
+package com.jkcredit.invoice.consumer;
+
+import com.jkcredit.invoice.common.CommonConstants;
+import com.jkcredit.invoice.model.entity.User;
+import com.jkcredit.invoice.service.UserService;
+import com.rabbitmq.client.Channel;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.amqp.core.Message;
+import org.springframework.amqp.rabbit.annotation.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.messaging.handler.annotation.Payload;
+import org.springframework.stereotype.Component;
+
+import java.io.IOException;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-06-20 09:04
+ * @version: V1.0
+ **/
+@Slf4j
+@Component
+public class B2bChargeConsumer {
+
+    @Autowired
+    private UserService userService;
+
+    @RabbitHandler
+    @RabbitListener(bindings = @QueueBinding(
+            exchange = @Exchange(
+                    name = CommonConstants.B2B_CHARGE_EXCHANGE,
+                    type = "topic",
+                    ignoreDeclarationExceptions = "true"
+            ),
+            value = @Queue(
+                    value = CommonConstants.B2B_CHARGE_QUEUE
+            ),
+            key = "b2b_charge.*"
+    ))
+    public void process(@Payload User user, Channel channel, Message message) throws IOException {
+        try {
+            synchronized (this) {
+                user = userService.getById(user.getId());
+               // user.setMoney(user.getMoney() - user.getPrice());
+                //更新余额
+                //userService.charge(user);
+            }
+            //告诉服务器收到这条消息 已经被我消费了 可以在队列删掉 这样以后就不会再发了 否则消息服务器以为这条消息没处理掉 后续还会在发
+            channel.basicAck(message.getMessageProperties().getDeliveryTag(),false);
+        } catch (IOException e) {
+            e.printStackTrace();
+            //丢弃这条消息
+            //channel.basicNack(message.getMessageProperties().getDeliveryTag(), false,false);
+            //ack返回false,并重新回到队列
+            channel.basicNack(message.getMessageProperties().getDeliveryTag(), false, true);
+            log.error("接受失败");
+        }
+
+    }
+
+}

+ 71 - 0
src/main/java/com/jkcredit/invoice/consumer/ChargeConsumer.java

@@ -0,0 +1,71 @@
+package com.jkcredit.invoice.consumer;
+
+import com.jkcredit.invoice.common.CommonConstants;
+import com.jkcredit.invoice.model.entity.Charge;
+import com.jkcredit.invoice.model.entity.User;
+import com.jkcredit.invoice.service.ChargeService;
+import com.jkcredit.invoice.service.UserService;
+import com.rabbitmq.client.Channel;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.amqp.core.Message;
+import org.springframework.amqp.rabbit.annotation.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.messaging.handler.annotation.Payload;
+import org.springframework.stereotype.Component;
+
+import java.io.IOException;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-06-04 13:51
+ * @version: V1.0
+ **/
+@Slf4j
+//@Component
+public class ChargeConsumer {
+
+    @Autowired
+    private UserService userService;
+    @Autowired
+    private ChargeService chargeService;
+
+    @RabbitHandler
+    @RabbitListener(bindings = @QueueBinding(
+            exchange = @Exchange(
+                    name = CommonConstants.CHARGE_EXCHANGE,
+                    type = "topic",
+                    ignoreDeclarationExceptions = "true"
+            ),
+            value = @Queue(
+                    value = CommonConstants.CHARGE_QUEUE
+            ),
+            key = "charge.*"
+    ))
+    public void process(@Payload User user, Channel channel, Message message) throws IOException {
+        try {
+            synchronized (this) {
+                user = userService.getById(user.getId());
+                //user.setMoney(user.getMoney() - user.getPrice());
+                //更新余额
+                //userService.charge(user);
+            }
+            //告诉服务器收到这条消息 已经被我消费了 可以在队列删掉 这样以后就不会再发了 否则消息服务器以为这条消息没处理掉 后续还会在发
+            channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
+            Charge charge = new Charge();
+            charge.setUserId(user.getId().toString());
+            chargeService.save(charge);
+            log.warn("消息队列日志:{},计费用户id:{}", "扣款", user.getId());
+        } catch (IOException e) {
+            e.printStackTrace();
+            //丢弃这条消息
+            //channel.basicNack(message.getMessageProperties().getDeliveryTag(), false,false);
+            //ack返回false,并重新回到队列
+            channel.basicNack(message.getMessageProperties().getDeliveryTag(), false, true);
+            log.warn("消息队列失败日志:{},计费用户id:{}", "扣款", user.getId());
+            log.error("接受失败");
+        }
+
+    }
+
+}

+ 69 - 0
src/main/java/com/jkcredit/invoice/controller/AutoBillController.java

@@ -0,0 +1,69 @@
+package com.jkcredit.invoice.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.jkcredit.invoice.model.entity.CarFreeCarrierBillStart;
+import com.jkcredit.invoice.model.entity.NumInvoice;
+import com.jkcredit.invoice.model.entity.User;
+import com.jkcredit.invoice.service.CarFreeCarrierBillEndService;
+import com.jkcredit.invoice.service.CarFreeCarrierBillStartService;
+import com.jkcredit.invoice.service.NumInvoiceService;
+import com.jkcredit.invoice.service.UserService;
+import com.jkcredit.invoice.util.HttpUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019/10/23 5:31 下午
+ * @version: V1.0
+ **/
+@RestController
+@Slf4j
+@RequestMapping("/autoBill")
+public class AutoBillController {
+
+    @Autowired
+    private CarFreeCarrierBillStartService carFreeCarrierBillStartService;
+
+    @Autowired
+    private CarFreeCarrierBillEndService carFreeCarrierBillEndService;
+
+    @Autowired
+    private UserService userService;
+
+    @Autowired
+    private NumInvoiceService numInvoiceService;
+
+    @Autowired
+    private HttpUtil httpUtil;
+
+//    @GetMapping("info")
+//    public String updateBillInfo() {
+//        //获取设置自动查询的用户id
+//        List<User> userList = userService.getUserIdByUserAutoUpdate();
+//        log.info("用户列表:{}",userList);
+//        userList.stream().forEach(user -> {
+//            List<NumInvoice> numInvoiceList = new ArrayList<>();
+//            //查询用户开票中的运单列表
+//            List<CarFreeCarrierBillStart> carFreeCarrierBillStarts = carFreeCarrierBillStartService.getNotFinishList(user.getId());
+//            log.info("查询用户开票中的运单列表:{},用户id是:{}",carFreeCarrierBillStarts,user.getId());
+//            carFreeCarrierBillStarts.stream().forEach(carFreeCarrierBillStart -> {
+//                NumInvoice numInvoice = new NumInvoice();
+//                numInvoice.setNum(carFreeCarrierBillStart.getNum());
+//                log.info("[手动触发]开票中运单自动查询发票信息:{}",JSON.toJSONString(numInvoice));
+//                numInvoiceList.add(numInvoice);
+//            });
+//            log.info("可更新的发票信息:{}",numInvoiceList);
+//            //批量查询发票信息
+//            numInvoiceService.addNumList(numInvoiceList,user.getId());
+//        });
+//        return "ok";
+//    }
+}

+ 45 - 0
src/main/java/com/jkcredit/invoice/controller/B2bInvoiceApplyController.java

@@ -0,0 +1,45 @@
+package com.jkcredit.invoice.controller;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jkcredit.invoice.annotation.LoginRequired;
+import com.jkcredit.invoice.model.entity.B2bInvoiceApply;
+import com.jkcredit.invoice.model.entity.CardTrade;
+import com.jkcredit.invoice.service.B2bInvoiceApplyService;
+import com.jkcredit.invoice.util.RespR;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+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;
+
+import java.util.List;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-06-19 14:27
+ * @version: V1.0
+ **/
+@RestController
+@RequestMapping("/b2bInvoice")
+public class B2bInvoiceApplyController {
+
+    @Autowired
+    private B2bInvoiceApplyService b2bInvoiceApplyService;
+
+    @LoginRequired
+    @ApiOperation(value = "批量申请开票,入参企业编号、车牌号、开始时间、结束时间",notes = "批量申请开票,入参企业编号、车牌号、开始时间、结束时间")
+    @PostMapping("/apply")
+    public RespR invoiceApply(@RequestBody List<CardTrade> cardTradeList){
+        return b2bInvoiceApplyService.invoiceApply(cardTradeList);
+    }
+
+    @PostMapping("/page")
+    @ApiOperation(value = "查询已申请开票列表", notes = "查询已申请开票列表")
+    @LoginRequired
+    public RespR getB2bInvoiceApplyList(Page page, B2bInvoiceApply b2bInvoiceApply){
+        return new RespR<>(b2bInvoiceApplyService.getB2bInvoiceApplyPage(page,b2bInvoiceApply));
+    }
+}

+ 41 - 0
src/main/java/com/jkcredit/invoice/controller/B2bInvoicePackageController.java

@@ -0,0 +1,41 @@
+package com.jkcredit.invoice.controller;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jkcredit.invoice.annotation.LoginRequired;
+import com.jkcredit.invoice.model.entity.B2bInvoicePackage;
+import com.jkcredit.invoice.service.B2bInvoicePackageService;
+import com.jkcredit.invoice.util.RespR;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+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:
+ * @author: sunzhaoning
+ * @create: 2019-06-21 10:36
+ * @version: V1.0
+ **/
+@RestController
+@RequestMapping(value = "b2bInvoicePackage")
+public class B2bInvoicePackageController {
+
+    @Autowired
+    private B2bInvoicePackageService b2bInvoicePackageService;
+
+    @LoginRequired
+    @ApiOperation(value = "发票打包接口,入参企业编号、月份格式yyyy-MM-01",notes = "发票打包接口,入参企业编号、月份格式yyyy-MM-01")
+    @PostMapping("/package")
+    public RespR getInvoicePackage(@RequestBody B2bInvoicePackage b2bInvoicePackage){
+        return b2bInvoicePackageService.getInvoicePackage(b2bInvoicePackage);
+    }
+
+    @LoginRequired
+    @ApiOperation(value = "分页查询发票打包信息",notes = "分页查询发票打包信息")
+    @PostMapping("/page")
+    public RespR getB2bInvoicePackageList(Page page,B2bInvoicePackage b2bInvoicePackage){
+        return new RespR<>(b2bInvoicePackageService.getB2bInvoicePackagePage(page,b2bInvoicePackage));
+    }
+}

+ 38 - 0
src/main/java/com/jkcredit/invoice/controller/B2bInvoiceQueryController.java

@@ -0,0 +1,38 @@
+package com.jkcredit.invoice.controller;
+
+import com.jkcredit.invoice.annotation.LoginRequired;
+import com.jkcredit.invoice.model.entity.B2bInvoiceQuery;
+import com.jkcredit.invoice.service.B2bInvoiceQueryService;
+import com.jkcredit.invoice.util.RespR;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+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:
+ * @author: sunzhaoning
+ * @create: 2019-06-19 17:17
+ * @version: V1.0
+ **/
+@RestController
+@RequestMapping("b2bInvoiceQuery")
+public class B2bInvoiceQueryController {
+
+    @Autowired
+    private B2bInvoiceQueryService b2bInvoiceQueryService;
+
+    /**
+     * 查询已开发票
+     * @param b2bInvoiceQuery
+     * @return
+     */
+    @PostMapping("/query")
+    @ApiOperation(value = "查询已开发票接口,入参企业编号、车牌号、开始时间、结束时间", notes = "查询已开发票接口,入参企业编号、车牌号、开始时间、结束时间")
+    @LoginRequired
+    public RespR queryInvoiceToInterface(@RequestBody B2bInvoiceQuery b2bInvoiceQuery){
+        return b2bInvoiceQueryService.queryInvoiceToInterface(b2bInvoiceQuery);
+    }
+}

+ 42 - 0
src/main/java/com/jkcredit/invoice/controller/BatchController.java

@@ -0,0 +1,42 @@
+package com.jkcredit.invoice.controller;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jkcredit.invoice.annotation.LoginRequired;
+import com.jkcredit.invoice.model.entity.Batch;
+import com.jkcredit.invoice.service.BatchService;
+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.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-05-30 14:02
+ * @version: V1.0
+ **/
+@Api(tags = "批次管理")
+@RestController
+@RequestMapping("/batch")
+public class BatchController {
+
+    @Autowired
+    private BatchService batchService;
+
+    /**
+     * 查询批次列表
+     * @param page
+     * @return
+     */
+    @PostMapping("/list")
+    @ApiOperation(value = "查询批次列表", notes = "查询批次列表")
+    @LoginRequired
+    public RespR getBatchList(Page page, Batch batch){
+        return new RespR<>(batchService.getBatchPage(page,batch));
+    }
+
+
+}

+ 58 - 0
src/main/java/com/jkcredit/invoice/controller/BillEstimateController.java

@@ -0,0 +1,58 @@
+package com.jkcredit.invoice.controller;
+
+import com.jkcredit.invoice.model.entity.BillEstimate;
+import com.jkcredit.invoice.model.entity.User;
+import com.jkcredit.invoice.service.BillEstimateService;
+import com.jkcredit.invoice.util.ReadExcelUtil;
+import com.jkcredit.invoice.util.RespR;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-07-19 13:49
+ * @version: V1.0
+ **/
+@Slf4j
+@RestController
+@RequestMapping("/billEstimate")
+public class BillEstimateController {
+
+    @Autowired
+    private BillEstimateService billEstimateService;
+
+    /**
+     * 处理运单预估
+     * @param file
+     * @return
+     */
+    @PostMapping("/export")
+    @ApiOperation(value = "导出预估运单", notes = "导出预估运单")
+    public RespR billEstimateExport(@RequestParam("file") MultipartFile file, User user) {
+        List<BillEstimate> list;
+        try {
+            list = ReadExcelUtil.readBillExcel(file, BillEstimate.class);
+        } catch (Exception e) {
+            log.error("预估运单读取excel失败,失败原因:{}", e.getMessage());
+            return new RespR<>(Boolean.FALSE, "读取excel失败,请检查excel格式");
+        }
+        return billEstimateService.saveAndImport(list,user);
+    }
+
+    /**
+     * 下载
+     * @param response
+     */
+    @GetMapping("/down")
+    public void down(HttpServletResponse response){
+        billEstimateService.download(response);
+    }
+}

+ 45 - 0
src/main/java/com/jkcredit/invoice/controller/BillEstimateResultController.java

@@ -0,0 +1,45 @@
+package com.jkcredit.invoice.controller;
+
+import com.jkcredit.invoice.model.entity.BillEstimate;
+import com.jkcredit.invoice.model.entity.BillEstimateResult;
+import com.jkcredit.invoice.service.BillEstimateResultService;
+import com.jkcredit.invoice.util.ReadExcelUtil;
+import com.jkcredit.invoice.util.RespR;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-07-18 17:23
+ * @version: V1.0
+ **/
+@Slf4j
+@RestController
+@RequestMapping("/billEstimateResult")
+public class BillEstimateResultController {
+
+    @Autowired
+    private BillEstimateResultService billEstimateResultService;
+
+    @PostMapping("/import")
+    @ApiOperation(value = "批量导入预估运单信息", notes = "批量导入预估运单信息")
+    public RespR billEstimateResultImport(@RequestParam("file") MultipartFile file) {
+        List<BillEstimateResult> list;
+        try {
+            list = ReadExcelUtil.readBillExcel(file, BillEstimateResult.class);
+        } catch (Exception e) {
+            log.error("预估运单读取excel失败,失败原因:{}", e.getMessage());
+            return new RespR<>(Boolean.FALSE, "读取excel失败,请检查excel格式");
+        }
+        return billEstimateResultService.save(list);
+    }
+}

+ 73 - 0
src/main/java/com/jkcredit/invoice/controller/CarEtcCardController.java

@@ -0,0 +1,73 @@
+package com.jkcredit.invoice.controller;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jkcredit.invoice.annotation.LoginRequired;
+import com.jkcredit.invoice.model.entity.CarEtcCard;
+import com.jkcredit.invoice.service.CarEtcCardService;
+import com.jkcredit.invoice.util.RespR;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-06-17 15:54
+ * @version: V1.0
+ **/
+@RestController
+@RequestMapping(value = "carEtcCard")
+public class CarEtcCardController {
+
+    @Autowired
+    private CarEtcCardService carEtcCardService;
+
+    /**
+     * 查询ETC卡列表
+     * @param page
+     * @return
+     */
+    @PostMapping("/list")
+    @ApiOperation(value = "查询ETC卡列表", notes = "查询ETC卡列表")
+    @LoginRequired
+    public RespR getCarEtcCardList(Page page, CarEtcCard carEtcCard){
+        return new RespR<>(carEtcCardService.getCarEtcCardPage(page, carEtcCard));
+    }
+
+    /**
+     * 绑卡
+     * @param carEtcCard
+     * @param code
+     * @return
+     */
+    @PostMapping("/bind/{code}")
+    @ApiOperation(value = "绑定卡", notes = "绑定卡")
+    @LoginRequired
+    public RespR bindingCard(@RequestBody CarEtcCard carEtcCard, @PathVariable String code){
+        return carEtcCardService.etcCardBing(carEtcCard,code);
+    }
+
+    /**
+     * 发送验证码
+     * @param carEtcCard
+     * @return
+     */
+    @PostMapping("/send")
+    @ApiOperation(value = "发送验证码", notes = "发送验证码")
+    @LoginRequired
+    public RespR sendCode(@RequestBody CarEtcCard carEtcCard){
+        return carEtcCardService.sendCode(carEtcCard);
+    }
+
+    /**
+     * 查询卡信息
+     * @param carEtcCard
+     * @return
+     */
+    @PostMapping("/queryCard")
+    @ApiOperation(value = "查询卡信息", notes = "查询卡信息")
+    @LoginRequired
+    public RespR getCardListByInterface(@RequestBody CarEtcCard carEtcCard){
+        return carEtcCardService.getCardListByInterface(carEtcCard);
+    }
+}

+ 136 - 0
src/main/java/com/jkcredit/invoice/controller/CarFreeCarrierBillController.java

@@ -0,0 +1,136 @@
+package com.jkcredit.invoice.controller;
+
+import cn.afterturn.easypoi.excel.entity.ExportParams;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jkcredit.invoice.annotation.LoginRequired;
+import com.jkcredit.invoice.common.CommonConstants;
+import com.jkcredit.invoice.model.entity.CarFreeCarrierBillEnd;
+import com.jkcredit.invoice.model.entity.CarFreeCarrierBillStart;
+import com.jkcredit.invoice.model.vo.CarFreeCarrierBillVo;
+import com.jkcredit.invoice.service.CarFreeCarrierBillEndService;
+import com.jkcredit.invoice.service.CarFreeCarrierBillService;
+import com.jkcredit.invoice.service.CarFreeCarrierBillStartService;
+import com.jkcredit.invoice.util.DownExcelTemplateUtil;
+import com.jkcredit.invoice.util.ExportUtil;
+import com.jkcredit.invoice.util.ReadExcelUtil;
+import com.jkcredit.invoice.util.RespR;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @description: 运单控制器
+ * @author: sunzhaoning
+ * @create: 2019-05-31 10:29
+ * @version: V1.0
+ **/
+@Api(tags = "运单管理")
+@RestController
+@Slf4j
+@RequestMapping("/carFreeCarrierBill")
+public class CarFreeCarrierBillController {
+
+    @Autowired
+    private CarFreeCarrierBillService carFreeCarrierBillService;
+
+    @Autowired
+    private CarFreeCarrierBillStartService carFreeCarrierBillStartService;
+
+    @Autowired
+    private CarFreeCarrierBillEndService carFreeCarrierBillEndService;
+
+    @LoginRequired
+    @PostMapping("/bill")
+    @ApiOperation(value = "批量导入运单信息", notes = "批量导入运单信息")
+    public RespR<Boolean> billImport(@RequestParam("file") MultipartFile file, @RequestParam Integer userId) {
+        List<CarFreeCarrierBillVo> list = ReadExcelUtil.readExcel(file, CarFreeCarrierBillVo.class);
+        log.info("批量导入实时运单传入参数:{}", JSON.toJSONString(list));
+        return carFreeCarrierBillService.addCarFreeCarrierBillList(list, userId);
+    }
+
+    @LoginRequired
+    @PostMapping("/historyBill")
+    @ApiOperation(value = "批量导入历史运单信息", notes = "批量导入历史运单信息")
+    public RespR<Boolean> historyBillImport(@RequestParam("file") MultipartFile file, @RequestParam Integer userId) {
+        List<CarFreeCarrierBillVo> list = ReadExcelUtil.readExcel(file, CarFreeCarrierBillVo.class);
+        log.info("批量导入历史运单传入参数:{}", JSON.toJSONString(list));
+        return carFreeCarrierBillService.addCarFreeCarrierBillHistoryList(list, userId);
+    }
+
+    @ApiOperation(value = "下载运单模板", notes = "下载运单模板")
+    @GetMapping("/downTemp")
+    public void donwTemp(HttpServletResponse response) {
+        DownExcelTemplateUtil.downloadExcel(response, "运单模板.xlsx");
+    }
+
+    @PostMapping("/list")
+    @ApiOperation(value = "查询运单列表", notes = "查询运单列表")
+    @LoginRequired
+    public RespR getCarFreeCarrierRegisterList(Page page, CarFreeCarrierBillStart carFreeCarrierBillStart) {
+        return new RespR<>(carFreeCarrierBillStartService.getCarFreeCarrierBillStartPage(page, carFreeCarrierBillStart));
+    }
+
+    @ApiOperation(value = "下载运单结束模板", notes = "下载运单结束模板")
+    @GetMapping("/downEndTemp")
+    public void donwTEndemp(HttpServletResponse response) {
+        DownExcelTemplateUtil.downloadExcel(response, "运单结束模板.xlsx");
+    }
+
+    @LoginRequired
+    @PostMapping("/billEnd")
+    @ApiOperation(value = "批量导入运单结束信息", notes = "批量导入运单结束信息")
+    public RespR<Boolean> billEndImport(@RequestParam("file") MultipartFile file, @RequestParam Integer userId) {
+        List<CarFreeCarrierBillEnd> list = ReadExcelUtil.readExcel(file, CarFreeCarrierBillEnd.class);
+//        List<CarFreeCarrierBillEnd> list = JSONArray.parseArray("[{\"endTime\":\"Tue Feb 12 12:21:21 CST 2019\",\"invoiceTime\":1,\"num\":\"123123\",\"realDestAddr\":\"beij\"},{\"endTime\":\"Tue Feb 12 12:21:21 CST 2019\",\"invoiceTime\":1,\"num\":\"123123\",\"realDestAddr\":\"beij\"}]",CarFreeCarrierBillEnd.class);
+        log.info("批量导入结束运单传入参数:{}", JSON.toJSONString(list));
+        return carFreeCarrierBillService.addCarFreeCarrierBillEndList(list, userId);
+    }
+
+    @PostMapping("/endList")
+    @ApiOperation(value = "查询运单结束列表", notes = "查询运单结束列表")
+    @LoginRequired
+    public RespR getCarFreeCarrierEndList(Page page, CarFreeCarrierBillEnd carFreeCarrierBillEnd) {
+        return new RespR<>(carFreeCarrierBillEndService.getCarFreeCarrierBillEndPage(page, carFreeCarrierBillEnd));
+    }
+
+    @ApiOperation(value = "导出运单列表", notes = "导出运单列表")
+    @GetMapping("/billExport")
+    public void export(Integer userId, HttpServletResponse response) throws IOException {
+        List<CarFreeCarrierBillStart> list = carFreeCarrierBillStartService.getCarFreeCarrierBillSuccessList(userId, CommonConstants.SUCCESS);
+//        List<CarFreeCarrierBillStart> newList = new ArrayList<>();
+
+        ExportUtil.exportExcel(list, CarFreeCarrierBillStart.class, "运单列表", new ExportParams("运单列表", "运单列表"), response);
+    }
+
+    @PostMapping("/notFinish")
+    @ApiOperation(value = "查询未开票完成运单列表", notes = "查询未开票完成运单列表")
+    @LoginRequired
+    public RespR getNotFinishListPage(Page page, CarFreeCarrierBillStart carFreeCarrierBillStart) {
+        return new RespR<>(carFreeCarrierBillStartService.getNotFinishListPage(page, carFreeCarrierBillStart));
+    }
+
+    @PostMapping("/finish")
+    @ApiOperation(value = "查询开票完成运单列表", notes = "查询开票完成运单列表")
+    @LoginRequired
+    public RespR getFinishListPage(Page page, CarFreeCarrierBillStart carFreeCarrierBillStart, Long startTime, Long endTime) {
+        if (endTime != null) {
+            carFreeCarrierBillStart.setCreateStartTime(startTime.toString());
+        }
+        if (endTime != null) {
+            carFreeCarrierBillStart.setCreateEndTime(endTime.toString());
+        }
+        return new RespR<>(carFreeCarrierBillStartService.getFinishListPage(page, carFreeCarrierBillStart));
+    }
+
+
+}

+ 72 - 0
src/main/java/com/jkcredit/invoice/controller/CarFreeCarrierRegisterController.java

@@ -0,0 +1,72 @@
+package com.jkcredit.invoice.controller;
+
+import cn.afterturn.easypoi.excel.entity.ExportParams;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jkcredit.invoice.annotation.LoginRequired;
+import com.jkcredit.invoice.model.entity.CarFreeCarrierRegister;
+import com.jkcredit.invoice.service.CarFreeCarrierRegisterService;
+import com.jkcredit.invoice.util.DownExcelTemplateUtil;
+import com.jkcredit.invoice.util.ExportUtil;
+import com.jkcredit.invoice.util.ReadExcelUtil;
+import com.jkcredit.invoice.util.RespR;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-05-30 14:59
+ * @version: V1.0
+ **/
+@RestController
+@RequestMapping("carFreeCarrierRegister")
+@Api(tags = "无车承运人备案")
+@Slf4j
+public class CarFreeCarrierRegisterController {
+
+    @Autowired
+    private CarFreeCarrierRegisterService carFreeCarrierRegisterService;
+
+    /**
+     * 查询无车承运人备案列表
+     * @param page
+     * @return
+     */
+    @PostMapping("/list")
+    @ApiOperation(value = "查询无车承运人备案列表", notes = "查询无车承运人备案列表")
+    @LoginRequired
+    public RespR getCarFreeCarrierRegisterList(Page page, CarFreeCarrierRegister carFreeCarrierRegister){
+        return new RespR<>(carFreeCarrierRegisterService.getCarFreeCarrierRegisterPage(page, carFreeCarrierRegister));
+    }
+
+//    @LoginRequired
+//    @PostMapping("/excel")
+//    @ApiOperation(value = "批量导入备案信息", notes = "批量导入备案信息")
+//    public RespR<Boolean> excel(@RequestParam("file") MultipartFile file,@RequestParam Integer userId) {
+//        List<CarFreeCarrierRegister> list =ReadExcelUtil.readExcel(file,CarFreeCarrierRegister.class);
+//        return carFreeCarrierRegisterService.addCarFreeCarrierRegisterList(list,userId);
+//    }
+
+    @ApiOperation(value = "下载车辆备案模板",notes = "下载车辆备案模板")
+    @GetMapping("/downTemp")
+    public void donwTemp(HttpServletResponse response){
+        DownExcelTemplateUtil.downloadExcel(response,"车辆备案模板.xlsx");
+    }
+
+    @ApiOperation(value = "导出车辆备案列表",notes = "导出车辆备案列表")
+    @GetMapping("/export")
+    public void export(Integer userId, String plateNumber, String isSuccess, HttpServletResponse response) throws IOException {
+        ExportUtil.exportExcel(carFreeCarrierRegisterService.exportList(userId, plateNumber, isSuccess),CarFreeCarrierRegister.class,"车辆备案列表",new ExportParams("车辆备案列表", "车辆备案列表"),response);
+    }
+
+}

+ 54 - 0
src/main/java/com/jkcredit/invoice/controller/CardTradeController.java

@@ -0,0 +1,54 @@
+package com.jkcredit.invoice.controller;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jkcredit.invoice.annotation.LoginRequired;
+import com.jkcredit.invoice.model.entity.CardTrade;
+import com.jkcredit.invoice.service.CardTradeService;
+import com.jkcredit.invoice.util.RespR;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+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;
+
+import java.util.List;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-06-19 16:07
+ * @version: V1.0
+ **/
+@RestController
+@RequestMapping("/cardTrade")
+public class CardTradeController {
+
+    @Autowired
+    private CardTradeService cardTradeService;
+
+    /**
+     * 查询交易列表
+     * @param page
+     * @param cardTrade
+     * @return
+     */
+    @PostMapping("/page")
+    @ApiOperation(value = "查询交易列表", notes = "查询交易列表")
+    @LoginRequired
+    public RespR getCardTradeList(Page page, CardTrade cardTrade){
+        return new RespR<>(cardTradeService.getCardTradePage(page, cardTrade));
+    }
+
+    /**
+     * 查询交易
+     * @param cardTradeList
+     * @return
+     */
+    @PostMapping("/query")
+    @ApiOperation(value = "批量查询交易,入参 企业编号、车牌号、开始时间、结束时间", notes = "批量查询交易,入参 企业编号、车牌号、开始时间、结束时间")
+    @LoginRequired
+    public RespR queryCardTrade(@RequestBody List<CardTrade> cardTradeList){
+        return cardTradeService.queryCardTrade(cardTradeList);
+    }
+}

+ 74 - 0
src/main/java/com/jkcredit/invoice/controller/Customer/CustomerController.java

@@ -0,0 +1,74 @@
+package com.jkcredit.invoice.controller.Customer;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jkcredit.invoice.annotation.LoginRequired;
+import com.jkcredit.invoice.model.entity.Customer;
+import com.jkcredit.invoice.model.entity.CustomerRec;
+import com.jkcredit.invoice.model.entity.CustomerRecharge;
+import com.jkcredit.invoice.model.entity.User;
+import com.jkcredit.invoice.service.CustomerService;
+import com.jkcredit.invoice.util.DateUtil;
+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.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 客户操作
+ */
+@Api(tags = "客户操作")
+@RestController
+@RequestMapping(value = {"/customer"})
+public class CustomerController {
+    @Autowired
+    CustomerService customerService;
+    /**
+     * 分页查询客户
+     *
+     * @param page    参数集
+     * @return 用户集合
+     */
+    @PostMapping("/findCustomer")
+    @ApiOperation(value="分页查询客户", notes="分页查询客户")
+    @LoginRequired
+    public RespR getCustomersByPage(Page page, Customer customer) {
+
+        return new RespR(customerService.findAllCustomers(page, customer));
+    }
+    /**
+     * 添加客户
+     * @return 用户集合
+     */
+    @PostMapping("/addCustomer")
+    @ApiOperation(value="添加客户", notes="添加客户")
+    @LoginRequired
+    public RespR addCustomer(@RequestBody  Customer customer) {
+        return new RespR(customerService.addCustomers(customer),"客户添加失败,请查看是否重复");
+    }
+    /**
+     * 修改客户状态
+     * @return 用户集合
+     */
+    @PostMapping("/updateCustomer")
+    @ApiOperation(value="更新用户", notes="更新用户")
+    @LoginRequired
+    public RespR updateCustomer(@RequestBody  Customer customer) {
+
+        return new RespR(customerService.updateCustomer(customer));
+    }
+    /**
+     * 充值
+     * @return 用户集合
+     */
+    @PostMapping("/customRecharge")
+    @ApiOperation(value="账号充值", notes="账号充值")
+    @LoginRequired
+    public RespR customRecharge(@RequestBody CustomerRecharge customerRecharge) {
+
+        return new RespR(customerService.customRecharge(customerRecharge));
+    }
+}

+ 65 - 0
src/main/java/com/jkcredit/invoice/controller/InvoiceController.java

@@ -0,0 +1,65 @@
+package com.jkcredit.invoice.controller;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jkcredit.invoice.annotation.LoginRequired;
+import com.jkcredit.invoice.model.entity.Invoice;
+import com.jkcredit.invoice.service.InvoiceService;
+import com.jkcredit.invoice.util.RespR;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @description: 发票信息控制器
+ * @author: sunzhaoning
+ * @create: 2019-05-30 09:18
+ * @version: V1.0
+ **/
+@Api(tags = "发票管理")
+@RestController
+@RequestMapping("/invoice")
+@Slf4j
+public class InvoiceController {
+
+    @Autowired
+    private InvoiceService invoiceService;
+
+    /**
+     * 新增发票信息
+     * @param invoice
+     * @return
+     */
+    @PostMapping("/add")
+    @ApiOperation(value = "新增发票信息", notes = "新增发票信息")
+    @LoginRequired
+    public RespR addInvoice(@RequestBody Invoice invoice) {
+        return invoiceService.saveInvoice(invoice);
+    }
+
+    /**
+     * 查询发票列表
+     * @param page
+     * @return
+     */
+    @PostMapping("/list")
+    @ApiOperation(value = "查询发票列表", notes = "查询发票列表")
+    @LoginRequired
+    public RespR getInvoiceList(Page page,Invoice invoice){
+        return new RespR<>(invoiceService.getInvoicesPage(page,invoice));
+    }
+
+    /**
+     * 根据用户查询发票列表
+     * @param userId
+     * @return
+     */
+    @PostMapping("/{userId}")
+    @ApiOperation(value = "根据用户id查询发票信息", notes = "根据用户id查询发票信息")
+    @LoginRequired
+    public RespR getInvoiceListByUserId(@PathVariable Integer userId){
+        return new RespR(invoiceService.getByUserId(userId));
+    }
+
+}

+ 85 - 0
src/main/java/com/jkcredit/invoice/controller/NumInvoiceController.java

@@ -0,0 +1,85 @@
+package com.jkcredit.invoice.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jkcredit.invoice.annotation.LoginRequired;
+import com.jkcredit.invoice.model.entity.NumInvoice;
+import com.jkcredit.invoice.service.NumInvoiceService;
+import com.jkcredit.invoice.util.DownExcelTemplateUtil;
+import com.jkcredit.invoice.util.ReadExcelUtil;
+import com.jkcredit.invoice.util.RespR;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-06-03 17:11
+ * @version: V1.0
+ **/
+@Api(tags = "运单查询发票")
+@RestController
+@Slf4j
+@RequestMapping("/numInvoice")
+public class NumInvoiceController {
+
+    @Autowired
+    private NumInvoiceService numInvoiceService;
+
+//    @LoginRequired
+//    @PostMapping("/excel")
+//    @ApiOperation(value = "批量导入运单信息", notes = "批量导入运单信息")
+//    public RespR<Boolean> numImport(@RequestParam("file") MultipartFile file, @RequestParam Integer userId) {
+//        List<NumInvoice> list = ReadExcelUtil.readNumExcel(file,NumInvoice.class);
+//        log.info("传入的参数是:{}", JSON.toJSONString(list));
+//        return numInvoiceService.addNumList(list,userId);
+//    }
+
+    @ApiOperation(value = "下载运单查询发票模板",notes = "下载运单查询发票模板")
+    @GetMapping("/downTemp")
+    public void donwTemp(HttpServletResponse response){
+        DownExcelTemplateUtil.downloadExcel(response,"运单查询发票模板.xlsx");
+    }
+
+    /**
+     * 查询列表
+     * @param page
+     * @return
+     */
+    @PostMapping("/list")
+    @ApiOperation(value = "查询列表", notes = "查询列表")
+    @LoginRequired
+    public RespR getInvoiceList(Page page, NumInvoice numInvoice){
+        return new RespR<>(numInvoiceService.getNumInvoicePage(page,numInvoice));
+    }
+
+    /**
+     * 批量开票接口
+     * @param nums
+     * @param userId
+     * @return
+     */
+//    @LoginRequired
+//    @PostMapping("/nums")
+//    @ApiOperation(value = "批量开票接口", notes = "批量开票")
+//    public RespR<Boolean> numImport(@RequestParam("nums") List<String> nums, @RequestParam Integer userId) {
+//        List<NumInvoice> list = new ArrayList<>();
+//        NumInvoice numInvoice;
+//        for(String num :nums){
+//            numInvoice = new NumInvoice();
+//            numInvoice.setNum(num);
+//            list.add(numInvoice);
+//        }
+////        log.info("传入的参数是:{}", JSON.toJSONString(list));
+//        return numInvoiceService.addNumList(list,userId);
+//    }
+}

+ 69 - 0
src/main/java/com/jkcredit/invoice/controller/PackageFileController.java

@@ -0,0 +1,69 @@
+package com.jkcredit.invoice.controller;
+
+import com.jkcredit.invoice.model.entity.SearchInvoiceResult;
+import com.jkcredit.invoice.service.CarFreeCarrierBillStartService;
+import com.jkcredit.invoice.service.SearchInvoiceResultService;
+import com.jkcredit.invoice.util.WebFileDownLoadUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @description: 发票打包下载
+ * @author: sunzhaoning
+ * @create: 2019-07-12 10:48
+ * @version: V1.0
+ **/
+@Slf4j
+@RestController
+@RequestMapping("package")
+@Api(tags = "发票打包下载")
+public class PackageFileController {
+
+    @Autowired
+    private WebFileDownLoadUtils webFileDownLoadUtils;
+    @Autowired
+    private SearchInvoiceResultService searchInvoiceResultService;
+    @Autowired
+    private CarFreeCarrierBillStartService carFreeCarrierBillStartService;
+
+    @GetMapping("/download")
+//    @LoginRequired
+    @ApiOperation(value = "打包下载接口", notes = "打包下载接口")
+    public void downLoad(Integer userId, String batchNumber, Long startTime, Long endTime, String taxpayerCode,
+                         String plateNum, String waybillNum, String invoiceNum,
+                         HttpServletResponse response) {
+        SearchInvoiceResult requestParam = new SearchInvoiceResult();
+        if (userId == null) {
+            return;
+        } else {
+            requestParam.setUserId(userId);
+        }
+        if (StringUtils.isNotBlank(taxpayerCode)) {
+            requestParam.setTaxPlayerCode(taxpayerCode);
+        }
+        if (startTime != null) {
+            requestParam.setStartTime(startTime);
+        }
+        if (endTime != null) {
+            requestParam.setEndTime(endTime);
+        }
+        if (plateNum != null) {
+            requestParam.setPlateNum(plateNum.trim());
+        }
+        if (waybillNum != null) {
+            requestParam.setWaybillNum(waybillNum);
+        }
+        if (invoiceNum != null) {
+            requestParam.setInvoiceNum(invoiceNum);
+        }
+        searchInvoiceResultService.downloadInvoiceBat(requestParam, batchNumber, response);
+    }
+}

+ 40 - 0
src/main/java/com/jkcredit/invoice/controller/RechargeController.java

@@ -0,0 +1,40 @@
+package com.jkcredit.invoice.controller;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jkcredit.invoice.annotation.LoginRequired;
+import com.jkcredit.invoice.model.entity.Recharge;
+import com.jkcredit.invoice.service.RechargeService;
+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.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-05-30 10:50
+ * @version: V1.0
+ **/
+@RestController
+@RequestMapping("/recharge")
+@Api(tags = "充值记录")
+public class RechargeController {
+
+    @Autowired
+    private RechargeService rechargeService;
+
+    /**
+     * 查询充值记录列表
+     * @param page
+     * @return
+     */
+    @PostMapping("/list")
+    @ApiOperation(value = "查询充值记录列表", notes = "查询充值记录列表")
+    @LoginRequired
+    public RespR getRechargeList(Page page, Recharge recharge){
+        return new RespR<>(rechargeService.getRechargesPage(page,recharge));
+    }
+}

+ 33 - 0
src/main/java/com/jkcredit/invoice/controller/RoleController.java

@@ -0,0 +1,33 @@
+package com.jkcredit.invoice.controller;
+
+import com.jkcredit.invoice.annotation.LoginRequired;
+import com.jkcredit.invoice.service.RoleService;
+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.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-05-29 17:26
+ * @version: V1.0
+ **/
+@Api(tags = "用户角色")
+@RestController
+@RequestMapping("/role")
+public class RoleController {
+
+    @Autowired
+    private RoleService roleService;
+
+    @LoginRequired
+    @PostMapping(value = "/list")
+    @ApiOperation(value="角色列表", notes="角色列表")
+    public RespR roleList(){
+        return new RespR<>(roleService.list());
+    }
+}

+ 102 - 0
src/main/java/com/jkcredit/invoice/controller/SearchInvoiceResultController.java

@@ -0,0 +1,102 @@
+package com.jkcredit.invoice.controller;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jkcredit.invoice.annotation.LoginRequired;
+import com.jkcredit.invoice.model.entity.SearchInvoiceData;
+import com.jkcredit.invoice.model.entity.SearchInvoiceResult;
+import com.jkcredit.invoice.service.SearchInvoiceDataService;
+import com.jkcredit.invoice.service.SearchInvoiceResultService;
+import com.jkcredit.invoice.util.RespR;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.List;
+
+@RestController
+@RequestMapping("/searchInvoiceResult")
+@Api(tags = "查询发票数据")
+public class SearchInvoiceResultController {
+    @Autowired
+    private SearchInvoiceResultService searchInvoiceResultService;
+    @Autowired
+    private SearchInvoiceDataService searchInvoiceDataService;
+    /**
+     * 查询发票数据列表
+     *
+     * @param page
+     * @return
+     */
+    @PostMapping("/list")
+    @ApiOperation(value = "查询发票数据列表", notes = "查询发票数据列表")
+    @LoginRequired
+    public RespR getSearchResultList(Page page, SearchInvoiceResult searchInvoiceResult,String batchNumber) {
+        return new RespR<>(searchInvoiceResultService.getSearchInvoiceResultPage(page, searchInvoiceResult,batchNumber));
+    }
+
+    /**
+     * 查询发票数据列表(表num_invoice与search_invoice_result数据)
+     *
+     * @param page
+     * @return
+     */
+    @PostMapping("/invoiceDataList")
+    @ApiOperation(value = "查询发票数据列表", notes = "查询发票数据列表")
+    @LoginRequired
+    public RespR getSearchInvoiceDataList(Page page, SearchInvoiceData searchInvoiceData) {
+        return new RespR(searchInvoiceDataService.getInvoiceDataPage(page, searchInvoiceData));
+    }
+
+    /**
+     * 导出发票列表
+     * @param userId
+     * @param waybillNum
+     * @param response
+     * @param batchNumber
+     * @param startTime
+     * @param endTime
+     * @throws IOException
+     */
+    @ApiOperation(value = "导出发票列表",notes = "导出发票列表")
+    @GetMapping("/export")
+    public void export(Integer userId,String waybillNum, HttpServletResponse response,String batchNumber,Long startTime,Long endTime) throws IOException {
+        try {
+            response.setCharacterEncoding("UTF-8");
+            response.setHeader("content-Type", "application/vnd.ms-excel");
+            response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("发票列表" + ".xlsx", "UTF-8"));
+            Workbook workbook = searchInvoiceResultService.exportExcelToTemplate(userId, waybillNum, batchNumber, startTime, endTime);
+            workbook.write(response.getOutputStream());
+        } catch (Exception e) {
+            throw new IOException(e.getMessage());
+        }
+    }
+
+    /**
+     * 查询发票统计
+     * @param searchInvoiceResult
+     * @return
+     */
+    @PostMapping("/statistics")
+    @ApiOperation(value = "查询发票统计", notes = "查询发票统计")
+    @LoginRequired
+    public RespR statisticsData(SearchInvoiceResult searchInvoiceResult,String batchNumber) {
+        List<SearchInvoiceResult> list = new ArrayList<>();
+        list.add(searchInvoiceResultService.statisticsData(searchInvoiceResult,batchNumber));
+        return new RespR<>(list);
+    }
+
+    @PostMapping("/dailyBill")
+    @ApiOperation(value = "查询发票统计", notes = "查询发票统计")
+    public RespR getDailyBilling(Page page,Integer userId) {
+        return new RespR<>(searchInvoiceResultService.getDailyBilling(page,userId));
+    }
+}

+ 147 - 0
src/main/java/com/jkcredit/invoice/controller/TempController.java

@@ -0,0 +1,147 @@
+package com.jkcredit.invoice.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
+import com.jkcredit.invoice.common.CommonConstants;
+import com.jkcredit.invoice.model.entity.SearchInvoiceResult;
+import com.jkcredit.invoice.model.entity.SearchInvoiceResultTemp;
+import com.jkcredit.invoice.model.entity.WayBillTest;
+import com.jkcredit.invoice.service.SearchInvoiceResultService;
+import com.jkcredit.invoice.service.SearchInvoiceResultTempService;
+import com.jkcredit.invoice.util.HttpUtil;
+import com.jkcredit.invoice.util.ReadExcelUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.stream.Collectors;
+
+/**
+ * @description:
+ * @author: xusonglin
+ * @create: 2019/12/13 13:21
+ * @version: V1.0
+ **/
+@RestController
+@RequestMapping("/temp")
+@Slf4j
+public class TempController {
+    @Autowired
+    private HttpUtil httpUtil;
+
+
+    @Autowired
+    private SearchInvoiceResultService searchInvoiceResultService;
+
+    @Autowired
+    private SearchInvoiceResultTempService tempService;
+
+    @Autowired
+    private RedisTemplate redisTemplate;
+
+    @RequestMapping("/temp")
+    public void temp(@RequestParam MultipartFile file) {
+        // 查询所有运单
+        List<WayBillTest> wayBillTestList = ReadExcelUtil.readTempExcel(file, WayBillTest.class);
+
+        //线程分割数
+        int count = 20000;
+        //获取list大小
+        int listSize = wayBillTestList.size();
+        //线程数
+        int threadSize = (listSize / count) + 1;
+
+        ThreadFactory namedThreadFactory = new ThreadFactoryBuilder().setNameFormat("thread-numInvoice-%d").build();
+
+        ExecutorService executor = new ThreadPoolExecutor(threadSize, threadSize, 200L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(), namedThreadFactory);
+
+        CountDownLatch countDownLatch = new CountDownLatch(threadSize);
+        List<WayBillTest> newList;
+        for (int i = 0; i < threadSize; i++) {
+            if ((i + 1) == threadSize) {
+                int startIndex = (i * count);
+                int endIndex = wayBillTestList.size();
+                newList = wayBillTestList.subList(startIndex, endIndex);
+            } else {
+                int startIndex = i * count;
+                int endIndex = (i + 1) * count;
+                newList = wayBillTestList.subList(startIndex, endIndex);
+            }
+
+            List<WayBillTest> finalNewList = newList;
+            executor.execute(new Thread(() -> {
+                if (null != finalNewList) {
+                    log.info("传入数据是:{}", JSON.toJSONString(finalNewList));
+                    finalNewList.stream().forEach(numInvoice -> {
+                        Map<String, Object> map = new HashMap<>(4);
+                        map.put("companyNum","10004616");
+                        map.put("num", numInvoice.getWayBillNum());
+                        log.info("运单编号num={}", numInvoice.getWayBillNum());
+                        //调用接口
+                        String registerResult = httpUtil.getCheckResult(map, CommonConstants.WAY_BILL_NUM_FIND_INVOICE_API);
+//                        String registerResult = getTestResult();
+                        log.info("运单查询发票接口返回:{},请求参数:{}", registerResult, JSON.toJSONString(map));
+                        //转换结果为jsonobject
+                        JSONObject registerResultJson = JSON.parseObject(registerResult);
+                        //获取返回data值
+                        String dataCode = registerResultJson.getString("data");
+                        //判断返回值是否为1 如果是1 设置状态为成功
+                        if ("1".equals(dataCode)) {
+
+                            String returnStr = registerResultJson.getString("msg");
+
+                            JSONObject returnStrJson = JSON.parseObject(returnStr);
+                            //获取接口返回结果
+                            String numResult = returnStrJson.getString("result");
+                            //获取接口状态
+                            String waybillStatus = returnStrJson.getString("waybillStatus");
+
+                            //转换为结果实体对象 并插入数据库 实现计费功能
+                            List<SearchInvoiceResult> ts = JSONArray.parseArray(numResult, SearchInvoiceResult.class);
+                            List<SearchInvoiceResult> newSearchInvoiceResultList;
+                            if (ts.size() > 0) {
+                                //去重列表
+                                newSearchInvoiceResultList = ts.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(
+                                        () -> new TreeSet<>(Comparator.comparing(SearchInvoiceResult::getTransactionId))),
+                                        ArrayList::new));
+                                //计费
+                                newSearchInvoiceResultList.stream().forEach(t -> {
+                                    if (!redisTemplate.hasKey(CommonConstants.NUM_FIND_INVOICE_KEY + t.getInvoiceNum() + "_" + t.getInvoiceCode())) {
+                                        SearchInvoiceResultTemp temp = new SearchInvoiceResultTemp();
+                                        BeanUtils.copyProperties(t, temp);
+                                        tempService.save(temp);
+                                        //存入redis发票信息
+                                        redisTemplate.opsForValue().set(CommonConstants.NUM_FIND_INVOICE_KEY + t.getInvoiceNum() + "_" + t.getInvoiceCode(), JSON.toJSONString(t));
+                                        //存入redis交易id
+                                        redisTemplate.opsForValue().set(CommonConstants.TRANSACTION_ID_KEY + t.getTransactionId(), t.getTransactionId());
+                                    }
+                                });
+                            }
+                        } else {
+                            //设置失败
+                            log.error("返回code不等于1的结果={}", registerResult);
+                        }
+                    });
+                }
+                countDownLatch.countDown();
+            }));
+        }
+
+        try {
+            countDownLatch.await();
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+
+        executor.shutdown();
+    }
+}

+ 76 - 0
src/main/java/com/jkcredit/invoice/controller/service/LowerServiceController.java

@@ -0,0 +1,76 @@
+package com.jkcredit.invoice.controller.service;
+
+import com.jkcredit.invoice.annotation.LoginRequired;
+import com.jkcredit.invoice.model.entity.CustomerCarRec;
+import com.jkcredit.invoice.model.entity.CustomerRec;
+import com.jkcredit.invoice.service.LowerService;
+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.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@Api(tags = "下游接口")
+@RestController
+@RequestMapping(value = {"/lowerService"})
+public class LowerServiceController {
+    @Autowired
+    LowerService lowerService;
+    /**
+     * @param customerRecs
+     * @return
+     */
+    @PostMapping("/customeRec")
+    @ApiOperation(value="用户备案", notes="用户备案")
+    //@LoginRequired
+    public RespR customeRec(@RequestBody List<CustomerRec> customerRecs){
+        return lowerService.customeRec(customerRecs);
+    }
+    /**
+     * @param customerRec
+     * @return
+     */
+    @PostMapping("/customeRecQueryList")
+    @ApiOperation(value="用户备案列表查询", notes="用户备案列表查询")
+    //@LoginRequired
+    public RespR customeRecQueryList(@RequestBody CustomerRec customerRec){
+        return lowerService.customeRecQueryList(customerRec);
+    }
+    /**
+     * @param customerRec
+     * @return
+     */
+    @PostMapping("/customeRecQuery")
+    @ApiOperation(value="用户备案信息查询", notes="用户备案信息查询")
+    //@LoginRequired
+    public RespR customeRecQuery(@RequestBody CustomerRec customerRec){
+        return lowerService.customeRecQuery(customerRec);
+    }
+    /**
+     * @param customerCarRecs
+     * @return
+     */
+    @PostMapping("/customerCarRec")
+    @ApiOperation(value="", notes="车辆备案")
+    //@LoginRequired
+    public RespR customerCarRec(@RequestBody List<CustomerCarRec> customerCarRecs){
+        return lowerService.customerCarRec(customerCarRecs);
+    }
+
+    /**
+     * @param customerCarRec
+     * @return
+     */
+    @PostMapping("/customerCarRecQuery")
+    @ApiOperation(value="", notes="车辆备案查询")
+   // @LoginRequired
+    public RespR customerCarRecQuery(@RequestBody CustomerCarRec customerCarRec){
+        return lowerService.customerCarRecQuery(customerCarRec);
+    }
+
+}

+ 62 - 0
src/main/java/com/jkcredit/invoice/controller/user/AuthenticationController.java

@@ -0,0 +1,62 @@
+package com.jkcredit.invoice.controller.user;
+
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONObject;
+import com.jkcredit.invoice.model.entity.User;
+import com.jkcredit.invoice.service.AuthenticationService;
+import com.jkcredit.invoice.service.UserService;
+import com.jkcredit.invoice.util.MD5Util;
+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.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-05-29 14:02
+ * @version: V1.0
+ **/
+@Api(tags = "用户登录")
+@RestController
+@RequestMapping("/auth/login")
+public class AuthenticationController {
+
+    @Autowired
+    private AuthenticationService authenticationService;
+    @Autowired
+    private UserService userService;
+
+    @ApiOperation(value="用户登录", notes="用户登录")
+    @PostMapping("")
+    public RespR login(@RequestBody User user) {
+        //获取用户名
+        String userName = user.getUserName();
+        //根据用户名获取用户信息
+        User userInDataBase = userService.selectUserByUserName(userName);
+        JSONObject jsonObject = new JSONObject();
+        //获取密码
+        String password = user.getPassword();
+        if (userInDataBase == null) {
+            return new RespR<>(Boolean.FALSE, "用户不存在");
+        } else if (1==userInDataBase.getIsLock()) {
+            return new RespR<>(Boolean.FALSE, "该账号已被锁定");
+        }else if(2==userInDataBase.getIsLock()){
+            return new RespR<>(Boolean.FALSE, "该账号已停用");
+        }else if (!StrUtil.equals(MD5Util.encrypt(password), userInDataBase.getPassword())) {
+            return new RespR<>(Boolean.FALSE, "密码不正确");
+        } else {
+            //获取token
+            String token = authenticationService.getToken(userInDataBase);
+            //移除密码
+            userInDataBase.setPassword("");
+            jsonObject.put("token", token);
+            jsonObject.put("user", userInDataBase);
+        }
+        return new RespR<>(jsonObject);
+    }
+}

+ 129 - 0
src/main/java/com/jkcredit/invoice/controller/user/UserController.java

@@ -0,0 +1,129 @@
+package com.jkcredit.invoice.controller.user;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jkcredit.invoice.annotation.LoginRequired;
+import com.jkcredit.invoice.model.entity.User;
+import com.jkcredit.invoice.service.UserService;
+import com.jkcredit.invoice.util.MD5Util;
+import com.jkcredit.invoice.util.RespR;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-05-29 09:14
+ * @version: V1.0
+ **/
+@Api(tags = "用户操作")
+@RestController
+@RequestMapping(value = {"/user"})
+public class UserController {
+
+    @Autowired
+    private UserService userService;
+
+    /**
+     * 通过ID查询用户信息
+     *
+     * @param id ID
+     * @return 用户信息
+     */
+    @GetMapping("/{id}")
+    @ApiOperation(value="通过ID查询用户信息", notes="通过ID查询用户信息")
+    @LoginRequired
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "用id", required = true, dataType = "Integer")
+    })
+    public RespR user(@PathVariable Integer id) {
+        return new RespR<>(userService.selectUserById(id));
+    }
+
+    /**
+     * 删除用户信息
+     *
+     * @param id ID
+     * @return R
+     */
+    @DeleteMapping("/{id}")
+    @ApiOperation(value="根据用户名id删除用户信息", notes="根据用户名id删除用户信息")
+    @LoginRequired
+    public RespR userDel(@PathVariable Integer id) {
+        User sysUser = userService.getById(id);
+        return new RespR<>(userService.deleteUserById(sysUser));
+    }
+
+    /**
+     * 添加用户
+     *
+     * @param user 用户信息
+     * @return success/false
+     */
+    @PostMapping
+    @ApiOperation(value="新增用户详细信息", notes="新增用户详细信息")
+    @LoginRequired
+    public RespR user(@RequestBody User user) {
+        user.setPassword(MD5Util.encrypt(user.getPassword()));
+        return new RespR<>(userService.saveUser(user));
+    }
+
+    /**
+     * 更新用户信息
+     *
+     * @param user 用户信息
+     * @return R
+     */
+    @PostMapping("/updateUser")
+    @ApiOperation(value="更新用户信息", notes="更新用户信息")
+    @LoginRequired
+    public RespR updateUser(@RequestBody User user) {
+        if(user.getPassword()!=null){
+            user.setPassword(MD5Util.encrypt(user.getPassword()));
+        }
+        return new RespR<>(userService.updateUserInfo(user));
+    }
+    /**
+     * 分页查询用户
+     *
+     * @param page    参数集
+     * @param user 查询参数列表
+     * @return 用户集合
+     */
+    @PostMapping("/page")
+    @ApiOperation(value="分页查询用户", notes="分页查询用户")
+    @LoginRequired
+    public RespR getUserPage(Page page, User user) {
+        return new RespR<>(userService.getUserWithRolePage(page, user));
+    }
+
+    /**
+     * 重置密码
+     *
+     * @param user user
+     * @return success/false
+     */
+    @PutMapping("/restPassword")
+    @ApiOperation(value="重置密码", notes="重置密码")
+    @LoginRequired
+    public RespR updateUserInfoPassWord(@RequestBody User user) {
+        user.setPassword(MD5Util.encrypt(user.getPassword()));
+        return userService.restPassword(user);
+    }
+
+    /**
+     * 修改锁定状态
+     *
+     * @param user user
+     * @return success/false
+     */
+    @PutMapping("/lock")
+    @ApiOperation(value="修改锁定状态", notes="修改锁定状态")
+    @LoginRequired
+    public RespR updateLock(@RequestBody User user) {
+        return userService.updateLock(user);
+    }
+}

+ 26 - 0
src/main/java/com/jkcredit/invoice/mapper/B2bInvoiceApplyMapper.java

@@ -0,0 +1,26 @@
+package com.jkcredit.invoice.mapper;
+
+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.B2bInvoiceApply;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-06-19 13:34
+ * @version: V1.0
+ **/
+public interface B2bInvoiceApplyMapper extends BaseMapper<B2bInvoiceApply> {
+
+    /**
+     * 分页查询开票
+     * @param page
+     * @param b2bInvoiceApply
+     * @return
+     */
+    IPage<List<B2bInvoiceApply>> getB2bInvoiceApplyPage(Page page, @Param("query") B2bInvoiceApply b2bInvoiceApply);
+}

+ 28 - 0
src/main/java/com/jkcredit/invoice/mapper/B2bInvoicePackageMapper.java

@@ -0,0 +1,28 @@
+package com.jkcredit.invoice.mapper;
+
+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.B2bInvoicePackage;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-06-21 10:08
+ * @version: V1.0
+ **/
+public interface B2bInvoicePackageMapper extends BaseMapper<B2bInvoicePackage> {
+
+
+    /**
+     * 分页查询
+     * @param page
+     * @param b2bInvoicePackage
+     * @return
+     */
+    IPage<List<B2bInvoicePackage>> getB2bInvoicePackagePage(Page page, @Param("query") B2bInvoicePackage b2bInvoicePackage);
+
+}

+ 39 - 0
src/main/java/com/jkcredit/invoice/mapper/B2bInvoiceQueryMapper.java

@@ -0,0 +1,39 @@
+package com.jkcredit.invoice.mapper;
+
+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.B2bInvoiceQuery;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-06-19 16:28
+ * @version: V1.0
+ **/
+public interface B2bInvoiceQueryMapper extends BaseMapper<B2bInvoiceQuery> {
+
+    /**
+     * 分页查询
+     * @param page
+     * @param b2bInvoiceQuery
+     * @return
+     */
+    IPage<List<B2bInvoiceQuery>> getB2bInvoiceQueryPage(Page page, @Param("query") B2bInvoiceQuery b2bInvoiceQuery);
+
+    /**
+     * 根据交易id查询是否存在交易
+     * @param tradeId
+     * @return
+     */
+    List<B2bInvoiceQuery> getB2bInvoiceByTradeId(String tradeId);
+
+    /**
+     * 根据交易id删除数据
+     * @param tradeId
+     */
+    void deleteByTradeId(String tradeId);
+}

+ 27 - 0
src/main/java/com/jkcredit/invoice/mapper/BatchMapper.java

@@ -0,0 +1,27 @@
+package com.jkcredit.invoice.mapper;
+
+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.Batch;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-05-30 11:59
+ * @version: V1.0
+ **/
+public interface BatchMapper extends BaseMapper<Batch> {
+
+    /**
+     * 分页查询批次
+     * @param page
+     * @param batch
+     * @return
+     */
+    IPage<List<Batch>> getBatchPage(Page page, @Param("query") Batch batch);
+
+}

+ 39 - 0
src/main/java/com/jkcredit/invoice/mapper/CarEtcCardMapper.java

@@ -0,0 +1,39 @@
+package com.jkcredit.invoice.mapper;
+
+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.CarEtcCard;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @description: etc卡mapper
+ * @author: sunzhaoning
+ * @create: 2019-06-17 15:07
+ * @version: V1.0
+ **/
+public interface CarEtcCardMapper extends BaseMapper<CarEtcCard> {
+
+    /**
+     * 分页查询ETC卡列表
+     * @param page
+     * @param carEtcCard
+     * @return
+     */
+    IPage<List<CarEtcCard>> getCarEtcCardPage(Page page, @Param("query") CarEtcCard carEtcCard);
+
+    /**
+     * 根据车牌号查询卡编号
+     * @param plateNum
+     * @return
+     */
+    List<CarEtcCard> getCarEtcCardByPlateNum(String plateNum);
+
+    /**
+     * 根据车牌号删除卡信息
+     * @param plateNum
+     */
+    void deleteByPlateNum(String plateNum);
+}

+ 43 - 0
src/main/java/com/jkcredit/invoice/mapper/CarFreeCarrierBillEndMapper.java

@@ -0,0 +1,43 @@
+package com.jkcredit.invoice.mapper;
+
+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.CarFreeCarrierBillEnd;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-05-31 11:36
+ * @version: V1.0
+ **/
+public interface CarFreeCarrierBillEndMapper extends BaseMapper<CarFreeCarrierBillEnd> {
+
+    /**
+     * 根据运单状态编号查询运单
+     * @param num
+     * @param isSuccess
+     * @return
+     */
+    List<CarFreeCarrierBillEnd> getEndBillByNum(String num,Integer isSuccess);
+
+    /**
+     * 根据运单编号修改运单请求状态
+     * @param num
+     * @param isSuccess
+     */
+    void updateIsSuccess(String num,Integer isSuccess);
+
+
+    /**
+     * 分页查询
+     * @param page
+     * @param carFreeCarrierBillEnd
+     * @return
+     */
+    IPage<List<CarFreeCarrierBillEnd>> getCarFreeCarrierBillEndPage(Page page, @Param("query") CarFreeCarrierBillEnd carFreeCarrierBillEnd);
+
+}

+ 127 - 0
src/main/java/com/jkcredit/invoice/mapper/CarFreeCarrierBillStartMapper.java

@@ -0,0 +1,127 @@
+package com.jkcredit.invoice.mapper;
+
+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.CarFreeCarrierBillStart;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-05-31 11:34
+ * @version: V1.0
+ **/
+public interface CarFreeCarrierBillStartMapper extends BaseMapper<CarFreeCarrierBillStart> {
+
+    /**
+     * 分页查询
+     * @param page
+     * @param carFreeCarrierBillStart
+     * @return
+     */
+    IPage<List<CarFreeCarrierBillStart>> getCarFreeCarrierBillStartPage(Page page, @Param("query") CarFreeCarrierBillStart carFreeCarrierBillStart);
+
+    /**
+     * 获取未开票完成列表
+     * @param page
+     * @param carFreeCarrierBillStart
+     * @return
+     */
+    IPage<List<CarFreeCarrierBillStart>> getNotFinishListPage(Page page, @Param("query") CarFreeCarrierBillStart carFreeCarrierBillStart);
+
+    /**
+     * 获取开票完成列表
+     * @param page
+     * @param carFreeCarrierBillStart
+     * @return
+     */
+    IPage<List<CarFreeCarrierBillStart>> getFinishListPage(Page page, @Param("query") CarFreeCarrierBillStart carFreeCarrierBillStart);
+
+    /**
+     * 更新状态
+     * @param carFreeCarrierBillStart
+     * @return
+     */
+    Boolean updateStatus(CarFreeCarrierBillStart carFreeCarrierBillStart);
+
+    /**
+     * 更新导出状态
+     * @param carFreeCarrierBillStart
+     * @return
+     */
+    Boolean updateIsExport(CarFreeCarrierBillStart carFreeCarrierBillStart);
+
+    /**
+     * 根据运单状态 查询 运单数据
+     * @param status
+     * @param isSuccess
+     * @return
+     */
+    List<CarFreeCarrierBillStart> getStartBillByStatus(Integer status,Integer isSuccess,Integer isHistory);
+
+    /**
+     * 根据运单状态 查询 预估自动运单数据
+     * @param status
+     * @param isSuccess
+     * @return
+     */
+    List<CarFreeCarrierBillStart> getStartBillByFlag(Integer status,Integer isSuccess,Integer isHistory,Integer autoFlag);
+
+    /**
+     * 获取成功列表
+     * @param userId
+     * @param isSuccess
+     * @return
+     */
+    List<CarFreeCarrierBillStart> getCarFreeCarrierBillSuccessList(Integer userId,Integer isSuccess);
+
+    /**
+     * 根据运单号状态查询运单
+     * @param num
+     * @param isSuccess
+     * @return
+     */
+    CarFreeCarrierBillStart getBillNumByNum(String num,Integer isSuccess);
+
+    /**
+     * 更新状态
+     * @param carFreeCarrierBillStart
+     * @return
+     */
+    Boolean updateStatusAndBatchId(CarFreeCarrierBillStart carFreeCarrierBillStart);
+
+    /**
+     * 根据批次ID获取运单编号
+     * @param batchNumber
+     * @return
+     */
+    List<CarFreeCarrierBillStart> getBillNumByBatchNumber(String batchNumber);
+
+    /**
+     * 根据用户id查询运单列表
+     * @param userId
+     * @return
+     */
+    List<CarFreeCarrierBillStart> getNotFinishList(Integer userId);
+
+    /**
+     * 获取自动开票运单列表
+     * @return
+     */
+    List<CarFreeCarrierBillStart> getAutoBillList(Integer userId);
+
+    /**
+     * 根据用户id查询实时运单列表
+     */
+    List<CarFreeCarrierBillStart> getNotFinishRealTimeList(Integer userId);
+
+    /**
+     * 根据用户id查询历史运单列表
+     */
+    List<CarFreeCarrierBillStart> getNotFinishHistoryList(Integer userId);
+
+    void updateLegacyDataFlag(String num);
+}

+ 54 - 0
src/main/java/com/jkcredit/invoice/mapper/CarFreeCarrierRegisterMapper.java

@@ -0,0 +1,54 @@
+package com.jkcredit.invoice.mapper;
+
+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.CarFreeCarrierRegister;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-05-30 12:05
+ * @version: V1.0
+ **/
+public interface CarFreeCarrierRegisterMapper extends BaseMapper<CarFreeCarrierRegister> {
+
+    /**
+     * 分页
+     * @param page
+     * @param carFreeCarrierRegister
+     * @return
+     */
+    IPage<List<CarFreeCarrierRegister>> getCarFreeCarrierRegisterPage(Page page, @Param("query") CarFreeCarrierRegister carFreeCarrierRegister);
+
+    /**
+     * 根据用户获取用户备案列表
+     * @param id
+     * @return
+     */
+    List<CarFreeCarrierRegister> getListByUser(Integer id, String plateNumber, String isSuccess);
+
+    /**
+     * 根据车牌号车牌颜色查询备案成功车辆
+     * @param carFreeCarrierRegister
+     * @return
+     */
+    CarFreeCarrierRegister getRegisterByPlateNum(CarFreeCarrierRegister carFreeCarrierRegister);
+
+    /**
+     * 根据车牌号车牌颜色查询备案成功车辆, 返回集合
+     * @param carFreeCarrierRegister
+     * @return
+     */
+    List<CarFreeCarrierRegister> getRegisterListByPlateNum(@Param("query") CarFreeCarrierRegister carFreeCarrierRegister, Integer userId);
+
+    /**
+     * 根据车牌号查询备案车辆
+     * @param carFreeCarrierRegister
+     * @return
+     */
+    CarFreeCarrierRegister getCarRegisterByPlateNum(@Param("query") CarFreeCarrierRegister carFreeCarrierRegister);
+}

+ 41 - 0
src/main/java/com/jkcredit/invoice/mapper/CardTradeMapper.java

@@ -0,0 +1,41 @@
+package com.jkcredit.invoice.mapper;
+
+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.CardTrade;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-06-19 10:08
+ * @version: V1.0
+ **/
+public interface CardTradeMapper extends BaseMapper<CardTrade> {
+
+    /**
+     * 分页查询交易
+     * @param page
+     * @param cardTrade
+     * @return
+     */
+    IPage<List<CardTrade>> getCardTradePage(Page page, @Param("query") CardTrade cardTrade);
+
+
+    /**
+     * 更新状态
+     * @param cardTrade
+     * @return
+     */
+    Boolean updateStatus(CardTrade cardTrade);
+
+    /**
+     * 获取交易编号列表
+     * @param cardTrade
+     * @return
+     */
+    List<CardTrade> getTradeIdList(CardTrade cardTrade);
+}

+ 7 - 0
src/main/java/com/jkcredit/invoice/mapper/ChargeMapper.java

@@ -0,0 +1,7 @@
+package com.jkcredit.invoice.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jkcredit.invoice.model.entity.Charge;
+
+public interface ChargeMapper extends BaseMapper<Charge> {
+}

+ 7 - 0
src/main/java/com/jkcredit/invoice/mapper/ConsumeQueueMapper.java

@@ -0,0 +1,7 @@
+package com.jkcredit.invoice.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jkcredit.invoice.model.entity.ConsumeQueue;
+
+public interface ConsumeQueueMapper extends BaseMapper<ConsumeQueue> {
+}

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

@@ -0,0 +1,22 @@
+package com.jkcredit.invoice.mapper;
+
+import com.jkcredit.invoice.model.entity.CustomerCarRec;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public interface CustomerCarRecMapper {
+    int deleteByPrimaryKey(String carNum);
+
+    int insert(CustomerCarRec record);
+
+    int insertSelective(CustomerCarRec record);
+
+    List<CustomerCarRec>  selectByCustName(String customerName);
+
+    CustomerCarRec selectByCarNum(String carNum);
+    int updateByPrimaryKeySelective(CustomerCarRec record);
+
+    int updateByPrimaryKey(CustomerCarRec record);
+}

+ 28 - 0
src/main/java/com/jkcredit/invoice/mapper/CustomerMapper.java

@@ -0,0 +1,28 @@
+package com.jkcredit.invoice.mapper;
+
+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;
+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);
+
+    int insert(Customer record);
+
+    int insertSelective(Customer record);
+
+    Customer selectByPrimaryKey(Integer id);
+
+    Customer selectByCustomerName(String  customerName);
+
+    int updateByPrimaryKeySelective(Customer record);
+
+    int updateByPrimaryKey(Customer record);
+
+    IPage<List<Customer>> selectAllByPage(Page page, @Param("customer") Customer customer);
+}

+ 24 - 0
src/main/java/com/jkcredit/invoice/mapper/CustomerRecMapper.java

@@ -0,0 +1,24 @@
+package com.jkcredit.invoice.mapper;
+
+import com.jkcredit.invoice.model.entity.CustomerRec;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public interface CustomerRecMapper {
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(CustomerRec record);
+
+    int insertSelective(CustomerRec record);
+
+    CustomerRec selectByPrimaryKey(Integer id);
+
+    List<CustomerRec> selectByCustomerName(String customerName);
+
+    CustomerRec selectByCustomerNameAndCompany(CustomerRec record);
+    int updateByPrimaryKeySelective(CustomerRec record);
+
+    int updateByPrimaryKey(CustomerRec record);
+}

+ 19 - 0
src/main/java/com/jkcredit/invoice/mapper/CustomerRechargeMapper.java

@@ -0,0 +1,19 @@
+package com.jkcredit.invoice.mapper;
+
+import com.jkcredit.invoice.model.entity.CustomerRecharge;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface CustomerRechargeMapper {
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(CustomerRecharge record);
+
+    int insertSelective(CustomerRecharge record);
+
+    CustomerRecharge selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(CustomerRecharge record);
+
+    int updateByPrimaryKey(CustomerRecharge record);
+}

+ 40 - 0
src/main/java/com/jkcredit/invoice/mapper/InvoiceMapper.java

@@ -0,0 +1,40 @@
+package com.jkcredit.invoice.mapper;
+
+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.Invoice;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-05-30 09:14
+ * @version: V1.0
+ **/
+public interface InvoiceMapper extends BaseMapper<Invoice> {
+
+    /**
+     * 分页查询发票列表
+     * @param page
+     * @param invoice
+     * @return
+     */
+    IPage<List<Invoice>> getInvoicesPage(Page page, @Param("query") Invoice invoice);
+
+    /**
+     * 根据税号查询发票信息
+     * @param dutyParagraph
+     * @return
+     */
+    Invoice getInvoiceByDutyParagraph(String dutyParagraph);
+
+    /**
+     * 根据用户id查询发票
+     * @param userId
+     * @return
+     */
+    List<Invoice> getByUserId(Integer userId);
+}

+ 26 - 0
src/main/java/com/jkcredit/invoice/mapper/NumInvoiceMapper.java

@@ -0,0 +1,26 @@
+package com.jkcredit.invoice.mapper;
+
+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.NumInvoice;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-06-03 17:04
+ * @version: V1.0
+ **/
+public interface NumInvoiceMapper extends BaseMapper<NumInvoice> {
+
+    /**
+     * 分页查询列表
+     * @param page
+     * @param numInvoice
+     * @return
+     */
+    IPage<List<NumInvoice>> getNumInvoicePage(Page page, @Param("query") NumInvoice numInvoice);
+}

+ 13 - 0
src/main/java/com/jkcredit/invoice/mapper/RealChargeMapper.java

@@ -0,0 +1,13 @@
+package com.jkcredit.invoice.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jkcredit.invoice.model.entity.RealCharge;
+
+/**
+ * @description:
+ * @author: xusonglin
+ * @create: 2020/5/25 9:50
+ * @version: V1.0
+ **/
+public interface RealChargeMapper extends BaseMapper<RealCharge> {
+}

+ 27 - 0
src/main/java/com/jkcredit/invoice/mapper/RechargeMapper.java

@@ -0,0 +1,27 @@
+package com.jkcredit.invoice.mapper;
+
+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.Recharge;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-05-30 10:43
+ * @version: V1.0
+ **/
+public interface RechargeMapper extends BaseMapper<Recharge> {
+
+    /**
+     * 分页查询充值记录
+     * @param page
+     * @param invoice
+     * @return
+     */
+    IPage<List<Recharge>> getRechargesPage(Page page, @Param("query") Recharge invoice);
+
+}

+ 13 - 0
src/main/java/com/jkcredit/invoice/mapper/RoleMapper.java

@@ -0,0 +1,13 @@
+package com.jkcredit.invoice.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jkcredit.invoice.model.entity.Role;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-05-29 17:20
+ * @version: V1.0
+ **/
+public interface RoleMapper extends BaseMapper<Role> {
+}

+ 13 - 0
src/main/java/com/jkcredit/invoice/mapper/SearchInvoiceDataMapper.java

@@ -0,0 +1,13 @@
+package com.jkcredit.invoice.mapper;
+
+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.SearchInvoiceData;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface SearchInvoiceDataMapper extends BaseMapper<SearchInvoiceData> {
+    IPage<List<SearchInvoiceData>> getSearchInvoiceDataPage(Page page, @Param("query") SearchInvoiceData searchInvoiceData);
+}

+ 73 - 0
src/main/java/com/jkcredit/invoice/mapper/SearchInvoiceResultMapper.java

@@ -0,0 +1,73 @@
+package com.jkcredit.invoice.mapper;
+
+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.SearchInvoiceData;
+import com.jkcredit.invoice.model.entity.SearchInvoiceResult;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface SearchInvoiceResultMapper extends BaseMapper<SearchInvoiceResult> {
+
+    /**
+     * 分页查询
+     * @param page
+     * @param searchInvoiceResult
+     * @return
+     */
+    IPage<SearchInvoiceResult> getSearchInvoiceResultPage(Page page, @Param("query") SearchInvoiceResult searchInvoiceResult,@Param("batchNumber") String batchNumber);
+
+    /**
+     * 分页查询流水
+     * @param page
+     * @param id
+     * @return
+     */
+    IPage<List<SearchInvoiceResult>> getDailyBilling(Page page,@Param("userId") Integer id);
+
+    /**
+     * 根据交易id删除
+     * @param transactionId
+     */
+    void deleteByTransactionId(String transactionId);
+
+    /**
+     * 根据用户id 运单号查询列表
+     * @param userId
+     * @param waybillNum
+     * @return
+     */
+    List<SearchInvoiceResult> getInvoiceList(Integer userId,String waybillNum,String batchNumber,Long startTime,Long endTime, String taxPlayerCode);
+
+    /**
+     * 查询统计发票数据
+     * @param searchInvoiceResult
+     * @return
+     */
+    SearchInvoiceResult statisticsData(@Param("query") SearchInvoiceResult searchInvoiceResult,@Param("batchNumber") String batchNumber);
+
+    /**
+     * 根据transactionId查发票
+     * @param transactionId
+     * @return
+     */
+    List<SearchInvoiceResult> getNumInvoiceByTransactionId(String transactionId);
+
+    /**
+     * 根据发票代码 发票号码查询发票
+     * @param invoiceNum
+     * @param invoiceCode
+     * @return
+     */
+    List<SearchInvoiceResult> getInvoiceByInvoiceNum(String invoiceNum, String invoiceCode);
+
+    /**
+     * 根据条件获取发票及下载地址列表
+     * @param searchInvoiceResult
+     * @param batchNumber
+     * @return
+     */
+    List<SearchInvoiceResult> getInvoiceUrlList(@Param("query")SearchInvoiceResult searchInvoiceResult,@Param("batchNumber") String batchNumber);
+}

+ 7 - 0
src/main/java/com/jkcredit/invoice/mapper/SearchInvoiceResultTempMapper.java

@@ -0,0 +1,7 @@
+package com.jkcredit.invoice.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jkcredit.invoice.model.entity.SearchInvoiceResultTemp;
+
+public interface SearchInvoiceResultTempMapper extends BaseMapper<SearchInvoiceResultTemp> {
+}

+ 80 - 0
src/main/java/com/jkcredit/invoice/mapper/UserMapper.java

@@ -0,0 +1,80 @@
+package com.jkcredit.invoice.mapper;
+
+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.User;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-05-28 17:47
+ * @version: V1.0
+ **/
+public interface UserMapper extends BaseMapper<User> {
+
+    /**
+     * 通过用户名查询用户信息(含有角色信息)
+     *
+     * @param userName 用户名
+     * @return User
+     */
+    User getUserByUserName(String userName);
+
+
+    /**
+     * 分页查询用户信息(含角色)
+     *
+     * @param page    分页
+     * @param user 查询参数
+     * @return list
+     */
+    IPage<List<User>> getUsersPage(Page page, @Param("query") User user);
+
+    /**
+     * 获取所有用户信息
+     * @return
+     */
+    List<User> getAllUser();
+    /**
+     * 通过ID查询用户信息
+     *
+     * @param id 用户ID
+     * @return User
+     */
+    User getUserById(Integer id);
+
+    /**
+     * 更新用户密码
+     * @param user
+     * @return
+     */
+    Boolean updatePassword(User user);
+
+
+
+    /**
+     * 更新锁定状态
+     * @param user
+     * @return
+     */
+    Boolean updateLock(User user);
+
+    /**
+     * 修改用户信息
+     * @param user
+     * @return
+     */
+    Boolean  updateUserInfo(User user);
+
+
+    /**
+     * 更新企业编号
+     * @param user
+     * @return
+     */
+    Boolean updateCompanyNumById(User user);
+}

+ 74 - 0
src/main/java/com/jkcredit/invoice/model/entity/B2bInvoiceApply.java

@@ -0,0 +1,74 @@
+package com.jkcredit.invoice.model.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.jkcredit.invoice.common.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @description: 申请开票实体
+ * @author: sunzhaoning
+ * @create: 2019-06-19 11:56
+ * @version: V1.0
+ **/
+@Data
+@ApiModel(value = "申请开票实体")
+public class B2bInvoiceApply extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = 3455083280482203836L;
+
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 企业编号
+     */
+    @ApiModelProperty(value = "企业编号")
+    private String companyNum;
+
+    /**
+     * 卡号
+     */
+    @ApiModelProperty(value = "卡号")
+    private String cardId;
+
+    /**
+     * 车牌号
+     */
+    @ApiModelProperty(value = "车牌号")
+    private String plateNum;
+
+    /**
+     *申请 ID
+     */
+    @ApiModelProperty(value = "申请 ID")
+    private String applyId;
+
+    /**
+     *发票数量
+     */
+    @ApiModelProperty(value = "发票数量")
+    private Integer invoiceCount;
+
+    /**
+     * 发票金额
+     */
+    @ApiModelProperty(value = "发票金额")
+    private Long invoiceAmount;
+
+    /**
+     * 发票税额
+     */
+    @ApiModelProperty(value = "发票税额")
+    private Long invoiceTaxAmount;
+
+    /**
+     * 接收时间
+     */
+    @ApiModelProperty(value = "接收时间")
+    private String receiveTime;
+}

+ 74 - 0
src/main/java/com/jkcredit/invoice/model/entity/B2bInvoicePackage.java

@@ -0,0 +1,74 @@
+package com.jkcredit.invoice.model.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.jkcredit.invoice.common.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-06-21 10:03
+ * @version: V1.0
+ **/
+@Data
+@ApiModel("发票打包下载实体类")
+public class B2bInvoicePackage extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = 4525265651071975642L;
+
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 企业编号
+     */
+    @ApiModelProperty(value = "企业编号")
+    private String companyNum;
+
+    /**
+     * 企业名
+     */
+    @ApiModelProperty(value = "企业名")
+    private String companyName;
+
+    /**
+     * 发票开具月
+     */
+    @ApiModelProperty(value = "发票开具月")
+    private String makeMonth;
+
+    /**
+     * 发票明细下载链接
+     */
+    @ApiModelProperty(value = "发票明细下载链接")
+    private String csvUrl;
+
+    /**
+     * 发票打包pdf下载链接
+     */
+    @ApiModelProperty(value = "发票打包pdf下载链接")
+    private String pdfUrl;
+
+    /**
+     * 明细下载状态
+     */
+    @ApiModelProperty(value = "明细下载状态")
+    private Integer csvStatus;
+
+    /**
+     * 发票pdf打包状态
+     */
+    @ApiModelProperty(value = "发票pdf打包状态")
+    private Integer pdfStatus;
+
+    /**
+     * 发票打包批次
+     */
+    @ApiModelProperty(value = "发票打包批次")
+    private Integer type;
+}

+ 167 - 0
src/main/java/com/jkcredit/invoice/model/entity/B2bInvoiceQuery.java

@@ -0,0 +1,167 @@
+package com.jkcredit.invoice.model.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.jkcredit.invoice.common.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-06-19 16:04
+ * @version: V1.0
+ **/
+@Data
+@ApiModel(value = "已开票查询实体")
+public class B2bInvoiceQuery extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -40568929592199065L;
+
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 企业编号
+     */
+    @ApiModelProperty(value = "企业编号")
+    private String companyNum;
+
+    /**
+     * 开始时间
+     */
+    @TableField(exist = false)
+    @ApiModelProperty(value = "开始时间")
+    private String startInvoiceMakeTime;
+
+    /**
+     * 结束时间
+     */
+    @TableField(exist = false)
+    @ApiModelProperty(value = "结束时间")
+    private String endInvoiceMakeTime;
+
+    /**
+     * etc卡号
+     */
+    @ApiModelProperty(value = "etc卡号")
+    private String cardId;
+
+    /**
+     * 车牌号
+     */
+    @ApiModelProperty(value = "车牌号")
+    private String plateNum;
+
+    /**
+     * 销方名称
+     */
+    @ApiModelProperty(value = "销方名称")
+    private String sellerName;
+
+    /**
+     * 销方税号
+     */
+    @ApiModelProperty(value = "销方税号")
+    private String sellerTaxpayerCode;
+
+    /**
+     * 发票号码
+     */
+    @ApiModelProperty(value = "发票号码")
+    private String invoiceNum;
+
+    /**
+     * 发票代码
+     */
+    @ApiModelProperty(value = "发票代码")
+    private String invoiceCode;
+
+    /**
+     * 发票类型
+     */
+    @ApiModelProperty(value = "发票类型")
+    private String invoiceType;
+
+    /**
+     * 发票 url
+     */
+    @ApiModelProperty(value = "发票 url")
+    private String invoiceUrl;
+
+    /**
+     * 开票时间
+     */
+    @ApiModelProperty(value = "开票时间")
+    private String invoiceMakeTime;
+
+    /**
+     * 发票板式文件 url
+     */
+    @ApiModelProperty(value = "发票板式文件url")
+    private String invoiceHtmlUrl;
+
+    /**
+     * 发票金额
+     */
+    @ApiModelProperty(value = "发票金额")
+    private Long amount;
+
+    /**
+     * 发票价税合计
+     */
+    @ApiModelProperty(value = "发票价税合计")
+    private Long totalAmount;
+
+    /**
+     * 发票税额
+     */
+    @ApiModelProperty(value = "发票税额")
+    private Long totalTaxAmount;
+
+    /**
+     * 税率
+     */
+    @ApiModelProperty(value = "税率")
+    private String taxRate;
+
+    /**
+     * 入口收费站
+     */
+    @ApiModelProperty(value = "入口收费站")
+    private String enStationName;
+
+    /**
+     * 出口收费站
+     */
+    @ApiModelProperty(value = "出口收费站")
+    private String exStationName;
+
+    /**
+     * 交易时间
+     */
+    @ApiModelProperty(value = "交易时间")
+    private String exTime;
+
+    /**
+     * 交易金额
+     */
+    @ApiModelProperty(value = "交易金额")
+    private Long fee;
+
+    /**
+     * 交易 Id
+     */
+    @ApiModelProperty(value = "交易 Id")
+    private String tradeId;
+
+    /**
+     * 车型
+     */
+    @ApiModelProperty(value = "车型")
+    private Integer vehicleType;
+}

+ 35 - 0
src/main/java/com/jkcredit/invoice/model/entity/Batch.java

@@ -0,0 +1,35 @@
+package com.jkcredit.invoice.model.entity;
+
+import com.jkcredit.invoice.common.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-05-30 11:46
+ * @version: V1.0
+ **/
+@Data
+@ApiModel(value = "批次实体")
+public class Batch extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = 4114952449282051115L;
+
+    private String id;
+
+    /**
+     * 批次号
+     */
+    @ApiModelProperty(value = "批次号")
+    private String batchNumber;
+
+    /**
+     * 类型
+     */
+    @ApiModelProperty(value = "类型")
+    private Integer type;
+}

+ 76 - 0
src/main/java/com/jkcredit/invoice/model/entity/BillEstimate.java

@@ -0,0 +1,76 @@
+package com.jkcredit.invoice.model.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @description: 运单预估
+ * @author: sunzhaoning
+ * @create: 2019-07-18 16:37
+ * @version: V1.0
+ **/
+@Data
+@ExcelTarget("BillEstimate")
+public class BillEstimate implements Serializable {
+
+    private static final long serialVersionUID = 4069610954703329530L;
+
+    /**
+     * 运单编号
+     */
+    @Excel(name = "运单编号")
+    private String num;
+
+    /**
+     * 车牌号
+     */
+    @Excel(name = "车牌号码")
+    private String plateNum;
+
+    /**
+     * 车牌颜色
+     */
+    @Excel(name = "车牌颜色")
+    private String plateColor;
+
+    /**
+     * 运单开始地址
+     */
+    @Excel(name = "运单开始地址")
+    private String sourceAddr;
+
+    /**
+     * 运单目的地址
+     */
+    @Excel(name = "运单目的地址")
+    private String destAddr;
+
+    /**
+     * 开始时间
+     */
+    @Excel(name = "运单开始时间")
+    private Date startTime;
+
+    /**
+     * 结束时间
+     */
+    @Excel(name = "运单预计完成时间")
+    private Date endTime;
+
+    /**
+      * 运单费用
+     */
+    @Excel(name = "运单费用")
+    private Double fee;
+
+    /**
+     * 税号
+     */
+    @Excel(name = "税号")
+    private String taxPlayerCode;
+}

+ 46 - 0
src/main/java/com/jkcredit/invoice/model/entity/BillEstimateResult.java

@@ -0,0 +1,46 @@
+package com.jkcredit.invoice.model.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @description: 运单预估结果
+ * @author: sunzhaoning
+ * @create: 2019-07-18 16:37
+ * @version: V1.0
+ **/
+@Data
+@ExcelTarget("BillEstimateResult")
+public class BillEstimateResult implements Serializable {
+
+    private static final long serialVersionUID = 5117145893747517818L;
+
+    private Long id;
+
+    /**
+     * 车牌号
+     */
+    @Excel(name = "车牌号")
+    private String plateNum;
+
+    /**
+     * 交易时间
+     */
+    @Excel(name = "交易时间")
+    private String exTime;
+
+    /**
+     * 税额
+     */
+    @Excel(name = "税额")
+    private Double totalTaxAmount;
+
+    /**
+     * 价税合计
+     */
+    @Excel(name = "价税合计")
+    private Double totalAmount;
+}

+ 103 - 0
src/main/java/com/jkcredit/invoice/model/entity/BillRelationEstimate.java

@@ -0,0 +1,103 @@
+package com.jkcredit.invoice.model.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @description: 运单关联预估
+ * @author: sunzhaoning
+ * @create: 2019-07-18 16:38
+ * @version: V1.0
+ **/
+@Data
+public class BillRelationEstimate implements Serializable {
+
+    private static final long serialVersionUID = -8589216617299856414L;
+
+    private Long id;
+
+    /**
+     * 运单编号
+     */
+    @Excel(name = "运单编号")
+    private String num;
+
+    /**
+     * 车牌号
+     */
+    @Excel(name = "车牌号码")
+    private String plateNum;
+
+    /**
+     * 车牌颜色
+     */
+    @Excel(name = "车牌颜色")
+    private String plateColor;
+
+    /**
+     * 运单开始地址
+     */
+    @Excel(name = "运单开始地址")
+    private String sourceAddr;
+
+    /**
+     * 运单目的地址
+     */
+    @Excel(name = "运单目的地址")
+    private String destAddr;
+
+    /**
+     * 开始时间
+     */
+    @Excel(name = "运单开始时间")
+    private String startTime;
+
+    /**
+     * 结束时间
+     */
+    @Excel(name = "运单预计完成时间")
+    private String endTime;
+
+    /**
+     * 交易时间
+     */
+    @Excel(name = "交易时间")
+    private String exTime;
+
+    /**
+     * 税额
+     */
+    @Excel(name = "税额")
+    private Double totalTaxAmount;
+
+    /**
+     * 价税合计
+     */
+    @Excel(name = "价税合计")
+    private Double totalAmount;
+
+    /**
+     * 运单费用
+     */
+    @Excel(name = "运单费用")
+    private Double fee;
+
+    /**
+     * 税号
+     */
+    @Excel(name = "税号")
+    private String taxPlayerCode;
+
+    /**
+     * 重复的条数
+     */
+    private int totalCount = 1;
+
+    /**
+     * 重复的条数的税率相加的和
+     */
+    private BigDecimal all;
+}

+ 91 - 0
src/main/java/com/jkcredit/invoice/model/entity/CarEtcCard.java

@@ -0,0 +1,91 @@
+package com.jkcredit.invoice.model.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.jkcredit.invoice.common.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-06-17 14:08
+ * @version: V1.0
+ **/
+@Data
+@ApiModel("ect卡信息表")
+public class CarEtcCard extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -1173191789389501238L;
+
+    @TableId(type = IdType.AUTO)
+    private String id;
+
+    /**
+     * 企业编号
+     */
+    @ApiModelProperty(value = "企业编号")
+    private String companyNum;
+
+    /**
+     * 绑定手机号
+     */
+    @ApiModelProperty(value = "绑定手机号")
+    private String mobile;
+
+    /**
+     * 省份
+     */
+    @ApiModelProperty(value = "省份")
+    private Integer province;
+
+    /**
+     * 卡类型
+     */
+    @ApiModelProperty(value = "卡类型")
+    private Integer cardType;
+
+    /**
+     * 车辆类型
+     */
+    @ApiModelProperty(value = "车辆类型")
+    private Integer vehicleType;
+
+    /**
+     * 车牌号
+     */
+    @ApiModelProperty(value = "车牌号")
+    private String plateNum;
+
+    /**
+     * 车牌颜色
+     */
+    @ApiModelProperty(value = "车牌颜色")
+    private Integer plateColor;
+
+    /**
+     * 卡号
+     */
+    @ApiModelProperty(value = "卡号id")
+    private String cardId;
+
+    /**
+     * ETC卡号
+     */
+    @ApiModelProperty(value = "ETC卡号")
+    private String etcCardId;
+
+    /**
+     * 绑定时间
+     */
+    @ApiModelProperty(value = "绑定时间")
+    private String bindTime;
+
+    private List<Plate> vehicleList;
+
+    private List<Card> cardList;
+}

+ 89 - 0
src/main/java/com/jkcredit/invoice/model/entity/CarFreeCarrierBillEnd.java

@@ -0,0 +1,89 @@
+package com.jkcredit.invoice.model.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.jkcredit.invoice.common.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @description: 运单结束实体
+ * @author: sunzhaoning
+ * @create: 2019-05-31 10:19
+ * @version: V1.0
+ **/
+@Data
+@ApiModel(value = "运单结束实体类")
+public class CarFreeCarrierBillEnd  extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -6567386776965435129L;
+
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 运单编号
+     */
+    @Excel(name = "运单编号")
+    @ApiModelProperty(value = "运单编号")
+    private String num;
+
+    /**
+     * 运单实际目的地址
+     */
+    @Excel(name = "运单目的地址")
+    @ApiModelProperty(value = "运单实际目的地址")
+    private String realDestAddr;
+
+    /**
+     * 运单实际结束时间
+     */
+    @Excel(name = "运单实际结束时间",format="yyyy-MM-dd HH:mm:ss",databaseFormat = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "运单实际结束时间")
+    private Date billEndTime;
+
+    /**
+     * 结束时间
+     */
+    @Excel(name = "结束时间")
+    @ApiModelProperty(value = "结束时间")
+    private String endTime;
+
+    /**
+     * 开票时长
+     */
+    @Excel(name = "开票时长")
+    @ApiModelProperty(value = "开票时长")
+    private Integer invoiceTime;
+
+    /**
+     * 是否成功
+     */
+    @ApiModelProperty(value = "是否成功")
+    private Integer isSuccess;
+
+    /**
+     * 批次号
+     */
+    @ApiModelProperty(value = "批次号")
+    private String batchNumber;
+
+    /**
+     * 批次id
+     */
+    @ApiModelProperty(value = "批次id")
+    private String batchId;
+
+    /**
+     * 是否为历史运单
+     */
+    @ApiModelProperty(value = "是否为历史运单")
+    private Integer isHistory;
+
+    private String errorMsg;
+}

+ 193 - 0
src/main/java/com/jkcredit/invoice/model/entity/CarFreeCarrierBillStart.java

@@ -0,0 +1,193 @@
+package com.jkcredit.invoice.model.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.jkcredit.invoice.common.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @description: 运单结束
+ * @author: sunzhaoning
+ * @create: 2019-05-31 09:50
+ * @version: V1.0
+ **/
+@Data
+@ApiModel(value = "运单开始实体类")
+public class CarFreeCarrierBillStart extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = 5874389369371443058L;
+
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 运单编号
+     */
+    @Excel(name = "运单编号")
+    @ApiModelProperty(value = "运单编号")
+    private String num;
+    /**
+     * 车牌号
+     */
+    @Excel(name = "车牌号码")
+    @ApiModelProperty(value = "车牌号码")
+    private String plateNumber;
+
+    /**
+     * 车牌颜色
+     */
+    @Excel(name = "车牌颜色")
+    @ApiModelProperty(value = "车牌颜色")
+    private String plateColor;
+
+    /**
+     * 运单开始时间
+     */
+    @Excel(name = "运单开始时间")
+    @ApiModelProperty(value = "运单开始时间")
+    private String startTime;
+
+    /**
+     * 运单开始地址
+     */
+    @Excel(name = "运单开始地址")
+    @ApiModelProperty(value = "运单开始地址")
+    private String sourceAddr;
+
+    /**
+     * 运单目的地址
+     */
+    @Excel(name = "运单目的地址")
+    @ApiModelProperty(value = "运单目的地址")
+    private String destAddr;
+
+    /**
+     * 运单预计完成时间
+     */
+    @Excel(name = "运单预计完成时间")
+    @ApiModelProperty(value = "运单预计完成时间")
+    private String predictEndTime;
+
+    /**
+     * 运单费用
+     */
+    @Excel(name = "运单费用")
+    @ApiModelProperty(value = "运单费用")
+    private Long fee;
+
+    /**
+     * 发票抬头类型
+     */
+    @ApiModelProperty(value = "发票抬头类型")
+    private Integer titleType;
+
+    /**
+     * 税号
+     */
+    @Excel(name = "税号")
+    @ApiModelProperty(value = "税号")
+    private String taxPlayerCode;
+
+    /**
+     * 发票抬头名称
+     */
+    @ApiModelProperty(value = "发票抬头名称")
+    private String name;
+
+    /**
+     * 单位地址
+     */
+    @ApiModelProperty(value = "单位地址")
+    private String address;
+
+    /**
+     * 电话
+     */
+    @ApiModelProperty(value = "电话")
+    private String tel;
+
+    /**
+     * 开户行
+     */
+    @ApiModelProperty(value = "开户行")
+    private String bank;
+
+    /**
+     * 开户行账号
+     */
+    @ApiModelProperty(value = "开户行账号")
+    private String bankAccount;
+
+    /**
+     * 是否成功
+     */
+    @ApiModelProperty(value = "是否成功")
+    private Integer isSuccess;
+
+    /**
+     * 批次号
+     */
+    @ApiModelProperty(value = "批次号")
+    private String batchNumber;
+
+    /**
+     * 批次id
+     */
+    @ApiModelProperty(value = "批次id")
+    private String batchId;
+
+    /**
+     * 运单状态
+     */
+    @Excel(name = "运单状态(1:未结束,2:已结束运单,3:已开发票,4:开票中)")
+    @ApiModelProperty(value = "运单状态")
+    private Integer status;
+
+    /**
+     * 是否为历史运单
+     */
+    @ApiModelProperty(value = "是否为历史运单")
+    private Integer isHistory;
+
+    /**
+     * 是否导出
+     */
+    @ApiModelProperty(value = "是否导出 1已导出,2未导出")
+    private Integer isExport;
+
+    /**
+     * 创建时间开始区间
+     */
+    private String createStartTime;
+    /**
+     * 创建时间结束区间
+     */
+    private String createEndTime;
+
+    /**
+     * 运单查询开始时间区间
+     */
+    private String billStartTime;
+    /**
+     * 运单查询结束时间区间
+     */
+    private String billEndTime;
+
+    /**
+     * 是否自动开票标记
+     */
+    private Integer autoFlag;
+
+    /**
+     * 是否遗留数据:1(不是遗留数据)2(是遗留数据)
+     */
+    @ApiModelProperty(value = "是否遗留数据:1(不是遗留数据)2(是遗留数据)")
+    private Integer isLegacyData;
+
+    private String errorMsg;
+}

+ 71 - 0
src/main/java/com/jkcredit/invoice/model/entity/CarFreeCarrierRegister.java

@@ -0,0 +1,71 @@
+package com.jkcredit.invoice.model.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.jkcredit.invoice.common.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-05-30 11:47
+ * @version: V1.0
+ **/
+@Data
+@ApiModel(value = "车辆备案")
+@ExcelTarget("carFreeCarrierRegister")
+public class CarFreeCarrierRegister extends BaseEntity implements Serializable {
+    private static final long serialVersionUID = -2043980490661881979L;
+
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 车牌号
+     */
+    @Excel(name = "车牌号码")
+    @ApiModelProperty(value = "车牌号")
+    private String plateNumber;
+
+    /**
+     * 车牌颜色
+     */
+    @Excel(name = "车牌颜色")
+    @ApiModelProperty(value = "车牌颜色")
+    private String plateColor;
+
+    /**
+     * 是否备案成功
+     */
+    @ApiModelProperty(value = "是否备案成功")
+    private Integer isSuccess;
+
+    /**
+     * 错误信息
+     */
+    @Excel(name = "备案结果")
+    @ApiModelProperty(value = "错误信息")
+    private String errorMsg;
+
+    /**
+     * 批次号
+     */
+    @ApiModelProperty(value = "批次号")
+    private String batchNumber;
+
+    /**
+     * 批次id
+     */
+    @ApiModelProperty(value = "批次id")
+    private String batchId;
+
+    private Long startTime;
+
+    private Long endTime;
+}

+ 15 - 0
src/main/java/com/jkcredit/invoice/model/entity/Card.java

@@ -0,0 +1,15 @@
+package com.jkcredit.invoice.model.entity;
+
+import lombok.Data;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-06-20 11:08
+ * @version: V1.0
+ **/
+@Data
+public class Card {
+
+    private String cardId;
+}

+ 86 - 0
src/main/java/com/jkcredit/invoice/model/entity/CardTrade.java

@@ -0,0 +1,86 @@
+package com.jkcredit.invoice.model.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.jkcredit.invoice.common.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @description: 交易信息实体
+ * @author: sunzhaoning
+ * @create: 2019-06-19 09:51
+ * @version: V1.0
+ **/
+@Data
+@ApiModel(value = "交易信息实体")
+public class CardTrade extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -8605072741219029942L;
+
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 企业编号
+     */
+    @ApiModelProperty(value = "企业编号")
+    private String companyNum;
+
+    /**
+     * 卡号
+     */
+    @ApiModelProperty(value = "卡号")
+    private String cardId;
+
+    /**
+     * 车牌号
+     */
+    @ApiModelProperty(value = "车牌号")
+    private String plateNum;
+
+    /**
+     * 状态
+     */
+    @ApiModelProperty(value = "状态")
+    private Integer tradeStatus;
+
+    /**
+     * 开始时间
+     */
+    @ApiModelProperty(value = "开始时间")
+    private String startExTime;
+
+    /**
+     * 结束时间
+     */
+    @ApiModelProperty(value = "结束时间")
+    private String endExTime;
+
+    /**
+     * 交易id
+     */
+    @ApiModelProperty(value = "交易id")
+    private String tradeId;
+
+    /**
+     * 交易时间
+     */
+    @ApiModelProperty(value = "交易时间")
+    private String exTime;
+
+    /**
+     * 交易金额
+     */
+    @ApiModelProperty(value = "交易金额")
+    private Long fee;
+
+    /**
+     * 是否成功
+     */
+    @ApiModelProperty(value = "是否请求成功")
+    private Integer isSuccess;
+}

+ 26 - 0
src/main/java/com/jkcredit/invoice/model/entity/Charge.java

@@ -0,0 +1,26 @@
+package com.jkcredit.invoice.model.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @description:
+ * @author: xusonglin
+ * @create: 2019/12/11 13:44
+ * @version: V1.0
+ **/
+@Data
+@ApiModel(value = "消息队列扣款列表")
+public class Charge {
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 用户id
+     */
+    @ApiModelProperty(value = "用户id")
+    private String userId;
+}

+ 40 - 0
src/main/java/com/jkcredit/invoice/model/entity/ConsumeQueue.java

@@ -0,0 +1,40 @@
+package com.jkcredit.invoice.model.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @description:
+ * @author: xusonglin
+ * @create: 2019/12/11 11:52
+ * @version: V1.0
+ **/
+@Data
+@ApiModel(value = "消息队列消费列表")
+public class ConsumeQueue {
+    private static final long serialVersionUID = -526324944915280489L;
+
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 用户id
+     */
+    @ApiModelProperty(value = "用户id")
+    private String userId;
+
+    /**
+     * 发票流水号
+     */
+    @ApiModelProperty(value = "用户id")
+    private String transactionId;
+
+    /**
+     * 运单号
+     */
+    @ApiModelProperty(value = "运单号")
+    private String wayBillNum;
+}

+ 125 - 0
src/main/java/com/jkcredit/invoice/model/entity/Customer.java

@@ -0,0 +1,125 @@
+package com.jkcredit.invoice.model.entity;
+
+import java.util.Date;
+
+public class Customer {
+    private int id;
+
+    private String customerName;
+
+    private String invoiceTime;
+
+    private Integer usenumAll;
+
+    private Integer usenumInterface;
+
+    private Integer usenumPlat;
+
+    private Double accountBalance =0d;
+
+    private Integer bussinessType;
+
+    private Integer integrationType;
+
+    private String firstSign;
+    //0 -正常 1-停用
+    private Integer accstatus;
+
+    private String company;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getCustomerName() {
+        return customerName;
+    }
+
+    public void setCustomerName(String customerName) {
+        this.customerName = customerName == null ? null : customerName.trim();
+    }
+
+    public String getInvoiceTime() {
+        return invoiceTime;
+    }
+
+    public void setInvoiceTime(String invoiceTime) {
+        this.invoiceTime = invoiceTime;
+    }
+
+    public Integer getUsenumAll() {
+        return usenumAll;
+    }
+
+    public void setUsenumAll(Integer usenumAll) {
+        this.usenumAll = usenumAll;
+    }
+
+    public Integer getUsenumInterface() {
+        return usenumInterface;
+    }
+
+    public void setUsenumInterface(Integer usenumInterface) {
+        this.usenumInterface = usenumInterface;
+    }
+
+    public Integer getUsenumPlat() {
+        return usenumPlat;
+    }
+
+    public void setUsenumPlat(Integer usenumPlat) {
+        this.usenumPlat = usenumPlat;
+    }
+
+    public Double getAccountBalance() {
+        return accountBalance;
+    }
+
+    public void setAccountBalance(Double accountBalance) {
+        this.accountBalance = accountBalance;
+    }
+
+    public Integer getBussinessType() {
+        return bussinessType;
+    }
+
+    public void setBussinessType(Integer bussinessType) {
+        this.bussinessType = bussinessType;
+    }
+
+    public Integer getIntegrationType() {
+        return integrationType;
+    }
+
+    public void setIntegrationType(Integer integrationType) {
+        this.integrationType = integrationType;
+    }
+
+    public String getFirstSign() {
+        return firstSign;
+    }
+
+    public void setFirstSign(String firstSign) {
+        this.firstSign = firstSign == null ? null : firstSign.trim();
+    }
+
+    public Integer getAccstatus() {
+        return accstatus;
+    }
+
+    public void setAccstatus(Integer accstatus) {
+        this.accstatus = accstatus;
+    }
+
+    public String getCompany() {
+        return company;
+    }
+
+    public void setCompany(String company) {
+        this.company = company == null ? null : company.trim();
+    }
+}

+ 114 - 0
src/main/java/com/jkcredit/invoice/model/entity/CustomerCarRec.java

@@ -0,0 +1,114 @@
+package com.jkcredit.invoice.model.entity;
+public class CustomerCarRec {
+    private String customerName;
+
+    private String companyName;
+    //0 -自有车 1 -外协车 2 -无车
+    private String businessType;
+
+    private String carNum;
+
+    private String carColor;
+
+    private String custPhone;
+
+    private String etcNum;
+
+    private String succTime;
+
+    private String failTime;
+    /**
+     * 0-备案失败 1-备案成功
+     */
+    private Integer recStatus;
+
+    private String failReason;
+
+    public String getCustomerName() {
+        return customerName;
+    }
+
+    public void setCustomerName(String customerName) {
+        this.customerName = customerName == null ? null : customerName.trim();
+    }
+
+    public String getCompanyName() {
+        return companyName;
+    }
+
+    public void setCompanyName(String companyName) {
+        this.companyName = companyName == null ? null : companyName.trim();
+    }
+
+    public String getCarNum() {
+        return carNum;
+    }
+
+    public void setCarNum(String carNum) {
+        this.carNum = carNum == null ? null : carNum.trim();
+    }
+
+    public String getCarColor() {
+        return carColor;
+    }
+
+    public void setCarColor(String carColor) {
+        this.carColor = carColor == null ? null : carColor.trim();
+    }
+
+    public String getCustPhone() {
+        return custPhone;
+    }
+
+    public void setCustPhone(String custPhone) {
+        this.custPhone = custPhone == null ? null : custPhone.trim();
+    }
+
+    public String getEtcNum() {
+        return etcNum;
+    }
+
+    public void setEtcNum(String etcNum) {
+        this.etcNum = etcNum == null ? null : etcNum.trim();
+    }
+
+    public String getSuccTime() {
+        return succTime;
+    }
+
+    public void setSuccTime(String succTime) {
+        this.succTime = succTime;
+    }
+
+    public String getFailTime() {
+        return failTime;
+    }
+
+    public void setFailTime(String failTime) {
+        this.failTime = failTime;
+    }
+
+    public Integer getRecStatus() {
+        return recStatus;
+    }
+
+    public void setRecStatus(Integer recStatus) {
+        this.recStatus = recStatus;
+    }
+
+    public String getBusinessType() {
+        return businessType;
+    }
+
+    public void setBusinessType(String businessType) {
+        this.businessType = businessType;
+    }
+
+    public String getFailReason() {
+        return failReason;
+    }
+
+    public void setFailReason(String failReason) {
+        this.failReason = failReason == null ? null : failReason.trim();
+    }
+}

+ 158 - 0
src/main/java/com/jkcredit/invoice/model/entity/CustomerRec.java

@@ -0,0 +1,158 @@
+package com.jkcredit.invoice.model.entity;
+
+import java.util.Date;
+
+public class CustomerRec {
+    private Integer id;
+
+    public String customerName;
+
+    private String companyLeader;
+
+    private String companyLeaderPhone;
+
+    private String companyName;
+
+    private String companyReferencenum;
+
+    private String companyOpenbank;
+
+    private String companyOpenbankAcc;
+
+    private String companyAdress;
+
+    private String companyPhone;
+
+    private String createtime;
+
+    private String companyBelongName;
+
+    private Integer recStatus;
+
+    private Integer interType; //0-接口 1-平台
+
+    /**
+     * 业务类型 0 -自有车 1-外协车 2-无车
+     */
+    private String bussinessType;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getCompanyLeader() {
+        return companyLeader;
+    }
+
+    public void setCompanyLeader(String companyLeader) {
+        this.companyLeader = companyLeader == null ? null : companyLeader.trim();
+    }
+
+    public String getCompanyLeaderPhone() {
+        return companyLeaderPhone;
+    }
+
+    public void setCompanyLeaderPhone(String companyLeaderPhone) {
+        this.companyLeaderPhone = companyLeaderPhone == null ? null : companyLeaderPhone.trim();
+    }
+
+    public String getCompanyName() {
+        return companyName;
+    }
+
+    public void setCompanyName(String companyName) {
+        this.companyName = companyName == null ? null : companyName.trim();
+    }
+
+    public String getCompanyReferencenum() {
+        return companyReferencenum;
+    }
+
+    public void setCompanyReferencenum(String companyReferencenum) {
+        this.companyReferencenum = companyReferencenum == null ? null : companyReferencenum.trim();
+    }
+
+    public String getCompanyOpenbank() {
+        return companyOpenbank;
+    }
+
+    public void setCompanyOpenbank(String companyOpenbank) {
+        this.companyOpenbank = companyOpenbank == null ? null : companyOpenbank.trim();
+    }
+
+    public String getCompanyOpenbankAcc() {
+        return companyOpenbankAcc;
+    }
+
+    public void setCompanyOpenbankAcc(String companyOpenbankAcc) {
+        this.companyOpenbankAcc = companyOpenbankAcc == null ? null : companyOpenbankAcc.trim();
+    }
+
+    public String getCompanyAdress() {
+        return companyAdress;
+    }
+
+    public void setCompanyAdress(String companyAdress) {
+        this.companyAdress = companyAdress == null ? null : companyAdress.trim();
+    }
+
+    public String getCompanyPhone() {
+        return companyPhone;
+    }
+
+    public void setCompanyPhone(String companyPhone) {
+        this.companyPhone = companyPhone == null ? null : companyPhone.trim();
+    }
+
+    public String getCreatetime() {
+        return createtime;
+    }
+
+    public void setCreatetime(String createtime) {
+        this.createtime = createtime;
+    }
+
+    public String getCompanyBelongName() {
+        return companyBelongName;
+    }
+
+    public void setCompanyBelongName(String companyBelongName) {
+        this.companyBelongName = companyBelongName == null ? null : companyBelongName.trim();
+    }
+
+    public Integer getRecStatus() {
+        return recStatus;
+    }
+
+    public void setRecStatus(Integer recStatus) {
+        this.recStatus = recStatus;
+    }
+
+    public String getCustomerName() {
+        return customerName;
+    }
+
+    public void setCustomerName(String customerName) {
+        this.customerName = customerName;
+    }
+
+    public Integer getInterType() {
+        return interType;
+    }
+
+    public void setInterType(Integer interType) {
+        this.interType = interType;
+    }
+
+    public String getBussinessType() {
+        return bussinessType;
+    }
+
+    public void setBussinessType(String bussinessType) {
+        this.bussinessType = bussinessType;
+    }
+}

+ 45 - 0
src/main/java/com/jkcredit/invoice/model/entity/CustomerRecharge.java

@@ -0,0 +1,45 @@
+package com.jkcredit.invoice.model.entity;
+
+import java.util.Date;
+
+public class CustomerRecharge {
+    private Integer id;
+
+    private String customerName;
+
+    private Double rechargeMony;
+
+    private String rechargeTime;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getCustomerName() {
+        return customerName;
+    }
+
+    public void setCustomerName(String customerName) {
+        this.customerName = customerName == null ? null : customerName.trim();
+    }
+
+    public Double getRechargeMony() {
+        return rechargeMony;
+    }
+
+    public void setRechargeMony(Double rechargeMony) {
+        this.rechargeMony = rechargeMony;
+    }
+
+    public String getRechargeTime() {
+        return rechargeTime;
+    }
+
+    public void setRechargeTime(String rechargeTime) {
+        this.rechargeTime = rechargeTime;
+    }
+}

+ 83 - 0
src/main/java/com/jkcredit/invoice/model/entity/Invoice.java

@@ -0,0 +1,83 @@
+package com.jkcredit.invoice.model.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.jkcredit.invoice.common.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @description: 发票实体
+ * @author: sunzhaoning
+ * @create: 2019-05-30 08:55
+ * @version: V1.0
+ **/
+@Data
+@ApiModel(value = "发票实体")
+public class Invoice extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = 2287864395092918879L;
+
+    /**
+     * 标识id
+     */
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 发票抬头
+     */
+    @ApiModelProperty(value = "发票抬头")
+    private String company;
+
+    /**
+     * 税号
+     */
+    @ApiModelProperty(value = "税号")
+    private String dutyParagraph;
+
+    /**
+     * 银行账号
+     */
+    @ApiModelProperty(value = "银行账号")
+    private String bankNumber;
+
+    /**
+     * 开户行
+     */
+    @ApiModelProperty(value = "开户行")
+    private String bankAddress;
+
+    /**
+     * 公司地址
+     */
+    @ApiModelProperty(value = "公司地址")
+    private String address;
+
+    /**
+     * 经营范围
+     */
+    @ApiModelProperty(value = "经营范围")
+    private String operatingRangeType;
+
+    /**
+     * 购方电话
+     */
+    @ApiModelProperty(value = "购方电话")
+    private String buyerTel;
+
+    /**
+     * 联系人
+     */
+    @ApiModelProperty(value = "联系人")
+    private String contact;
+
+    /**
+     * 联系人电话
+     */
+    @ApiModelProperty(value = "联系人电话")
+    private String contactTel;
+}

+ 44 - 0
src/main/java/com/jkcredit/invoice/model/entity/NumInvoice.java

@@ -0,0 +1,44 @@
+package com.jkcredit.invoice.model.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.jkcredit.invoice.common.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-06-03 08:57
+ * @version: V1.0
+ **/
+@Data
+public class NumInvoice extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = 1077775202676468049L;
+
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    @Excel(name = "运单编号")
+    @ApiModelProperty(value = "运单号")
+    private String num;
+
+    @ApiModelProperty(value = "是否请求成功")
+    private Integer isSuccess;
+
+    /**
+     * 批次号
+     */
+    @ApiModelProperty(value = "批次号")
+    private String batchNumber;
+
+    /**
+     * 批次id
+     */
+    @ApiModelProperty(value = "批次id")
+    private String batchId;
+}

+ 17 - 0
src/main/java/com/jkcredit/invoice/model/entity/Plate.java

@@ -0,0 +1,17 @@
+package com.jkcredit.invoice.model.entity;
+
+import lombok.Data;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-06-20 10:08
+ * @version: V1.0
+ **/
+@Data
+public class Plate {
+
+    private String plateNum;
+
+    private Integer plateColor;
+}

+ 36 - 0
src/main/java/com/jkcredit/invoice/model/entity/RealCharge.java

@@ -0,0 +1,36 @@
+package com.jkcredit.invoice.model.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.ToString;
+
+import java.io.Serializable;
+
+/**
+ * @description:
+ * @author: xusonglin
+ * @create: 2020/5/25 9:39
+ * @version: V1.0
+ **/
+@Data
+@ToString
+@ApiModel(value = "实际计费记录")
+public class RealCharge implements Serializable {
+
+    private static final long serialVersionUID = -315611646175785315L;
+
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    private Integer userId;
+
+    private String num;
+
+    private Long price;
+
+    private String transactionId;
+
+    private Long createTime;
+}

+ 39 - 0
src/main/java/com/jkcredit/invoice/model/entity/Recharge.java

@@ -0,0 +1,39 @@
+package com.jkcredit.invoice.model.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.jkcredit.invoice.common.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-05-30 10:39
+ * @version: V1.0
+ **/
+@Data
+@ApiModel(value = "充值记录实体")
+public class Recharge extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -2368035888962889457L;
+
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 充值余额
+     */
+    @ApiModelProperty(value = "充值前余额")
+    private Long beforeMoney;
+
+    /**
+     * 充值金额
+     */
+    @ApiModelProperty(value = "充值金额")
+    private Long money;
+
+}

+ 28 - 0
src/main/java/com/jkcredit/invoice/model/entity/Role.java

@@ -0,0 +1,28 @@
+package com.jkcredit.invoice.model.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-05-29 17:18
+ * @version: V1.0
+ **/
+@Data
+@ApiModel(value = "角色实体")
+public class Role implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private Integer id;
+
+    /**
+     * 角色名称
+     */
+    @ApiModelProperty(value = "角色名称")
+    private String roleName;
+}

+ 100 - 0
src/main/java/com/jkcredit/invoice/model/entity/SearchInvoiceData.java

@@ -0,0 +1,100 @@
+package com.jkcredit.invoice.model.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.jkcredit.invoice.common.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class SearchInvoiceData extends BaseEntity implements Serializable {
+    private static final long serialVersionUID = 2287864395092918879L;
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    @ApiModelProperty(value = "发票号码")
+    private String invoiceNum;
+
+    @ApiModelProperty(value = "发票代码")
+    private String invoiceCode;
+
+    @ApiModelProperty(value = "开票时间")
+    private String invoiceMakeTime;
+
+    @ApiModelProperty(value = "发票url")
+    private String invoiceUrl;
+
+    @ApiModelProperty(value = "发票模板url")
+    private String invoiceHtmlUrl;
+
+    @ApiModelProperty(value = "入口收费站")
+    private String enStation;
+
+    @ApiModelProperty(value = "出口收费站")
+    private String exStation;
+
+    @ApiModelProperty(value = "交易时间")
+    private String exTime;
+
+    @ApiModelProperty(value = "交易金额")
+    private int fee;
+
+    @ApiModelProperty(value = "税额")
+    private int totalTaxAmount;
+
+    @ApiModelProperty(value = "车牌号")
+    private String plateNum;
+
+    @ApiModelProperty(value = "车型")
+    private int vehicleType;
+
+    @ApiModelProperty(value = "运单编号")
+    private String waybillNum;
+
+    @ApiModelProperty(value = "运单状态")
+    private int waybillStatus;
+
+    @ApiModelProperty(value = "运单开始时间")
+    private String waybillStartTime;
+
+    @ApiModelProperty(value = "运单结束时间")
+    private String waybillEndTime;
+
+    @ApiModelProperty(value = "价税合计")
+    private int totalAmount;
+
+    @ApiModelProperty(value = "税率")
+    private double taxRate;
+
+    @ApiModelProperty(value = "发票种类")
+    private String invoiceType;
+
+    @ApiModelProperty(value = "金额")
+    private int amount;
+
+    @ApiModelProperty(value = "销方名称")
+    private String sellerName;
+
+    @ApiModelProperty(value = "销方税号")
+    private String sellerTaxpayerCode;
+
+    @ApiModelProperty(value = "交易id")
+    private String transactionId;
+
+    @ApiModelProperty(value = "id")
+    private Integer numInvoiceId;
+
+    @ApiModelProperty(value = "运单号")
+    private String num;
+
+    @ApiModelProperty(value = "是否请求成功")
+    private Integer isSuccess;
+
+    @ApiModelProperty(value = "批次号")
+    private String batchNumber;
+
+    @ApiModelProperty(value = "批次id")
+    private String batchId;
+}

+ 47 - 0
src/main/java/com/jkcredit/invoice/model/entity/SearchInvoiceMsg.java

@@ -0,0 +1,47 @@
+package com.jkcredit.invoice.model.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.jkcredit.invoice.common.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+@ApiModel(value = "运单号查询发票数据")
+public class SearchInvoiceMsg extends BaseEntity implements Serializable {
+    private static final long serialVersionUID = 2287864395092918879L;
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    @ApiModelProperty(value = "信息")
+    private String info;
+
+    @ApiModelProperty(value = "接收时间")
+    private String receiveTime;
+
+    @ApiModelProperty(value = "数据列表")
+    private List<SearchInvoiceResult> result;
+
+    @ApiModelProperty(value = "车牌")
+    private String plateNum;
+
+    @ApiModelProperty(value = "车型")
+    private int vehicleType;
+
+    @ApiModelProperty(value = "运单编号")
+    private String waybillNum;
+
+    @ApiModelProperty(value = "运单状态")
+    private int waybillStatus;
+
+    @ApiModelProperty(value = "运单开始时间")
+    private String waybillStartTime;
+
+    @ApiModelProperty(value = "运单结束时间")
+    private String waybillEndTime;
+
+}

+ 116 - 0
src/main/java/com/jkcredit/invoice/model/entity/SearchInvoiceResult.java

@@ -0,0 +1,116 @@
+package com.jkcredit.invoice.model.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.jkcredit.invoice.common.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+@ApiModel(value = "运单号查询发票数据")
+public class SearchInvoiceResult extends BaseEntity implements Serializable {
+    private static final long serialVersionUID = 2287864395092918879L;
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    @Excel(name = "发票号码")
+    @ApiModelProperty(value = "发票号码")
+    private String invoiceNum;
+
+    @Excel(name = "发票代码")
+    @ApiModelProperty(value = "发票代码")
+    private String invoiceCode;
+
+    @Excel(name = "开票时间")
+    @ApiModelProperty(value = "开票时间")
+    private String invoiceMakeTime;
+
+    @Excel(name = "下载地址")
+    @ApiModelProperty(value = "发票url")
+    private String invoiceUrl;
+
+    @ApiModelProperty(value = "发票模板url")
+    private String invoiceHtmlUrl;
+
+    @Excel(name = "入口收费站")
+    @ApiModelProperty(value = "入口收费站")
+    private String enStation;
+
+    @Excel(name = "出口收费站")
+    @ApiModelProperty(value = "出口收费站")
+    private String exStation;
+
+    @Excel(name = "交易时间")
+    @ApiModelProperty(value = "交易时间")
+    private String exTime;
+
+    @Excel(name = "交易金额")
+    @ApiModelProperty(value = "交易金额")
+    private Long fee;
+
+    @Excel(name = "税额")
+    @ApiModelProperty(value = "税额")
+    private Long totalTaxAmount;
+
+    @Excel(name = "车牌号")
+    @ApiModelProperty(value = "车牌号")
+    private String plateNum;
+
+    @Excel(name = "车型")
+    @ApiModelProperty(value = "车型")
+    private int vehicleType;
+
+    @Excel(name = "运单编号")
+    @ApiModelProperty(value = "运单编号")
+    private String waybillNum;
+
+    @Excel(name = "运单状态")
+    @ApiModelProperty(value = "运单状态")
+    private int waybillStatus;
+
+    @Excel(name = "运单开始时间")
+    @ApiModelProperty(value = "运单开始时间")
+    private String waybillStartTime;
+
+    @Excel(name = "运单结束时间")
+    @ApiModelProperty(value = "运单结束时间")
+    private String waybillEndTime;
+
+    @Excel(name = "价税合计")
+    @ApiModelProperty(value = "价税合计")
+    private Long totalAmount;
+
+    @Excel(name = "税率")
+    @ApiModelProperty(value = "税率")
+    private double taxRate;
+
+    @Excel(name = "发票种类")
+    @ApiModelProperty(value = "发票种类")
+    private String invoiceType;
+
+    @Excel(name = "金额")
+    @ApiModelProperty(value = "金额")
+    private Long amount;
+
+    @Excel(name = "销方名称")
+    @ApiModelProperty(value = "销方名称")
+    private String sellerName;
+
+    @Excel(name = "销方税号")
+    @ApiModelProperty(value = "销方税号")
+    private String sellerTaxpayerCode;
+
+    @Excel(name = "交易id")
+    @ApiModelProperty(value = "交易id")
+    private String transactionId;
+
+    private Long startTime;
+
+    private Long endTime;
+
+    private String taxPlayerCode;
+}

+ 116 - 0
src/main/java/com/jkcredit/invoice/model/entity/SearchInvoiceResultTemp.java

@@ -0,0 +1,116 @@
+package com.jkcredit.invoice.model.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.jkcredit.invoice.common.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+@ApiModel(value = "运单号查询发票数据")
+public class SearchInvoiceResultTemp extends BaseEntity implements Serializable {
+    private static final long serialVersionUID = 2287864395092918879L;
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    @Excel(name = "发票号码")
+    @ApiModelProperty(value = "发票号码")
+    private String invoiceNum;
+
+    @Excel(name = "发票代码")
+    @ApiModelProperty(value = "发票代码")
+    private String invoiceCode;
+
+    @Excel(name = "开票时间")
+    @ApiModelProperty(value = "开票时间")
+    private String invoiceMakeTime;
+
+    @Excel(name = "下载地址")
+    @ApiModelProperty(value = "发票url")
+    private String invoiceUrl;
+
+    @ApiModelProperty(value = "发票模板url")
+    private String invoiceHtmlUrl;
+
+    @Excel(name = "入口收费站")
+    @ApiModelProperty(value = "入口收费站")
+    private String enStation;
+
+    @Excel(name = "出口收费站")
+    @ApiModelProperty(value = "出口收费站")
+    private String exStation;
+
+    @Excel(name = "交易时间")
+    @ApiModelProperty(value = "交易时间")
+    private String exTime;
+
+    @Excel(name = "交易金额")
+    @ApiModelProperty(value = "交易金额")
+    private Long fee;
+
+    @Excel(name = "税额")
+    @ApiModelProperty(value = "税额")
+    private Long totalTaxAmount;
+
+    @Excel(name = "车牌号")
+    @ApiModelProperty(value = "车牌号")
+    private String plateNum;
+
+    @Excel(name = "车型")
+    @ApiModelProperty(value = "车型")
+    private int vehicleType;
+
+    @Excel(name = "运单编号")
+    @ApiModelProperty(value = "运单编号")
+    private String waybillNum;
+
+    @Excel(name = "运单状态")
+    @ApiModelProperty(value = "运单状态")
+    private int waybillStatus;
+
+    @Excel(name = "运单开始时间")
+    @ApiModelProperty(value = "运单开始时间")
+    private String waybillStartTime;
+
+    @Excel(name = "运单结束时间")
+    @ApiModelProperty(value = "运单结束时间")
+    private String waybillEndTime;
+
+    @Excel(name = "价税合计")
+    @ApiModelProperty(value = "价税合计")
+    private Long totalAmount;
+
+    @Excel(name = "税率")
+    @ApiModelProperty(value = "税率")
+    private double taxRate;
+
+    @Excel(name = "发票种类")
+    @ApiModelProperty(value = "发票种类")
+    private String invoiceType;
+
+    @Excel(name = "金额")
+    @ApiModelProperty(value = "金额")
+    private Long amount;
+
+    @Excel(name = "销方名称")
+    @ApiModelProperty(value = "销方名称")
+    private String sellerName;
+
+    @Excel(name = "销方税号")
+    @ApiModelProperty(value = "销方税号")
+    private String sellerTaxpayerCode;
+
+    @Excel(name = "交易id")
+    @ApiModelProperty(value = "交易id")
+    private String transactionId;
+
+    private Long startTime;
+
+    private Long endTime;
+
+    private String taxPlayerCode;
+}

+ 87 - 0
src/main/java/com/jkcredit/invoice/model/entity/User.java

@@ -0,0 +1,87 @@
+package com.jkcredit.invoice.model.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.io.Serializable;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-05-28 17:44
+ * @version: V1.0
+ **/
+@Data
+@ApiModel(value = "用户实体")
+public class User implements Serializable {
+
+    private static final long serialVersionUID = -526324944915280489L;
+
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 用户名
+     */
+    @ApiModelProperty(value = "用户名")
+    private String userName;
+
+    /**
+     * 密码
+     */
+    @ApiModelProperty(value = "密码")
+    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
+    private String password;
+
+    /**
+     * 姓名
+     */
+    @ApiModelProperty(value = "姓名")
+    private String name;
+
+    /**
+     * 手机号
+     */
+    @ApiModelProperty(value = "手机号")
+    private String phone;
+
+    /**
+     * 行云返回的企业编号
+     */
+    @ApiModelProperty(value = "企业编号")
+    private String companyNum;
+    /**
+     * 企业名称
+     */
+    @ApiModelProperty(value = "企业名称")
+    private String company;
+
+    /**
+     * 角色id
+     */
+    @ApiModelProperty(value = "角色id")
+    private String roleId;
+
+    /**
+     * 角色名称
+     */
+    @ApiModelProperty(value = "角色名称")
+    private String roleName;
+
+
+
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty(value = "创建时间")
+    private Long createTime;
+
+    /**
+     * 锁定状态 0正常 1锁定,2停用
+     */
+    @ApiModelProperty(value = "锁定状态")
+    private Integer isLock;
+}

+ 20 - 0
src/main/java/com/jkcredit/invoice/model/entity/WayBillTest.java

@@ -0,0 +1,20 @@
+package com.jkcredit.invoice.model.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
+import lombok.Data;
+
+/**
+ * @description:
+ * @author: xusonglin
+ * @create: 2019/12/13 16:43
+ * @version: V1.0
+ **/
+@Data
+@ExcelTarget("WayBillTest")
+public class WayBillTest {
+    @Excel(name = "num")
+    private String num;
+    @Excel(name = "wayBillNum")
+    private String wayBillNum;
+}

+ 131 - 0
src/main/java/com/jkcredit/invoice/model/vo/CarFreeCarrierBillVo.java

@@ -0,0 +1,131 @@
+package com.jkcredit.invoice.model.vo;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-05-31 10:24
+ * @version: V1.0
+ **/
+@Data
+public class CarFreeCarrierBillVo implements Serializable {
+
+    private static final long serialVersionUID = 4158547178363230855L;
+    /**
+     * 运单编号
+     */
+    @Excel(name = "运单编号")
+    @NotNull
+    @ApiModelProperty(value = "运单编号")
+    private String num;
+    /**
+     * 车牌号
+     */
+    @Excel(name = "车牌号码")
+    @ApiModelProperty(value = "车牌号码")
+    private String plateNumber;
+
+    /**
+     * 车牌颜色
+     */
+    @Excel(name = "车牌颜色")
+    @ApiModelProperty(value = "车牌颜色")
+    private String plateColor;
+
+    /**
+     * 运单开始时间
+     */
+    @Excel(name = "运单开始时间",format="yyyy-MM-dd HH:mm:ss",databaseFormat = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "运单开始时间")
+    private Date startTime;
+
+    /**
+     * 运单开始地址
+     */
+    @Excel(name = "运单开始地址")
+    @ApiModelProperty(value = "运单开始地址")
+    private String sourceAddr;
+
+    /**
+     * 运单目的地址
+     */
+    @Excel(name = "运单目的地址")
+    @ApiModelProperty(value = "运单目的地址")
+    private String destAddr;
+
+    /**
+     * 运单预计完成时间
+     */
+    @Excel(name = "运单预计完成时间",format="yyyy-MM-dd HH:mm:ss",databaseFormat = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "运单预计完成时间")
+    private Date endTime;
+
+    /**
+     * 运单费用
+     */
+    @Excel(name = "运单费用")
+    @ApiModelProperty(value = "运单费用")
+    private BigDecimal fee;
+
+    /**
+     * 发票抬头类型
+     */
+    @ApiModelProperty(value = "发票抬头类型")
+    private Integer titleType;
+
+    /**
+     * 税号
+     */
+    @Excel(name = "税号")
+    @ApiModelProperty(value = "税号")
+    private String taxPlayerCode;
+
+    /**
+     * 发票抬头名称
+     */
+    @ApiModelProperty(value = "发票抬头名称")
+    private String name;
+
+    /**
+     * 单位地址
+     */
+    @ApiModelProperty(value = "单位地址")
+    private String address;
+
+    /**
+     * 电话
+     */
+    @ApiModelProperty(value = "电话")
+    private String tel;
+
+    /**
+     * 开户行
+     */
+    @ApiModelProperty(value = "开户行")
+    private String bank;
+
+    /**
+     * 开户行账号
+     */
+    @ApiModelProperty(value = "开户行账号")
+    private String bankAccount;
+
+    /**
+     * 开票时长
+     */
+    @ApiModelProperty(value = "开票时长")
+    private Integer invoiceTime;
+
+    /**
+     * 是否自动开票标记
+     */
+    private Integer autoFlag;
+}

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

@@ -0,0 +1,116 @@
+package com.jkcredit.invoice.model.vo;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.jkcredit.invoice.common.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @description:
+ * @author: sunzhaoning
+ * @create: 2019-07-22 15:05
+ * @version: V1.0
+ **/
+@Data
+public class SearchInvoiceResultVo extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -6252880474223288690L;
+
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    @Excel(name = "发票号码")
+    @ApiModelProperty(value = "发票号码")
+    private String invoiceNum;
+
+    @Excel(name = "发票代码")
+    @ApiModelProperty(value = "发票代码")
+    private String invoiceCode;
+
+    @Excel(name = "开票时间")
+    @ApiModelProperty(value = "开票时间")
+    private String invoiceMakeTime;
+
+    @Excel(name = "下载地址")
+    @ApiModelProperty(value = "发票url")
+    private String invoiceUrl;
+
+    @ApiModelProperty(value = "发票模板url")
+    private String invoiceHtmlUrl;
+
+    @Excel(name = "入口收费站")
+    @ApiModelProperty(value = "入口收费站")
+    private String enStation;
+
+    @Excel(name = "出口收费站")
+    @ApiModelProperty(value = "出口收费站")
+    private String exStation;
+
+    @Excel(name = "交易时间")
+    @ApiModelProperty(value = "交易时间")
+    private String exTime;
+
+    @Excel(name = "交易金额")
+    @ApiModelProperty(value = "交易金额")
+    private BigDecimal fee;
+
+    @Excel(name = "税额")
+    @ApiModelProperty(value = "税额")
+    private BigDecimal totalTaxAmount;
+
+    @Excel(name = "车牌号")
+    @ApiModelProperty(value = "车牌号")
+    private String plateNum;
+
+//    @Excel(name = "车型")
+    @ApiModelProperty(value = "车型")
+    private int vehicleType;
+
+    @Excel(name = "运单编号")
+    @ApiModelProperty(value = "运单编号")
+    private String waybillNum;
+
+//    @Excel(name = "运单状态")
+    @ApiModelProperty(value = "运单状态")
+    private int waybillStatus;
+
+    @Excel(name = "运单开始时间")
+    @ApiModelProperty(value = "运单开始时间")
+    private String waybillStartTime;
+
+    @Excel(name = "运单结束时间")
+    @ApiModelProperty(value = "运单结束时间")
+    private String waybillEndTime;
+
+    @Excel(name = "价税合计")
+    @ApiModelProperty(value = "价税合计")
+    private BigDecimal totalAmount;
+
+    @Excel(name = "税率")
+    @ApiModelProperty(value = "税率")
+    private double taxRate;
+
+    @ApiModelProperty(value = "发票种类")
+    private String invoiceType;
+
+    @Excel(name = "金额")
+    @ApiModelProperty(value = "金额")
+    private BigDecimal amount;
+
+    @Excel(name = "销方名称")
+    @ApiModelProperty(value = "销方名称")
+    private String sellerName;
+
+    @Excel(name = "销方税号")
+    @ApiModelProperty(value = "销方税号")
+    private String sellerTaxpayerCode;
+
+    @Excel(name = "交易id")
+    @ApiModelProperty(value = "交易id")
+    private String transactionId;
+}

+ 0 - 0
src/main/java/com/jkcredit/invoice/producer/B2bChargeProducer.java


Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff