Browse Source

增加dbfind,基础资料api接口

will.chen 7 years ago
parent
commit
91308a5806
35 changed files with 1632 additions and 1 deletions
  1. 35 0
      applications/common-dto/src/main/java/com/usoftchina/saas/common/dto/DocReqDTO.java
  2. 31 0
      applications/document/document-api/pom.xml
  3. 23 0
      applications/document/document-api/src/main/java/com/usoftchina/saas/document/api/ProductApi.java
  4. 22 0
      applications/document/document-api/src/main/java/com/usoftchina/saas/document/api/VendorApi.java
  5. 44 0
      applications/document/document-api/src/main/resources/application.yml
  6. 15 0
      applications/document/document-api/src/main/resources/banner.txt
  7. 64 0
      applications/document/document-api/src/main/resources/logback-spring.xml
  8. 23 0
      applications/document/document-dto/pom.xml
  9. 61 0
      applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/ProductDTO.java
  10. 61 0
      applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/VendorDTO.java
  11. 87 0
      applications/document/document-server/pom.xml
  12. 22 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/DocumentApplication.java
  13. 29 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductController.java
  14. 35 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/VendorController.java
  15. 14 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductMapper.java
  16. 14 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/VendorMapper.java
  17. 274 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/po/Product.java
  18. 291 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/po/Vendor.java
  19. 38 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/Impl/ProductServiceImpl.java
  20. 41 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/Impl/VendorServiceImpl.java
  21. 14 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductService.java
  22. 15 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/VendorService.java
  23. 47 0
      applications/document/document-server/src/main/resources/application.yml
  24. BIN
      applications/document/document-server/src/main/resources/auth/pub.key
  25. 15 0
      applications/document/document-server/src/main/resources/banner.txt
  26. 42 0
      applications/document/document-server/src/main/resources/config/application-dev.yml
  27. 7 0
      applications/document/document-server/src/main/resources/config/application-docker.yml
  28. 64 0
      applications/document/document-server/src/main/resources/logback-spring.xml
  29. 48 0
      applications/document/document-server/src/main/resources/mapper/ProductMapper.xml
  30. 41 0
      applications/document/document-server/src/main/resources/mapper/VendorMapper.xml
  31. 32 0
      applications/document/document-server/src/test/java/com/usoftchina/saas/document/service/VendorServiceTest.java
  32. 6 1
      applications/document/pom.xml
  33. 5 0
      applications/purchase/purchase-server/pom.xml
  34. 36 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/config/WebMvcConfig.java
  35. 36 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/ComponentController.java

+ 35 - 0
applications/common-dto/src/main/java/com/usoftchina/saas/common/dto/DocReqDTO.java

@@ -0,0 +1,35 @@
+package com.usoftchina.saas.common.dto;
+
+
+/**
+ * @author chenwei
+ * @date   2018/10/15
+ */
+public class DocReqDTO {
+
+    /**
+     * where 条件
+     */
+    private String condition;
+
+    /**
+     * order by 语句
+     */
+    private String orderbyClause;
+
+    public String getCondition() {
+        return condition;
+    }
+
+    public void setCondition(String condition) {
+        this.condition = condition;
+    }
+
+    public String getOrderbyClause() {
+        return orderbyClause;
+    }
+
+    public void setOrderbyClause(String orderbyClause) {
+        this.orderbyClause = orderbyClause;
+    }
+}

+ 31 - 0
applications/document/document-api/pom.xml

@@ -0,0 +1,31 @@
+<?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">
+    <parent>
+        <artifactId>document</artifactId>
+        <groupId>com.usoftchina.saas</groupId>
+        <version>1.0.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>document-api</artifactId>
+    <description>document-api server</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-openfeign</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>document-dto</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>core</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>

+ 23 - 0
applications/document/document-api/src/main/java/com/usoftchina/saas/document/api/ProductApi.java

@@ -0,0 +1,23 @@
+package com.usoftchina.saas.document.api;
+
+import com.usoftchina.saas.document.dto.ProductDTO;
+import com.usoftchina.saas.page.PageRequest;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.List;
+
+@FeignClient(name = "document-server")
+public interface ProductApi {
+
+    /**
+     * 查询Products
+     * @param page
+     * @param condition
+     * @return
+     */
+    @GetMapping("/api/document/product/getProductsByCondition")
+    public List<ProductDTO> getProductsByCondition(@RequestParam(value = "page") PageRequest page, @RequestParam(value = "condition") String condition);
+
+}

+ 22 - 0
applications/document/document-api/src/main/java/com/usoftchina/saas/document/api/VendorApi.java

@@ -0,0 +1,22 @@
+package com.usoftchina.saas.document.api;
+
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.document.dto.VendorDTO;
+import com.usoftchina.saas.page.PageRequest;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.List;
+
+@FeignClient(name = "document-server")
+public interface VendorApi {
+
+    /**
+     * 查询Vendors
+     * @param condition
+     * @return
+     */
+    @GetMapping("/api/document/vendor/getVendorsByCondition")
+    public List<VendorDTO> getVendorsByCondition(@RequestParam(value = "page") PageRequest page, @RequestParam(value = "condition") String condition);
+}

+ 44 - 0
applications/document/document-api/src/main/resources/application.yml

@@ -0,0 +1,44 @@
+spring:
+  application:
+    name: document-api
+  security:
+    user:
+      name: admin
+      password: select111***
+  datasource:
+    driver-class-name: com.mysql.jdbc.Driver
+    url: jdbc:mysql://192.168.253.12:3306/saas_biz?characterEncoding=utf-8&useSSL=false
+    username: root
+    password: select111***
+    hikari:
+      minimum-idle: 5
+      maximum-pool-size: 50
+      idle-timeout: 30000
+      max-lifetime: 1800000
+      connection-timeout: 30000
+  messages:
+    basename: i18n/messages
+eureka:
+  instance:
+    leaseRenewalIntervalInSeconds: 10
+    health-check-url-path: /actuator/health
+    status-page-url-path: /actuator/info
+    metadata-map:
+      user.name: ${spring.security.user.name}
+      user.password: ${spring.security.user.password}
+  client:
+    registryFetchIntervalSeconds: 5
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8500/eureka/
+server:
+  port: 9481
+  tomcat:
+    uri-encoding: UTF-8
+info:
+  name: '@project.artifactId@'
+  description: '@project.description@'
+  version: '@project.version@'
+  spring-boot-version: '@spring.boot.version@'
+  spring-cloud-version: '@spring.cloud.version@'
+auth:
+  public-key: auth/pub.key

+ 15 - 0
applications/document/document-api/src/main/resources/banner.txt

@@ -0,0 +1,15 @@
+${AnsiColor.BRIGHT_YELLOW}
+
+88        88   ad88888ba     ,ad8888ba,    88888888888  888888888888  ,ad8888ba,   88        88  88  888b      88         db
+88        88  d8"     "8b   d8"'    `"8b   88                88      d8"'    `"8b  88        88  88  8888b     88        d88b
+88        88  Y8,          d8'        `8b  88                88     d8'            88        88  88  88 `8b    88       d8'`8b
+88        88  `Y8aaaaa,    88          88  88aaaaa           88     88             88aaaaaaaa88  88  88  `8b   88      d8'  `8b
+88        88    `"""""8b,  88          88  88"""""           88     88             88""""""""88  88  88   `8b  88     d8YaaaaY8b
+88        88          `8b  Y8,        ,8P  88                88     Y8,            88        88  88  88    `8b 88    d8""""""""8b
+Y8a.    .a8P  Y8a     a8P   Y8a.    .a8P   88                88      Y8a.    .a8P  88        88  88  88     `8888   d8'        `8b
+ `"Y8888Y"'    "Y88888P"     `"Y8888Y"'    88                88       `"Y8888Y"'   88        88  88  88      `888  d8'          `8b
+
+
+Application Version: ${application.version}${application.formatted-version}
+Spring Boot Version: ${spring-boot.version}${spring-boot.formatted-version}
+${AnsiColor.DEFAULT}

+ 64 - 0
applications/document/document-api/src/main/resources/logback-spring.xml

@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+    <include resource="org/springframework/boot/logging/logback/defaults.xml" />
+    <jmxConfigurator/>
+
+    <!--
+    %m
+    输出代码中指定的消息
+    %p
+    输出优先级,即DEBUG,INFO,WARN,ERROR,FATAL
+    %r
+    输出自应用启动到输出该log信息耗费的毫秒数
+    %c
+    输出所属的类目,通常就是所在类的全名
+    %t
+    输出产生该日志事件的线程名
+    %n
+    输出一个回车换行符,Windows平台为“\r\n”,Unix平台为“\n”
+    %d
+    输出日志时间点的日期或时间,默认格式为ISO8601,也可以在其后指定格式,比如:%d{yyy MMM dd HH:mm:ss,SSS},
+    输出类似:2002年10月18日 22:10:28,921
+    %l
+    输出日志事件的发生位置,包括类目名、发生的线程,以及在代码中的行数。举例:Testlog4.main(TestLog4.java:10)
+    -->
+
+    <springProperty scope="context" name="log.path" source="logging.path" defaultValue="/var/log/saas/document-api"/>
+    <springProperty scope="context" name="spring.application.name" source="spring.application.name" defaultValue="document-api"/>
+    <springProperty scope="context" name="spring.profiles.active" source="spring.profiles.active" defaultValue="dev"/>
+    <springProperty scope="context" name="common-pattern" source="logging.common-pattern" defaultValue="%d{yyyy-MM-dd HH:mm:ss.SSS}:[%5p] [%t:%r] [%C{1}:%M:%L] --> %m%n"/>
+    <springProperty scope="context" name="log.level.console" source="logging.level.console" defaultValue="INFO"/>
+
+    <contextName>${spring.application.name}-${spring.profiles.active}-logback</contextName>
+
+
+    <appender name="CONSOLE_APPENDER" class="ch.qos.logback.core.ConsoleAppender">
+        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+            <level>${log.level.console}</level>
+        </filter>
+        <encoder>
+            <pattern>${common-pattern}</pattern>
+        </encoder>
+    </appender>
+
+    <appender name="ROOT_APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/root.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- 每天一归档 -->
+            <fileNamePattern>${log.path}/%d{yyyy-MM}/root-%d{yyyy-MM-dd}-%i.log.gz</fileNamePattern>
+            <!-- 单个日志文件最多 100MB, 60天的日志周期,最大不能超过20GB -->
+            <maxFileSize>128MB</maxFileSize>
+            <maxHistory>60</maxHistory>
+            <totalSizeCap>20GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${common-pattern}</pattern>
+        </encoder>
+    </appender>
+
+    <root level="${log.level.console}">
+        <appender-ref ref="CONSOLE_APPENDER"/>
+        <appender-ref ref="ROOT_APPENDER"/>
+    </root>
+
+</configuration>

+ 23 - 0
applications/document/document-dto/pom.xml

@@ -0,0 +1,23 @@
+<?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">
+    <parent>
+        <artifactId>document</artifactId>
+        <groupId>com.usoftchina.saas</groupId>
+        <version>1.0.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>document-dto</artifactId>
+    <description>document data transfer object</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+            <scope>compile</scope>
+        </dependency>
+    </dependencies>
+
+</project>

+ 61 - 0
applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/ProductDTO.java

@@ -0,0 +1,61 @@
+package com.usoftchina.saas.document.dto;
+
+import java.io.Serializable;
+
+public class ProductDTO implements Serializable {
+
+    private String pr_id;
+    private String pr_code;
+    private String pr_detail;
+    private String pr_spec;
+    private String pr_orispeccode;
+    private String pr_brand;
+
+    public String getPr_id() {
+        return pr_id;
+    }
+
+    public void setPr_id(String pr_id) {
+        this.pr_id = pr_id;
+    }
+
+    public String getPr_code() {
+        return pr_code;
+    }
+
+    public void setPr_code(String pr_code) {
+        this.pr_code = pr_code;
+    }
+
+    public String getPr_detail() {
+        return pr_detail;
+    }
+
+    public void setPr_detail(String pr_detail) {
+        this.pr_detail = pr_detail;
+    }
+
+    public String getPr_spec() {
+        return pr_spec;
+    }
+
+    public void setPr_spec(String pr_spec) {
+        this.pr_spec = pr_spec;
+    }
+
+    public String getPr_orispeccode() {
+        return pr_orispeccode;
+    }
+
+    public void setPr_orispeccode(String pr_orispeccode) {
+        this.pr_orispeccode = pr_orispeccode;
+    }
+
+    public String getPr_brand() {
+        return pr_brand;
+    }
+
+    public void setPr_brand(String pr_brand) {
+        this.pr_brand = pr_brand;
+    }
+}

+ 61 - 0
applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/VendorDTO.java

@@ -0,0 +1,61 @@
+package com.usoftchina.saas.document.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+@ApiModel(value = "Vendor", description = "供应商资料")
+public class VendorDTO implements Serializable{
+
+    @ApiModelProperty(value = "ID")
+    private long ve_id;
+    @ApiModelProperty(value = "供应商编号")
+    private String ve_code;
+    @ApiModelProperty(value = "供应商名称")
+    private String ve_name;
+    @ApiModelProperty(value = "供应商类型")
+    private String ve_type;
+    @ApiModelProperty(value = "状态")
+    private String ve_status;
+
+    public long getVe_id() {
+        return ve_id;
+    }
+
+    public void setVe_id(long ve_id) {
+        this.ve_id = ve_id;
+    }
+
+    public String getVe_code() {
+        return ve_code;
+    }
+
+    public void setVe_code(String ve_code) {
+        this.ve_code = ve_code;
+    }
+
+    public String getVe_name() {
+        return ve_name;
+    }
+
+    public void setVe_name(String ve_name) {
+        this.ve_name = ve_name;
+    }
+
+    public String getVe_type() {
+        return ve_type;
+    }
+
+    public void setVe_type(String ve_type) {
+        this.ve_type = ve_type;
+    }
+
+    public String getVe_status() {
+        return ve_status;
+    }
+
+    public void setVe_status(String ve_status) {
+        this.ve_status = ve_status;
+    }
+}

+ 87 - 0
applications/document/document-server/pom.xml

@@ -0,0 +1,87 @@
+<?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">
+    <parent>
+        <artifactId>document</artifactId>
+        <groupId>com.usoftchina.saas</groupId>
+        <version>1.0.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>document-server</artifactId>
+    <description>document server</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>auth-client</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+        <!-- db -->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.mybatis.spring.boot</groupId>
+            <artifactId>mybatis-spring-boot-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+        </dependency>
+        <!-- sleuth -->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-zipkin</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.amqp</groupId>
+            <artifactId>spring-rabbit</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper-spring-boot-starter</artifactId>
+        </dependency>
+        <!-- feign -->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-openfeign</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>document-dto</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>common-dto</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>com.spotify</groupId>
+                <artifactId>docker-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+</project>

+ 22 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/DocumentApplication.java

@@ -0,0 +1,22 @@
+package com.usoftchina.saas.document;
+
+import com.usoftchina.saas.auth.client.EnableAuthClient;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.SpringBootConfiguration;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+@SpringBootApplication
+@EnableEurekaClient
+//@EnableAuthClient
+@EnableTransactionManagement
+@MapperScan("com.usoftchina.saas.document.mapper")
+public class DocumentApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(DocumentApplication.class);
+    }
+
+}

+ 29 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductController.java

@@ -0,0 +1,29 @@
+package com.usoftchina.saas.document.controller;
+
+import com.usoftchina.saas.common.dto.DocReqDTO;
+import com.usoftchina.saas.document.po.Product;
+import com.usoftchina.saas.document.service.ProductService;
+import com.usoftchina.saas.page.PageRequest;
+import feign.Param;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/api/document/product")
+public class ProductController {
+
+    @Autowired
+    private ProductService productService;
+
+    @RequestMapping("/getProductsByCondition")
+    @ResponseBody
+    public List<Product> getProductsByCondition(PageRequest page, DocReqDTO docReqDTO){
+        List<Product> productList = productService.getProductsByCondition(page, docReqDTO);
+        return productList;
+    }
+
+}

+ 35 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/VendorController.java

@@ -0,0 +1,35 @@
+package com.usoftchina.saas.document.controller;
+
+import com.usoftchina.saas.common.dto.DocReqDTO;
+import com.usoftchina.saas.document.po.Vendor;
+import com.usoftchina.saas.document.service.VendorService;
+import com.usoftchina.saas.page.PageRequest;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/api/document/vendor")
+public class VendorController {
+
+    @Autowired
+    private VendorService vendorService;
+
+
+    @RequestMapping(value = "")
+    @ResponseBody
+    public String getVendorList(){
+
+        return "HelloWorld!";
+    }
+
+    @RequestMapping("/getVendorsByCondition")
+    @ResponseBody
+    public List<Vendor> getVendorsByCondition(PageRequest page, DocReqDTO docReqDTO){
+        List<Vendor> vendorList = vendorService.getVendorsByCondition(page, docReqDTO);
+        return vendorList;
+    }
+}

+ 14 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductMapper.java

@@ -0,0 +1,14 @@
+package com.usoftchina.saas.document.mapper;
+
+import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.common.dto.DocReqDTO;
+import com.usoftchina.saas.document.po.Product;
+import com.usoftchina.saas.page.PageRequest;
+
+import java.util.List;
+
+public interface ProductMapper extends CommonBaseMapper<Product> {
+
+    List<Product> getProductsByCondition(DocReqDTO docReqDTO);
+
+}

+ 14 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/VendorMapper.java

@@ -0,0 +1,14 @@
+package com.usoftchina.saas.document.mapper;
+
+import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.common.dto.DocReqDTO;
+import com.usoftchina.saas.document.po.Vendor;
+import com.usoftchina.saas.page.PageRequest;
+
+import java.util.List;
+
+public interface VendorMapper extends CommonBaseMapper<Vendor> {
+
+    List<Vendor> getVendorsByCondition(DocReqDTO docReqDTO);
+
+}

+ 274 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/po/Product.java

@@ -0,0 +1,274 @@
+package com.usoftchina.saas.document.po;
+
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class Product extends CommonBaseEntity implements Serializable {
+
+    private long pr_id;
+    private String pr_code;
+    private String pr_detail;
+    private String pr_spec;
+    private String pr_unit;
+    private String pr_kind;
+    private String pr_orispeccode;
+    private long pr_whid;
+    private String pr_whcode;
+    private String pr_whname;
+    private long pr_zxbzs;
+    private long pr_leadtime;
+    private String pr_brand;
+    private String pr_standardprice;
+    private String pr_purcprice;
+    private String pr_saleprice;
+    private long pr_vendid;
+    private String pr_vendname;
+    private String pr_vendcode;
+    private Date pr_docdate;
+    private long pr_recordmanid;
+    private String pr_recordman;
+    private String pr_status;
+    private String pr_statuscode;
+    private String pr_text1;
+    private String pr_text2;
+    private String pr_text3;
+    private String pr_text4;
+
+    public long getPr_id() {
+        return pr_id;
+    }
+
+    public void setPr_id(long pr_id) {
+        this.pr_id = pr_id;
+    }
+
+    public String getPr_code() {
+        return pr_code;
+    }
+
+    public void setPr_code(String pr_code) {
+        this.pr_code = pr_code;
+    }
+
+    public String getPr_detail() {
+        return pr_detail;
+    }
+
+    public void setPr_detail(String pr_detail) {
+        this.pr_detail = pr_detail;
+    }
+
+    public String getPr_spec() {
+        return pr_spec;
+    }
+
+    public void setPr_spec(String pr_spec) {
+        this.pr_spec = pr_spec;
+    }
+
+    public String getPr_unit() {
+        return pr_unit;
+    }
+
+    public void setPr_unit(String pr_unit) {
+        this.pr_unit = pr_unit;
+    }
+
+    public String getPr_kind() {
+        return pr_kind;
+    }
+
+    public void setPr_kind(String pr_kind) {
+        this.pr_kind = pr_kind;
+    }
+
+    public String getPr_orispeccode() {
+        return pr_orispeccode;
+    }
+
+    public void setPr_orispeccode(String pr_orispeccode) {
+        this.pr_orispeccode = pr_orispeccode;
+    }
+
+    public long getPr_whid() {
+        return pr_whid;
+    }
+
+    public void setPr_whid(long pr_whid) {
+        this.pr_whid = pr_whid;
+    }
+
+    public String getPr_whcode() {
+        return pr_whcode;
+    }
+
+    public void setPr_whcode(String pr_whcode) {
+        this.pr_whcode = pr_whcode;
+    }
+
+    public String getPr_whname() {
+        return pr_whname;
+    }
+
+    public void setPr_whname(String pr_whname) {
+        this.pr_whname = pr_whname;
+    }
+
+    public long getPr_zxbzs() {
+        return pr_zxbzs;
+    }
+
+    public void setPr_zxbzs(long pr_zxbzs) {
+        this.pr_zxbzs = pr_zxbzs;
+    }
+
+    public long getPr_leadtime() {
+        return pr_leadtime;
+    }
+
+    public void setPr_leadtime(long pr_leadtime) {
+        this.pr_leadtime = pr_leadtime;
+    }
+
+    public String getPr_brand() {
+        return pr_brand;
+    }
+
+    public void setPr_brand(String pr_brand) {
+        this.pr_brand = pr_brand;
+    }
+
+    public String getPr_standardprice() {
+        return pr_standardprice;
+    }
+
+    public void setPr_standardprice(String pr_standardprice) {
+        this.pr_standardprice = pr_standardprice;
+    }
+
+    public String getPr_purcprice() {
+        return pr_purcprice;
+    }
+
+    public void setPr_purcprice(String pr_purcprice) {
+        this.pr_purcprice = pr_purcprice;
+    }
+
+    public String getPr_saleprice() {
+        return pr_saleprice;
+    }
+
+    public void setPr_saleprice(String pr_saleprice) {
+        this.pr_saleprice = pr_saleprice;
+    }
+
+    public long getPr_vendid() {
+        return pr_vendid;
+    }
+
+    public void setPr_vendid(long pr_vendid) {
+        this.pr_vendid = pr_vendid;
+    }
+
+    public String getPr_vendname() {
+        return pr_vendname;
+    }
+
+    public void setPr_vendname(String pr_vendname) {
+        this.pr_vendname = pr_vendname;
+    }
+
+    public String getPr_vendcode() {
+        return pr_vendcode;
+    }
+
+    public void setPr_vendcode(String pr_vendcode) {
+        this.pr_vendcode = pr_vendcode;
+    }
+
+    public Date getPr_docdate() {
+        return pr_docdate;
+    }
+
+    public void setPr_docdate(Date pr_docdate) {
+        this.pr_docdate = pr_docdate;
+    }
+
+    public long getPr_recordmanid() {
+        return pr_recordmanid;
+    }
+
+    public void setPr_recordmanid(long pr_recordmanid) {
+        this.pr_recordmanid = pr_recordmanid;
+    }
+
+    public String getPr_recordman() {
+        return pr_recordman;
+    }
+
+    public void setPr_recordman(String pr_recordman) {
+        this.pr_recordman = pr_recordman;
+    }
+
+    public String getPr_status() {
+        return pr_status;
+    }
+
+    public void setPr_status(String pr_status) {
+        this.pr_status = pr_status;
+    }
+
+    public String getPr_statuscode() {
+        return pr_statuscode;
+    }
+
+    public void setPr_statuscode(String pr_statuscode) {
+        this.pr_statuscode = pr_statuscode;
+    }
+
+    public String getPr_text1() {
+        return pr_text1;
+    }
+
+    public void setPr_text1(String pr_text1) {
+        this.pr_text1 = pr_text1;
+    }
+
+    public String getPr_text2() {
+        return pr_text2;
+    }
+
+    public void setPr_text2(String pr_text2) {
+        this.pr_text2 = pr_text2;
+    }
+
+    public String getPr_text3() {
+        return pr_text3;
+    }
+
+    public void setPr_text3(String pr_text3) {
+        this.pr_text3 = pr_text3;
+    }
+
+    public String getPr_text4() {
+        return pr_text4;
+    }
+
+    public void setPr_text4(String pr_text4) {
+        this.pr_text4 = pr_text4;
+    }
+
+    public String getPr_text5() {
+        return pr_text5;
+    }
+
+    public void setPr_text5(String pr_text5) {
+        this.pr_text5 = pr_text5;
+    }
+
+    private String pr_text5;
+
+}

+ 291 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/po/Vendor.java

@@ -0,0 +1,291 @@
+package com.usoftchina.saas.document.po;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 供应商资料
+ * @author chenwei
+ * @Date 2018/10/13
+ */
+public class Vendor extends CommonBaseEntity implements Serializable{
+
+    /**
+     * 供应商ID
+     */
+    private long ve_id;
+    /**
+     * 供应商编号
+     */
+    private String ve_code;
+    /**
+     * 供应商名称
+     */
+    private String ve_name;
+    /**
+     * 供应商UU
+     */
+    private String ve_uu;
+    /**
+     * 供应商类型
+     */
+    private String ve_type;
+    /**
+     * 期初日期
+     */
+    private Date ve_begindate;
+    /**
+     * 期初应付
+     */
+    private long ve_beginapamount;
+    /**
+     * 期初预付
+     */
+    private long ve_beginprepayamount;
+    /**
+     * 承付天数
+     */
+    private long ve_promisedays;
+    /**
+     * 税率
+     */
+    private double ve_taxrate;
+    /**
+     * 纳税人识别号
+     */
+    private String ve_nsrzh;
+    /**
+     * 银行账号
+     */
+    private String ve_bankaccount;
+    /**
+     * 银行行号
+     */
+    private String ve_bankcode;
+    /**
+     * 状态   defualt "启用"
+     */
+    private String ve_status;
+    /**
+     * 状态码
+     */
+    private String ve_statuscode;
+    /**
+     * 录入人ID
+     */
+    private long ve_recordid;
+    /**
+     * 录入人
+     */
+    private String ve_recordname;
+    /**
+     * 建立日期
+     */
+    private Date ve_initdate;
+    /**
+     * 自定义字段
+     */
+    private String ve_text1;
+    /**
+     * 自定义字段
+     */
+    private String ve_text2;
+    /**
+     * 自定义字段
+     */
+    private String ve_text3;
+    /**
+     * 自定义字段
+     */
+    private String ve_text4;
+    /**
+     * 自定义字段
+     */
+    private String ve_text5;
+
+    public long getVe_id() {
+        return ve_id;
+    }
+
+    public void setVe_id(long ve_id) {
+        this.ve_id = ve_id;
+    }
+
+    public String getVe_code() {
+        return ve_code;
+    }
+
+    public void setVe_code(String ve_code) {
+        this.ve_code = ve_code;
+    }
+
+    public String getVe_name() {
+        return ve_name;
+    }
+
+    public void setVe_name(String ve_name) {
+        this.ve_name = ve_name;
+    }
+
+    public String getVe_uu() {
+        return ve_uu;
+    }
+
+    public void setVe_uu(String ve_uu) {
+        this.ve_uu = ve_uu;
+    }
+
+    public String getVe_type() {
+        return ve_type;
+    }
+
+    public void setVe_type(String ve_type) {
+        this.ve_type = ve_type;
+    }
+
+    public Date getVe_begindate() {
+        return ve_begindate;
+    }
+
+    public void setVe_begindate(Date ve_begindate) {
+        this.ve_begindate = ve_begindate;
+    }
+
+    public long getVe_beginapamount() {
+        return ve_beginapamount;
+    }
+
+    public void setVe_beginapamount(long ve_beginapamount) {
+        this.ve_beginapamount = ve_beginapamount;
+    }
+
+    public long getVe_beginprepayamount() {
+        return ve_beginprepayamount;
+    }
+
+    public void setVe_beginprepayamount(long ve_beginprepayamount) {
+        this.ve_beginprepayamount = ve_beginprepayamount;
+    }
+
+    public long getVe_promisedays() {
+        return ve_promisedays;
+    }
+
+    public void setVe_promisedays(long ve_promisedays) {
+        this.ve_promisedays = ve_promisedays;
+    }
+
+    public double getVe_taxrate() {
+        return ve_taxrate;
+    }
+
+    public void setVe_taxrate(double ve_taxrate) {
+        this.ve_taxrate = ve_taxrate;
+    }
+
+    public String getVe_nsrzh() {
+        return ve_nsrzh;
+    }
+
+    public void setVe_nsrzh(String ve_nsrzh) {
+        this.ve_nsrzh = ve_nsrzh;
+    }
+
+    public String getVe_bankaccount() {
+        return ve_bankaccount;
+    }
+
+    public void setVe_bankaccount(String ve_bankaccount) {
+        this.ve_bankaccount = ve_bankaccount;
+    }
+
+    public String getVe_bankcode() {
+        return ve_bankcode;
+    }
+
+    public void setVe_bankcode(String ve_bankcode) {
+        this.ve_bankcode = ve_bankcode;
+    }
+
+    public String getVe_status() {
+        return ve_status;
+    }
+
+    public void setVe_status(String ve_status) {
+        this.ve_status = ve_status;
+    }
+
+    public String getVe_statuscode() {
+        return ve_statuscode;
+    }
+
+    public void setVe_statuscode(String ve_statuscode) {
+        this.ve_statuscode = ve_statuscode;
+    }
+
+    public long getVe_recordid() {
+        return ve_recordid;
+    }
+
+    public void setVe_recordid(long ve_recordid) {
+        this.ve_recordid = ve_recordid;
+    }
+
+    public String getVe_recordname() {
+        return ve_recordname;
+    }
+
+    public void setVe_recordname(String ve_recordname) {
+        this.ve_recordname = ve_recordname;
+    }
+
+    public Date getVe_initdate() {
+        return ve_initdate;
+    }
+
+    public void setVe_initdate(Date ve_initdate) {
+        this.ve_initdate = ve_initdate;
+    }
+
+    public String getVe_text1() {
+        return ve_text1;
+    }
+
+    public void setVe_text1(String ve_text1) {
+        this.ve_text1 = ve_text1;
+    }
+
+    public String getVe_text2() {
+        return ve_text2;
+    }
+
+    public void setVe_text2(String ve_text2) {
+        this.ve_text2 = ve_text2;
+    }
+
+    public String getVe_text3() {
+        return ve_text3;
+    }
+
+    public void setVe_text3(String ve_text3) {
+        this.ve_text3 = ve_text3;
+    }
+
+    public String getVe_text4() {
+        return ve_text4;
+    }
+
+    public void setVe_text4(String ve_text4) {
+        this.ve_text4 = ve_text4;
+    }
+
+    public String getVe_text5() {
+        return ve_text5;
+    }
+
+    public void setVe_text5(String ve_text5) {
+        this.ve_text5 = ve_text5;
+    }
+}

+ 38 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/Impl/ProductServiceImpl.java

@@ -0,0 +1,38 @@
+package com.usoftchina.saas.document.service.Impl;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.common.dto.DocReqDTO;
+import com.usoftchina.saas.document.mapper.ProductMapper;
+import com.usoftchina.saas.document.po.Product;
+import com.usoftchina.saas.document.service.ProductService;
+import com.usoftchina.saas.page.PageRequest;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Product> implements ProductService {
+
+    @Autowired
+    private ProductMapper productMapper;
+
+    @Override
+    public List<Product> getProductsByCondition(PageRequest page, DocReqDTO docReqDTO) {
+        //设置分页
+        if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
+            page = new PageRequest();
+            page.setNumber(1);
+            page.setSize(10);
+        }
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        System.out.println("condition:    " + docReqDTO);
+        List<Product> productList = productMapper.getProductsByCondition(docReqDTO);
+        //取分页信息
+        PageInfo<Product> pageInfo = new PageInfo<Product>(productList);
+        return productList;
+    }
+}

+ 41 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/Impl/VendorServiceImpl.java

@@ -0,0 +1,41 @@
+package com.usoftchina.saas.document.service.Impl;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.common.dto.DocReqDTO;
+import com.usoftchina.saas.document.mapper.VendorMapper;
+import com.usoftchina.saas.document.po.Vendor;
+import com.usoftchina.saas.document.service.VendorService;
+import com.usoftchina.saas.page.PageRequest;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @author chenwei
+ * @Date 2018/10/13
+ */
+@Service
+public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendor> implements VendorService {
+
+    @Autowired
+    private VendorMapper vendorMapper;
+
+
+    @Override
+    public List<Vendor> getVendorsByCondition(PageRequest page, DocReqDTO docReqDTO) {
+        //设置分页
+        if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
+            page = new PageRequest();
+            page.setNumber(1);
+            page.setSize(10);
+        }
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        List<Vendor> vendorList = vendorMapper.getVendorsByCondition(docReqDTO);
+        //取分页信息
+        PageInfo<Vendor> pageInfo = new PageInfo<Vendor>(vendorList);
+        return vendorList;
+    }
+}

+ 14 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductService.java

@@ -0,0 +1,14 @@
+package com.usoftchina.saas.document.service;
+
+import com.usoftchina.saas.base.service.CommonBaseService;
+import com.usoftchina.saas.common.dto.DocReqDTO;
+import com.usoftchina.saas.document.mapper.ProductMapper;
+import com.usoftchina.saas.document.po.Product;
+import com.usoftchina.saas.page.PageRequest;
+
+import java.util.List;
+
+public interface ProductService extends CommonBaseService<ProductMapper, Product> {
+
+    List<Product> getProductsByCondition(PageRequest page, DocReqDTO docReqDTO);
+}

+ 15 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/VendorService.java

@@ -0,0 +1,15 @@
+package com.usoftchina.saas.document.service;
+
+import com.usoftchina.saas.base.service.CommonBaseService;
+import com.usoftchina.saas.common.dto.DocReqDTO;
+import com.usoftchina.saas.document.mapper.VendorMapper;
+import com.usoftchina.saas.document.po.Vendor;
+import com.usoftchina.saas.page.PageRequest;
+
+import java.util.List;
+
+public interface VendorService extends CommonBaseService<VendorMapper, Vendor>{
+
+    List<Vendor> getVendorsByCondition(PageRequest page, DocReqDTO docReqDTO);
+
+}

+ 47 - 0
applications/document/document-server/src/main/resources/application.yml

@@ -0,0 +1,47 @@
+spring:
+  application:
+    name: document-server
+  security:
+    user:
+      name: admin
+      password: select111***
+  datasource:
+    driver-class-name: com.mysql.jdbc.Driver
+    url: jdbc:mysql://192.168.253.12:3306/saas_biz?characterEncoding=utf-8&useSSL=false
+    username: root
+    password: select111***
+    hikari:
+      minimum-idle: 5
+      maximum-pool-size: 50
+      idle-timeout: 30000
+      max-lifetime: 1800000
+      connection-timeout: 30000
+  messages:
+    basename: i18n/messages
+eureka:
+  instance:
+    leaseRenewalIntervalInSeconds: 10
+    health-check-url-path: /actuator/health
+    status-page-url-path: /actuator/info
+    metadata-map:
+      user.name: ${spring.security.user.name}
+      user.password: ${spring.security.user.password}
+  client:
+    registryFetchIntervalSeconds: 5
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8500/eureka/
+server:
+  port: 9480
+  tomcat:
+    uri-encoding: UTF-8
+info:
+  name: '@project.artifactId@'
+  description: '@project.description@'
+  version: '@project.version@'
+  spring-boot-version: '@spring.boot.version@'
+  spring-cloud-version: '@spring.cloud.version@'
+mybatis:
+  type-aliases-package: com.usoftchina.saas.document.po
+  mapper-locations: classpath:mapper/*.xml
+auth:
+  public-key: auth/pub.key

BIN
applications/document/document-server/src/main/resources/auth/pub.key


+ 15 - 0
applications/document/document-server/src/main/resources/banner.txt

@@ -0,0 +1,15 @@
+${AnsiColor.BRIGHT_YELLOW}
+
+88        88   ad88888ba     ,ad8888ba,    88888888888  888888888888  ,ad8888ba,   88        88  88  888b      88         db
+88        88  d8"     "8b   d8"'    `"8b   88                88      d8"'    `"8b  88        88  88  8888b     88        d88b
+88        88  Y8,          d8'        `8b  88                88     d8'            88        88  88  88 `8b    88       d8'`8b
+88        88  `Y8aaaaa,    88          88  88aaaaa           88     88             88aaaaaaaa88  88  88  `8b   88      d8'  `8b
+88        88    `"""""8b,  88          88  88"""""           88     88             88""""""""88  88  88   `8b  88     d8YaaaaY8b
+88        88          `8b  Y8,        ,8P  88                88     Y8,            88        88  88  88    `8b 88    d8""""""""8b
+Y8a.    .a8P  Y8a     a8P   Y8a.    .a8P   88                88      Y8a.    .a8P  88        88  88  88     `8888   d8'        `8b
+ `"Y8888Y"'    "Y88888P"     `"Y8888Y"'    88                88       `"Y8888Y"'   88        88  88  88      `888  d8'          `8b
+
+
+Application Version: ${application.version}${application.formatted-version}
+Spring Boot Version: ${spring-boot.version}${spring-boot.formatted-version}
+${AnsiColor.DEFAULT}

+ 42 - 0
applications/document/document-server/src/main/resources/config/application-dev.yml

@@ -0,0 +1,42 @@
+spring:
+  application:
+    name: document-server
+  security:
+    user:
+      name: admin
+      password: select111***
+  datasource:
+    hikari:
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      jdbc-url: jdbc:mysql://192.168.253.12:3306/saas_biz?characterEncoding=utf-8&useSSL=false
+      username: root
+      password: select111***
+  messages:
+    basename: i18n/messages
+eureka:
+  instance:
+    leaseRenewalIntervalInSeconds: 10
+    health-check-url-path: /actuator/health
+    status-page-url-path: /actuator/info
+    metadata-map:
+      user.name: ${spring.security.user.name}
+      user.password: ${spring.security.user.password}
+  client:
+    registryFetchIntervalSeconds: 5
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.253.12:8500/eureka/
+server:
+  port: 9480
+  tomcat:
+    uri-encoding: UTF-8
+info:
+  name: '@project.artifactId@'
+  description: '@project.description@'
+  version: '@project.version@'
+  spring-boot-version: '@spring.boot.version@'
+  spring-cloud-version: '@spring.cloud.version@'
+mybatis:
+  type-aliases-package: com.usoftchina.saas.document.po
+  mapper-locations: classpath:mapper/*.xml
+auth:
+  publie-key: auth/pub.key

+ 7 - 0
applications/document/document-server/src/main/resources/config/application-docker.yml

@@ -0,0 +1,7 @@
+eureka:
+  instance:
+    hostname: saas-document-server
+    prefer-ip-address: false
+  client:
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@saas-eureka-server:8500/eureka/

+ 64 - 0
applications/document/document-server/src/main/resources/logback-spring.xml

@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+    <include resource="org/springframework/boot/logging/logback/defaults.xml" />
+    <jmxConfigurator/>
+
+    <!--
+    %m
+    输出代码中指定的消息
+    %p
+    输出优先级,即DEBUG,INFO,WARN,ERROR,FATAL
+    %r
+    输出自应用启动到输出该log信息耗费的毫秒数
+    %c
+    输出所属的类目,通常就是所在类的全名
+    %t
+    输出产生该日志事件的线程名
+    %n
+    输出一个回车换行符,Windows平台为“\r\n”,Unix平台为“\n”
+    %d
+    输出日志时间点的日期或时间,默认格式为ISO8601,也可以在其后指定格式,比如:%d{yyy MMM dd HH:mm:ss,SSS},
+    输出类似:2002年10月18日 22:10:28,921
+    %l
+    输出日志事件的发生位置,包括类目名、发生的线程,以及在代码中的行数。举例:Testlog4.main(TestLog4.java:10)
+    -->
+
+    <springProperty scope="context" name="log.path" source="logging.path" defaultValue="/var/log/saas/document-server"/>
+    <springProperty scope="context" name="spring.application.name" source="spring.application.name" defaultValue="document-server"/>
+    <springProperty scope="context" name="spring.profiles.active" source="spring.profiles.active" defaultValue="dev"/>
+    <springProperty scope="context" name="common-pattern" source="logging.common-pattern" defaultValue="%d{yyyy-MM-dd HH:mm:ss.SSS}:[%5p] [%t:%r] [%C{1}:%M:%L] --> %m%n"/>
+    <springProperty scope="context" name="log.level.console" source="logging.level.console" defaultValue="INFO"/>
+
+    <contextName>${spring.application.name}-${spring.profiles.active}-logback</contextName>
+
+
+    <appender name="CONSOLE_APPENDER" class="ch.qos.logback.core.ConsoleAppender">
+        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+            <level>${log.level.console}</level>
+        </filter>
+        <encoder>
+            <pattern>${common-pattern}</pattern>
+        </encoder>
+    </appender>
+
+    <appender name="ROOT_APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/root.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- 每天一归档 -->
+            <fileNamePattern>${log.path}/%d{yyyy-MM}/root-%d{yyyy-MM-dd}-%i.log.gz</fileNamePattern>
+            <!-- 单个日志文件最多 100MB, 60天的日志周期,最大不能超过20GB -->
+            <maxFileSize>128MB</maxFileSize>
+            <maxHistory>60</maxHistory>
+            <totalSizeCap>20GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${common-pattern}</pattern>
+        </encoder>
+    </appender>
+
+    <root level="${log.level.console}">
+        <appender-ref ref="CONSOLE_APPENDER"/>
+        <appender-ref ref="ROOT_APPENDER"/>
+    </root>
+
+</configuration>

+ 48 - 0
applications/document/document-server/src/main/resources/mapper/ProductMapper.xml

@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.usoftchina.saas.document.mapper.ProductMapper">
+    <resultMap id="ProductResultMapper" type="com.usoftchina.saas.document.po.Product">
+        <id column="pr_id" property="pr_id" jdbcType="INTEGER" />
+        <result column="pr_code" property="pr_code" jdbcType="VARCHAR" />
+        <result column="pr_detail" property="pr_detail" jdbcType="VARCHAR" />
+        <result column="pr_spec" property="pr_spec" jdbcType="VARCHAR" />
+        <result column="pr_unit" property="pr_unit" jdbcType="VARCHAR" />
+        <result column="pr_kind" property="pr_kind" jdbcType="VARCHAR" />
+        <result column="pr_orispeccode" property="pr_orispeccode" jdbcType="VARCHAR" />
+        <result column="pr_whid" property="pr_whid" jdbcType="INTEGER" />
+        <result column="pr_whcode" property="pr_whcode" jdbcType="VARCHAR" />
+        <result column="pr_whname" property="pr_whname" jdbcType="VARCHAR" />
+        <result column="pr_zxbzs" property="pr_zxbzs" jdbcType="INTEGER" />
+        <result column="pr_leadtime" property="pr_leadtime" jdbcType="INTEGER" />
+        <result column="pr_brand" property="pr_brand" jdbcType="VARCHAR" />
+        <result column="pr_standardprice" property="pr_standardprice" jdbcType="DOUBLE" />
+        <result column="pr_purcprice" property="pr_purcprice" jdbcType="DOUBLE" />
+        <result column="pr_saleprice" property="pr_saleprice" jdbcType="DOUBLE" />
+        <result column="pr_vendid" property="pr_vendid" jdbcType="INTEGER" />
+        <result column="pr_vendcode" property="pr_vendcode" jdbcType="VARCHAR" />
+        <result column="pr_vendname" property="pr_vendname" jdbcType="VARCHAR" />
+        <result column="pr_docdate" property="pr_docdate" jdbcType="TIMESTAMP" />
+        <result column="pr_recordmanid" property="pr_recordmanid" jdbcType="INTEGER" />
+        <result column="pr_recordman" property="pr_recordman" jdbcType="VARCHAR" />
+        <result column="pr_status" property="pr_status" jdbcType="VARCHAR" />
+        <result column="pr_statuscode" property="pr_statuscode" jdbcType="VARCHAR" />
+        <result column="companyid" property="companyId" jdbcType="INTEGER" />
+        <result column="updatemanid" property="updaterId" jdbcType="INTEGER" />
+        <result column="updatetime" property="updateTime" jdbcType="TIMESTAMP" />
+        <result column="pr_text1" property="pr_text1" jdbcType="VARCHAR" />
+        <result column="pr_text2" property="pr_text2" jdbcType="VARCHAR" />
+        <result column="pr_text3" property="pr_text3" jdbcType="VARCHAR" />
+        <result column="pr_text4" property="pr_text4" jdbcType="VARCHAR" />
+        <result column="pr_text5" property="pr_text5" jdbcType="VARCHAR" />
+    </resultMap>
+    <select id="getProductsByCondition" resultMap="ProductResultMapper" parameterType="com.usoftchina.saas.common.dto.DocReqDTO">
+        SELECT * FROM PRODUCT
+        <where>
+            <if test="condition!=null">
+                ${condition}
+            </if>
+        </where>
+
+    </select>
+</mapper>
+

+ 41 - 0
applications/document/document-server/src/main/resources/mapper/VendorMapper.xml

@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.usoftchina.saas.document.mapper.VendorMapper">
+    <resultMap id="VendorResultMapper" type="com.usoftchina.saas.document.po.Vendor">
+        <id column="ve_id" property="ve_id" jdbcType="INTEGER" />
+        <result column="ve_code" property="ve_code" jdbcType="VARCHAR" />
+        <result column="ve_uu" property="ve_uu" jdbcType="VARCHAR" />
+        <result column="ve_name" property="ve_name" jdbcType="VARCHAR" />
+        <result column="ve_type" property="ve_type" jdbcType="VARCHAR" />
+        <result column="ve_begindate" property="ve_begindate" jdbcType="TIMESTAMP" />
+        <result column="ve_beginapamount" property="ve_beginapamount" jdbcType="INTEGER" />
+        <result column="ve_beginprepayamount" property="ve_beginprepayamount" jdbcType="INTEGER" />
+        <result column="ve_promisedays" property="ve_promisedays" jdbcType="INTEGER" />
+        <result column="ve_taxrate" property="ve_taxrate" jdbcType="DOUBLE" />
+        <result column="ve_nsrzh" property="ve_nsrzh" jdbcType="VARCHAR" />
+        <result column="ve_bankaccount" property="ve_bankaccount" jdbcType="VARCHAR" />
+        <result column="ve_bankcode" property="ve_bankcode" jdbcType="VARCHAR" />
+        <result column="ve_status" property="ve_status" jdbcType="VARCHAR" />
+        <result column="ve_statuscode" property="ve_statuscode" jdbcType="VARCHAR" />
+        <result column="ve_recordid" property="ve_recordid" jdbcType="INTEGER" />
+        <result column="ve_recordname" property="ve_recordname" jdbcType="VARCHAR" />
+        <result column="ve_initdate" property="ve_initdate" jdbcType="TIMESTAMP" />
+        <result column="companyid" property="companyId" jdbcType="INTEGER" />
+        <result column="updatemanid" property="updaterId" jdbcType="INTEGER" />
+        <result column="updatedate" property="updateTime" jdbcType="TIMESTAMP" />
+        <result column="ve_text1" property="ve_text1" jdbcType="VARCHAR" />
+        <result column="ve_text2" property="ve_text2" jdbcType="VARCHAR" />
+        <result column="ve_text3" property="ve_text3" jdbcType="VARCHAR" />
+        <result column="ve_text4" property="ve_text4" jdbcType="VARCHAR" />
+        <result column="ve_text5" property="ve_text5" jdbcType="VARCHAR" />
+    </resultMap>
+    <select id="getVendorsByCondition" resultMap="VendorResultMapper" parameterType="com.usoftchina.saas.common.dto.DocReqDTO">
+        SELECT * FROM VENDOR
+        <where>
+            <if test="condition!=null">
+                ${condition}
+            </if>
+        </where>
+    </select>
+</mapper>
+

+ 32 - 0
applications/document/document-server/src/test/java/com/usoftchina/saas/document/service/VendorServiceTest.java

@@ -0,0 +1,32 @@
+package com.usoftchina.saas.document.service;
+
+
+import com.usoftchina.saas.document.DocumentApplication;
+import com.usoftchina.saas.document.po.Vendor;
+import com.usoftchina.saas.page.PageRequest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+import java.util.List;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = DocumentApplication.class)
+@EnableAutoConfiguration
+public class VendorServiceTest {
+
+    @Autowired
+    private VendorService vendorService;
+
+    @Test
+    public void testSelectAll(){
+        List<Vendor> vendorList = vendorService.getVendorsByCondition(null, null);
+        System.out.println("vendCode: " + vendorList.get(0).getVe_code());
+        System.out.println("vendName: " + vendorList.get(0).getVe_name());
+        System.out.println("vendType: " + vendorList.get(0).getVe_type());
+        System.out.println("vendBeginDate: " + vendorList.get(0).getVe_begindate());
+    }
+}

+ 6 - 1
applications/document/pom.xml

@@ -10,7 +10,12 @@
     <modelVersion>4.0.0</modelVersion>
 
     <artifactId>document</artifactId>
+    <packaging>pom</packaging>
     <description>base document server</description>
-
+    <modules>
+        <module>document-dto</module>
+        <module>document-server</module>
+        <module>document-api</module>
+    </modules>
 
 </project>

+ 5 - 0
applications/purchase/purchase-server/pom.xml

@@ -21,6 +21,11 @@
             <groupId>com.usoftchina.saas</groupId>
             <artifactId>purchase-dto</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>document-api</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+        </dependency>
         <dependency>
             <groupId>com.usoftchina.saas</groupId>
             <artifactId>auth-client</artifactId>

+ 36 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/config/WebMvcConfig.java

@@ -0,0 +1,36 @@
+package com.usoftchina.saas.purchase.config;
+
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.http.converter.StringHttpMessageConverter;
+import org.springframework.web.client.RestTemplate;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+import java.nio.charset.Charset;
+import java.util.List;
+
+@Configuration
+public class WebMvcConfig implements WebMvcConfigurer{
+
+    @Bean
+    public HttpMessageConverter<String> responseBodyConverter() {
+        StringHttpMessageConverter converter = new StringHttpMessageConverter(Charset.forName("UTF-8"));
+        return converter;
+    }
+
+    @Override
+    public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
+        WebMvcConfigurer.super.configureMessageConverters(converters);
+        converters.add(responseBodyConverter());
+    }
+
+    @Bean
+    public RestTemplate restTemplate(){
+        RestTemplate restTemplate = new RestTemplate();
+        restTemplate.getMessageConverters().add(0, responseBodyConverter());
+        return restTemplate;
+    }
+
+}

+ 36 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/ComponentController.java

@@ -0,0 +1,36 @@
+package com.usoftchina.saas.purchase.controller;
+
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.document.api.ProductApi;
+import com.usoftchina.saas.document.api.VendorApi;
+import com.usoftchina.saas.document.dto.ProductDTO;
+import com.usoftchina.saas.document.dto.VendorDTO;
+import com.usoftchina.saas.page.PageRequest;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/purchase/component")
+public class ComponentController {
+
+    @Autowired
+    private VendorApi vendorApi;
+    @Autowired
+    private ProductApi productApi;
+
+    @GetMapping("/dbfind/vendor")
+    @ResponseBody
+    public Result<VendorDTO> getVendorList(PageRequest page, String condition){
+        List<VendorDTO> vendorDTOResult = vendorApi.getVendorsByCondition(page, condition);
+        return Result.success(vendorDTOResult);
+    }
+
+    @GetMapping("/dbfind/product")
+    @ResponseBody
+    public Result<ProductDTO> getProductList(PageRequest page, String condition){
+        List<ProductDTO> productDTOResult = productApi.getProductsByCondition(page, condition);
+        return Result.success(productDTOResult);
+    }
+}