Explorar o código

init from phab

xielq %!s(int64=4) %!d(string=hai) anos
pai
achega
e5c26bc3f6
Modificáronse 100 ficheiros con 10248 adicións e 0 borrados
  1. 284 0
      finance-service/pom.xml
  2. 40 0
      finance-service/src/main/java/com/uas/finance/Application.java
  3. 128 0
      finance-service/src/main/java/com/uas/finance/DruidDBConfiguration.java
  4. 14 0
      finance-service/src/main/java/com/uas/finance/RestTemplateConfig.java
  5. 82 0
      finance-service/src/main/java/com/uas/finance/SSOConfiguration.java
  6. 70 0
      finance-service/src/main/java/com/uas/finance/WebAppConfiguration.java
  7. 61 0
      finance-service/src/main/java/com/uas/finance/constants/Role.java
  8. 144 0
      finance-service/src/main/java/com/uas/finance/constants/Status.java
  9. 64 0
      finance-service/src/main/java/com/uas/finance/controller/AccountApplyAttachController.java
  10. 75 0
      finance-service/src/main/java/com/uas/finance/controller/AccountApplyController.java
  11. 48 0
      finance-service/src/main/java/com/uas/finance/controller/AccountInfoController.java
  12. 47 0
      finance-service/src/main/java/com/uas/finance/controller/AssociateCompanyController.java
  13. 141 0
      finance-service/src/main/java/com/uas/finance/controller/AttachController.java
  14. 39 0
      finance-service/src/main/java/com/uas/finance/controller/BusinessConditionController.java
  15. 47 0
      finance-service/src/main/java/com/uas/finance/controller/ChangesInstructionController.java
  16. 51 0
      finance-service/src/main/java/com/uas/finance/controller/CustomerExcutiveController.java
  17. 240 0
      finance-service/src/main/java/com/uas/finance/controller/CustomerInfoController.java
  18. 39 0
      finance-service/src/main/java/com/uas/finance/controller/FinanceConditionController.java
  19. 132 0
      finance-service/src/main/java/com/uas/finance/controller/FinancingApplyController.java
  20. 40 0
      finance-service/src/main/java/com/uas/finance/controller/FsSaleController.java
  21. 54 0
      finance-service/src/main/java/com/uas/finance/controller/MFCustInfoController.java
  22. 48 0
      finance-service/src/main/java/com/uas/finance/controller/MFCustInfoDetailController.java
  23. 48 0
      finance-service/src/main/java/com/uas/finance/controller/ProductMixController.java
  24. 40 0
      finance-service/src/main/java/com/uas/finance/controller/ReceiptController.java
  25. 68 0
      finance-service/src/main/java/com/uas/finance/controller/RepaymentPlanController.java
  26. 317 0
      finance-service/src/main/java/com/uas/finance/controller/SecurityController.java
  27. 92 0
      finance-service/src/main/java/com/uas/finance/controller/SellerQuotaController.java
  28. 51 0
      finance-service/src/main/java/com/uas/finance/controller/ShareholdersController.java
  29. 48 0
      finance-service/src/main/java/com/uas/finance/controller/UpdowncastController.java
  30. 63 0
      finance-service/src/main/java/com/uas/finance/controller/ViewExcel.java
  31. 23 0
      finance-service/src/main/java/com/uas/finance/dao/AccountApplyAttachDao.java
  32. 40 0
      finance-service/src/main/java/com/uas/finance/dao/AccountApplyDao.java
  33. 13 0
      finance-service/src/main/java/com/uas/finance/dao/AccountInfoDao.java
  34. 13 0
      finance-service/src/main/java/com/uas/finance/dao/AssociateCompanyDao.java
  35. 47 0
      finance-service/src/main/java/com/uas/finance/dao/AttachDao.java
  36. 12 0
      finance-service/src/main/java/com/uas/finance/dao/BusinessConditionDao.java
  37. 14 0
      finance-service/src/main/java/com/uas/finance/dao/ChangesInstructionDao.java
  38. 124 0
      finance-service/src/main/java/com/uas/finance/dao/CommonDao.java
  39. 12 0
      finance-service/src/main/java/com/uas/finance/dao/CustomerExcutiveDao.java
  40. 33 0
      finance-service/src/main/java/com/uas/finance/dao/CustomerInfoDao.java
  41. 13 0
      finance-service/src/main/java/com/uas/finance/dao/EnterpriseDao.java
  42. 11 0
      finance-service/src/main/java/com/uas/finance/dao/ErpLogDao.java
  43. 14 0
      finance-service/src/main/java/com/uas/finance/dao/FinanceConditionDao.java
  44. 70 0
      finance-service/src/main/java/com/uas/finance/dao/FinancingApplyDao.java
  45. 29 0
      finance-service/src/main/java/com/uas/finance/dao/FsSaleDao.java
  46. 13 0
      finance-service/src/main/java/com/uas/finance/dao/MFCustInfoDao.java
  47. 12 0
      finance-service/src/main/java/com/uas/finance/dao/MFCustInfoDetailDao.java
  48. 11 0
      finance-service/src/main/java/com/uas/finance/dao/ProductMixDao.java
  49. 37 0
      finance-service/src/main/java/com/uas/finance/dao/ReceiptDao.java
  50. 17 0
      finance-service/src/main/java/com/uas/finance/dao/RepaymentPlanDao.java
  51. 44 0
      finance-service/src/main/java/com/uas/finance/dao/SellerQuotaDao.java
  52. 15 0
      finance-service/src/main/java/com/uas/finance/dao/ShareholdersDao.java
  53. 12 0
      finance-service/src/main/java/com/uas/finance/dao/UpdowncastDao.java
  54. 11 0
      finance-service/src/main/java/com/uas/finance/dao/UsageLogDao.java
  55. 60 0
      finance-service/src/main/java/com/uas/finance/erp/controller/AccountApplyDownController.java
  56. 55 0
      finance-service/src/main/java/com/uas/finance/erp/controller/CustomerInfoDownController.java
  57. 53 0
      finance-service/src/main/java/com/uas/finance/erp/controller/FinancingApplyDownController.java
  58. 172 0
      finance-service/src/main/java/com/uas/finance/erp/model/AccountInfo.java
  59. 243 0
      finance-service/src/main/java/com/uas/finance/erp/model/Apply.java
  60. 130 0
      finance-service/src/main/java/com/uas/finance/erp/model/AssociateCompanyInfo.java
  61. 105 0
      finance-service/src/main/java/com/uas/finance/erp/model/AttachInfo.java
  62. 73 0
      finance-service/src/main/java/com/uas/finance/erp/model/BusinessConditionInfo.java
  63. 101 0
      finance-service/src/main/java/com/uas/finance/erp/model/ChangesInstructionInfo.java
  64. 529 0
      finance-service/src/main/java/com/uas/finance/erp/model/CustInfo.java
  65. 192 0
      finance-service/src/main/java/com/uas/finance/erp/model/CustomerExcutiveInfo.java
  66. 174 0
      finance-service/src/main/java/com/uas/finance/erp/model/FinanceConditionInfo.java
  67. 116 0
      finance-service/src/main/java/com/uas/finance/erp/model/ProductMixInfo.java
  68. 339 0
      finance-service/src/main/java/com/uas/finance/erp/model/PurcCustInfo.java
  69. 112 0
      finance-service/src/main/java/com/uas/finance/erp/model/PurcCustInfoDetail.java
  70. 116 0
      finance-service/src/main/java/com/uas/finance/erp/model/ShareholdersInfo.java
  71. 146 0
      finance-service/src/main/java/com/uas/finance/erp/model/UpdowncastInfo.java
  72. 28 0
      finance-service/src/main/java/com/uas/finance/erp/service/AccountApplyDownService.java
  73. 21 0
      finance-service/src/main/java/com/uas/finance/erp/service/CustomerInfoDownService.java
  74. 29 0
      finance-service/src/main/java/com/uas/finance/erp/service/FinancingApplyDownService.java
  75. 62 0
      finance-service/src/main/java/com/uas/finance/erp/service/impl/AccountApplyDownServiceImpl.java
  76. 40 0
      finance-service/src/main/java/com/uas/finance/erp/service/impl/CustomerInfoDownServiceImpl.java
  77. 55 0
      finance-service/src/main/java/com/uas/finance/erp/service/impl/FinancingApplyDownServiceImpl.java
  78. 92 0
      finance-service/src/main/java/com/uas/finance/filter/AbstractSSOInterceptor.java
  79. 64 0
      finance-service/src/main/java/com/uas/finance/filter/AccessSignatureInterceptor.java
  80. 78 0
      finance-service/src/main/java/com/uas/finance/filter/BaseController.java
  81. 55 0
      finance-service/src/main/java/com/uas/finance/filter/SSOInterceptor.java
  82. 241 0
      finance-service/src/main/java/com/uas/finance/model/AccountApply.java
  83. 134 0
      finance-service/src/main/java/com/uas/finance/model/AccountApplyAttach.java
  84. 217 0
      finance-service/src/main/java/com/uas/finance/model/AccountInfo.java
  85. 168 0
      finance-service/src/main/java/com/uas/finance/model/AssociateCompany.java
  86. 134 0
      finance-service/src/main/java/com/uas/finance/model/Attach.java
  87. 108 0
      finance-service/src/main/java/com/uas/finance/model/BusinessCondition.java
  88. 142 0
      finance-service/src/main/java/com/uas/finance/model/ChangesInstruction.java
  89. 233 0
      finance-service/src/main/java/com/uas/finance/model/CustomerExcutive.java
  90. 577 0
      finance-service/src/main/java/com/uas/finance/model/CustomerInfo.java
  91. 94 0
      finance-service/src/main/java/com/uas/finance/model/Enterprise.java
  92. 166 0
      finance-service/src/main/java/com/uas/finance/model/ErpLog.java
  93. 72 0
      finance-service/src/main/java/com/uas/finance/model/FinanceApplyAttach.java
  94. 228 0
      finance-service/src/main/java/com/uas/finance/model/FinanceCondition.java
  95. 340 0
      finance-service/src/main/java/com/uas/finance/model/FinancingApply.java
  96. 128 0
      finance-service/src/main/java/com/uas/finance/model/FsSale.java
  97. 356 0
      finance-service/src/main/java/com/uas/finance/model/MFCustInfo.java
  98. 142 0
      finance-service/src/main/java/com/uas/finance/model/MFCustInfoDetail.java
  99. 158 0
      finance-service/src/main/java/com/uas/finance/model/ProductMix.java
  100. 115 0
      finance-service/src/main/java/com/uas/finance/model/Receipt.java

+ 284 - 0
finance-service/pom.xml

@@ -0,0 +1,284 @@
+<?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>finance-parent</artifactId>
+        <groupId>com.uas.finance</groupId>
+        <version>0.0.1-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>finance-service</artifactId>
+    <packaging>war</packaging>
+    <dependencies>
+        <dependency>
+            <groupId>com.uas.platform</groupId>
+            <artifactId>platform-core</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>*</groupId>
+                    <artifactId>*</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>ant</groupId>
+            <artifactId>ant</artifactId>
+            <version>1.6.5</version>
+        </dependency>
+
+        <!-- spring boot -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-jpa</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-security</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-tx</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.uas.account</groupId>
+            <artifactId>sso-core</artifactId>
+            <version>0.0.1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>com.uas.sso</groupId>
+            <artifactId>sso-common</artifactId>
+            <version>0.0.1-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.github.sgroschupf</groupId>
+            <artifactId>zkclient</artifactId>
+            <version>0.1</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>slf4j-log4j12</artifactId>
+                    <groupId>org.slf4j</groupId>
+                </exclusion>
+              <exclusion>
+                <artifactId>log4j</artifactId>
+                <groupId>log4j</groupId>
+              </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.zookeeper</groupId>
+            <artifactId>zookeeper</artifactId>
+            <version>3.4.6</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>slf4j-log4j12</artifactId>
+                    <groupId>org.slf4j</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpmime</artifactId>
+            <version>4.5.2</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.4</version>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>dubbo</artifactId>
+            <version>2.8.4</version>
+          <exclusions>
+            <exclusion>
+              <artifactId>log4j</artifactId>
+              <groupId>log4j</groupId>
+            </exclusion>
+          </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>com.caucho</groupId>
+            <artifactId>hessian</artifactId>
+            <version>4.0.38</version>
+        </dependency>
+        <dependency>
+            <groupId>com.uas.dfs</groupId>
+            <artifactId>dfs-api</artifactId>
+            <version>0.0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi</artifactId>
+            <version>3.9</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <!-- 在maven生命周期validate阶段生成timestamp -->
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>buildnumber-maven-plugin</artifactId>
+                <version>1.3</version>
+                <executions>
+                    <execution>
+                        <phase>validate</phase>
+                        <goals>
+                            <goal>create-timestamp</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <format>{0,date,yyyy-MM-dd HH:mm:ss}</format>
+                    <items>
+                        <item>timestamp</item>
+                    </items>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <encoding>${project.build.sourceEncoding}</encoding>
+                    <source>1.7</source>
+                    <target>1.7</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-resources</id>
+                        <phase>prepare-package</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${project.build.directory}/minify</outputDirectory>
+                            <overwrite>false</overwrite>
+                            <resources>
+                                <resource>
+                                    <directory>${basedir}/src/main/webapp</directory>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+           <!-- <plugin>
+                <groupId>com.uas.plugins</groupId>
+                <artifactId>static-maven-plugin</artifactId>
+                <version>0.0.2-SNAPSHOT</version>
+                &lt;!&ndash; 静态资源分离 &ndash;&gt;
+                <executions>
+                    <execution>
+                        <id>default-static</id>
+                        <phase>prepare-package</phase>
+                        <configuration>
+                            <staticUrl>static</staticUrl>
+                            <webappDir>${project.build.directory}/minify</webappDir>
+                            <sourceDir>/</sourceDir>
+                            <targetDir>${project.build.directory}/statics</targetDir>
+                            <staticDir>/</staticDir>
+                            <sourceIncludes>
+                                <sourceInclude>resources/js/**/*.js</sourceInclude>
+                                <sourceInclude>WEB-INF/views/**/*.html</sourceInclude>
+                            </sourceIncludes>
+                            &lt;!&ndash; http://static.ubtoc.com/css/index.css?_v=1450321871828 &ndash;&gt;
+                            <versionSuffix>
+                                <suffix>?_v=${timestamp}</suffix>
+                                <exclude>**/lib/**/*</exclude>
+                            </versionSuffix>
+                        </configuration>
+                        <goals>
+                            <goal>static</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>-->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-war-plugin</artifactId>
+                <!--<configuration>
+                    <webResources>
+                        <resource>
+                            <directory>${project.build.directory}/statics</directory>
+                        </resource>
+                        <resource>
+                            <directory>${project.build.directory}/minify</directory>
+                        </resource>
+                    </webResources>
+                </configuration>-->
+            </plugin>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.eclipse.m2e</groupId>
+                    <artifactId>lifecycle-mapping</artifactId>
+                    <version>1.0.0</version>
+                    <configuration>
+                        <lifecycleMappingMetadata>
+                            <pluginExecutions>
+                                <pluginExecution>
+                                    <pluginExecutionFilter>
+                                        <groupId>
+                                            org.codehaus.mojo
+                                        </groupId>
+                                        <artifactId>
+                                            buildnumber-maven-plugin
+                                        </artifactId>
+                                        <versionRange>
+                                            [1.3,)
+                                        </versionRange>
+                                        <goals>
+                                            <goal>
+                                                create-timestamp
+                                            </goal>
+                                        </goals>
+                                    </pluginExecutionFilter>
+                                    <action>
+                                        <ignore></ignore>
+                                    </action>
+                                </pluginExecution>
+                            </pluginExecutions>
+                        </lifecycleMappingMetadata>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build>
+
+
+</project>

+ 40 - 0
finance-service/src/main/java/com/uas/finance/Application.java

@@ -0,0 +1,40 @@
+package com.uas.finance;
+
+import com.uas.finance.util.ContextUtils;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.context.event.ApplicationPreparedEvent;
+import org.springframework.context.ApplicationListener;
+import org.springframework.context.annotation.ImportResource;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+import org.springframework.web.servlet.config.annotation.EnableWebMvc;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.PrintStream;
+
+/**
+ * created by shicr on 2017/12/12
+ **/
+@EnableTransactionManagement(proxyTargetClass = true)
+@SpringBootApplication(scanBasePackages = "com.uas.finance")
+@EnableWebMvc
+@ImportResource("classpath:spring/*.xml")
+public class Application {
+    public static void main(String[] args) throws FileNotFoundException {
+        File logFile = new File("logs/log.log");
+        if (!logFile.getParentFile().exists()) {
+            logFile.getParentFile().mkdir();
+        }
+        System.setErr(new PrintStream(new FileOutputStream(logFile, true)));
+        SpringApplication application = new SpringApplication(Application.class);
+        application.addListeners(new ApplicationListener<ApplicationPreparedEvent>() {
+            @Override
+            public void onApplicationEvent(ApplicationPreparedEvent event) {
+                ContextUtils.setApplicationContext(event.getApplicationContext());
+            }
+        });
+        application.run(args);
+    }
+}

+ 128 - 0
finance-service/src/main/java/com/uas/finance/DruidDBConfiguration.java

@@ -0,0 +1,128 @@
+package com.uas.finance;
+
+import com.alibaba.druid.pool.DruidDataSource;
+import com.alibaba.druid.support.http.StatViewServlet;
+import com.alibaba.druid.support.http.WebStatFilter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Value;
+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;
+import org.springframework.context.annotation.Primary;
+
+import javax.sql.DataSource;
+import java.sql.SQLException;
+
+@Configuration
+public class DruidDBConfiguration {
+
+	private Logger logger = LoggerFactory.getLogger(DruidDBConfiguration.class);
+
+	@Value("${datasource.url}")
+	private String url;
+
+	@Value("${datasource.username}")
+	private String username;
+
+	@Value("${datasource.password}")
+	private String password;
+
+	@Value("${datasource.driverClassName}")
+	private String driverClassName;
+
+	@Value("${datasource.initialSize}")
+	private int initialSize;
+
+	@Value("${datasource.minIdle}")
+	private int minIdle;
+
+	@Value("${datasource.maxActive}")
+	private int maxActive;
+
+	@Value("${datasource.maxWait}")
+	private int maxWait;
+
+	@Value("${datasource.timeBetweenEvictionRunsMillis}")
+	private int timeBetweenEvictionRunsMillis;
+
+	@Value("${datasource.minEvictableIdleTimeMillis}")
+	private int minEvictableIdleTimeMillis;
+
+	@Value("${datasource.validationQuery}")
+	private String validationQuery;
+
+	@Value("${datasource.testWhileIdle}")
+	private boolean testWhileIdle;
+
+	@Value("${datasource.testOnBorrow}")
+	private boolean testOnBorrow;
+
+	@Value("${datasource.testOnReturn}")
+	private boolean testOnReturn;
+
+	@Value("${datasource.timeBetweenLogStatsMillis}")
+	private int timeBetweenLogStatsMillis;
+
+	@Value("${datasource.poolPreparedStatements}")
+	private boolean poolPreparedStatements;
+
+	@Value("${datasource.maxPoolPreparedStatementPerConnectionSize}")
+	private int maxPoolPreparedStatementPerConnectionSize;
+
+	@Value("${datasource.filters}")
+	private String filters;
+
+	@Value("${datasource.connectionProperties}")
+	private String connectionProperties;
+
+	@Bean
+	@Primary
+	public DataSource dataSource() {
+		DruidDataSource dataSource = new DruidDataSource();
+
+		dataSource.setUrl(url);
+		dataSource.setUsername(username);
+		dataSource.setPassword(password);
+		dataSource.setDriverClassName(driverClassName);
+
+		// configuration
+		dataSource.setInitialSize(initialSize);
+		dataSource.setMinIdle(minIdle);
+		dataSource.setMaxActive(maxActive);
+		dataSource.setMaxWait(maxWait);
+		dataSource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
+		dataSource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
+		dataSource.setValidationQuery(validationQuery);
+		dataSource.setTestWhileIdle(testWhileIdle);
+		dataSource.setTestOnBorrow(testOnBorrow);
+		dataSource.setTestOnReturn(testOnReturn);
+		dataSource.setTimeBetweenLogStatsMillis(timeBetweenLogStatsMillis);
+		dataSource.setPoolPreparedStatements(poolPreparedStatements);
+		dataSource.setMaxPoolPreparedStatementPerConnectionSize(maxPoolPreparedStatementPerConnectionSize);
+		try {
+			dataSource.setFilters(filters);
+		} catch (SQLException e) {
+			logger.error("数据源初始化失败: setFilters", e);
+		}
+		dataSource.setConnectionProperties(connectionProperties);
+		return dataSource;
+	}
+
+	@Bean
+	public ServletRegistrationBean servletRegistrationBean() {
+		return new ServletRegistrationBean(new StatViewServlet(), "/druid/*");
+	}
+
+	@Bean
+	public FilterRegistrationBean filterRegistrationBean() {
+		FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
+		filterRegistrationBean.setFilter(new WebStatFilter());
+		filterRegistrationBean.addUrlPatterns("/*");
+		filterRegistrationBean.addInitParameter("exclusions",
+				"*.js,*.gif,*.jpg,*.png,*.bmp,*.css,*.ico,*.html,/druid/*");
+		return filterRegistrationBean;
+	}
+
+}

+ 14 - 0
finance-service/src/main/java/com/uas/finance/RestTemplateConfig.java

@@ -0,0 +1,14 @@
+package com.uas.finance;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.client.RestTemplate;
+
+@Configuration
+public class RestTemplateConfig {
+
+    @Bean
+    public RestTemplate restTemplate(){
+        return new RestTemplate();
+    }
+}

+ 82 - 0
finance-service/src/main/java/com/uas/finance/SSOConfiguration.java

@@ -0,0 +1,82 @@
+package com.uas.finance;
+
+import com.uas.finance.filter.AccessSignatureInterceptor;
+import com.uas.finance.filter.SSOInterceptor;
+import com.uas.finance.util.ContextUtils;
+import com.uas.sso.web.AccountConfigurer;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Profile;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+
+import java.util.Properties;
+
+/**
+ * SSOconfig 配置
+ *
+ * @author hejq
+ */
+@Configuration
+public class SSOConfiguration extends WebMvcConfigurerAdapter {
+
+    @Autowired
+    private SSOInterceptor ssoInterceptor;
+
+    @Autowired
+    private AccessSignatureInterceptor accessSignatureInterceptor;
+
+    private Logger logger = Logger.getLogger(this.getClass());
+
+    @Override
+    public void addInterceptors(InterceptorRegistry registry) {
+
+        /**
+         * SSO过滤, 这个地方拦截配置
+         */
+        registry.addInterceptor(ssoInterceptor).addPathPatterns("/**").
+                excludePathPatterns("/WEB-INF/**", "/**/static/**", "/sso/login/**", "/sso/login","/sso/logout/**", "/sso/register/**",
+                        "/erp/**", "/sellerquota/erp/**", "/customer/erp/**", "/repayment/erp/**", "/login/**");
+
+        /**
+         * 拦截器配置
+         */
+        registry.addInterceptor(accessSignatureInterceptor).addPathPatterns("/erp/**", "/sellerquota/erp/**", "/customer/erp/**", "/repayment/erp/**");
+
+    }
+
+    @Bean
+    @Profile("prod")
+    public AccountConfigurer prodAccountConfigurer() {
+        return accountConfigurer("prod");
+    }
+
+    @Bean
+    @Profile("dev")
+    public AccountConfigurer testAccountConfigurer() {
+        return accountConfigurer("dev");
+    }
+
+    /**
+     * 获取当前环境下的配置
+     *
+     * @param profile
+     * @return
+     */
+    private AccountConfigurer accountConfigurer(String profile) {
+        AccountConfigurer accountConfigurer = new AccountConfigurer();
+        accountConfigurer.setApplicationContext(ContextUtils.getApplicationContext());
+        Properties properties = new Properties();
+        String configPath = profile + "/account.properties";
+        logger.info("***: " + configPath);
+        try {
+            properties.load(this.getClass().getClassLoader().getResourceAsStream(configPath));
+        } catch (Throwable e) {
+            throw new IllegalStateException("配置加载失败" + configPath);
+        }
+        accountConfigurer.initProperties(properties);
+        return accountConfigurer;
+    }
+}

+ 70 - 0
finance-service/src/main/java/com/uas/finance/WebAppConfiguration.java

@@ -0,0 +1,70 @@
+package com.uas.finance;
+
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.alibaba.fastjson.support.config.FastJsonConfig;
+import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.MediaType;
+import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.http.converter.StringHttpMessageConverter;
+import org.springframework.web.servlet.config.annotation.*;
+import org.springframework.web.servlet.view.InternalResourceViewResolver;
+
+import java.nio.charset.Charset;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Web相关配置
+ * 
+ * @author sunyj
+ * @since 2017217日 下午5:45:38
+ */
+@Configuration
+@ComponentScan(basePackages = "com.uas.finance.controller")
+public class WebAppConfiguration extends WebMvcConfigurerAdapter {
+
+	@Override
+	public void addResourceHandlers(ResourceHandlerRegistry registry) {
+		// Spring boot默认资源路径在src/main/resources下,而非/src/main/webapp
+		// 使用/src/main/webapp下资源均需在此添加
+		registry.addResourceHandler("/static/**").addResourceLocations("/resources/");
+		registry.addResourceHandler("/WEB-INF/**").addResourceLocations("/WEB-INF/");
+		super.addResourceHandlers(registry);
+	}
+
+	@Override
+	public void configureViewResolvers(ViewResolverRegistry registry) {
+		InternalResourceViewResolver viewResolver = new InternalResourceViewResolver("/WEB-INF/views/", ".html");
+		viewResolver.setContentType("text/html;charset=UTF-8");
+		registry.viewResolver(viewResolver);
+		super.configureViewResolvers(registry);
+	}
+
+	@Override
+	public void addViewControllers(ViewControllerRegistry registry) {
+		registry.addViewController("/").setViewName("index");
+		registry.addViewController("/index").setViewName("index");
+		registry.addViewController("/login/proxy").setViewName("proxyLogin");
+		registry.addViewController("/logout/proxy").setViewName("proxyLogout");
+		super.addViewControllers(registry);
+	}
+
+	@Override
+	public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
+		FastJsonHttpMessageConverter fastJsonHttpMessageConverter = new FastJsonHttpMessageConverter();
+		fastJsonHttpMessageConverter.setSupportedMediaTypes(Arrays.asList(MediaType.APPLICATION_JSON_UTF8));
+		FastJsonConfig fastJsonConfig = new FastJsonConfig();
+		fastJsonConfig.setSerializerFeatures(SerializerFeature.DisableCircularReferenceDetect);
+		fastJsonHttpMessageConverter.setFastJsonConfig(fastJsonConfig);
+		converters.add(fastJsonHttpMessageConverter);
+
+		StringHttpMessageConverter stringHttpMessageConverter = new StringHttpMessageConverter(
+				Charset.forName("UTF-8"));
+		stringHttpMessageConverter.setSupportedMediaTypes(Arrays.asList(MediaType.TEXT_HTML));
+		converters.add(stringHttpMessageConverter);
+		super.configureMessageConverters(converters);
+	}
+
+}

+ 61 - 0
finance-service/src/main/java/com/uas/finance/constants/Role.java

@@ -0,0 +1,61 @@
+package com.uas.finance.constants;
+
+import com.uas.finance.util.StringUtils;
+
+/**
+ * 用户角色
+ * 
+ * @author sunyj
+ * @since 2017817日 上午10:43:46
+ */
+public enum Role {
+
+	/**
+	 * 用户刚注册时,默认为普通用户
+	 */
+	DEFAULT,
+
+	/**
+	 * 金融服务商
+	 */
+	PROVIDER,
+
+	/**
+	 * 管理员
+	 */
+	ADMIN;
+
+	/**
+	 * 获取用户角色
+	 * 
+	 * @param role
+	 * @return 获取的用户角色,失败则返回null
+	 */
+	public static Role getRole(String role) {
+		if (StringUtils.isEmpty(role)) {
+			return null;
+		}
+		try {
+			return Role.valueOf(role.toUpperCase());
+		} catch (IllegalArgumentException e) {
+			return null;
+		}
+	}
+
+	/**
+	 * 获取用户角色
+	 * 
+	 * @param role
+	 * @return 获取的用户角色
+	 * @throws IllegalArgumentException
+	 *             失败,抛出异常
+	 */
+	public static Role checkRole(String role) throws IllegalArgumentException {
+		Role r = getRole(role);
+		if (r == null) {
+			throw new IllegalArgumentException("不支持该用户角色:" + role);
+		}
+		return r;
+	}
+
+}

+ 144 - 0
finance-service/src/main/java/com/uas/finance/constants/Status.java

@@ -0,0 +1,144 @@
+package com.uas.finance.constants;
+
+import com.uas.finance.util.StringUtils;
+
+/**
+ * 状态
+ * 
+ * @author sunyj
+ * @since 2017818日 上午9:11:25
+ */
+public enum Status {
+
+	/**
+	 * 待处理
+	 */
+	UNPROCESSED(100),
+
+	/**
+	 * 已批准
+	 */
+	APPROVED(101),
+
+	/**
+	 * 不批准
+	 */
+	UNAPPROVED(102),
+
+	/**
+	 * 已保存
+	 */
+	SAVED(201),
+
+	/**
+	 * 已提交
+	 */
+	SUBMIT(202),
+
+	/**
+	 * 待下载
+	 */
+	NOT_UPLOAD(202),
+
+	/**
+	 * 已下载
+	 */
+	DOWNLOADED(203),
+
+
+	/**
+	 *批复成功
+	 */
+	SUCCESS(204),
+
+
+	/**
+	 * 批复失败
+	 */
+	FAILED(205);
+
+
+
+	private Integer code;
+
+	private Status(Integer code) {
+		this.code = code;
+	}
+
+	public Integer code() {
+		return code;
+	}
+
+	/**
+	 * 获取状态
+	 * 
+	 * @param name
+	 *            状态名
+	 * @return 获取的状态,失败则返回null
+	 */
+	public static Status getStatus(String name) {
+		if (StringUtils.isEmpty(name)) {
+			return null;
+		}
+		try {
+			return Status.valueOf(name.toUpperCase());
+		} catch (IllegalArgumentException e) {
+			return null;
+		}
+	}
+
+	/**
+	 * 获取状态
+	 * 
+	 * @param name
+	 *            状态名
+	 * @return 获取的状态
+	 * @throws IllegalArgumentException
+	 *             失败,抛出异常
+	 */
+	public static Status checkStatus(String name) throws IllegalArgumentException {
+		Status status = getStatus(name);
+		if (status == null) {
+			throw new IllegalArgumentException("不支持该状态:" + name);
+		}
+		return status;
+	}
+
+	/**
+	 * 获取状态
+	 * 
+	 * @param code
+	 *            状态码
+	 * @return 获取的状态,失败则返回null
+	 */
+	public static Status getStatus(Integer code) {
+		if (code == null) {
+			return null;
+		}
+		for (Status status : Status.values()) {
+			if (status.code == code) {
+				return status;
+			}
+		}
+		return null;
+
+	}
+
+	/**
+	 * 获取状态
+	 * 
+	 * @param code
+	 *            状态码
+	 * @return 获取的状态
+	 * @throws IllegalArgumentException
+	 *             失败,抛出异常
+	 */
+	public static Status checkStatus(Integer code) throws IllegalArgumentException {
+		Status status = getStatus(code);
+		if (status == null) {
+			throw new IllegalArgumentException("不支持该状态:" + code);
+		}
+		return status;
+	}
+
+}

+ 64 - 0
finance-service/src/main/java/com/uas/finance/controller/AccountApplyAttachController.java

@@ -0,0 +1,64 @@
+package com.uas.finance.controller;
+
+import com.uas.finance.model.AccountApplyAttach;
+import com.uas.finance.service.AccountApplyAttachService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+
+/**
+ * 应收账款转让控制层
+ * created by shicr on 2018/1/30
+ **/
+@RequestMapping("/accountapply")
+@RestController
+public class AccountApplyAttachController {
+
+    private Logger logger = LoggerFactory.getLogger(AccountApplyAttachController.class);
+
+    @Autowired
+    private AccountApplyAttachService accountApplyAttachService;
+
+    /**
+     * 应收账款附件保存
+     *
+     * @param attach
+     * @return
+     */
+    @RequestMapping(value = "/attachsave", method = RequestMethod.POST)
+    public AccountApplyAttach save(MultipartFile file, AccountApplyAttach attach) {
+        logger.info("应收账款附件保存","success");
+        return accountApplyAttachService.save(file, attach);
+    }
+
+    /**
+     * 删除附件
+     * @param id
+     */
+    @RequestMapping(value = "/attachdelete",method = RequestMethod.POST)
+    public void delete(Long id){
+        logger.info("删除附件","success");
+        accountApplyAttachService.delete(id);
+    }
+
+    /**
+     * 查找某出账单下所有附件
+     *
+     * @param aaid
+     * @return
+     */
+    @RequestMapping(value = "/findByAaid", method = RequestMethod.GET)
+    public List<AccountApplyAttach> findByAaid(Long aaid) {
+        logger.info("查找出某账单下所有附件", "success");
+        List<AccountApplyAttach> list = accountApplyAttachService.findByAaid(aaid);
+        return list;
+    }
+
+
+}

+ 75 - 0
finance-service/src/main/java/com/uas/finance/controller/AccountApplyController.java

@@ -0,0 +1,75 @@
+package com.uas.finance.controller;
+
+import com.uas.finance.model.AccountApply;
+import com.uas.finance.service.AccountApplyService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 应收账款转让控制类
+ * created by shicr on 2018/1/27
+ **/
+@RequestMapping("/accountapply")
+@RestController
+public class AccountApplyController {
+
+    private Logger logger = LoggerFactory.getLogger(AccountApplyController.class);
+
+    @Autowired
+    private AccountApplyService service;
+
+    /**
+     * 出账申请保存
+     * @param accountApply
+     * @return
+     */
+    @RequestMapping(value = "/save",method = RequestMethod.POST)
+    public AccountApply save(@RequestBody AccountApply accountApply){
+        logger.info("出账申请保存","success");
+        AccountApply a =  service.save(accountApply);
+        return  a;
+    }
+
+    /**
+     * 出账申请提交
+     * @param accountApply
+     * @return
+     */
+    @RequestMapping(value = "/submit",method = RequestMethod.POST)
+    public AccountApply submit(@RequestBody AccountApply accountApply){
+        logger.info("出账申请正式提交","success");
+        AccountApply a = service.submit(accountApply);
+        return a;
+    }
+
+    /**
+     * 找到某买方下面的所有出账申请
+     * @param id
+     * @return
+     */
+    @RequestMapping(value = "/find",method = RequestMethod.GET)
+    public List<AccountApply> find(Long id){
+        logger.info("查找某买方客户的所有出账申请","success");
+        List<AccountApply> accountApplies = service.findByCq_id(id);
+        return accountApplies;
+    }
+
+    /**
+     * 找到某条出账单
+     * @param id
+     * @return
+     */
+    @RequestMapping(value = "/findone",method = RequestMethod.GET)
+    public AccountApply findone(Long id){
+        logger.info("查找某条出账单","success");
+        AccountApply accountApply = service.findOne(id);
+        return accountApply;
+    }
+}

+ 48 - 0
finance-service/src/main/java/com/uas/finance/controller/AccountInfoController.java

@@ -0,0 +1,48 @@
+package com.uas.finance.controller;
+
+import com.uas.finance.service.AccountInfoService;
+import com.uas.finance.model.AccountInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * created by shicr on 2017/12/21
+ * 财务数据表
+ **/
+@Controller
+@RequestMapping("/accountinfo")
+public class AccountInfoController {
+
+    private final static Logger logger = LoggerFactory.getLogger(AccountInfoController.class);
+
+    @Autowired
+    private AccountInfoService accountInfoService;
+
+    /**
+     * 财务数据保存
+     *
+     * @param accountInfos
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping("/save")
+    public List<AccountInfo> save(@RequestBody AccountInfo[] accountInfos) {
+        logger.info("财务数据保存", "success");
+        ArrayList<AccountInfo> arrayList = new ArrayList<AccountInfo>();
+        for (AccountInfo a : accountInfos) {
+            AccountInfo accountInfo = accountInfoService.save(a);
+            arrayList.add(accountInfo);
+        }
+        /*Long time = new Date().getTime();*/
+        Long time = System.currentTimeMillis();
+        return arrayList;
+    }
+}

+ 47 - 0
finance-service/src/main/java/com/uas/finance/controller/AssociateCompanyController.java

@@ -0,0 +1,47 @@
+package com.uas.finance.controller;
+
+import com.uas.finance.model.AssociateCompany;
+import com.uas.finance.service.AssociateCompanyService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 关联企业表单
+ * created by shicr on 2017/12/19
+ **/
+@Controller
+@RequestMapping("/associate")
+public class AssociateCompanyController {
+
+    private final static Logger logger = LoggerFactory.getLogger(AssociateCompanyController.class);
+
+    @Autowired
+    private AssociateCompanyService service;
+
+    /**
+     * 关联企业保存
+     *
+     * @param company
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    public List<AssociateCompany> save(@RequestBody AssociateCompany[] company) {
+        logger.info("关联企业表单保存", "success");
+        ArrayList<AssociateCompany> arrayList = new ArrayList<AssociateCompany>();
+        for (AssociateCompany a : company) {
+            AssociateCompany associateCompany = service.save(a);
+            arrayList.add(associateCompany);
+        }
+        return arrayList;
+    }
+}

+ 141 - 0
finance-service/src/main/java/com/uas/finance/controller/AttachController.java

@@ -0,0 +1,141 @@
+package com.uas.finance.controller;
+
+import com.uas.dfs.service.FileClient;
+import com.uas.finance.service.AttachService;
+import com.uas.finance.model.Attach;
+import com.uas.finance.service.FinancingApplyService;
+import com.uas.finance.util.FileUploadHttp;
+import com.uas.finance.util.FileUrl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+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.*;
+import java.util.List;
+
+/**
+ * 附件上传下载控制层
+ * created by shicr on 2017/12/25
+ **/
+@RestController
+@RequestMapping("/attach")
+public class AttachController {
+
+    private final static Logger logger = LoggerFactory.getLogger(AttachController.class);
+
+    @Autowired
+    private FileClient fileClient;
+
+    @Autowired
+    private AttachService attachService;
+
+    @Autowired
+    private FinancingApplyService financingApplyService;
+
+
+    /**
+     * 上传图片
+     *
+     * @param file
+     * @param attach
+     * @return
+     * @throws IOException
+     */
+    @RequestMapping(value = "/upload", method = RequestMethod.POST)
+    public Attach save(MultipartFile file, Attach attach) throws Exception {
+        //上传图片
+        String path = FileUploadHttp.upload(FileUrl.FILE_UPLOAD, file, null);
+        String name = file.getOriginalFilename();
+        Long size = file.getSize();
+        attach.setName(name);
+        attach.setSize(size);
+        attach.setPath(path);
+        attach.setApplyId(attach.getApplyId());
+        attach.setType(attach.getType());
+
+        logger.info("附件保存", "success");
+        return attachService.save(attach);
+    }
+
+
+
+    /**
+     * 删除附件
+     *
+     * @param id
+     * @return
+     */
+    @RequestMapping(value = "/delete", method = RequestMethod.POST)
+    public void delete(Long id) {
+        logger.info("删除单个附件");
+         attachService.deleteOne(id);
+    }
+
+    /**
+     * 查找某金融申请单的所有附件
+     * @param cuId
+     * @return
+     */
+    @RequestMapping("/findattaches")
+    public List<Attach> findattaches(Long cuId) {
+        List<Attach> attaches =attachService.findAttachesByCuId(cuId);
+        logger.info("查找某金融申请单的所有附件", "success");
+        return  attaches;
+    }
+
+
+
+    /**
+     * 找到保理申请需要下载的文件
+     *
+     * @param fauu
+     * @return
+     */
+    @RequestMapping("/download")
+    public void findDownload(Long fauu, HttpServletResponse response) throws IOException {
+        logger.info("找到保理申请需要下载的文件", "success");
+        Attach attach = attachService.findDownload(fauu);
+        if (attach == null) {
+            throw new IllegalArgumentException("附件不存在");
+        }
+        response.addHeader("Content-Disposition", "attachment;filename=" + new String(attach.getName().getBytes("utf-8"), "iso-8859-1"));
+        response.setCharacterEncoding("utf-8");
+        response.setContentType("application/octec-stream");
+        String path = attach.getPath();
+        if (path.startsWith("https://dfs.ubtob.com")) {// 存储在dfs存储服务器,去dfs存储服务器下载
+            byte[] fileBytes = fileClient.download(attach.getPath());
+            if (fileBytes.length <= 0) {
+                throw new IllegalArgumentException("附件不存在");
+            }
+            response.addHeader("Content-Length", String.valueOf(fileBytes.length));
+            OutputStream os = response.getOutputStream();
+            os.write(fileBytes);
+            os.close();
+        } else if (path.startsWith("http://") || path.startsWith("https://") || path.startsWith("ftp://") || path.startsWith("sftp://")) {
+            // 存放在其他网络资源中,直接跳转至链接地址
+            response.sendRedirect(path);
+        } else {
+            // 其他的当做是存放在本地服务器上,去本地服务器根据文件路径去获取
+            File file = new File(attach.getPath());
+            if (!file.exists()) {throw new IllegalArgumentException("附件不存在");}
+            InputStream in = new FileInputStream(path);
+            OutputStream os = response.getOutputStream();
+            response.addHeader("Content-Disposition", "attachment;filename=" + new String(attach.getName().getBytes("utf-8"), "iso-8859-1"));
+            response.addHeader("Content-Length", String.valueOf(file.length()));
+            response.setCharacterEncoding("utf-8");
+            response.setContentType("application/octec-stream");
+            int data = 0;
+            while ((data = in.read()) != -1) {
+                os.write(data);
+            }
+            in.close();
+            os.close();
+        }
+    }
+
+
+
+}

+ 39 - 0
finance-service/src/main/java/com/uas/finance/controller/BusinessConditionController.java

@@ -0,0 +1,39 @@
+package com.uas.finance.controller;
+
+import com.uas.finance.service.BusinessConditionService;
+import com.uas.finance.model.BusinessCondition;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+/**
+ * 情况描述表单有关操作
+ * created by shicr on 2017/12/21
+ **/
+@Controller
+@RequestMapping("/businesscondition")
+public class BusinessConditionController {
+
+    private final static Logger logger = LoggerFactory.getLogger(BusinessConditionController.class);
+
+    @Autowired
+    private BusinessConditionService businessConditionService;
+
+    /**
+     * 情况描述表单保存
+     *
+     * @param businessCondition
+     * @return
+     */
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    @ResponseBody
+    public BusinessCondition save(@RequestBody BusinessCondition businessCondition) {
+        logger.info("情况描述表单保存", "success");
+        return businessConditionService.save(businessCondition);
+    }
+}

+ 47 - 0
finance-service/src/main/java/com/uas/finance/controller/ChangesInstructionController.java

@@ -0,0 +1,47 @@
+package com.uas.finance.controller;
+
+import com.uas.finance.service.ChangesInstructionService;
+import com.uas.finance.model.ChangesInstruction;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 变更内容表单
+ * created by shicr on 2017/12/20
+ **/
+@Controller
+@RequestMapping("/changesInstruction")
+public class ChangesInstructionController {
+
+    private final static Logger logger = LoggerFactory.getLogger(ChangesInstructionController.class);
+
+    @Autowired
+    private ChangesInstructionService service;
+
+    /**
+     * 变更内容保存
+     *
+     * @param instructions
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    public List<ChangesInstruction> save(@RequestBody ChangesInstruction[] instructions) {
+        logger.info("变更内容保存", "success");
+        ArrayList<ChangesInstruction> arrayList = new ArrayList<ChangesInstruction>();
+        for (ChangesInstruction c : instructions) {
+            ChangesInstruction changesInstruction = service.save(c);
+            arrayList.add(changesInstruction);
+        }
+        return arrayList;
+    }
+}

+ 51 - 0
finance-service/src/main/java/com/uas/finance/controller/CustomerExcutiveController.java

@@ -0,0 +1,51 @@
+package com.uas.finance.controller;
+
+import com.uas.finance.service.CustomerExcutiveService;
+import com.uas.finance.model.CustomerExcutive;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 管理层信息表单
+ * created by shicr on 2017/12/21
+ **/
+@Controller
+@RequestMapping("/customerexcutive")
+public class CustomerExcutiveController {
+
+    private final static Logger logger = LoggerFactory.getLogger(CustomerExcutiveController.class);
+
+
+    @Autowired
+    private CustomerExcutiveService excutiveService;
+
+
+    /**
+     * 管理层信息保存
+     *
+     * @param customerExcutive
+     * @return
+     */
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    @ResponseBody
+    public List<CustomerExcutive> save(@RequestBody CustomerExcutive[] customerExcutive) {
+        ArrayList<CustomerExcutive> arrayList = new ArrayList<CustomerExcutive>();
+        logger.info("管理层信息保存", "success");
+        for (CustomerExcutive excutive : customerExcutive) {
+            CustomerExcutive excutive1 = excutiveService.save(excutive);
+            arrayList.add(excutive1);
+        }
+
+        return arrayList;
+    }
+
+}

+ 240 - 0
finance-service/src/main/java/com/uas/finance/controller/CustomerInfoController.java

@@ -0,0 +1,240 @@
+package com.uas.finance.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.uas.finance.model.*;
+import com.uas.finance.service.*;
+import com.uas.finance.util.CollectionUtils;
+import com.uas.finance.util.SystemSession;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 客户基础资料表
+ * created by shicr on 2017/12/18
+ **/
+@Controller
+@RequestMapping("/customer")
+public class CustomerInfoController {
+
+    private final static Logger logger = LoggerFactory.getLogger(CustomerInfoController.class);
+
+    @Autowired
+    private CustomerInfoService service;
+
+    @Autowired
+    private CustomerExcutiveService excutiveService;
+
+    @Autowired
+    private AssociateCompanyService companyService;
+
+    @Autowired
+    private ChangesInstructionService instructionService;
+
+    @Autowired
+    private ShareholdersService shareholdersService;
+
+    @Autowired
+    private MFCustInfoService mfCustInfoService;
+
+    @Autowired
+    private BusinessConditionService businessConditionService;
+
+    @Autowired
+    private FinanceConditionService financeConditionService;
+
+    @Autowired
+    private AccountInfoService accountInfoService;
+
+    @Autowired
+    private UpdowncastService updowncastService;
+
+    @Autowired
+    private ProductMixService productMixService;
+
+    @Autowired
+    private MFCustInfoDetailService mfCustInfoDetailService;
+
+    /**
+     * 保存客户基础资料
+     *
+     * @param info
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/save")
+    public CustomerInfo save(@RequestBody CustomerInfo info) {
+        info.setEnuu(SystemSession.getUserAccount().getSpaceUU());
+        info.setCu_name(SystemSession.getUserAccount().getSpaceName());
+        info.setSubmitTime(new Date());
+        logger.info("保存客户基础资料", "success");
+        return service.save(info);
+    }
+
+    /**
+     * 判断是否已有客户资料
+     *
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/findnew", method = RequestMethod.GET)
+    public Boolean findNew() {
+        CustomerInfo customerInfo = null;
+        Long enuu = SystemSession.getUserAccount().getSpaceUU();
+        if (enuu != null) {
+            customerInfo = service.findNew(enuu);
+            if (customerInfo != null) {
+                return true;
+            }
+        }
+        logger.info("查看最新客户基础资料", "success");
+        return false;
+    }
+
+    /**
+     * 找到某一具体的客户资料
+     *
+     * @param id
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/findone", method = RequestMethod.GET)
+    public CustomerInfo findone(@RequestParam(value = "id") Long id) {
+        logger.info("找到某一具体的客户资料");
+        CustomerInfo customerInfo = service.findOne(id);
+        return customerInfo;
+    }
+
+    /**
+     * 接收UAS传来的补充客户资料
+     *
+     * @param customer
+     */
+    @Transactional
+    @ResponseBody
+    @RequestMapping(value = "/erp/updateinfo", method = RequestMethod.POST)
+    public Map<String, List<Map<String, Long>>> updateinfo(String customer) throws UnsupportedEncodingException {
+
+        Map<String, List<Map<String, Long>>> map = new HashMap<String, List<Map<String, Long>>>();
+        //客户资料
+        String customerInfo1 = URLDecoder.decode(customer, "utf-8");
+        CustomerInfo customerInfo = JSON.parseObject(customerInfo1, CustomerInfo.class);
+        //高管信息
+        List<CustomerExcutive> customerExcutiveList = customerInfo.getCustomerExcutives();
+
+        //股东信息表
+        List<Shareholders> shareholders = customerInfo.getShareholders();
+        //关联企业
+        List<AssociateCompany> associateCompanies = customerInfo.getAssociateCompanies();
+        //变更信息
+        List<ChangesInstruction> changesInstructions = customerInfo.getChangesInstructions();
+
+        List<Map<String, Long>> list1 = service.update(customerInfo);
+        map.put("customer", list1);
+
+        if (!CollectionUtils.isEmpty(customerExcutiveList)) {
+            List<Map<String, Long>> list = excutiveService.update(customerExcutiveList);
+            map.put("customerExcutive", list);
+        }
+        if (!CollectionUtils.isEmpty(shareholders)) {
+            List<Map<String, Long>> list = shareholdersService.update(shareholders);
+            map.put("shareholders", list);
+        }
+        if (!CollectionUtils.isEmpty(associateCompanies)) {
+            List<Map<String, Long>> list = companyService.update(associateCompanies);
+            map.put("associateCompany", list);
+        }
+        if (!CollectionUtils.isEmpty(changesInstructions)) {
+            List<Map<String, Long>> list = instructionService.update(changesInstructions);
+            map.put("changeInstruction", list);
+        }
+        logger.info("接收UAS传来的补充客户资料", "success");
+        return map;
+    }
+
+    /**
+     * 接收ERP传来的补充客户资料下的从表
+     *
+     * @param mfCust
+     * @param businessCondition
+     * @param prouductMixe
+     * @param updowncast
+     * @param financeCondition
+     * @param accountList
+     */
+    @Transactional
+    @ResponseBody
+    @RequestMapping(value = "/erp/updateinfo2", method = RequestMethod.POST)
+    public Map<String, List<Map<String, Long>>> updateinfo2(String mfCust,
+                                                            String mfCustInfoDetailList,
+                                                            String businessCondition,
+                                                            String prouductMixe,
+                                                            String updowncast,
+                                                            String financeCondition,
+                                                            String accountList)
+            throws UnsupportedEncodingException {
+
+        Map<String, List<Map<String, Long>>> map = new HashMap<String, List<Map<String, Long>>>();
+        //买方客户资料
+        if (mfCust != null) {
+            String mfCust1 = URLDecoder.decode(mfCust, "utf-8");
+            List<MFCustInfo> mfCustInfos = JSON.parseArray(mfCust1, MFCustInfo.class);
+            List<Map<String, Long>> list = mfCustInfoService.update(mfCustInfos);
+            map.put("mfCust", list);
+        }
+        //买方客户明细
+        if (mfCustInfoDetailList != null) {
+            String mfCustDetail = URLDecoder.decode(mfCustInfoDetailList, "utf-8");
+            List<MFCustInfoDetail> mfCustInfoDetails = JSON.parseArray(mfCustDetail, MFCustInfoDetail.class);
+            List<Map<String, Long>> list = mfCustInfoDetailService.update(mfCustInfoDetails);
+            map.put("mfCustInfoDetailList", list);
+        }
+        if (businessCondition != null) {
+            //贸易描述
+            String businessCondition1 = URLDecoder.decode(businessCondition, "utf-8");
+            BusinessCondition businessCondition2 = JSON.parseObject(businessCondition1, BusinessCondition.class);
+            List<Map<String, Long>> list = businessConditionService.update(businessCondition2);
+            map.put("businessCondition", list);
+        }
+        if (financeCondition != null) {
+            //财务情况说明
+            String financeCondition1 = URLDecoder.decode(financeCondition, "utf-8");
+            FinanceCondition financeCondition2 = JSON.parseObject(financeCondition1, FinanceCondition.class);
+            List<Map<String, Long>> list = financeConditionService.update(financeCondition2);
+            map.put("financeCondition", list);
+        }
+        if (prouductMixe != null) {
+            //经营情况表
+            String prouductMixe1 = URLDecoder.decode(prouductMixe, "utf-8");
+            List<ProductMix> productMixes = JSON.parseArray(prouductMixe1, ProductMix.class);
+            List<Map<String, Long>> list = productMixService.update(productMixes);
+            map.put("prouductMixe", list);
+        }
+        if (updowncast != null) {
+            //上下游
+            String updowncasts = URLDecoder.decode(updowncast, "utf-8");
+            List<Updowncast> updowncasts1 = JSON.parseArray(updowncasts, Updowncast.class);
+            List<Map<String, Long>> list = updowncastService.update(updowncasts1);
+            map.put("updowncast", list);
+        }
+        if (accountList != null) {
+            String accountInfo = URLDecoder.decode(accountList, "utf-8");
+            List<AccountInfo> accountInfos = JSON.parseArray(accountInfo, AccountInfo.class);
+            List<Map<String, Long>> list = accountInfoService.update(accountInfos);
+            map.put("accountList", list);
+        }
+        logger.info("接收ERP传来的补充客户资料下的从表", "success");
+        return map;
+    }
+}
+

+ 39 - 0
finance-service/src/main/java/com/uas/finance/controller/FinanceConditionController.java

@@ -0,0 +1,39 @@
+package com.uas.finance.controller;
+
+import com.uas.finance.service.FinanceConditionService;
+import com.uas.finance.model.FinanceCondition;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+/**
+ * 财务情况说明
+ * created by shicr on 2017/12/21
+ **/
+@Controller
+@RequestMapping("/financecondition")
+public class FinanceConditionController {
+
+    private final static Logger logger = LoggerFactory.getLogger(FinanceConditionController.class);
+
+    @Autowired
+    private FinanceConditionService financeConditionService;
+
+    /**
+     * 财务情况说明保存
+     *
+     * @param financeCondition
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    public FinanceCondition save(@RequestBody FinanceCondition financeCondition) {
+        logger.info("财务情况说明保存", "success");
+        return financeConditionService.save(financeCondition);
+    }
+}

+ 132 - 0
finance-service/src/main/java/com/uas/finance/controller/FinancingApplyController.java

@@ -0,0 +1,132 @@
+package com.uas.finance.controller;
+
+import com.uas.finance.service.CustomerInfoService;
+import com.uas.finance.service.FinancingApplyService;
+import com.uas.finance.constants.Status;
+import com.uas.finance.model.FinancingApply;
+import com.uas.finance.util.SystemSession;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 保理申请控制层
+ * created by shicr on 2017/12/25
+ **/
+@Controller
+@RequestMapping("/financeapply")
+public class FinancingApplyController {
+
+    private final static Logger logger = LoggerFactory.getLogger(FinancingApplyController.class);
+
+    @Autowired
+    private FinancingApplyService service;
+
+    @Autowired
+    private CustomerInfoService customerInfoService;
+
+    /**
+     * 金融申请表单保存
+     *
+     * @param financingApply
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    public FinancingApply save(@RequestBody FinancingApply financingApply) {
+        //设置保存状态
+        financingApply.setStatus(Status.SAVED.code());
+        logger.info("金融申请表单保存", "success");
+        return service.save(financingApply);
+    }
+
+
+    /**
+     * 金融申请表单提交
+     *
+     * @param financingApply
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/submit", method = RequestMethod.POST)
+    public FinancingApply submit(@RequestBody FinancingApply financingApply) {
+        //设置成提交状态
+        financingApply.setStatus(Status.SUBMIT.code());
+        //轮询设置成未下载状态
+        financingApply.setErpstatus(Status.NOT_UPLOAD.code());
+        logger.info("金融申请表单提交", "success");
+        return service.save(financingApply);
+    }
+
+    /**
+     * 根据id找到金融保理单
+     *
+     * @param id
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/findOne", method = RequestMethod.GET)
+    public FinancingApply findOne(@RequestBody Long id) {
+        logger.info("根据id找到金融保理单","success");
+        return service.findOne(id);
+    }
+
+
+    /**
+     * 查找某企业申请的保理单
+     *
+     * @param enuu
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/findByEnuu", method = RequestMethod.GET)
+    public List<FinancingApply> findByEnuu(Long enuu) {
+        logger.info("获取登录人的所有买方客户", "成功");
+        if (enuu != null) {
+            List<FinancingApply> financingApplies = service.findByEnuu(enuu);
+            return financingApplies;
+        }
+        return null;
+    }
+
+    /**
+     * 得到之前填写的客户资料
+     *
+     * @param enuu
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/getHistory", method = RequestMethod.GET)
+    public ModelMap hasApproved(@RequestParam(value = "enuu") Long enuu) {
+        logger.info("得到之前填写的客户资料","success");
+        return service.getHistory(enuu);
+    }
+
+    /**
+     * 确认客户资料
+     * @param id
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/checkinfo", method = RequestMethod.POST)
+    public void checkinfo(@RequestParam  Long id){
+        logger.info("确认客户资料","success");
+         service.checkInfo(id);
+    }
+
+    /**
+     * 查找出英唐保理下的所有客户
+     */
+    @ResponseBody
+    @RequestMapping(value = "/findAll", method = RequestMethod.GET)
+    public List<FinancingApply> findAll() {
+        Long fauu = SystemSession.getUserAccount().getSpaceUU();
+        logger.info("查找出英唐保理下的所有客户","success");
+        return service.findByFauu(fauu);
+    }
+}

+ 40 - 0
finance-service/src/main/java/com/uas/finance/controller/FsSaleController.java

@@ -0,0 +1,40 @@
+package com.uas.finance.controller;
+
+import com.uas.finance.model.FsSale;
+import com.uas.finance.service.FsSaleService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 基础合同控制层
+ * created by shicr on 2018/1/25
+ **/
+@RequestMapping("/fssale")
+@RestController
+public class FsSaleController {
+
+    private final static Logger logger = LoggerFactory.getLogger(FsSaleController.class);
+
+    @Autowired
+    private FsSaleService fsSaleService;
+
+    /**
+     * 基础合同保存
+     *
+     * @param fsSales
+     * @return
+     */
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    public List<FsSale> save(@RequestBody List<FsSale> fsSales) {
+        logger.info("基础合同保存", "成功");
+        List<FsSale> fsSaleList = fsSaleService.save(fsSales);
+        return fsSaleList;
+    }
+}

+ 54 - 0
finance-service/src/main/java/com/uas/finance/controller/MFCustInfoController.java

@@ -0,0 +1,54 @@
+package com.uas.finance.controller;
+
+import com.uas.finance.service.MFCustInfoService;
+import com.uas.finance.model.MFCustInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+/**
+ * 买方客户信息
+ * created by shicr on 2017/12/22
+ **/
+@Controller
+@RequestMapping("/mfcustinfo")
+public class MFCustInfoController {
+
+    private final static Logger logger = LoggerFactory.getLogger(MFCustInfoController.class);
+
+    @Autowired
+    private MFCustInfoService mfCustInfoService;
+
+    /**
+     * 买方客户信息保存
+     *
+     * @param mfCustInfo
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    public MFCustInfo save(@RequestBody MFCustInfo mfCustInfo) {
+
+        logger.info("买方客户信息保存", "success");
+        return mfCustInfoService.save(mfCustInfo);
+    }
+
+    /**
+     * 查找某一具体的买方客户信息
+     *
+     * @param id
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/findOne", method = RequestMethod.GET)
+    public MFCustInfo findOne(@RequestBody Long id) {
+
+        logger.info("查找某一具体的买方客户信息", "success");
+        return mfCustInfoService.findOne(id);
+    }
+}

+ 48 - 0
finance-service/src/main/java/com/uas/finance/controller/MFCustInfoDetailController.java

@@ -0,0 +1,48 @@
+package com.uas.finance.controller;
+
+import com.uas.finance.service.MFCustInfoDetailService;
+import com.uas.finance.model.MFCustInfoDetail;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 买方客户信息详情
+ * created by shicr on 2017/12/24
+ **/
+@Controller
+@RequestMapping("/mfcustinfodetail")
+public class MFCustInfoDetailController {
+
+    private final static Logger logger = LoggerFactory.getLogger(MFCustInfoDetailController.class);
+
+    @Autowired
+    private MFCustInfoDetailService service;
+
+    /**
+     * 买方客户信息详情保存
+     *
+     * @param mfCustInfoDetails
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    public List<MFCustInfoDetail> save(@RequestBody MFCustInfoDetail[] mfCustInfoDetails) {
+
+        ArrayList<MFCustInfoDetail> arrayList = new ArrayList<MFCustInfoDetail>();
+        logger.info("买方客户信息详情保存", "success");
+        for (MFCustInfoDetail mfCustInfoDetail : mfCustInfoDetails) {
+            MFCustInfoDetail mfCustInfoDetail1 = service.save(mfCustInfoDetail);
+            arrayList.add(mfCustInfoDetail1);
+        }
+        return arrayList;
+    }
+}

+ 48 - 0
finance-service/src/main/java/com/uas/finance/controller/ProductMixController.java

@@ -0,0 +1,48 @@
+package com.uas.finance.controller;
+
+import com.uas.finance.service.ProductMixService;
+import com.uas.finance.model.ProductMix;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 经营情况表单
+ * created by shicr on 2017/12/21
+ **/
+@Controller
+@RequestMapping("/productmix")
+public class ProductMixController {
+
+    private final static Logger logger = LoggerFactory.getLogger(ProductMixController.class);
+
+    @Autowired
+    private ProductMixService productMixService;
+
+    /**
+     * 经营情况表单保存
+     *
+     * @param productMixes
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    List<ProductMix> save(@RequestBody ProductMix[] productMixes) {
+
+        ArrayList<ProductMix> arrayList = new ArrayList<ProductMix>();
+        logger.info("经营情况表单保存", "success");
+        for (ProductMix productMix : productMixes) {
+            ProductMix productMix1 = productMixService.save(productMix);
+            arrayList.add(productMix1);
+        }
+        return arrayList;
+    }
+}

+ 40 - 0
finance-service/src/main/java/com/uas/finance/controller/ReceiptController.java

@@ -0,0 +1,40 @@
+package com.uas.finance.controller;
+
+import com.uas.finance.model.Receipt;
+import com.uas.finance.service.ReceiptService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 发票控制层
+ * created by shicr on 2018/1/27
+ **/
+@RequestMapping("/receipt")
+@RestController
+public class ReceiptController {
+
+    private final static Logger logger = LoggerFactory.getLogger(ReceiptController.class);
+
+    @Autowired
+    private ReceiptService service;
+
+    /**
+     * 基础发票保存
+     *
+     * @param receiptList
+     * @return
+     */
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    public List<Receipt> save(@RequestBody List<Receipt> receiptList) {
+        logger.info("保存发票信息", "success");
+        List<Receipt> receipts = service.save(receiptList);
+        return receipts;
+    }
+}

+ 68 - 0
finance-service/src/main/java/com/uas/finance/controller/RepaymentPlanController.java

@@ -0,0 +1,68 @@
+package com.uas.finance.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.uas.finance.model.RepaymentPlan;
+import com.uas.finance.service.RepaymentPlanService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 还款计划控制器
+ * created by shicr on 2018/2/24
+ **/
+@RestController
+@RequestMapping(value = "/repayment")
+public class RepaymentPlanController {
+
+    private final static Logger logger = LoggerFactory.getLogger(RepaymentPlanController.class);
+
+    @Autowired
+    private RepaymentPlanService service;
+
+    /**
+     * 获得UAS传来的某出账单下所有的还款计划
+     *
+     * @return
+     */
+    @RequestMapping(value = "/erp/getfromuas", method = RequestMethod.POST)
+    public List<Map<String, Long>> getfromuas(String list) throws UnsupportedEncodingException {
+        if (list != null) {
+            list = URLDecoder.decode(list, "utf-8");
+        }
+        List<RepaymentPlan> list1 = JSONObject.parseArray(list, RepaymentPlan.class);
+        logger.info("获得UAS传来的某出账单下所有的还款计划","success");
+        return service.save(list1);
+    }
+
+    /**
+     * 下载某出账单下的还款计划
+     */
+    @RequestMapping(value = "/downExcel")
+    public ModelAndView downExcel(Long aaid) {
+        Map<String, Object> model = new HashMap<>();
+        logger.info("下载某出账单下的还款计划","success");
+        model.put("repaylist", findByAaid(aaid));
+        return new ModelAndView(new ViewExcel(), model);
+    }
+
+    /**
+     * 查找还款计划
+     * @param aaid
+     * @return
+     */
+    private List<RepaymentPlan> findByAaid(Long aaid) {
+        logger.info("查找还款计划");
+        return service.findByAaid(aaid);
+    }
+}

+ 317 - 0
finance-service/src/main/java/com/uas/finance/controller/SecurityController.java

@@ -0,0 +1,317 @@
+package com.uas.finance.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.uas.finance.dao.FinancingApplyDao;
+import com.uas.finance.filter.BaseController;
+import com.uas.finance.model.Enterprise;
+import com.uas.finance.model.FinancingApply;
+import com.uas.finance.util.SystemSession;
+import com.uas.platform.core.util.AgentUtils;
+import com.uas.sso.AuthToken;
+import com.uas.sso.SSOConfig;
+import com.uas.sso.SSOHelper;
+import com.uas.sso.SSOToken;
+import com.uas.sso.entity.UserAccount;
+import com.uas.sso.entity.UserSpaceView;
+import com.uas.sso.entity.UserView;
+import com.uas.sso.util.AccountUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.ui.ModelMap;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.WebDataBinder;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import java.beans.PropertyEditorSupport;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 账号登录配置
+ * Created by hejq on 2017-11-15.
+ */
+@RequestMapping(value = "/sso")
+@RestController
+public class SecurityController extends BaseController {
+
+    private final static Logger logger = LoggerFactory.getLogger(SecurityController.class);
+
+    @Autowired
+    private FinancingApplyDao financingApplyDao;
+
+    /**
+     * 获取登录名
+     */
+    @RequestMapping(value = "/getName", method = RequestMethod.GET)
+    public ModelMap getName() {
+        logger.info("获取登录名");
+        return success(SystemSession.getUserAccount().getVipName());
+    }
+
+    /**
+     * 获取登录人公司
+     */
+    @RequestMapping(value = "/getCompany", method = RequestMethod.GET)
+    public ModelMap getCompany() {
+        logger.info("获取登录人公司");
+        return success(SystemSession.getUserAccount().getSpaceName());
+    }
+
+    /**
+     * 获取登录人企业并且判断是否有已审批的保理单
+     */
+    @RequestMapping(value = "/getEnuu", method = RequestMethod.GET)
+    public ModelMap getEnuu() {
+        ModelMap modelMap = new ModelMap();
+        String enuu = String.valueOf(SystemSession.getUserAccount().getSpaceUU());
+        if (!"".equals(enuu)) {
+            modelMap.put("enuu", enuu);
+            Long uu = Long.parseLong(enuu);
+            //查询所有已审批的金融保理单
+            List<FinancingApply> list = financingApplyDao.hasApproved(uu);
+            if (list.size() > 0) {
+                modelMap.put("approved", true);
+            }
+        }
+        logger.info("获取登录人企业并且判断是否有已审批的保理单");
+        return modelMap;
+    }
+
+    /**
+     * 账户信息、SSO配置
+     */
+    @RequestMapping(value = "/account", method = RequestMethod.GET)
+    public ModelMap getAccountInfo() {
+        logger.info("账户信息、SSO配置");
+        return success(SystemSession.getUserAccount());
+    }
+
+    /**
+     * 跳转登录
+     *
+     * @throws IOException
+     */
+    @RequestMapping(value = "/login", method = RequestMethod.GET)
+    public ModelMap getLoginPage(HttpServletRequest request, HttpServletResponse response, String returnUrl) throws IOException {
+       // request.getSession().setAttribute(SSOConfig.SSOReferer, returnUrl );
+        logger.info("跳转登录");
+        SSOHelper.clearLogin(request, response);
+        String redirectUrl = null;
+        if (StringUtils.isEmpty(returnUrl)) {
+            redirectUrl = SSOHelper.getRedirectRefererLoginUrl(request);
+        } else {
+            redirectUrl = SSOHelper.getRedirectLoginUrl(request, returnUrl);
+        }
+        boolean cross = SSOHelper.isCrossDomain(request);
+        if (cross) {
+            // 跨域代理界面
+            redirectUrl = request.getContextPath() + "/login/proxy";
+        }
+        return new ModelMap("content", redirectUrl);
+    }
+
+
+    /**
+     *
+     * 退出
+     *
+     * @throws IOException
+     */
+   /* @RequestMapping(value = "/logout", method = RequestMethod.GET, headers = "Accept=application/json")
+    @ResponseStatus(value = HttpStatus.OK)
+    public ModelMap logout(HttpServletRequest request, HttpServletResponse response, HttpSession session, String returnUrl) throws IOException {
+        session.invalidate();
+        SSOHelper.clearLogin(request, response);
+        SystemSession.clear();
+        if (StringUtils.isEmpty(returnUrl)) {
+            returnUrl = request.getHeader("Referer");
+        }
+        boolean cross = SSOHelper.isCrossDomain(request);
+        if (cross) {
+            request.getSession().setAttribute(SSOConfig.SSOReferer, returnUrl);
+            // 跨域情况,需要再次询问账户中心
+            returnUrl = "logout/proxy";
+        }
+        return new ModelMap("content", returnUrl);
+    }
+*/
+    /**
+     * 获取跳转登录的url
+     *
+     * @param request
+     * @param response
+     * @returnf
+     * @throws IOException
+     */
+    @RequestMapping(value = "/login/page", method = RequestMethod.GET)
+    public ModelMap signin(HttpServletRequest request, HttpServletResponse response,String returnUrl) throws IOException {
+        logger.info("获取跳转登录的url");
+        request.getSession().setAttribute(SSOConfig.SSOReferer, request.getHeader("Referer"));
+        SSOHelper.clearLogin(request, response);
+        String redirectUrl = SSOHelper.getRedirectRefererLoginUrl(request);
+        if (!StringUtils.isEmpty(returnUrl)) {
+            redirectUrl = SSOHelper.getRedirectLoginUrl(request, returnUrl);
+        }
+        boolean cross = SSOHelper.isCrossDomain(request);
+       /*if (cross) {
+            // 跨域代理界面
+            redirectUrl = "login/proxy";
+        }*/
+        return new ModelMap("content", redirectUrl).addAttribute("cross", cross);
+    }
+
+    /**
+     * 获取跨域登录的参数
+     *
+     * @param request
+     * @param response
+     * @return
+     * @throws IOException
+     */
+    @RequestMapping(value = "/login/crossBefore")
+    public ModelMap getCrossLoginData(HttpServletRequest request, HttpServletResponse response) throws IOException {
+        logger.info("获取跨域登录的参数");
+        ModelMap model = new ModelMap();
+        SSOConfig config = SSOHelper.getSSOService().getConfig();
+        // 业务系统私钥签名 authToken 自动设置临时会话 cookie 授权后自动销毁
+        AuthToken at = SSOHelper.askCiphertext(request, response, config.getClientPrivateKey());
+        // askUrl 询问 sso 是否登录地址
+        model.addAttribute("askUrl", config.getCrossAskUrl());
+        // askTxt 询问 token 密文
+        model.addAttribute("askData", at.encryptAuthToken());
+        // 未登录情况下,登录地址
+        Object loginUrl = null;
+        boolean cross = SSOHelper.isCrossDomain(request);
+        if (cross) {
+            loginUrl = SSOHelper.getRedirectRefererLoginUrl(request);
+        } else {
+            loginUrl = SSOHelper.getRedirectLoginUrl(request, String.valueOf(request.getSession().getAttribute("SSOReferer")));
+        }
+        model.addAttribute("loginUrl", loginUrl);
+        return model;
+    }
+
+    @InitBinder
+    public void InitBinder(WebDataBinder dataBinder) {
+        dataBinder.registerCustomEditor(Date.class, new PropertyEditorSupport() {
+            @Override
+            public void setAsText(String value) {
+                setValue(new Date(Long.valueOf(value)));
+            }
+        });
+    }
+
+    /**
+     * 其他地点登录后 同步登录状态
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/login/other", produces = {"application/javascript"})
+    @ResponseBody
+    public void afterCrossLogin(HttpServletRequest request, HttpServletResponse response, UserAccount userAccount, Integer maxage) throws Exception {
+        String data;
+        if (userAccount != null && userAccount.getMobile() != null) {
+            SSOToken tk = new SSOToken();
+            // 设置cookie
+            tk.setUid(userAccount.getMobile());
+            tk.setTime(System.currentTimeMillis());
+            tk.setData(JSON.toJSONString(userAccount));
+            if (null != maxage) {
+                request.setAttribute("sso_cookie_maxage", maxage);
+            }
+            SSOHelper.setSSOCookie(request, response, tk, true);
+            response.setHeader("P3P","CP='IDCDSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT'");
+            response.setHeader("P3P","CP=\"CURaADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSPCOR\"");
+
+            data= "successCallback({success:'1'})";
+
+        } else {
+            data="successCallback({success:'0'})";
+        }
+        PrintWriter out = response.getWriter();
+        out.write(data);
+        out.close();
+    }
+
+    @RequestMapping(value = "/test")
+    public String test() {
+        return "dsfsa";
+    }
+
+    /**
+     * 获取跨域登录的参数
+     *
+     * @param request
+     * @param response
+     * @return
+     * @throws IOException
+     */
+    @RequestMapping(value = "/logout/crossBefore")
+    public ModelMap getCrossLogoutData(HttpServletRequest request, HttpServletResponse response) throws IOException {
+        logger.info("获取跨域登录的参数");
+        SSOHelper.clearLogin(request, response);
+        ModelMap model = new ModelMap();
+        SSOConfig config = SSOHelper.getSSOService().getConfig();
+        model.addAttribute("askUrl", config.getCrossAskOutUrl());
+        Object referer = request.getSession().getAttribute(SSOConfig.SSOReferer);
+        model.addAttribute("returnUrl", null == referer ? "/" : referer.toString());
+        // 未登录情况下,登录地址
+        Object logoutUrl = null;
+        boolean cross = SSOHelper.isCrossDomain(request);
+        if (cross) {
+            logoutUrl = SSOHelper.getRedirectRefererLogoutUrl(request);
+        } else {
+            logoutUrl = SSOHelper.getRedirectLogoutUrl(request, String.valueOf(request.getSession().getAttribute("SSOReferer")));
+        }
+        model.addAttribute("logoutUrl", logoutUrl);
+        model.addAttribute("baseUrl","/logout");
+        return model;
+    }
+
+    /**
+     * 获取跳转注册的url
+     *
+     * @param request
+     * @param response
+     * @return
+     * @throws IOException
+     */
+    @RequestMapping(value = "/register/page", method = RequestMethod.GET)
+    public ModelMap register(HttpServletRequest request, HttpServletResponse response, String returnUrl) throws IOException {
+        logger.info("获取跳转注册的url");
+        request.getSession().setAttribute(SSOConfig.SSOReferer, returnUrl);
+        SSOHelper.clearLogin(request, response);
+        String redirectUrl = null;
+        if (StringUtils.isEmpty(returnUrl)) {
+            redirectUrl = SSOHelper.getRedirectRefererRegisterUrl(request);
+        } else {
+            redirectUrl = SSOHelper.getRedirectRegisterUrl(request, returnUrl);
+        }
+        return new ModelMap("content", redirectUrl);
+    }
+
+    @RequestMapping(value = "/logout", method = RequestMethod.GET, headers = "Accept=application/json")
+    @ResponseStatus(value = HttpStatus.OK)
+    public ModelMap logout(HttpServletRequest request, HttpServletResponse response, HttpSession session) throws IOException {
+        logger.info("退出账号");
+        session.invalidate();
+        SSOHelper.clearLogin(request, response);
+        SystemSession.clear();
+        String returnUrl = request.getHeader("Referer");
+        boolean cross = SSOHelper.isCrossDomain(request);
+        if (cross) {
+            request.getSession().setAttribute(SSOConfig.SSOReferer, returnUrl);
+            // 跨域情况,需要再次询问账户中心
+            returnUrl = "logout/proxy";
+        }
+
+        return new ModelMap("content", returnUrl);
+    }
+}

+ 92 - 0
finance-service/src/main/java/com/uas/finance/controller/SellerQuotaController.java

@@ -0,0 +1,92 @@
+package com.uas.finance.controller;
+
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.uas.finance.model.AccountApply;
+import com.uas.finance.model.FinancingApply;
+import com.uas.finance.model.RepaymentPlan;
+import com.uas.finance.model.SellerQuota;
+import com.uas.finance.service.AccountApplyService;
+import com.uas.finance.service.RepaymentPlanService;
+import com.uas.finance.service.SellerQuotaService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.List;
+
+/**
+ * 买方用户额度控制层
+ * created by shicr on 2018/1/16
+ **/
+@RestController
+@RequestMapping("/sellerquota")
+public class SellerQuotaController {
+
+    @Autowired
+    private SellerQuotaService sellerQuotaService;
+
+    @Autowired
+    private AccountApplyService accountApplyService;
+
+    @Autowired
+    private RepaymentPlanService repaymentPlanService;
+
+    private final static Logger logger = LoggerFactory.getLogger(SellerQuotaController.class);
+
+    /**
+     * 接收ERP传来的买方用户额度
+     *
+     * @param list
+     * @return
+     */
+    @RequestMapping(value = "/erp/getfromuas", method = RequestMethod.POST)
+    public List<SellerQuota> sellerQuotas(String list, Long faid, Integer status, Long access_id) throws UnsupportedEncodingException {
+
+        if (list != null) {
+            list = URLDecoder.decode(list, "utf-8");
+        }
+        List<SellerQuota> list1 = JSONObject.parseArray(list, SellerQuota.class);
+        logger.info("接收ERP传来的买方用户额度");
+        return sellerQuotaService.getSeller(list1, faid, status, access_id);
+    }
+
+    /**
+     * 还款更新买方客户可用额度以及修改还款状态
+     *
+     * @param sellerQuota
+     * @return
+     */
+    @RequestMapping(value = "/erp/updateQuota", method = RequestMethod.POST)
+    public SellerQuota updateQuota(String sellerQuota,Long aaid,String iscloseoff,String repaymentPlans) throws UnsupportedEncodingException {
+        if (sellerQuota != null) {
+            sellerQuota = URLDecoder.decode(sellerQuota, "utf-8");
+        }
+        iscloseoff = URLDecoder.decode(iscloseoff);
+        SellerQuota sellerQuota1 = JSON.parseObject(sellerQuota, SellerQuota.class);
+        //更新买方用户可用额度
+        logger.info("还款更新买方客户可用额度以及修改还款状态");
+        SellerQuota sellerQuota2 = sellerQuotaService.updateQuota(sellerQuota1,aaid,iscloseoff);
+        return sellerQuota2;
+    }
+
+    /**
+     * 找到某客户下面的所有买方
+     *
+     * @param uu
+     * @returns
+     */
+    @RequestMapping(value = "/findAll")
+    public List<SellerQuota> findAll(@RequestParam(value = "enuu") Long uu) {
+        logger.info("找到某客户下面的所有买方");
+        return sellerQuotaService.findAll(uu);
+    }
+
+}

+ 51 - 0
finance-service/src/main/java/com/uas/finance/controller/ShareholdersController.java

@@ -0,0 +1,51 @@
+package com.uas.finance.controller;
+
+import com.uas.finance.service.ShareholdersService;
+import com.uas.finance.model.Shareholders;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 股东信息表
+ * created by shicr on 2017/12/19
+ **/
+@Controller
+@RequestMapping("/shareholders")
+public class ShareholdersController {
+
+    private final static Logger logger = LoggerFactory.getLogger(ShareholdersController.class);
+
+    @Autowired
+    private ShareholdersService shareholdersService;
+
+
+    /**
+     * 股东信息表保存
+     *
+     * @param shareholders
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    public List<Shareholders> save(@RequestBody Shareholders[] shareholders, HttpServletRequest request) {
+        logger.info("股东信息表保存", "success");
+        ArrayList<Shareholders> arrayList = new ArrayList<Shareholders>();
+
+        for (Shareholders s : shareholders) {
+            Shareholders shareholders1 = shareholdersService.save(s);
+            arrayList.add(shareholders1);
+        }
+
+        return arrayList;
+    }
+}

+ 48 - 0
finance-service/src/main/java/com/uas/finance/controller/UpdowncastController.java

@@ -0,0 +1,48 @@
+package com.uas.finance.controller;
+
+import com.uas.finance.model.Updowncast;
+import com.uas.finance.service.UpdowncastService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 上下游表单信息
+ * created by shicr on 2017/12/21
+ **/
+@Controller
+@RequestMapping("/updowncast")
+public class UpdowncastController {
+
+    private final static Logger logger = LoggerFactory.getLogger(UpdowncastController.class);
+
+    @Autowired
+    private UpdowncastService updowncastService;
+
+    /**
+     * 上下游表单信息保存
+     *
+     * @param updowncasts
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    public List<Updowncast> updowncastList(@RequestBody Updowncast[] updowncasts) {
+        logger.info("上下游表单信息保存", "success");
+        ArrayList<Updowncast> arrayList = new ArrayList<Updowncast>();
+        for (Updowncast updowncast : updowncasts) {
+            Updowncast updowncast1 = updowncastService.save(updowncast);
+            arrayList.add(updowncast1);
+        }
+
+        return arrayList;
+    }
+}

+ 63 - 0
finance-service/src/main/java/com/uas/finance/controller/ViewExcel.java

@@ -0,0 +1,63 @@
+package com.uas.finance.controller;
+
+import com.uas.finance.model.RepaymentPlan;
+import org.apache.poi.hssf.usermodel.*;
+import org.springframework.web.servlet.view.document.AbstractExcelView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.OutputStream;
+import java.text.SimpleDateFormat;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 创建excel视图类
+ * created by shicr on 2018/2/25
+ **/
+public class ViewExcel extends AbstractExcelView {
+    /**
+     * Subclasses must implement this method to create an Excel HSSFWorkbook document,
+     * given the model.
+     *
+     * @param model    the model Map
+     * @param workbook the Excel workbook to complete
+     * @param request  in case we need locale etc. Shouldn't look at attributes.
+     * @param response in case we need to set cookies. Shouldn't write to it.
+     */
+    @Override
+    protected void buildExcelDocument(Map<String, Object> model, HSSFWorkbook workbook, HttpServletRequest request, HttpServletResponse response) throws Exception {
+        String fileName = "还款计划.xls";
+        response.setCharacterEncoding("UTF-8");
+        response.setContentType("application/ms-excel");
+        response.setHeader("Content-Disposition", "inline; filename="+new String(fileName.getBytes(),"iso8859-1"));
+        OutputStream outputStream = response.getOutputStream();
+
+        List<RepaymentPlan> repaymentPlans = (List<RepaymentPlan>) model.get("repaylist");
+        // 产生Excel表头
+        HSSFSheet sheet = workbook.createSheet("还款计划表");
+        HSSFRow header = sheet.createRow(0);
+        // 产生标题列
+        header.createCell(0).setCellValue("还款日期");
+        header.createCell(1).setCellValue("业务币种");
+        header.createCell(2).setCellValue("本期应还本金");
+        header.createCell(3).setCellValue("本期应还利息");
+        header.createCell(4).setCellValue("经办经理");
+        header.createCell(5).setCellValue("是否执行");
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        int rowNumber = 1;
+        for (RepaymentPlan repaymentPlan : repaymentPlans) {
+            HSSFRow row = sheet.createRow(rowNumber++);
+            // 产生标题列
+            row.createCell(0).setCellValue(sdf.format(repaymentPlan.getRp_backdate()));
+            row.createCell(1).setCellValue(repaymentPlan.getRp_currency());
+            row.createCell(2).setCellValue(repaymentPlan.getRp_principal());
+            row.createCell(3).setCellValue(repaymentPlan.getRp_interest());
+            row.createCell(4).setCellValue(repaymentPlan.getRp_truster());
+            row.createCell(5).setCellValue(repaymentPlan.getRp_iscloseoff());
+        }
+        workbook.write(outputStream);
+        outputStream.flush();
+        outputStream.close();
+    }
+}

+ 23 - 0
finance-service/src/main/java/com/uas/finance/dao/AccountApplyAttachDao.java

@@ -0,0 +1,23 @@
+package com.uas.finance.dao;
+
+import com.uas.finance.model.AccountApplyAttach;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * 应收账款转让附件dao层
+ * created by shicr on 2018/1/30
+ **/
+@Repository
+public interface AccountApplyAttachDao extends JpaRepository<AccountApplyAttach,Long>{
+
+    /**
+     * 查找某出账单下所以附件
+     * @param aaid
+     * @return
+     */
+    List<AccountApplyAttach> findByAaid(Long aaid);
+
+}

+ 40 - 0
finance-service/src/main/java/com/uas/finance/dao/AccountApplyDao.java

@@ -0,0 +1,40 @@
+package com.uas.finance.dao;
+
+import com.uas.finance.model.AccountApply;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * 出账申请Dao层
+ * created by shicr on 2018/1/27
+ **/
+@Repository
+public interface AccountApplyDao extends JpaRepository<AccountApply, Long> {
+
+    /**
+     * 找到某买方下面的所有出账申请
+     *
+     * @param id
+     * @return
+     */
+
+    List<AccountApply> findByCqIdOrderByIndateDesc(Long id);
+
+    /**
+     * 找到某保理方下某状态的所有应收账款转让
+     *
+     * @param fauu
+     * @return
+     */
+    List<AccountApply> findByFauuAndErpstatus(Long fauu, Integer erpstatus);
+
+    /**
+     * 找到某买方下已提交的出账申请
+     *
+     * @param id
+     * @return
+     */
+    List<AccountApply> findByCqIdAndErpstatusIsNotNull(Long id);
+}

+ 13 - 0
finance-service/src/main/java/com/uas/finance/dao/AccountInfoDao.java

@@ -0,0 +1,13 @@
+package com.uas.finance.dao;
+
+import com.uas.finance.model.AccountInfo;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+/**
+ * created by shicr on 2017/12/21
+ **/
+@Repository
+public interface AccountInfoDao extends JpaRepository<AccountInfo, Long> {
+
+}

+ 13 - 0
finance-service/src/main/java/com/uas/finance/dao/AssociateCompanyDao.java

@@ -0,0 +1,13 @@
+package com.uas.finance.dao;
+
+import com.uas.finance.model.AssociateCompany;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+/**
+ * created by shicr on 2017/12/19
+ **/
+@Repository
+public interface AssociateCompanyDao  extends JpaRepository<AssociateCompany,Long>,JpaSpecificationExecutor<AssociateCompany> {
+}

+ 47 - 0
finance-service/src/main/java/com/uas/finance/dao/AttachDao.java

@@ -0,0 +1,47 @@
+package com.uas.finance.dao;
+
+import com.uas.finance.model.Attach;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * 附件数据访问层
+ * created by shicr on 2017/12/25
+ **/
+@Repository
+public interface AttachDao extends JpaRepository<Attach, Long> {
+
+    /**
+     * 查找某金融单下的附件
+     *
+     * @param applyId
+     * @return
+     */
+    List<Attach> findAttachesByApplyId(Long applyId);
+
+
+    /**
+     * 找到某家保理公司需要下载的文件
+     *
+     * @param fauu
+     * @return
+     */
+    Attach findAttachesByFauu(Long fauu);
+
+    /**
+     * 删除附件
+     * @param id
+     * @return
+     */
+    @Transactional(rollbackFor = Exception.class)
+    @Modifying
+    @Query(value = "delete from attach where id = ?1", nativeQuery = true)
+    void deleteOne(Long id);
+}
+

+ 12 - 0
finance-service/src/main/java/com/uas/finance/dao/BusinessConditionDao.java

@@ -0,0 +1,12 @@
+package com.uas.finance.dao;
+
+import com.uas.finance.model.BusinessCondition;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+/**
+ * created by shicr on 2017/12/21
+ **/
+@Repository
+public interface BusinessConditionDao extends JpaRepository<BusinessCondition,Long>{
+}

+ 14 - 0
finance-service/src/main/java/com/uas/finance/dao/ChangesInstructionDao.java

@@ -0,0 +1,14 @@
+package com.uas.finance.dao;
+
+import com.uas.finance.model.ChangesInstruction;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+/**
+ * created by shicr on 2017/12/20
+ **/
+@Repository
+public interface ChangesInstructionDao extends JpaRepository<ChangesInstruction, Long>, JpaSpecificationExecutor<ChangesInstruction> {
+
+}

+ 124 - 0
finance-service/src/main/java/com/uas/finance/dao/CommonDao.java

@@ -0,0 +1,124 @@
+package com.uas.finance.dao;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.dao.EmptyResultDataAccessException;
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+@Repository
+public class CommonDao {
+
+	@Autowired
+	private JdbcTemplate jdbcTemplate;
+
+	public List<Map<String, Object>> queryForList(String sql) {
+		return this.jdbcTemplate.queryForList(sql);
+	}
+
+	public <T> List<T> queryForList(String sql, Class<T> elementType) {
+		return this.jdbcTemplate.queryForList(sql, elementType);
+	}
+
+	public List<Map<String, Object>> queryForList(String sql, Object... args) {
+		return this.jdbcTemplate.queryForList(sql, args);
+	}
+
+	public <T> List<T> queryForList(String sql, Object[] args, Class<T> elementType) {
+		return this.jdbcTemplate.queryForList(sql, args, elementType);
+	}
+
+	public <T> List<T> queryForList(String sql, Class<T> elementType, Object... args) {
+		return this.jdbcTemplate.queryForList(sql, elementType, args);
+	}
+
+	public <T> List<T> query(String sql, Object[] args, Class<T> elementType) {
+		return this.jdbcTemplate.query(sql, args, new BeanPropertyRowMapper<T>(elementType));
+	}
+
+	public <T> List<T> query(String sql, Class<T> elementType) {
+		return this.jdbcTemplate.query(sql, new BeanPropertyRowMapper<T>(elementType));
+	}
+
+	public <T> List<T> query(String sql, Class<T> elementType, Object... args) {
+		return this.jdbcTemplate.query(sql, new BeanPropertyRowMapper<T>(elementType), args);
+	}
+
+	/**
+	 * 查找自定义实体对象集合
+	 * 
+	 * @param sql
+	 * @param args
+	 * @param elementType
+	 * @return
+	 */
+	public <T> T queryBean(String sql, Object[] args, Class<T> elementType) {
+		try {
+			return this.jdbcTemplate.queryForObject(sql, args, new BeanPropertyRowMapper<T>(elementType));
+		} catch (EmptyResultDataAccessException e) {
+			return null;
+		}
+	}
+
+	/**
+	 * 查找自定义实体对象集合
+	 * 
+	 * @param sql
+	 * @param elementType
+	 * @return
+	 */
+	public <T> T queryBean(String sql, Class<T> elementType) {
+		try {
+			return this.jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<T>(elementType));
+		} catch (EmptyResultDataAccessException e) {
+			return null;
+		}
+	}
+
+	/**
+	 * 查找自定义实体对象
+	 * 
+	 * @param sql
+	 * @param elementType
+	 * @param args
+	 * @return
+	 */
+	public <T> T queryBean(String sql, Class<T> elementType, Object... args) {
+		try {
+			return this.jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<T>(elementType), args);
+		} catch (EmptyResultDataAccessException e) {
+			return null;
+		}
+	}
+
+	public <T> T queryForObject(String sql, Object[] args, Class<T> elementType) {
+		return this.jdbcTemplate.queryForObject(sql, args, elementType);
+	}
+
+	public <T> T queryForObject(String sql, Class<T> elementType) {
+		return this.jdbcTemplate.queryForObject(sql, elementType);
+	}
+
+	public <T> T queryForObject(String sql, Class<T> elementType, Object... args) {
+		return this.jdbcTemplate.queryForObject(sql, elementType, args);
+	}
+
+	/**
+	 * 取序列值<br>
+	 * 只针对oracle数据库
+	 * 
+	 * @param sequenceName
+	 * @return
+	 */
+	public long generateSequence(String sequenceName) {
+		return this.jdbcTemplate.queryForObject("select " + sequenceName + ".nextval from dual", Long.class);
+	}
+
+	public JdbcTemplate getJdbcTemplate() {
+		return jdbcTemplate;
+	}
+
+}

+ 12 - 0
finance-service/src/main/java/com/uas/finance/dao/CustomerExcutiveDao.java

@@ -0,0 +1,12 @@
+package com.uas.finance.dao;
+
+import com.uas.finance.model.CustomerExcutive;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+/**
+ * created by shicr on 2017/12/21
+ */
+@Repository
+public interface CustomerExcutiveDao extends JpaRepository<CustomerExcutive, Long> {
+}

+ 33 - 0
finance-service/src/main/java/com/uas/finance/dao/CustomerInfoDao.java

@@ -0,0 +1,33 @@
+package com.uas.finance.dao;
+
+import com.uas.finance.model.CustomerInfo;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * 客户资料数据操作层
+ * created by shicr on 2017/12/18
+ **/
+@Repository
+public interface CustomerInfoDao extends JpaRepository<CustomerInfo, Long>, JpaSpecificationExecutor<CustomerInfo>{
+
+    /**
+     * 通过企业UU号和下载状态获取待下载的数据
+     *
+     * @param enuu
+     * @param status
+     * @return
+     */
+    List<CustomerInfo> findByEnuuAndErpstatus(Long enuu, Integer status);
+
+    /**
+     * 找到最新的客户资料
+     * @param enuu
+     * @return
+     */
+    List<CustomerInfo> findByEnuuOrderBySubmitTimeDesc(Long enuu);
+
+}

+ 13 - 0
finance-service/src/main/java/com/uas/finance/dao/EnterpriseDao.java

@@ -0,0 +1,13 @@
+package com.uas.finance.dao;
+
+import com.uas.finance.model.Enterprise;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Created by hejq on 2017-11-24.
+ */
+@Repository
+public interface EnterpriseDao extends JpaRepository<Enterprise, Long>, JpaSpecificationExecutor<Enterprise> {
+}

+ 11 - 0
finance-service/src/main/java/com/uas/finance/dao/ErpLogDao.java

@@ -0,0 +1,11 @@
+package com.uas.finance.dao;
+
+import com.uas.finance.model.ErpLog;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface ErpLogDao extends JpaSpecificationExecutor<ErpLog>, JpaRepository<ErpLog, Long> {
+
+}

+ 14 - 0
finance-service/src/main/java/com/uas/finance/dao/FinanceConditionDao.java

@@ -0,0 +1,14 @@
+package com.uas.finance.dao;
+
+import com.uas.finance.model.FinanceCondition;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+/**
+ * created by shicr on 2017/12/21
+ **/
+@Repository
+public interface FinanceConditionDao extends JpaRepository<FinanceCondition,Long>{
+
+    FinanceCondition save(FinanceCondition financeCondition);
+}

+ 70 - 0
finance-service/src/main/java/com/uas/finance/dao/FinancingApplyDao.java

@@ -0,0 +1,70 @@
+package com.uas.finance.dao;
+
+import com.uas.finance.model.FinancingApply;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * created by shicr on 2017/12/21
+ **/
+@Repository
+public interface FinancingApplyDao extends JpaRepository<FinancingApply, Long> {
+
+    /**
+     * 通过保理企业UU和下载状态获取未下载的保理申请数据
+     *
+     * @param faenuu
+     * @param status
+     * @return
+     */
+    List<FinancingApply> findByFauuAndErpstatus(Long faenuu, Integer status);
+
+    /**
+     * 查找某企业申请的保理单
+     *
+     * @return
+     */
+    List<FinancingApply> findByEnuuOrderBySubmitTimeDesc(Long enuu);
+
+
+    /**
+     * 找出所有已是审核的申请单
+     *
+     * @param enuu
+     * @return
+     */
+    @Query("from FinancingApply where enuu = :enuu and status = 204")
+    List<FinancingApply> hasApproved(@Param("enuu") Long enuu);
+
+    /**
+     * 根据客户资料找到保理单
+     * @param cusId
+     * @return
+     */
+    FinancingApply findByCusId(Long cusId);
+
+
+
+    /**
+     * 确认客户资料
+     * @param enuu
+     * @return
+     */
+    @Modifying
+    @Transactional
+    @Query(value = "update financingapply set fa_check = 1 where fa_id = ?1 ",nativeQuery = true)
+    void checkInfo(@Param("enuu") Long enuu);
+
+    /**
+     * 找到英唐保理下所有保理单据
+     * @param fauu
+     * @return
+     */
+    List<FinancingApply> findByFauu(Long fauu);
+}

+ 29 - 0
finance-service/src/main/java/com/uas/finance/dao/FsSaleDao.java

@@ -0,0 +1,29 @@
+package com.uas.finance.dao;
+
+import com.uas.finance.model.FsSale;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * 基础合同信息表
+ * created by shicr on 2018/1/25
+ **/
+@Repository
+public interface FsSaleDao extends JpaRepository<FsSale,Long>{
+
+    /**
+     * 找到某出账单下的所有合同
+     * @param aaid
+     * @return
+     */
+    @Query(value = "select * from fasale where aa_id = ?1",nativeQuery = true)
+    Set<FsSale> findByAa_id(Long aaid);
+}

+ 13 - 0
finance-service/src/main/java/com/uas/finance/dao/MFCustInfoDao.java

@@ -0,0 +1,13 @@
+package com.uas.finance.dao;
+
+import com.uas.finance.model.MFCustInfo;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+/**
+ * created by shicr on 2017/12/21
+ **/
+@Repository
+public interface MFCustInfoDao extends JpaRepository<MFCustInfo,Long>{
+
+}

+ 12 - 0
finance-service/src/main/java/com/uas/finance/dao/MFCustInfoDetailDao.java

@@ -0,0 +1,12 @@
+package com.uas.finance.dao;
+
+import com.uas.finance.model.MFCustInfoDetail;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+/**
+ * created by shicr on 2017/12/24
+ **/
+@Repository
+public interface MFCustInfoDetailDao extends JpaRepository<MFCustInfoDetail,Long>{
+}

+ 11 - 0
finance-service/src/main/java/com/uas/finance/dao/ProductMixDao.java

@@ -0,0 +1,11 @@
+package com.uas.finance.dao;
+
+
+import com.uas.finance.model.ProductMix;
+import org.springframework.data.jpa.repository.JpaRepository;
+
+/**
+ * created by shicr on 2017/12/21
+ **/
+public interface ProductMixDao extends JpaRepository<ProductMix,Long> {
+}

+ 37 - 0
finance-service/src/main/java/com/uas/finance/dao/ReceiptDao.java

@@ -0,0 +1,37 @@
+package com.uas.finance.dao;
+
+import com.uas.finance.model.Receipt;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * 发票dao层
+ * created by shicr on 2018/1/27
+ **/
+@Repository
+public interface ReceiptDao extends JpaRepository<Receipt,Long>{
+
+    /**
+     * 删除某出账下的所有发票
+     * @param aaid
+     * @return
+     */
+    @Transactional
+    @Modifying
+    @Query(value = "delete from receipt where aa_id = ?1",nativeQuery = true)
+    void deleteByAa_id(Long aaid);
+
+    /**
+     * 找到出账单下的所有发票
+     * @param aaid
+     * @return
+     */
+    @Query(value = "select * from receipt where aa_id = ?1",nativeQuery = true)
+    List<Receipt> findByAa_id(Long aaid);
+}

+ 17 - 0
finance-service/src/main/java/com/uas/finance/dao/RepaymentPlanDao.java

@@ -0,0 +1,17 @@
+package com.uas.finance.dao;
+
+import com.uas.finance.model.RepaymentPlan;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * 还款计划dao层
+ * created by shicr on 2018/2/24
+ **/
+@Repository
+public interface RepaymentPlanDao extends JpaRepository<RepaymentPlan, Long> {
+
+    List<RepaymentPlan> findByAaid(Long aaid);
+}

+ 44 - 0
finance-service/src/main/java/com/uas/finance/dao/SellerQuotaDao.java

@@ -0,0 +1,44 @@
+package com.uas.finance.dao;
+
+import com.uas.finance.model.SellerQuota;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * 买方用户额度数据操作层
+ * created by shicr on 2018/1/16
+ **/
+@Repository
+public interface SellerQuotaDao extends JpaRepository<SellerQuota, Long> {
+
+    /**
+     * 根据申请单id和买方名查找买方额度
+     *
+     * @param faid
+     * @param custname
+     * @return
+     */
+    @Query(value = "from SellerQuota where faid=:faid and cq_custname=:custname and cq_status = null")
+    SellerQuota findByFaidAndCq_custname(@Param("faid") Long faid, @Param("custname") String custname);
+
+    /**
+     * 找到某客户下面的所有买方
+     *
+     * @param uu
+     * @return
+     */
+    @Query(value = " from SellerQuota where cq_uu = :uu and cq_status = null")
+    List<SellerQuota> findByCq_uu(@Param("uu") Long uu);
+
+    /**
+     * 找到申请单下的所有买方额度
+     *
+     * @param faid
+     * @return
+     */
+    List<SellerQuota> findByFaid(Long faid);
+}

+ 15 - 0
finance-service/src/main/java/com/uas/finance/dao/ShareholdersDao.java

@@ -0,0 +1,15 @@
+package com.uas.finance.dao;
+
+import com.uas.finance.model.Shareholders;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+/**
+ * created by shicr on 2017/12/19
+ **/
+@Repository
+public interface ShareholdersDao extends JpaRepository<Shareholders,Long>,JpaSpecificationExecutor<Shareholders> {
+
+
+}

+ 12 - 0
finance-service/src/main/java/com/uas/finance/dao/UpdowncastDao.java

@@ -0,0 +1,12 @@
+package com.uas.finance.dao;
+
+import com.uas.finance.model.Updowncast;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+/**
+ * created by shicr on 2017/12/21
+ **/
+@Repository
+public interface UpdowncastDao extends JpaRepository<Updowncast,Long>{
+}

+ 11 - 0
finance-service/src/main/java/com/uas/finance/dao/UsageLogDao.java

@@ -0,0 +1,11 @@
+package com.uas.finance.dao;
+
+import com.uas.finance.model.UsageLog;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface UsageLogDao extends JpaSpecificationExecutor<UsageLog>, JpaRepository<UsageLog, Long> {
+
+}

+ 60 - 0
finance-service/src/main/java/com/uas/finance/erp/controller/AccountApplyDownController.java

@@ -0,0 +1,60 @@
+package com.uas.finance.erp.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.uas.finance.constants.Status;
+import com.uas.finance.erp.service.AccountApplyDownService;
+import com.uas.finance.model.AccountApply;
+import com.uas.finance.service.AccountApplyService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.List;
+
+/**
+ * 应收账款转让数据传输控制器
+ * created by shicr on 2018/1/29
+ **/
+@RequestMapping("/erp/accountapply")
+@RestController
+public class AccountApplyDownController {
+
+    @Autowired
+    private AccountApplyDownService service;
+
+    @Autowired
+    private AccountApplyService accountApplyService;
+
+    /**
+     * 找到所有未下载的应收账款转让
+     *
+     * @return
+     */
+    @RequestMapping(method = RequestMethod.GET)
+    public ModelMap findUnload() {
+        //获取英唐保理下的所有未下载应收账款单据
+        List<AccountApply> accountApplies = accountApplyService.findByFauuAndErpstatus(10046945L, Status.NOT_UPLOAD.code());
+        return service.covert(accountApplies);
+    }
+
+    /**
+     * 更新应收账款的下载状态
+     *
+     * @param data
+     * @throws UnsupportedEncodingException
+     */
+    @RequestMapping(value = "/back", method = RequestMethod.POST)
+    public void updateErpstatus(@RequestParam("data") String data) throws UnsupportedEncodingException {
+        String idStr = URLDecoder.decode(data, "UTF-8");
+        JSONObject jsonObject = JSON.parseObject(idStr);
+        Long id = jsonObject.getLong("id");
+        service.updateErpStatus(id);
+    }
+
+}

+ 55 - 0
finance-service/src/main/java/com/uas/finance/erp/controller/CustomerInfoDownController.java

@@ -0,0 +1,55 @@
+package com.uas.finance.erp.controller;
+
+import com.uas.finance.service.CustomerInfoService;
+import com.uas.finance.constants.Status;
+import com.uas.finance.erp.service.CustomerInfoDownService;
+import com.uas.finance.model.CustomerInfo;
+import com.uas.finance.util.SystemSession;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.List;
+
+/**
+ *  客户基础信息下载
+ *
+ * Created by hejq on 2017-12-21.
+ */
+@RequestMapping("/erp/customerInfo")
+@RestController
+public class CustomerInfoDownController {
+
+    @Autowired
+    private CustomerInfoService customerInfoService;
+
+    @Autowired
+    private CustomerInfoDownService customerInfoDownService;
+
+    /**
+     * 获取未下载客户资料数据
+     *
+     * @return
+     */
+    @RequestMapping(method = RequestMethod.GET)
+    public ModelMap findUnload() {
+        List<CustomerInfo> infoList = customerInfoService.findByEnuuAndErpsatus(SystemSession.getUserAccount().getSpaceUU(), Status.NOT_UPLOAD.code());
+        return customerInfoDownService.covert(infoList);
+    }
+
+    /**
+     * 下载成功后返回id更新下载状态
+     *
+     * @param data
+     */
+    @RequestMapping(value = "/back", method = RequestMethod.POST)
+    public void updateAfterCheck(@RequestParam("data") String data) throws UnsupportedEncodingException {
+        String idStr = URLDecoder.decode(data, "UTF-8");
+        customerInfoService.updateDownStatus(idStr);
+    }
+}

+ 53 - 0
finance-service/src/main/java/com/uas/finance/erp/controller/FinancingApplyDownController.java

@@ -0,0 +1,53 @@
+package com.uas.finance.erp.controller;
+
+import com.uas.finance.constants.Status;
+import com.uas.finance.erp.service.FinancingApplyDownService;
+import com.uas.finance.model.FinancingApply;
+import com.uas.finance.service.FinancingApplyService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.List;
+
+/**
+ * 金融服务下载接口
+ * created by shicr on 2017/12/26
+ **/
+@RequestMapping("/erp/finance")
+@RestController
+public class FinancingApplyDownController {
+
+    @Autowired
+    private FinancingApplyService financingApplyService;
+
+    @Autowired
+    private FinancingApplyDownService financingApplyDownService;
+
+    /**
+     * 获取未下载金融申请数据
+     *
+     * @return
+     */
+    @RequestMapping(method = RequestMethod.GET)
+    public ModelMap findApplyUnload() {
+        List<FinancingApply> financingApplies = financingApplyService.findByFaenuuAndErpstatus(10046945L, Status.NOT_UPLOAD.code());
+        return financingApplyDownService.covert(financingApplies);
+    }
+
+    /**
+     * 下载成功后返回id更新下载状态
+     *
+     * @param data 封装的idStr数据
+     */
+    @RequestMapping(value = "/back", method = RequestMethod.POST)
+    public void updateAfterCheck(@RequestParam("data") String data) throws UnsupportedEncodingException {
+        String idStr = URLDecoder.decode(data, "UTF-8");
+        financingApplyDownService.updateDownStatus(idStr);
+    }
+}

+ 172 - 0
finance-service/src/main/java/com/uas/finance/erp/model/AccountInfo.java

@@ -0,0 +1,172 @@
+package com.uas.finance.erp.model;
+
+
+/**
+ * created by shicr on 2017/12/20
+ * 财务数据表
+ **/
+public class AccountInfo {
+
+    /**
+     * ID
+     */
+    private Long id;
+
+    /**
+     * 企业uu
+     *
+     * @return
+     */
+    private Long enuu;
+
+    /**
+     * 财务类型情况
+     */
+    private String ai_kind;
+
+    /**
+     * 欠款客户全称
+     */
+    private String ai_cuname;
+
+    /**
+     * 项目名称
+     */
+    private String ai_caname;
+
+    /**
+     * 金额
+     */
+    private String ai_amount;
+
+    /**
+     * 占比
+     */
+    private Double ai_rate;
+
+    /**
+     * 账龄
+     */
+    private String ai_payment;
+
+    /**
+     * 机构名称
+     */
+    private String ai_bank;
+
+    /**
+     * 应收账款余额
+     */
+    private Double ai_leftamount;
+
+    /**
+     * 产生原因
+     */
+    private String ai_remark;
+
+    public String getAi_bank() {
+        return ai_bank;
+    }
+
+    public void setAi_bank(String ai_bank) {
+        this.ai_bank = ai_bank;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public String getAi_kind() {
+        return ai_kind;
+    }
+
+    public void setAi_kind(String ai_kind) {
+        this.ai_kind = ai_kind;
+    }
+
+    public String getAi_cuname() {
+        return ai_cuname;
+    }
+
+    public void setAi_cuname(String ai_cuname) {
+        this.ai_cuname = ai_cuname;
+    }
+
+    public String getAi_amount() {
+        return ai_amount;
+    }
+
+    public void setAi_amount(String ai_amount) {
+        this.ai_amount = ai_amount;
+    }
+
+    public Double getAi_rate() {
+        return ai_rate;
+    }
+
+    public void setAi_rate(Double ai_rate) {
+        this.ai_rate = ai_rate;
+    }
+
+    public String getAi_payment() {
+        return ai_payment;
+    }
+
+    public void setAi_payment(String ai_payment) {
+        this.ai_payment = ai_payment;
+    }
+
+    public Double getAi_leftamount() {
+        return ai_leftamount;
+    }
+
+    public void setAi_leftamount(Double ai_leftamount) {
+        this.ai_leftamount = ai_leftamount;
+    }
+
+    public String getAi_remark() {
+        return ai_remark;
+    }
+
+    public void setAi_remark(String ai_remark) {
+        this.ai_remark = ai_remark;
+    }
+
+    public String getAi_caname() {
+        return ai_caname;
+    }
+
+    public void setAi_caname(String ai_caname) {
+        this.ai_caname = ai_caname;
+    }
+
+    public AccountInfo(com.uas.finance.model.AccountInfo accountInfo) {
+        this.ai_amount = accountInfo.getAi_amount();
+        this.ai_cuname = accountInfo.getAi_cuname();
+        this.ai_caname = accountInfo.getAi_caname();
+        this.ai_kind = accountInfo.getAi_kind();
+        this.ai_payment = accountInfo.getAi_payment();
+        this.ai_rate = accountInfo.getAi_rate();
+        this.enuu = accountInfo.getEnuu();
+        this.id = accountInfo.getId();
+        this.ai_bank = accountInfo.getAi_bank();
+        this.ai_leftamount = accountInfo.getAi_leftamount();
+        this.ai_remark = accountInfo.getAi_remark();
+    }
+
+    public AccountInfo() {
+
+    }
+}

+ 243 - 0
finance-service/src/main/java/com/uas/finance/erp/model/Apply.java

@@ -0,0 +1,243 @@
+package com.uas.finance.erp.model;
+
+import com.uas.finance.model.Attach;
+import com.uas.finance.model.FinancingApply;
+import com.uas.finance.util.CollectionUtils;
+import com.uas.finance.util.DateUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 金融服务申请数据
+ * 
+ * @author hejq
+ * @time 创建时间:20171124
+ */
+public class Apply {
+
+	/**
+	 * ID
+	 */
+	private Long id;
+
+	/**
+	 * 企业uu
+	 * @return
+	 */
+	private Long enuu;
+
+	/**
+	 * 企业名
+	 */
+	private String fa_enname;
+
+	/**
+	 * 联系人
+	 */
+	private String fa_contact;
+
+	/**
+	 * 联系方式1
+	 */
+	private String fa_telphone;
+	
+	/**
+	 * 联系方式2
+	 */
+	private String fa_phone;
+	
+	/**
+	 * 申请金额
+	 */
+	private Long fa_appamount;
+	
+	/**
+	 * 申请人
+	 */
+	private String fa_applyman;
+	
+	/**
+	 * 申请日期
+	 */
+	private String fa_applydate;
+	
+	/**
+	 * 申请得分
+	 */
+	private Double fa_score;
+	
+	/**
+	 * 融资申请单号
+	 */
+	private String fa_busincode;
+	
+	/**
+	 * 保理公司名称
+	 */
+	private String fa_facorpname;
+	
+	/**
+	 * 保理公司
+	 */
+	private String fa_facorpcode;
+
+	/**
+	 * 客户信息表
+	 */
+	private CustInfo customerInfo;
+
+	/**
+	 * 附件
+	 * @return
+	 */
+	private List<AttachInfo> attachList;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Long getEnuu() {
+		return enuu;
+	}
+
+	public void setEnuu(Long enuu) {
+		this.enuu = enuu;
+	}
+
+	public String getFa_contact() {
+		return fa_contact;
+	}
+
+	public void setFa_contact(String fa_contact) {
+		this.fa_contact = fa_contact;
+	}
+
+	public String getFa_telphone() {
+		return fa_telphone;
+	}
+
+	public void setFa_telphone(String fa_telphone) {
+		this.fa_telphone = fa_telphone;
+	}
+
+	public String getFa_phone() {
+		return fa_phone;
+	}
+
+	public void setFa_phone(String fa_phone) {
+		this.fa_phone = fa_phone;
+	}
+
+	public Long getFa_appamount() {
+		return fa_appamount;
+	}
+
+	public void setFa_appamount(Long fa_appamount) {
+		this.fa_appamount = fa_appamount;
+	}
+
+	public String getFa_applyman() {
+		return fa_applyman;
+	}
+
+	public void setFa_applyman(String fa_applyman) {
+		this.fa_applyman = fa_applyman;
+	}
+
+	public String getFa_applydate() {
+		return fa_applydate;
+	}
+
+	public void setFa_applydate(String fa_applydate) {
+		this.fa_applydate = fa_applydate;
+	}
+
+	public Double getFa_score() {
+		return fa_score;
+	}
+
+	public void setFa_score(Double fa_score) {
+		this.fa_score = fa_score;
+	}
+
+	public String getFa_busincode() {
+		return fa_busincode;
+	}
+
+	public void setFa_busincode(String fa_busincode) {
+		this.fa_busincode = fa_busincode;
+	}
+
+	public String getFa_facorpname() {
+		return fa_facorpname;
+	}
+
+	public void setFa_facorpname(String fa_facorpname) {
+		this.fa_facorpname = fa_facorpname;
+	}
+
+	public String getFa_facorpcode() {
+		return fa_facorpcode;
+	}
+
+	public void setFa_facorpcode(String fa_facorpcode) {
+		this.fa_facorpcode = fa_facorpcode;
+	}
+
+	public CustInfo getCustomerInfo() {
+		return customerInfo;
+	}
+
+	public void setCustomerInfo(CustInfo customerInfo) {
+		this.customerInfo = customerInfo;
+	}
+
+	public List<AttachInfo> getAttachList() {
+		return attachList;
+	}
+
+	public void setAttachList(List<AttachInfo> attachList) {
+		this.attachList = attachList;
+	}
+
+	public String getFa_enname() {
+		return fa_enname;
+	}
+
+	public void setFa_enname(String fa_enname) {
+		this.fa_enname = fa_enname;
+	}
+
+	public Apply(FinancingApply apply) {
+		this.id = apply.getId();
+		this.enuu = apply.getEnuu();
+		this.fa_appamount = apply.getFa_appamount();
+		this.fa_applydate = apply.getFa_applydate() == null ? null : DateUtils.DateInfo(apply.getFa_applydate());
+		this.fa_applyman = apply.getFa_applyman();
+		this.fa_busincode = apply.getFa_busincode();
+		this.fa_contact = apply.getFa_contact();
+		this.fa_facorpcode = apply.getFa_facorpcode();
+		this.fa_facorpname = apply.getFa_facorpname();
+		this.fa_phone = apply.getFa_phone();
+		this.fa_score = apply.getFa_score();
+		this.fa_telphone = apply.getFa_telphone();
+		this.fa_enname = apply.getFa_enname();
+		if (null != apply.getCustomerInfo()) {
+			CustInfo customerInfo = new CustInfo(apply.getCustomerInfo());
+			this.customerInfo=customerInfo;
+		}
+		if (!CollectionUtils.isEmpty(apply.getAttachList())) {
+			List<AttachInfo> attachs = new ArrayList<AttachInfo>();
+			for (Attach attach : apply.getAttachList()) {
+				attachs.add(new AttachInfo(attach));
+			}
+			this.attachList = attachs;
+		}
+	}
+
+}

+ 130 - 0
finance-service/src/main/java/com/uas/finance/erp/model/AssociateCompanyInfo.java

@@ -0,0 +1,130 @@
+package com.uas.finance.erp.model;
+
+import com.uas.finance.model.AssociateCompany;
+
+/**
+ * 关联企业
+ * created by shicr on 2017/12/18
+ **/
+public class AssociateCompanyInfo {
+
+    /**
+     * ID
+     */
+    private Long id;
+
+    /**
+     * 企业uu
+     * @return
+     */
+    private Long enuu;
+
+    /**
+     *关联方企业名称
+     */
+    private String cud_name;
+
+    /**
+     * 关联关系
+     */
+    private String cud_association;
+
+    /**
+     * 法人代表
+     */
+    private String cud_legalperson;
+
+    /**
+     * 法人代表股权(占比%)
+     */
+    private Double cud_ratio;
+
+    /**
+     * 主营业务
+     */
+    private String cud_product;
+
+    /**
+     * 注册资本(万元)
+     */
+    private Double cud_amount;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getCud_name() {
+        return cud_name;
+    }
+
+    public void setCud_name(String cud_name) {
+        this.cud_name = cud_name;
+    }
+
+    public String getCud_association() {
+        return cud_association;
+    }
+
+    public void setCud_association(String cud_association) {
+        this.cud_association = cud_association;
+    }
+
+    public String getCud_legalperson() {
+        return cud_legalperson;
+    }
+
+    public void setCud_legalperson(String cud_legalperson) {
+        this.cud_legalperson = cud_legalperson;
+    }
+
+    public Double getCud_ratio() {
+        return cud_ratio;
+    }
+
+    public void setCud_ratio(Double cud_ratio) {
+        this.cud_ratio = cud_ratio;
+    }
+
+    public String getCud_product() {
+        return cud_product;
+    }
+
+    public void setCud_product(String cud_product) {
+        this.cud_product = cud_product;
+    }
+
+    public Double getCud_amount() {
+        return cud_amount;
+    }
+
+    public void setCud_amount(Double cud_amount) {
+        this.cud_amount = cud_amount;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public AssociateCompanyInfo(AssociateCompany company) {
+        this.id = company.getId();
+        this.cud_amount = company.getCud_amount();
+        this.cud_association = company.getCud_association();
+        this.cud_legalperson = company.getCud_legalperson();
+        this.cud_name = company.getCud_name();
+        this.cud_product = company.getCud_product();
+        this.cud_ratio = company.getCud_ratio();
+        this.enuu = company.getEnuu();
+    }
+
+    public AssociateCompanyInfo() {
+
+    }
+}

+ 105 - 0
finance-service/src/main/java/com/uas/finance/erp/model/AttachInfo.java

@@ -0,0 +1,105 @@
+package com.uas.finance.erp.model;
+
+
+import com.uas.finance.model.Attach;
+
+import java.io.Serializable;
+
+/**
+ * 附件实体传输转换类
+ * created by shicr on 2017/12/25
+ **/
+public class AttachInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 附件id
+     */
+    private Long id;
+
+    /**
+     * 附件名
+     */
+    private String name;
+
+    /**
+     * 附件路径
+     */
+    private String path;
+
+    /**
+     * 文件大小
+     */
+    private Long size;
+
+    /**
+     * 文件所属类别
+     */
+    private String type;
+
+    /**
+     * 附件所属的金融单据
+     */
+    private Long applyId;
+
+    public Long getApplyId() {
+        return applyId;
+    }
+
+    public void setApplyId(Long applyId) {
+        this.applyId = applyId;
+    }
+
+    public Long getSize() {
+        return size;
+    }
+
+    public void setSize(Long size) {
+        this.size = size;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getPath() {
+        return path;
+    }
+
+    public void setPath(String path) {
+        this.path = path;
+    }
+
+    public AttachInfo(Attach attach) {
+        this.applyId = attach.getApplyId();
+        this.id = attach.getId();
+        this.name = attach.getName();
+        this.path = attach.getPath();
+        this.size = attach.getSize();
+        this.type = attach.getType();
+    }
+
+    public AttachInfo() {
+    }
+}

+ 73 - 0
finance-service/src/main/java/com/uas/finance/erp/model/BusinessConditionInfo.java

@@ -0,0 +1,73 @@
+package com.uas.finance.erp.model;
+
+import com.uas.finance.model.BusinessCondition;
+
+/**
+ * created by shicr on 2017/12/20
+ * 情况描述
+ **/
+public class BusinessConditionInfo {
+
+    /**
+     * ID
+     */
+    private Long id;
+
+    /**
+     * 企业uu
+     * @return
+     */
+    private Long enuu;
+
+    /**
+     * 经营情况简述
+     */
+    private String bc_bcremark;
+
+    /**
+     *贸易流程简述
+     * @return
+     */
+    private String bc_sweaterprocess;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public String getBc_bcremark() {
+        return bc_bcremark;
+    }
+
+    public void setBc_bcremark(String bc_bcremark) {
+        this.bc_bcremark = bc_bcremark;
+    }
+
+    public String getBc_sweaterprocess() {
+        return bc_sweaterprocess;
+    }
+
+    public void setBc_sweaterprocess(String bc_sweaterprocess) {
+        this.bc_sweaterprocess = bc_sweaterprocess;
+    }
+
+    public BusinessConditionInfo(BusinessCondition businessCondition) {
+        this.id = businessCondition.getId();
+        this.bc_bcremark = businessCondition.getBc_bcremark();
+        this.bc_sweaterprocess = businessCondition.getBc_sweaterprocess();
+    }
+    public BusinessConditionInfo() {
+
+    }
+}

+ 101 - 0
finance-service/src/main/java/com/uas/finance/erp/model/ChangesInstructionInfo.java

@@ -0,0 +1,101 @@
+package com.uas.finance.erp.model;
+
+import com.uas.finance.model.ChangesInstruction;
+import com.uas.finance.util.DateUtils;
+
+/**
+ * 变更内容
+ */
+public class ChangesInstructionInfo {
+
+    /**
+     * ID
+     */
+    private Long id;
+
+    /**
+     * 优软账号
+     */
+    private Long enuu;
+
+    /**
+     * 变更科目
+     */
+    private String cd_type;
+
+    /**
+     * 变更时间
+     */
+    private String cs_date;
+
+    /**
+     * 变更前内容
+     */
+    private String cs_before;
+
+    /**
+     * 变更后内容
+     */
+    private String cs_after;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public String getCd_type() {
+        return cd_type;
+    }
+
+    public void setCd_type(String cd_type) {
+        this.cd_type = cd_type;
+    }
+
+    public String getCs_date() {
+        return cs_date;
+    }
+
+    public void setCs_date(String cs_date) {
+        this.cs_date = cs_date;
+    }
+
+    public String getCs_before() {
+        return cs_before;
+    }
+
+    public void setCs_before(String cs_before) {
+        this.cs_before = cs_before;
+    }
+
+    public String getCs_after() {
+        return cs_after;
+    }
+
+    public void setCs_after(String cs_after) {
+        this.cs_after = cs_after;
+    }
+
+    public ChangesInstructionInfo(ChangesInstruction instruction) {
+        this.cd_type = instruction.getCd_type();
+        this.cs_after = instruction.getCs_after();
+        this.cs_before = instruction.getCs_before();
+        this.cs_date = instruction.getCs_date() == null ? null : DateUtils.DateInfo(instruction.getCs_date());
+        this.enuu = instruction.getEnuu();
+        this.id = instruction.getId();
+    }
+
+    public ChangesInstructionInfo() {
+
+    }
+}

+ 529 - 0
finance-service/src/main/java/com/uas/finance/erp/model/CustInfo.java

@@ -0,0 +1,529 @@
+package com.uas.finance.erp.model;
+
+import com.uas.finance.model.*;
+import com.uas.finance.util.CollectionUtils;
+import com.uas.finance.util.DateUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by hejq on 2017-12-21.
+ */
+public class CustInfo {
+
+    /**
+     * ID
+     */
+    private Long id;
+
+    /**
+     * 公司中文名
+     */
+    private String cu_name;
+
+    /**
+     * 公司英文名
+     */
+    private String cu_engname;
+
+    /**
+     * 公司类型
+     */
+    private String cu_enterptype;
+
+    /**
+     * 成立时间
+     */
+    private String cu_licensedate;
+
+    /**
+     * 证件类型
+     */
+    private String cu_paperstype;
+
+    /**
+     * 机构类型
+     */
+    private String cu_institutype;
+
+    /**
+     * 证件号码
+     */
+    private String cu_paperscode;
+
+    /**
+     * 证件到期日
+     */
+    private String cu_ctfduedate;
+
+    /**
+     * 营业执照号
+     */
+    private String cu_businesscode;
+
+    /**
+     * 国标行业分类
+     */
+    private String cu_nastdinducls;
+
+    /**
+     * 注册资本币种
+     */
+    private String cu_capcurrency;
+
+    /**
+     * 注册资本
+     */
+    private Double cu_regcapital;
+
+    /**
+     * 实缴资本
+     */
+    private Double cu_paidincapital;
+    /**
+     * 公司注册地
+     */
+    private String cu_regadd;
+    /**
+     * 办公地址
+     */
+    private String cu_officeadd;
+
+    /**
+     * 经营范围
+     */
+    private String cu_businsscope;
+
+    /**
+     * 其他情况说明
+     */
+    private String cu_others;
+
+    /**
+     * 企业uu
+     *
+     * @return
+     */
+    private Long cu_enuu;
+
+    /**
+     * 最高权力机构
+     *
+     * @return
+     */
+    private String cu_highestauthority;
+
+    /**
+     * 员工人数
+     *
+     * @return
+     */
+    private Long cu_employeesnum;
+
+    /**
+     * 部门设置概况
+     *
+     * @return
+     */
+    private String cu_departsituation;
+
+
+    /**
+     * 财务数据表
+     */
+    private List<AccountInfo> accountInfoList;
+
+    /**
+     * 关联企业
+     */
+    private List<AssociateCompanyInfo> associateCompanies;
+
+    /**
+     * 情况描述
+     */
+    private BusinessConditionInfo businessCondition;
+
+    /**
+     * 变更内容
+     */
+    private List<ChangesInstructionInfo> changesInstructions;
+
+    /**
+     * 管理层信息
+     */
+    private List<CustomerExcutiveInfo> customerExcutives;
+
+    /**
+     * 财务情况说明
+     */
+    private FinanceConditionInfo financeConditions;
+
+    /**
+     * 买方客户资料
+     */
+    private List<PurcCustInfo> mfCustInfos;
+
+    /**
+     * 经营情况表
+     */
+    private List<ProductMixInfo> productMixes;
+
+    /**
+     * 股东信息表
+     */
+    private List<ShareholdersInfo> shareholders;
+
+    /**
+     * 供应商客户
+     */
+    private List<UpdowncastInfo> updowncasts;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getCu_name() {
+        return cu_name;
+    }
+
+    public void setCu_name(String cu_name) {
+        this.cu_name = cu_name;
+    }
+
+    public String getCu_engname() {
+        return cu_engname;
+    }
+
+    public void setCu_engname(String cu_engname) {
+        this.cu_engname = cu_engname;
+    }
+
+    public String getCu_enterptype() {
+        return cu_enterptype;
+    }
+
+    public void setCu_enterptype(String cu_enterptype) {
+        this.cu_enterptype = cu_enterptype;
+    }
+
+    public String getCu_licensedate() {
+        return cu_licensedate;
+    }
+
+    public void setCu_licensedate(String cu_licensedate) {
+        this.cu_licensedate = cu_licensedate;
+    }
+
+    public String getCu_paperstype() {
+        return cu_paperstype;
+    }
+
+    public void setCu_paperstype(String cu_paperstype) {
+        this.cu_paperstype = cu_paperstype;
+    }
+
+    public String getCu_institutype() {
+        return cu_institutype;
+    }
+
+    public void setCu_institutype(String cu_institutype) {
+        this.cu_institutype = cu_institutype;
+    }
+
+    public String getCu_paperscode() {
+        return cu_paperscode;
+    }
+
+    public void setCu_paperscode(String cu_paperscode) {
+        this.cu_paperscode = cu_paperscode;
+    }
+
+    public String getCu_ctfduedate() {
+        return cu_ctfduedate;
+    }
+
+    public void setCu_ctfduedate(String cu_ctfduedate) {
+        this.cu_ctfduedate = cu_ctfduedate;
+    }
+
+    public String getCu_businesscode() {
+        return cu_businesscode;
+    }
+
+    public void setCu_businesscode(String cu_businesscode) {
+        this.cu_businesscode = cu_businesscode;
+    }
+
+    public String getCu_nastdinducls() {
+        return cu_nastdinducls;
+    }
+
+    public void setCu_nastdinducls(String cu_nastdinducls) {
+        this.cu_nastdinducls = cu_nastdinducls;
+    }
+
+    public String getCu_capcurrency() {
+        return cu_capcurrency;
+    }
+
+    public void setCu_capcurrency(String cu_capcurrency) {
+        this.cu_capcurrency = cu_capcurrency;
+    }
+
+    public Double getCu_regcapital() {
+        return cu_regcapital;
+    }
+
+    public void setCu_regcapital(Double cu_regcapital) {
+        this.cu_regcapital = cu_regcapital;
+    }
+
+    public Double getCu_paidincapital() {
+        return cu_paidincapital;
+    }
+
+    public void setCu_paidincapital(Double cu_paidincapital) {
+        this.cu_paidincapital = cu_paidincapital;
+    }
+
+    public String getCu_regadd() {
+        return cu_regadd;
+    }
+
+    public void setCu_regadd(String cu_regadd) {
+        this.cu_regadd = cu_regadd;
+    }
+
+    public String getCu_officeadd() {
+        return cu_officeadd;
+    }
+
+    public void setCu_officeadd(String cu_officeadd) {
+        this.cu_officeadd = cu_officeadd;
+    }
+
+    public String getCu_businsscope() {
+        return cu_businsscope;
+    }
+
+    public void setCu_businsscope(String cu_businsscope) {
+        this.cu_businsscope = cu_businsscope;
+    }
+
+    public String getCu_others() {
+        return cu_others;
+    }
+
+    public void setCu_others(String cu_others) {
+        this.cu_others = cu_others;
+    }
+
+    public Long getCu_enuu() {
+        return cu_enuu;
+    }
+
+    public void setCu_enuu(Long cu_enuu) {
+        this.cu_enuu = cu_enuu;
+    }
+
+    public String getCu_highestauthority() {
+        return cu_highestauthority;
+    }
+
+    public void setCu_highestauthority(String cu_highestauthority) {
+        this.cu_highestauthority = cu_highestauthority;
+    }
+
+    public Long getCu_employeesnum() {
+        return cu_employeesnum;
+    }
+
+    public void setCu_employeesnum(Long cu_employeesnum) {
+        this.cu_employeesnum = cu_employeesnum;
+    }
+
+    public String getCu_departsituation() {
+        return cu_departsituation;
+    }
+
+    public void setCu_departsituation(String cu_departsituation) {
+        this.cu_departsituation = cu_departsituation;
+    }
+
+    public List<AccountInfo> getAccountInfoList() {
+        return accountInfoList;
+    }
+
+    public void setAccountInfoList(List<AccountInfo> accountInfoList) {
+        this.accountInfoList = accountInfoList;
+    }
+
+    public List<AssociateCompanyInfo> getAssociateCompanies() {
+        return associateCompanies;
+    }
+
+    public void setAssociateCompanies(List<AssociateCompanyInfo> associateCompanies) {
+        this.associateCompanies = associateCompanies;
+    }
+
+    public BusinessConditionInfo getBusinessCondition() {
+        return businessCondition;
+    }
+
+    public void setBusinessCondition(BusinessConditionInfo businessCondition) {
+        this.businessCondition = businessCondition;
+    }
+
+    public List<ChangesInstructionInfo> getChangesInstructions() {
+        return changesInstructions;
+    }
+
+    public void setChangesInstructions(List<ChangesInstructionInfo> changesInstructions) {
+        this.changesInstructions = changesInstructions;
+    }
+
+    public List<CustomerExcutiveInfo> getCustomerExcutives() {
+        return customerExcutives;
+    }
+
+    public void setCustomerExcutives(List<CustomerExcutiveInfo> customerExcutives) {
+        this.customerExcutives = customerExcutives;
+    }
+
+    public FinanceConditionInfo getFinanceConditions() {
+        return financeConditions;
+    }
+
+    public void setFinanceConditions(FinanceConditionInfo financeConditions) {
+        this.financeConditions = financeConditions;
+    }
+
+    public List<PurcCustInfo> getMfCustInfos() {
+        return mfCustInfos;
+    }
+
+    public void setMfCustInfos(List<PurcCustInfo> mfCustInfos) {
+        this.mfCustInfos = mfCustInfos;
+    }
+
+    public List<ProductMixInfo> getProductMixes() {
+        return productMixes;
+    }
+
+    public void setProductMixes(List<ProductMixInfo> productMixes) {
+        this.productMixes = productMixes;
+    }
+
+    public List<ShareholdersInfo> getShareholders() {
+        return shareholders;
+    }
+
+    public void setShareholders(List<ShareholdersInfo> shareholders) {
+        this.shareholders = shareholders;
+    }
+
+    public List<UpdowncastInfo> getUpdowncasts() {
+        return updowncasts;
+    }
+
+    public void setUpdowncasts(List<UpdowncastInfo> updowncasts) {
+        this.updowncasts = updowncasts;
+    }
+
+    public CustInfo(com.uas.finance.model.CustomerInfo info) {
+        this.cu_businesscode = info.getCu_businesscode();
+        this.cu_businsscope = info.getCu_businsscope();
+        this.cu_capcurrency = info.getCu_capcurrency();
+        this.cu_ctfduedate = info.getCu_ctfduedate() == null ? null : DateUtils.DateInfo(info.getCu_ctfduedate());
+        this.cu_departsituation = info.getCu_departsituation();
+        this.cu_employeesnum = info.getCu_employeesnum();
+        this.cu_engname = info.getCu_engname();
+        this.cu_enterptype = info.getCu_enterptype();
+        this.cu_highestauthority = info.getCu_highestauthority();
+        this.cu_institutype = info.getCu_institutype();
+        this.cu_licensedate = info.getCu_licensedate() == null ? null : DateUtils.DateInfo(info.getCu_licensedate());
+        this.cu_name = info.getCu_name();
+        this.cu_nastdinducls = info.getCu_nastdinducls();
+        this.cu_officeadd = info.getCu_officeadd();
+        this.cu_others = info.getCu_others();
+        this.cu_paidincapital = info.getCu_paidincapital();
+        this.cu_paperscode = info.getCu_paperscode();
+        this.cu_paperstype = info.getCu_paperstype();
+        this.cu_regadd = info.getCu_regadd();
+        this.cu_regcapital = info.getCu_regcapital();
+        this.cu_enuu = info.getEnuu();
+        this.id = info.getId();
+        if (null != info.getFinanceCondition()) {
+            FinanceConditionInfo financeConditionInfo = new FinanceConditionInfo(info.getFinanceCondition());
+            this.financeConditions = financeConditionInfo;
+        }
+        if (!CollectionUtils.isEmpty(info.getAccountInfoList())) {
+            List<AccountInfo> accountInfos = new ArrayList<AccountInfo>();
+            for (com.uas.finance.model.AccountInfo accountInfo : info.getAccountInfoList()) {
+                accountInfos.add(new AccountInfo(accountInfo));
+            }
+            this.accountInfoList = accountInfos;
+        }
+        if (!CollectionUtils.isEmpty(info.getAssociateCompanies())) {
+            List<AssociateCompanyInfo> associateCompanyInfos = new ArrayList<AssociateCompanyInfo>();
+            for (AssociateCompany company : info.getAssociateCompanies()) {
+                associateCompanyInfos.add(new AssociateCompanyInfo(company));
+            }
+            this.associateCompanies = associateCompanyInfos;
+        }
+
+        if (!CollectionUtils.isEmpty(info.getChangesInstructions())) {
+            List<ChangesInstructionInfo> changesInstructionInfos = new ArrayList<ChangesInstructionInfo>();
+            for (ChangesInstruction instruction : info.getChangesInstructions()) {
+                changesInstructionInfos.add(new ChangesInstructionInfo(instruction));
+            }
+            this.changesInstructions = changesInstructionInfos;
+        }
+        if (!CollectionUtils.isEmpty(info.getCustomerExcutives())) {
+            List<CustomerExcutiveInfo> excutiveInfos = new ArrayList<CustomerExcutiveInfo>();
+            for (CustomerExcutive excutive : info.getCustomerExcutives()) {
+                excutiveInfos.add(new CustomerExcutiveInfo(excutive));
+            }
+            this.customerExcutives = excutiveInfos;
+        }
+
+        if (null != info.getBusinessCondition()) {
+            BusinessConditionInfo conditionInfo = new BusinessConditionInfo(info.getBusinessCondition());
+            this.businessCondition = conditionInfo;
+        }
+        if (!CollectionUtils.isEmpty(info.getMfCustInfos())) {
+            List<PurcCustInfo> custInfos = new ArrayList<PurcCustInfo>();
+            for (MFCustInfo custInfo : info.getMfCustInfos()) {
+                custInfos.add(new PurcCustInfo(custInfo));
+            }
+            this.mfCustInfos = custInfos;
+        }
+        if (!CollectionUtils.isEmpty(info.getProductMixes())) {
+            List<ProductMixInfo> mixInfos = new ArrayList<ProductMixInfo>();
+            for (ProductMix productMix : info.getProductMixes()) {
+                mixInfos.add(new ProductMixInfo(productMix));
+            }
+            this.productMixes = mixInfos;
+        }
+        if (!CollectionUtils.isEmpty(info.getShareholders())) {
+            List<ShareholdersInfo> shareholdersInfos = new ArrayList<ShareholdersInfo>();
+            for (com.uas.finance.model.Shareholders shareholders : info.getShareholders()) {
+                shareholdersInfos.add(new ShareholdersInfo(shareholders));
+            }
+            this.shareholders = shareholdersInfos;
+        }
+        if (!CollectionUtils.isEmpty(info.getUpdowncasts())) {
+            List<UpdowncastInfo> updowncastInfos = new ArrayList<UpdowncastInfo>();
+            for (Updowncast updowncast : info.getUpdowncasts()) {
+                updowncastInfos.add(new UpdowncastInfo(updowncast));
+            }
+            this.updowncasts = updowncastInfos;
+        }
+    }
+
+}

+ 192 - 0
finance-service/src/main/java/com/uas/finance/erp/model/CustomerExcutiveInfo.java

@@ -0,0 +1,192 @@
+package com.uas.finance.erp.model;
+
+import com.uas.finance.model.CustomerExcutive;
+import com.uas.finance.util.DateUtils;
+
+import java.util.Date;
+
+/**
+ * created by shicr on 2017/12/20
+ * 管理层信息
+ **/
+public class CustomerExcutiveInfo {
+
+    /**
+     * ID
+     */
+    private Long id;
+
+    /**
+     * 企业uu
+     * @return
+     */
+    private Long enuu;
+
+    /**
+     * 高管姓名
+     */
+    private String ce_name;
+
+    /**
+     *性别
+     */
+    private String ce_sex;
+
+    /**
+     *证件类型
+     */
+    private String ce_paperstype;
+
+    /**
+     *证件号码
+     */
+    private String ce_paperscode;
+
+
+    /**
+     *学历
+     */
+    private String ce_education;
+
+    /**
+     * 职务
+     */
+    private String ce_position;
+
+    /**
+     *担任该职务时间
+     */
+    private String ce_stwkfpo;
+
+    /**
+     * 从事本行业时间
+     */
+    private Integer ce_workeyears;
+
+    /**
+     *住所
+     */
+    private String ce_nowaddress;
+
+    /**
+     *工作简介
+     */
+    private String ce_woekexper;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public String getCe_name() {
+        return ce_name;
+    }
+
+    public void setCe_name(String ce_name) {
+        this.ce_name = ce_name;
+    }
+
+    public String getCe_sex() {
+        return ce_sex;
+    }
+
+    public void setCe_sex(String ce_sex) {
+        this.ce_sex = ce_sex;
+    }
+
+    public String getCe_paperstype() {
+        return ce_paperstype;
+    }
+
+    public void setCe_paperstype(String ce_paperstype) {
+        this.ce_paperstype = ce_paperstype;
+    }
+
+    public String getCe_paperscode() {
+        return ce_paperscode;
+    }
+
+    public void setCe_paperscode(String ce_paperscode) {
+        this.ce_paperscode = ce_paperscode;
+    }
+
+    public String getCe_education() {
+        return ce_education;
+    }
+
+    public void setCe_education(String ce_education) {
+        this.ce_education = ce_education;
+    }
+
+    public String getCe_position() {
+        return ce_position;
+    }
+
+    public void setCe_position(String ce_position) {
+        this.ce_position = ce_position;
+    }
+
+    public String getCe_stwkfpo() {
+        return ce_stwkfpo;
+    }
+
+    public void setCe_stwkfpo(String ce_stwkfpo) {
+        this.ce_stwkfpo = ce_stwkfpo;
+    }
+
+    public Integer getCe_workeyears() {
+        return ce_workeyears;
+    }
+
+    public void setCe_workeyears(Integer ce_workeyears) {
+        this.ce_workeyears = ce_workeyears;
+    }
+
+    public String getCe_nowaddress() {
+        return ce_nowaddress;
+    }
+
+    public void setCe_nowaddress(String ce_nowaddress) {
+        this.ce_nowaddress = ce_nowaddress;
+    }
+
+    public String getCe_woekexper() {
+        return ce_woekexper;
+    }
+
+    public void setCe_woekexper(String ce_woekexper) {
+        this.ce_woekexper = ce_woekexper;
+    }
+
+    public CustomerExcutiveInfo(CustomerExcutive excutive) {
+        this.id = excutive.getId();
+        this.ce_education = excutive.getCe_education();
+        this.ce_name = excutive.getCe_name();
+        this.ce_nowaddress = excutive.getCe_nowaddress();
+        this.ce_paperscode = excutive.getCe_paperscode();
+        this.ce_paperstype = excutive.getCe_paperstype();
+        this.ce_position = excutive.getCe_position();
+        this.ce_sex = excutive.getCe_sex();
+        this.ce_stwkfpo = excutive.getCe_stwkfpo() == null ? null : DateUtils.DateInfo(excutive.getCe_stwkfpo());
+        this.ce_woekexper = excutive.getCe_woekexper();
+        this.ce_workeyears = excutive.getCe_workeyears();
+        this.enuu = excutive.getEnuu();
+    }
+
+    public CustomerExcutiveInfo() {
+
+    }
+}
+
+

+ 174 - 0
finance-service/src/main/java/com/uas/finance/erp/model/FinanceConditionInfo.java

@@ -0,0 +1,174 @@
+package com.uas.finance.erp.model;
+
+import com.uas.finance.model.FinanceCondition;
+
+import javax.persistence.Column;
+
+/**
+ * created by shicr on 2017/12/20
+ * 财务情况说明
+ **/
+public class FinanceConditionInfo {
+
+    /**
+     * ID
+     */
+    private Long id;
+
+    /**
+     * 企业uu
+     *
+     * @return
+     */
+    private Long enuu;
+
+    /**
+     * 账龄<=3个月
+     */
+    private Double fc_agingamount1;
+
+    /**
+     * 3个月<帐龄≤6个月
+     */
+    private Double fc_agingamount2;
+
+    /**
+     * 6个月<帐龄<=1
+     */
+    private Double fc_agingamount4;
+
+    /**
+     * 帐龄>1
+     */
+    private Double fc_agingamount3;
+
+    /**
+     * 其他应收账款说明
+     */
+    private String fc_otharremark;
+
+    /**
+     * 截止时间,年月的拼接,字段名按UAS表来写,不是手误
+     */
+    private Integer fc_yeatmonth;
+
+    /**
+     * 截止至XX年
+     */
+    private Integer year;
+
+    /**
+     * 截止至XX月
+     */
+    private Integer month;
+
+    /**
+     * 余额
+     */
+    private Double fc_arbalance;
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public Double getFc_agingamount1() {
+        return fc_agingamount1;
+    }
+
+    public void setFc_agingamount1(Double fc_agingamount1) {
+        this.fc_agingamount1 = fc_agingamount1;
+    }
+
+    public Double getFc_agingamount2() {
+        return fc_agingamount2;
+    }
+
+    public void setFc_agingamount2(Double fc_agingamount2) {
+        this.fc_agingamount2 = fc_agingamount2;
+    }
+
+    public Double getFc_agingamount4() {
+        return fc_agingamount4;
+    }
+
+    public void setFc_agingamount4(Double fc_agingamount4) {
+        this.fc_agingamount4 = fc_agingamount4;
+    }
+
+    public Double getFc_agingamount3() {
+        return fc_agingamount3;
+    }
+
+    public void setFc_agingamount3(Double fc_agingamount3) {
+        this.fc_agingamount3 = fc_agingamount3;
+    }
+
+    public String getFc_otharremark() {
+        return fc_otharremark;
+    }
+
+    public void setFc_otharremark(String fc_otharremark) {
+        this.fc_otharremark = fc_otharremark;
+    }
+
+    public Integer getFc_yeatmonth() {
+        return fc_yeatmonth;
+    }
+
+    public void setFc_yeatmonth(Integer fc_yeatmonth) {
+        this.fc_yeatmonth = fc_yeatmonth;
+    }
+
+    public Integer getYear() {
+        return year;
+    }
+
+    public void setYear(Integer year) {
+        this.year = year;
+    }
+
+    public Integer getMonth() {
+        return month;
+    }
+
+    public void setMonth(Integer month) {
+        this.month = month;
+    }
+
+    public Double getFc_arbalance() {
+        return fc_arbalance;
+    }
+
+    public void setFc_arbalance(Double fc_arbalance) {
+        this.fc_arbalance = fc_arbalance;
+    }
+
+    public FinanceConditionInfo(FinanceCondition condition) {
+        this.enuu = condition.getEnuu();
+        this.id = condition.getId();
+        this.fc_agingamount1 = condition.getFc_agingamount1();
+        this.fc_agingamount2 = condition.getFc_agingamount2();
+        this.fc_agingamount3 = condition.getFc_agingamount3();
+        this.fc_agingamount4 = condition.getFc_agingamount4();
+        this.fc_otharremark = condition.getFc_otharremark();
+        this.fc_arbalance = condition.getFc_arbalance();
+        this.fc_yeatmonth = condition.getFc_yeatmonth();
+    }
+
+    public FinanceConditionInfo() {
+
+    }
+}

+ 116 - 0
finance-service/src/main/java/com/uas/finance/erp/model/ProductMixInfo.java

@@ -0,0 +1,116 @@
+package com.uas.finance.erp.model;
+
+import com.uas.finance.model.ProductMix;
+
+/**
+ * created by shicr on 2017/12/20
+ * 经营情况表
+ **/
+public class ProductMixInfo {
+
+    /**
+     * ID
+     */
+    private Long id;
+
+    /**
+     * 企业UU
+     * @return
+     */
+    private Long enuu;
+
+    /**
+     *产品/服务种类
+     */
+    private String pm_kind;
+
+    /**
+     *今年营业收入
+     */
+    private Double pm_tannualrevenue;
+
+    /**
+     * 占今年总收入比例
+     */
+    private Double pm_tratio;
+
+    /**
+     * 上年营业收入
+     */
+    private Double pm_annualrevenue;
+
+    /**
+     * 占总收入比例
+     */
+    private Double pm_ratio;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public String getPm_kind() {
+        return pm_kind;
+    }
+
+    public void setPm_kind(String pm_kind) {
+        this.pm_kind = pm_kind;
+    }
+
+    public Double getPm_tannualrevenue() {
+        return pm_tannualrevenue;
+    }
+
+    public void setPm_tannualrevenue(Double pm_tannualrevenue) {
+        this.pm_tannualrevenue = pm_tannualrevenue;
+    }
+
+    public Double getPm_tratio() {
+        return pm_tratio;
+    }
+
+    public void setPm_tratio(Double pm_tratio) {
+        this.pm_tratio = pm_tratio;
+    }
+
+    public Double getPm_annualrevenue() {
+        return pm_annualrevenue;
+    }
+
+    public void setPm_annualrevenue(Double pm_annualrevenue) {
+        this.pm_annualrevenue = pm_annualrevenue;
+    }
+
+    public Double getPm_ratio() {
+        return pm_ratio;
+    }
+
+    public void setPm_ratio(Double pm_ratio) {
+        this.pm_ratio = pm_ratio;
+    }
+
+    public ProductMixInfo(ProductMix productMix) {
+        this.id = productMix.getId();
+        this.enuu = productMix.getEnuu();
+        this.pm_annualrevenue = productMix.getPm_annualrevenue();
+        this.pm_kind = productMix.getPm_kind();
+        this.pm_ratio = productMix.getPm_ratio();
+        this.pm_tannualrevenue = productMix.getPm_tannualrevenue();
+        this.pm_tratio = productMix.getPm_tratio();
+    }
+
+    public ProductMixInfo() {
+
+    }
+}

+ 339 - 0
finance-service/src/main/java/com/uas/finance/erp/model/PurcCustInfo.java

@@ -0,0 +1,339 @@
+package com.uas.finance.erp.model;
+
+import com.uas.finance.model.MFCustInfo;
+import com.uas.finance.model.MFCustInfoDetail;
+import com.uas.finance.util.CollectionUtils;
+import com.uas.finance.util.DateUtils;
+import com.uas.sso.util.FlexJsonUtil;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 买方客户资料
+ * created by shicr on 2017/12/20
+ **/
+public class PurcCustInfo {
+
+    /**
+     * ID
+     */
+    private Long id;
+
+    /**
+     * 企业uu
+     *
+     * @return
+     */
+    private Long enuu;
+
+    /**
+     * 买方名称
+     */
+    private String mf_custname;
+
+    /**
+     * 额度申请
+     */
+    private Double mf_credit;
+
+    /**
+     * 法人代表
+     */
+    private String mf_legrep;
+
+    /**
+     * 注册资本(万元)
+     */
+    private Double mf_regcapital;
+
+    /**
+     * 经营地址
+     */
+    private String mf_addr;
+
+    /**
+     * 成立时间
+     */
+    private String mf_estabtime;
+
+    /**
+     * 联系人
+     */
+    private String mf_contact;
+
+    /**
+     * 联系电话
+     */
+    private String mf_contactnum;
+
+    /**
+     * 传真
+     */
+    private String mf_fax;
+
+    /**
+     * 电子邮箱
+     */
+    private String mf_email;
+
+    /**
+     * 结算开户行
+     */
+    private String mf_balancebank;
+
+    /**
+     * 银行账户
+     */
+    private String mf_bankaccount;
+
+    /**
+     * 交易产品
+     */
+    private String mf_tradprod;
+
+    /**
+     * 付款条件
+     */
+    private String mf_payterm;
+
+    /**
+     * 股东占比(%)
+     */
+    private Double mf_shareholder;
+
+    /**
+     * 经营范围
+     */
+    private String mf_businsscope;
+
+    /**
+     * 是否与其他保理商合作
+     * -1:true 0:false
+     */
+    private Short mf_coopothers;
+
+    /**
+     * 保险公司取得保险额度
+     * -1:true 0:false
+     */
+    private Short mf_hasinslimit;
+
+    /**
+     * 买方客户信息详情
+     */
+    //private List<PurcCustInfoDetail> purcCustInfoDetails;
+    private String purcCustInfoDetails;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public String getMf_custname() {
+        return mf_custname;
+    }
+
+    public void setMf_custname(String mf_custname) {
+        this.mf_custname = mf_custname;
+    }
+
+    public Double getMf_credit() {
+        return mf_credit;
+    }
+
+    public void setMf_credit(Double mf_credit) {
+        this.mf_credit = mf_credit;
+    }
+
+    public String getMf_legrep() {
+        return mf_legrep;
+    }
+
+    public void setMf_legrep(String mf_legrep) {
+        this.mf_legrep = mf_legrep;
+    }
+
+    public Double getMf_regcapital() {
+        return mf_regcapital;
+    }
+
+    public void setMf_regcapital(Double mf_regcapital) {
+        this.mf_regcapital = mf_regcapital;
+    }
+
+    public String getMf_addr() {
+        return mf_addr;
+    }
+
+    public void setMf_addr(String mf_addr) {
+        this.mf_addr = mf_addr;
+    }
+
+    public String getMf_estabtime() {
+        return mf_estabtime;
+    }
+
+    public void setMf_estabtime(String mf_estabtime) {
+        this.mf_estabtime = mf_estabtime;
+    }
+
+    public String getMf_contact() {
+        return mf_contact;
+    }
+
+    public void setMf_contact(String mf_contact) {
+        this.mf_contact = mf_contact;
+    }
+
+    public String getMf_contactnum() {
+        return mf_contactnum;
+    }
+
+    public void setMf_contactnum(String mf_contactnum) {
+        this.mf_contactnum = mf_contactnum;
+    }
+
+    public String getMf_fax() {
+        return mf_fax;
+    }
+
+    public void setMf_fax(String mf_fax) {
+        this.mf_fax = mf_fax;
+    }
+
+    public String getMf_email() {
+        return mf_email;
+    }
+
+    public void setMf_email(String mf_email) {
+        this.mf_email = mf_email;
+    }
+
+    public String getMf_balancebank() {
+        return mf_balancebank;
+    }
+
+    public void setMf_balancebank(String mf_balancebank) {
+        this.mf_balancebank = mf_balancebank;
+    }
+
+    public String getMf_bankaccount() {
+        return mf_bankaccount;
+    }
+
+    public void setMf_bankaccount(String mf_bankaccount) {
+        this.mf_bankaccount = mf_bankaccount;
+    }
+
+    public String getMf_tradprod() {
+        return mf_tradprod;
+    }
+
+    public void setMf_tradprod(String mf_tradprod) {
+        this.mf_tradprod = mf_tradprod;
+    }
+
+    public String getMf_payterm() {
+        return mf_payterm;
+    }
+
+    public void setMf_payterm(String mf_payterm) {
+        this.mf_payterm = mf_payterm;
+    }
+
+    public Double getMf_shareholder() {
+        return mf_shareholder;
+    }
+
+    public void setMf_shareholder(Double mf_shareholder) {
+        this.mf_shareholder = mf_shareholder;
+    }
+
+    public String getMf_businsscope() {
+        return mf_businsscope;
+    }
+
+    public void setMf_businsscope(String mf_businsscope) {
+        this.mf_businsscope = mf_businsscope;
+    }
+
+    public Short getMf_coopothers() {
+        return mf_coopothers;
+    }
+
+    public void setMf_coopothers(Short mf_coopothers) {
+        this.mf_coopothers = mf_coopothers;
+    }
+
+    public Short getMf_hasinslimit() {
+        return mf_hasinslimit;
+    }
+
+    public void setMf_hasinslimit(Short mf_hasinslimit) {
+        this.mf_hasinslimit = mf_hasinslimit;
+    }
+
+    public String getPurcCustInfoDetails() {
+        return purcCustInfoDetails;
+    }
+
+    public void setPurcCustInfoDetails(String purcCustInfoDetails) {
+        this.purcCustInfoDetails = purcCustInfoDetails;
+    }
+/*public List<PurcCustInfoDetail> getPurcCustInfoDetails() {
+        return purcCustInfoDetails;
+    }
+
+    public void setPurcCustInfoDetails(List<PurcCustInfoDetail> purcCustInfoDetails) {
+        this.purcCustInfoDetails = purcCustInfoDetails;
+    }*/
+
+    public PurcCustInfo(MFCustInfo custInfo) {
+        this.id = custInfo.getId();
+        this.enuu = custInfo.getEnuu();
+        this.mf_custname = custInfo.getMf_custname();
+        this.mf_addr = custInfo.getMf_addr();
+        this.mf_balancebank = custInfo.getMf_balancebank();
+        this.mf_bankaccount = custInfo.getMf_bankaccount();
+        this.mf_businsscope = custInfo.getMf_businsscope();
+        this.mf_contact = custInfo.getMf_contact();
+        this.mf_contactnum = custInfo.getMf_contactnum();
+        this.mf_credit = custInfo.getMf_credit();
+        this.mf_custname = custInfo.getMf_custname();
+        this.mf_email = custInfo.getMf_email();
+        this.mf_estabtime = custInfo.getMf_estabtime() == null ? null : DateUtils.DateInfo(custInfo.getMf_estabtime());
+        this.mf_fax = custInfo.getMf_fax();
+        this.mf_payterm = custInfo.getMf_payterm();
+        this.mf_shareholder = custInfo.getMf_shareholder();
+        this.mf_tradprod = custInfo.getMf_tradprod();
+        this.mf_coopothers=custInfo.getMf_coopohers();
+        this.mf_hasinslimit = custInfo.getMf_hasinslimit();
+        this.mf_shareholder = custInfo.getMf_shareholder();
+        this.mf_regcapital = custInfo.getMf_regcapital();
+        this.mf_legrep = custInfo.getMf_legrep();
+        if (!CollectionUtils.isEmpty(custInfo.getMfCustInfoDetailList())) {
+            List<PurcCustInfoDetail> purcCustInfoDetails = new ArrayList<PurcCustInfoDetail>();
+            for (MFCustInfoDetail mfCustInfoDetail : custInfo.getMfCustInfoDetailList()) {
+                purcCustInfoDetails.add(new PurcCustInfoDetail(mfCustInfoDetail));
+            }
+            //this.purcCustInfoDetails = purcCustInfoDetails;
+            this.purcCustInfoDetails = FlexJsonUtil.toJsonArray(purcCustInfoDetails);
+        }
+    }
+
+    public PurcCustInfo() {
+
+    }
+}

+ 112 - 0
finance-service/src/main/java/com/uas/finance/erp/model/PurcCustInfoDetail.java

@@ -0,0 +1,112 @@
+package com.uas.finance.erp.model;
+
+import com.uas.finance.model.MFCustInfoDetail;
+
+/**
+ * 买方客户明细
+ * created by shicr on 2017/12/29
+ **/
+public class PurcCustInfoDetail {
+
+    /**
+     * ID
+     */
+    private Long id;
+
+    /**
+     * 年度
+     */
+    private Integer mfd_year;
+
+    /**
+     * 购买总额
+     */
+    private Double mfd_amount;
+
+    /**
+     * 赊账总额
+     */
+    private Double mfd_chargeamount;
+
+    /**
+     * 折扣金额
+     */
+    private Double mfd_discountamount;
+
+    /**
+     * 有无逾期
+     */
+    private String mfd_overdue;
+
+
+    /**
+     * 买方信息id
+     */
+    private Long mfId;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Integer getMfd_year() {
+        return mfd_year;
+    }
+
+    public void setMfd_year(Integer mfd_year) {
+        this.mfd_year = mfd_year;
+    }
+
+    public Double getMfd_amount() {
+        return mfd_amount;
+    }
+
+    public void setMfd_amount(Double mfd_amount) {
+        this.mfd_amount = mfd_amount;
+    }
+
+    public Double getMfd_chargeamount() {
+        return mfd_chargeamount;
+    }
+
+    public void setMfd_chargeamount(Double mfd_chargeamount) {
+        this.mfd_chargeamount = mfd_chargeamount;
+    }
+
+    public Double getMfd_discountamount() {
+        return mfd_discountamount;
+    }
+
+    public void setMfd_discountamount(Double mfd_discountamount) {
+        this.mfd_discountamount = mfd_discountamount;
+    }
+
+    public String getMfd_overdue() {
+        return mfd_overdue;
+    }
+
+    public void setMfd_overdue(String mfd_overdue) {
+        this.mfd_overdue = mfd_overdue;
+    }
+
+    public Long getMfId() {
+        return mfId;
+    }
+
+    public void setMfId(Long mfId) {
+        this.mfId = mfId;
+    }
+
+    public PurcCustInfoDetail(MFCustInfoDetail mfCustInfoDetail) {
+        this.id = mfCustInfoDetail.getId();
+        this.mfd_year = mfCustInfoDetail.getMfd_year();
+        this.mfd_amount = mfCustInfoDetail.getMfd_amount();
+        this.mfd_chargeamount = mfCustInfoDetail.getMfd_chargeamount();
+        this.mfd_discountamount = mfCustInfoDetail.getMfd_discountamount();
+        this.mfd_overdue = mfCustInfoDetail.getMfd_overdue();
+        this.mfId = mfCustInfoDetail.getMfId();
+    }
+}

+ 116 - 0
finance-service/src/main/java/com/uas/finance/erp/model/ShareholdersInfo.java

@@ -0,0 +1,116 @@
+package com.uas.finance.erp.model;
+
+import com.uas.finance.model.Shareholders;
+
+/**
+ * 股东信息表
+ * created by shicr on 2017/12/18
+ **/
+public class ShareholdersInfo {
+
+    /**
+     * ID
+     */
+    private Long id;
+
+    /**
+     * 股东名称
+     */
+    private String cs_name;
+
+    /**
+     * 证件类型
+     */
+    private String cs_paperstype;
+
+    /**
+     * 证件号码
+     */
+    private String cs_paperscode;
+
+    /**
+     * 出资比例(%)
+     */
+    private Double cs_investratio;
+
+    /**
+     *实际投资金额
+     */
+    private Double cs_investamount;
+
+    /**
+     * 企业UU
+     * @return
+     */
+    private Long enuu;
+
+    public String getCs_name() {
+        return cs_name;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public void setCs_name(String cs_name) {
+        this.cs_name = cs_name;
+    }
+
+    public String getCs_paperstype() {
+        return cs_paperstype;
+    }
+
+    public void setCs_paperstype(String cs_paperstype) {
+        this.cs_paperstype = cs_paperstype;
+    }
+
+    public String getCs_paperscode() {
+        return cs_paperscode;
+    }
+
+    public void setCs_paperscode(String cs_paperscode) {
+        this.cs_paperscode = cs_paperscode;
+    }
+
+    public Double getCs_investratio() {
+        return cs_investratio;
+    }
+
+    public void setCs_investratio(Double cs_investratio) {
+        this.cs_investratio = cs_investratio;
+    }
+
+    public Double getCs_investamount() {
+        return cs_investamount;
+    }
+
+    public void setCs_investamount(Double cs_investamount) {
+        this.cs_investamount = cs_investamount;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public ShareholdersInfo(com.uas.finance.model.Shareholders shareholders) {
+        this.id = shareholders.getId();
+        this.cs_investamount = shareholders.getCs_investamount();
+        this.cs_investratio = shareholders.getCs_investratio();
+        this.cs_name = shareholders.getCs_name();
+        this.cs_paperscode = shareholders.getCs_paperscode();
+        this.cs_paperstype = shareholders.getCs_paperstype();
+        this.enuu = shareholders.getEnuu();
+    }
+
+    public ShareholdersInfo() {
+
+    }
+}

+ 146 - 0
finance-service/src/main/java/com/uas/finance/erp/model/UpdowncastInfo.java

@@ -0,0 +1,146 @@
+package com.uas.finance.erp.model;
+
+import com.uas.finance.model.Updowncast;
+
+import javax.persistence.Column;
+
+/**
+ * 供应商客户
+ * created by shicr on 2017/12/20
+ **/
+public class UpdowncastInfo {
+
+    /**
+     * ID
+     */
+    private Long id;
+
+    /**
+     * 名称
+     */
+    private String udc_name;
+
+    /**
+     * 企业uu
+     * @return
+     */
+    private Long enuu;
+
+    /**
+     * 产品
+     */
+    private String udc_product;
+
+    /**
+     * 上年交易额
+     */
+    private Double udc_lastyear;
+
+    /**
+     * 今年交易额
+     */
+    private Double udc_thisyear;
+
+    /**
+     * 结账方式及日期
+     */
+    private String udc_payment;
+
+    /**
+     * 合作年限
+     */
+    private Short udc_cooperationyears;
+
+    /**
+     *上/下游客户
+     */
+    private String udc_kind;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public String getUdc_name() {
+        return udc_name;
+    }
+
+    public void setUdc_name(String udc_name) {
+        this.udc_name = udc_name;
+    }
+
+    public String getUdc_product() {
+        return udc_product;
+    }
+
+    public void setUdc_product(String udc_product) {
+        this.udc_product = udc_product;
+    }
+
+    public Double getUdc_lastyear() {
+        return udc_lastyear;
+    }
+
+    public void setUdc_lastyear(Double udc_lastyear) {
+        this.udc_lastyear = udc_lastyear;
+    }
+
+    public Double getUdc_thisyear() {
+        return udc_thisyear;
+    }
+
+    public void setUdc_thisyear(Double udc_thisyear) {
+        this.udc_thisyear = udc_thisyear;
+    }
+
+    public String getUdc_payment() {
+        return udc_payment;
+    }
+
+    public void setUdc_payment(String udc_payment) {
+        this.udc_payment = udc_payment;
+    }
+
+    public Short getUdc_cooperationyears() {
+        return udc_cooperationyears;
+    }
+
+    public void setUdc_cooperationyears(Short udc_cooperationyears) {
+        this.udc_cooperationyears = udc_cooperationyears;
+    }
+
+    public String getUdc_kind() {
+        return udc_kind;
+    }
+
+    public void setUdc_kind(String udc_kind) {
+        this.udc_kind = udc_kind;
+    }
+
+    public UpdowncastInfo(Updowncast updowncast) {
+        this.id = updowncast.getId();
+        this.enuu = updowncast.getEnuu();
+        this.udc_cooperationyears = updowncast.getUdc_cooperationyears();
+        this.udc_lastyear = updowncast.getUdc_lastyear();
+        this.udc_name = updowncast.getUdc_name();
+        this.udc_payment = updowncast.getUdc_payment();
+        this.udc_product = updowncast.getUdc_product();
+        this.udc_thisyear = updowncast.getUdc_thisyear();
+        this.udc_kind=updowncast.getUdc_kind();
+    }
+
+    public UpdowncastInfo() {
+
+    }
+}

+ 28 - 0
finance-service/src/main/java/com/uas/finance/erp/service/AccountApplyDownService.java

@@ -0,0 +1,28 @@
+package com.uas.finance.erp.service;
+
+import com.uas.finance.model.AccountApply;
+import org.springframework.ui.ModelMap;
+
+import java.util.List;
+
+/**
+ * 应收账款转让接口
+ * created by shicr on 2018/1/29
+ **/
+public interface AccountApplyDownService {
+
+    /**
+     * 对应收账款转让表AccountApply进行封装
+     *
+     * @param apply
+     * @return
+     */
+    ModelMap covert(List<AccountApply> apply);
+
+    /**
+     * 更新accountapply的下载状态
+     *
+     * @param id
+     */
+    void updateErpStatus(Long id);
+}

+ 21 - 0
finance-service/src/main/java/com/uas/finance/erp/service/CustomerInfoDownService.java

@@ -0,0 +1,21 @@
+package com.uas.finance.erp.service;
+
+import com.uas.finance.model.CustomerInfo;
+import org.springframework.ui.ModelMap;
+
+import java.util.List;
+
+/**
+ * 客户录入信息接口
+ * Created by hejq on 2017-12-21.
+ */
+public interface CustomerInfoDownService {
+
+    /**
+     * 将金融平台的CustomerInfo进行封装操作
+     * @param infos CustomerInfo信息
+     * @return
+     */
+    ModelMap covert(List<CustomerInfo> infos);
+
+}

+ 29 - 0
finance-service/src/main/java/com/uas/finance/erp/service/FinancingApplyDownService.java

@@ -0,0 +1,29 @@
+package com.uas.finance.erp.service;
+
+import com.uas.finance.model.FinancingApply;
+import org.springframework.ui.ModelMap;
+
+import java.util.List;
+
+/**
+ * 金融服务下载接口
+ * <p>
+ * created by shicr on 2017/12/26
+ **/
+public interface FinancingApplyDownService {
+
+    /**
+     * 将金融平台的financeingApply进行封装操作
+     *
+     * @param financingApply financingApply数据
+     * @return
+     */
+    ModelMap covert(List<FinancingApply> financingApply);
+
+    /**
+     * 更新financeingApply下载状态
+     *
+     * @param idStr 需要更新的id
+     */
+    void updateDownStatus(String idStr);
+}

+ 62 - 0
finance-service/src/main/java/com/uas/finance/erp/service/impl/AccountApplyDownServiceImpl.java

@@ -0,0 +1,62 @@
+package com.uas.finance.erp.service.impl;
+
+import com.uas.finance.dao.AccountApplyDao;
+import com.uas.finance.dao.SellerQuotaDao;
+import com.uas.finance.erp.service.AccountApplyDownService;
+import com.uas.finance.model.AccountApply;
+import com.uas.finance.model.SellerQuota;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.stereotype.Service;
+import org.springframework.ui.ModelMap;
+
+import java.util.List;
+
+/**
+ * 应收账款转让接口实现类
+ * created by shicr on 2018/1/29
+ **/
+@Service
+public class AccountApplyDownServiceImpl implements AccountApplyDownService {
+
+    @Autowired
+    private JdbcTemplate jdbcTemplate;
+
+    @Autowired
+    private AccountApplyDao dao;
+
+    @Autowired
+    private SellerQuotaDao sellerQuotaDao;
+
+    /**
+     * 对应收账款转让表AccountApply进行封装
+     *
+     * @param accountApplies
+     * @return
+     */
+    public ModelMap covert(List<AccountApply> accountApplies) {
+        ModelMap modelMap = new ModelMap();
+        modelMap.put("accountapply", accountApplies);
+        for(AccountApply a : accountApplies){
+
+            SellerQuota s = sellerQuotaDao.findOne(a.getCqId());
+            //买方客户名
+            modelMap.put("custname", s.getCq_custname());
+            //客户UU
+            modelMap.put("uu", s.getCq_uu());
+            //买房额度对应的申请单id
+            modelMap.put("faid", s.getFaid());
+        }
+
+        return modelMap;
+    }
+
+    /**
+     * 更新accountapply的下载状态
+     * @param id
+     */
+    public void updateErpStatus(Long id){
+        String sql = "update accountapply set erpstatus = 203 where id = "+ id;
+        jdbcTemplate.execute(sql);
+    }
+}

+ 40 - 0
finance-service/src/main/java/com/uas/finance/erp/service/impl/CustomerInfoDownServiceImpl.java

@@ -0,0 +1,40 @@
+package com.uas.finance.erp.service.impl;
+
+import com.uas.finance.erp.model.CustInfo;
+import com.uas.finance.erp.service.CustomerInfoDownService;
+import com.uas.finance.model.CustomerInfo;
+import com.uas.finance.util.CollectionUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.ui.ModelMap;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by hejq on 2017-12-21.
+ */
+@Service
+public class CustomerInfoDownServiceImpl implements CustomerInfoDownService {
+
+    @Override
+    public ModelMap covert(List<CustomerInfo> infos) {
+        ModelMap map = new ModelMap();
+        List<CustInfo> custInfos = new ArrayList<CustInfo>();
+        //id 这边先提取出来,保存成功返回直接更新状态,轮询中间不作处理
+        StringBuffer idStr = new StringBuffer();
+        int size = 0;
+        if(idStr.length() > 0)
+            idStr.append(",");
+        if(!CollectionUtils.isEmpty(infos)) {
+            for(CustomerInfo info : infos) {
+                custInfos.add(new CustInfo(info));
+                idStr.append(info.getId());
+                size = size + 1;
+            }
+        }
+        map.put("custInfos", custInfos);
+        map.put("idStr", idStr);
+        map.put("size", size);
+        return map;
+    }
+}

+ 55 - 0
finance-service/src/main/java/com/uas/finance/erp/service/impl/FinancingApplyDownServiceImpl.java

@@ -0,0 +1,55 @@
+package com.uas.finance.erp.service.impl;
+
+import com.uas.finance.erp.model.Apply;
+import com.uas.finance.erp.service.FinancingApplyDownService;
+import com.uas.finance.model.FinancingApply;
+import com.uas.finance.util.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.stereotype.Service;
+import org.springframework.ui.ModelMap;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * created by shicr on 2017/12/26
+ **/
+@Service
+public class FinancingApplyDownServiceImpl implements FinancingApplyDownService {
+
+    @Autowired
+    private JdbcTemplate jdbcTemplate;
+
+    @Override
+    public ModelMap covert(List<FinancingApply> financingApplies) {
+        ModelMap map = new ModelMap();
+        List<Apply> financingApplyList = new ArrayList<Apply>();
+        //id 这边先提取出来,保存成功返回直接更新状态,轮询中间不作处理
+        StringBuffer idStr = new StringBuffer();
+        int size = 0;
+        if (!CollectionUtils.isEmpty(financingApplies)) {
+            for (FinancingApply financingApply : financingApplies) {
+                financingApplyList.add(new Apply(financingApply));
+                if (idStr.length() > 0) {
+                    idStr.append(",");
+                }
+                idStr.append(financingApply.getId());
+                size = size + 1;
+            }
+        }
+        map.put("apply", financingApplyList);
+        //System.out.println(JSON.toJSON(financingApplyList));
+        map.put("idStr", idStr);
+        map.put("size", size);
+        return map;
+    }
+
+
+    @Override
+    public void updateDownStatus(String idStr) {
+        String sql = "update financingapply set fa_erpstatus = 203 , fa_status = 203 where fa_id in (" + idStr + ")";
+        jdbcTemplate.execute(sql);
+    }
+
+}

+ 92 - 0
finance-service/src/main/java/com/uas/finance/filter/AbstractSSOInterceptor.java

@@ -0,0 +1,92 @@
+package com.uas.finance.filter;
+
+import com.uas.sso.SSOConfig;
+import com.uas.sso.SSOHelper;
+import com.uas.sso.SSOToken;
+import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.logging.Logger;
+
+/**
+ * spring mvc 接口,SSO 过滤器验证登录状态
+ * 
+ * @author yingp
+ *
+ */
+public abstract class AbstractSSOInterceptor extends HandlerInterceptorAdapter {
+
+	private static final Logger logger = Logger.getLogger(com.uas.sso.web.spring.AbstractSSOInterceptor.class.getName());
+
+	/**
+	 * 未登录情况下的处理
+	 * 
+	 * @param request
+	 * @param response
+	 * @return true继续,false跳转登录
+	 */
+	protected abstract boolean onAuthenticateFailed(HttpServletRequest request, HttpServletResponse response);
+
+	/**
+	 * 已登录情况下的处理
+	 * 
+	 * @param request
+	 * @param response
+	 * @return
+	 */
+	protected abstract void onAuthenticateSuccess(HttpServletRequest request, HttpServletResponse response);
+
+	/**
+	 * 跳转登录
+	 * 
+	 * @param request
+	 * @param response
+	 * @throws IOException
+	 */
+	protected void sendRedirect(HttpServletRequest request, HttpServletResponse response) throws IOException {
+		boolean cross = SSOHelper.isCrossDomain(request);
+		if (cross) {
+			request.getSession().setAttribute(SSOConfig.SSOReferer, request.getRequestURL());
+			response.sendRedirect(SSOHelper.getSSOService().getConfig().getCrossProxyUri());
+		} else {
+			SSOHelper.clearRedirectLogin(request, response);
+		}
+	}
+
+	private final boolean authenticate(HttpServletRequest request, HttpServletResponse response) throws IOException {
+		SSOToken token = SSOHelper.getToken(request);
+		if (token == null) {
+			// 返回false表示需要跳转登录
+			if (!onAuthenticateFailed(request, response)) {
+				if (isRedirectAble(request)) {
+					/**
+					 * 重新登录
+					 */
+					logger.fine("logout. request url:" + request.getRequestURL());
+					sendRedirect(request, response);
+				}
+				return false;
+			} else {
+				return true;
+			}
+		}
+		request.setAttribute(SSOConfig.SSO_TOKEN_ATTR, token);
+		onAuthenticateSuccess(request, response);
+		return true;
+	}
+
+	@Override
+	public final boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
+		if (super.preHandle(request, response, handler)) {
+			return authenticate(request, response);
+		}
+		return false;
+	}
+
+	protected boolean isRedirectAble(HttpServletRequest request) {
+		return null == request.getHeader("x-requested-with")
+				&& (null == request.getHeader("Accept") || !request.getHeader("Accept").contains("application/json"));
+	}
+}

+ 64 - 0
finance-service/src/main/java/com/uas/finance/filter/AccessSignatureInterceptor.java

@@ -0,0 +1,64 @@
+package com.uas.finance.filter;
+
+import com.uas.finance.service.EnterpriseService;
+import com.uas.finance.model.Enterprise;
+import com.uas.finance.util.AgentUtils;
+import com.uas.finance.util.HmacUtils;
+import com.uas.finance.util.SystemSession;
+import com.uas.sso.entity.UserAccount;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.stereotype.Component;
+import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * 对需要签名认证的请求进行拦截认证
+ */
+@SuppressWarnings("deprecation")
+@Component
+public class AccessSignatureInterceptor extends HandlerInterceptorAdapter {
+
+	private final static String idParam = "access_id";
+	private final static String signatureParam = "_signature";
+
+	private static final Logger logger = Logger.getLogger(AccessSignatureInterceptor.class);
+
+	@Autowired
+	private EnterpriseService enterpriseService;
+
+
+	@Override
+	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
+		String id = request.getParameter(idParam);
+		String sign = request.getParameter(signatureParam);
+		if (id != null && sign != null) {
+			UserAccount user = (UserAccount) request.getSession().getAttribute("userAccount");
+
+			Enterprise enterprise = enterpriseService.findByEnuu(Long.parseLong(id));
+			if (enterprise != null && enterprise.getAccessSecret() != null) {
+				String urlMessage = request.getRequestURL() + "?"
+						+ request.getQueryString().substring(0, request.getQueryString().indexOf(signatureParam) - 1);
+				if (sign.equals(HmacUtils.encode(urlMessage, enterprise.getAccessSecret()))) {
+                    //写入用户信息
+					SystemSession.setUserAccount(user);
+                    return true;
+				}
+				logger.error(String.format("FORBIDDEN FROM %s@%s, REQUEST: %s, SIGNATURE: %s", AgentUtils.getIp(request), id, urlMessage,
+						sign));
+			}
+		}
+		response.setStatus(HttpStatus.FORBIDDEN.value());
+		return false;
+	}
+
+	@Override
+	public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
+		super.afterCompletion(request, response, handler, ex);
+		SystemSession.clear();
+	}
+
+}

+ 78 - 0
finance-service/src/main/java/com/uas/finance/filter/BaseController.java

@@ -0,0 +1,78 @@
+package com.uas.finance.filter;
+
+import com.alibaba.fastjson.JSON;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.ui.ModelMap;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+/**
+ * controller基础类
+ * 
+ * @author yingp
+ *
+ */
+public class BaseController {
+
+	protected static final String defultCharset = "UTF-8";
+
+	@Autowired
+	protected HttpServletRequest request;
+
+	@Autowired
+	protected HttpServletResponse response;
+
+	protected static ModelMap success() {
+		return new ModelMap("success", true);
+	}
+
+	protected static ModelMap success(Object data) {
+		return new ModelMap("success", true).addAttribute("content", data);
+	}
+
+	protected static ModelMap error(String errMsg) {
+		return new ModelMap("error", true).addAttribute("errMsg", errMsg);
+	}
+
+	protected static ModelMap error(String errCode, String errMsg) {
+		return new ModelMap("error", true).addAttribute("errCode", errCode).addAttribute("errMsg", errMsg);
+	}
+
+	/**
+	 * 输出json格式
+	 * 
+	 * @param obj
+	 * @throws IOException
+	 */
+	protected void printJson(Object obj) throws IOException {
+		response.setStatus(HttpStatus.FORBIDDEN.value());
+		response.addHeader("Content-Type", "application/json; charset=" + defultCharset);
+		PrintWriter printWriter = response.getWriter();
+		printWriter.append(JSON.toJSONString(obj));
+		printWriter.flush();
+		printWriter.close();
+	}
+
+	/**
+	 * 输出流
+	 * 
+	 * @param fileName
+	 *            文件名
+	 * @param bytes
+	 * @throws IOException
+	 */
+	protected ResponseEntity<byte[]> outputStream(String fileName, byte[] bytes) {
+		HttpHeaders headers = new HttpHeaders();
+		headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
+		headers.setContentDispositionFormData("attachment", fileName);
+		return new ResponseEntity<byte[]>(bytes, headers, HttpStatus.CREATED);
+	}
+
+}

+ 55 - 0
finance-service/src/main/java/com/uas/finance/filter/SSOInterceptor.java

@@ -0,0 +1,55 @@
+package com.uas.finance.filter;
+
+import com.uas.finance.util.FastjsonUtils;
+import com.uas.finance.util.SystemSession;
+import com.uas.sso.SSOHelper;
+import com.uas.sso.SSOToken;
+import com.uas.sso.entity.UserAccount;
+import com.uas.sso.web.spring.AbstractSSOInterceptor;
+import org.springframework.stereotype.Component;
+import org.springframework.util.StringUtils;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * 登录拦截
+ */
+@Component
+public class SSOInterceptor extends AbstractSSOInterceptor {
+
+	@Override
+	protected boolean onAuthenticateFailed(HttpServletRequest request, HttpServletResponse response) {
+		return false;
+	}
+
+	@Override
+	protected void onAuthenticateSuccess(HttpServletRequest request, HttpServletResponse response) {
+		UserAccount userAccount = (UserAccount) request.getSession().getAttribute("userAccount");
+		if (userAccount == null) {
+			SSOToken token = SSOHelper.attrToken(request);
+			userAccount = getUserByToken(token);
+			if (userAccount != null) {
+				request.getSession().setAttribute("userAccount", userAccount);
+			}
+		}
+		if (userAccount != null) {
+			SystemSession.setUserAccount(userAccount);
+		}
+	}
+
+	@Override
+	public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
+			throws Exception {
+		super.afterCompletion(request, response, handler, ex);
+		SystemSession.clear();
+	}
+
+	private UserAccount getUserByToken(SSOToken token) {
+		UserAccount userAccount = null;
+		if (token != null && !StringUtils.isEmpty(token.getData())) {
+			userAccount = FastjsonUtils.fromJson(token.getData(), UserAccount.class);
+		}
+		return userAccount;
+	}
+}

+ 241 - 0
finance-service/src/main/java/com/uas/finance/model/AccountApply.java

@@ -0,0 +1,241 @@
+package com.uas.finance.model;
+
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 应收账款转让表
+ * created by shicr on 2018/1/25
+ **/
+@Entity
+@Table(name = "accountapply")
+public class AccountApply implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Long id;
+
+    /**
+     * 买方额度表id
+     */
+    @Column(name = "cq_id")
+    private Long cqId;
+
+    /**
+     * 保理转让款
+     */
+    @Column(name = "aa_transferamount")
+    private Double aa_transferamount;
+
+    /**
+     * 保理首付款
+     */
+    @Column(name = "aa_dueamount")
+    private Double aa_dueamount;
+
+    /**
+     * 应收账款到期日
+     */
+    @Column(name = "aa_maturitydate")
+    private Date aa_maturitydate;
+
+    /**
+     * 合同总金额
+     */
+    @Column(name = "aa_saamount")
+    private Double aa_saamount;
+
+    /**
+     * 开票总金额
+     */
+    @Column(name = "aa_billamount")
+    private Double aa_billamount;
+
+    /**
+     * 申请日期
+     */
+    @Column(name = "indate")
+    private Date indate;
+
+    /**
+     * 审核状态
+     * 201:已保存
+     * 202:已提交
+     * 204:批复成功
+     * 205:批复失败
+     */
+    @Column(name = "status")
+    private Integer status;
+
+    /**
+     * ERP下载状态
+     */
+    @Column(name = "erpstatus")
+    private Integer erpstatus;
+
+    /**
+     * 还款状态
+     */
+    @Column(name = "aa_iscloseoff")
+    private String aa_iscloseoff;
+
+    /**
+     * 保理uu
+     */
+    @Column(name = "fauu")
+    private Long fauu;
+
+    /**
+     * ERP系统中的主键id
+     */
+    @Column(name = "erpId")
+    private Long erpId;
+
+    @OneToMany(mappedBy = "accountApply", cascade = CascadeType.REFRESH)
+    private List<FsSale> fsSaleList;
+
+    @OneToMany(mappedBy = "accountApply", cascade = CascadeType.REFRESH)
+    private List<Receipt> receipts;
+
+    @OneToMany(mappedBy = "accountApply",cascade = CascadeType.REFRESH)
+    private List<AccountApplyAttach> attaches;
+
+    public Double getAa_billamount() {
+        return aa_billamount;
+    }
+
+    public void setAa_billamount(Double aa_billamount) {
+        this.aa_billamount = aa_billamount;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Integer getErpstatus() {
+        return erpstatus;
+    }
+
+    public void setErpstatus(Integer erpstatus) {
+        this.erpstatus = erpstatus;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Double getAa_transferamount() {
+        return aa_transferamount;
+    }
+
+    public void setAa_transferamount(Double aa_transferamount) {
+        this.aa_transferamount = aa_transferamount;
+    }
+
+    public Double getAa_dueamount() {
+        return aa_dueamount;
+    }
+
+    public void setAa_dueamount(Double aa_dueamount) {
+        this.aa_dueamount = aa_dueamount;
+    }
+
+    public String getAa_maturitydate() {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        Date date = this.aa_maturitydate;
+        return date != null ? sdf.format(date) : null;
+    }
+
+    public void setAa_maturitydate(Date aa_maturitydate) {
+        this.aa_maturitydate = aa_maturitydate;
+    }
+
+    public Double getAa_saamount() {
+        return aa_saamount;
+    }
+
+    public void setAa_saamount(Double aa_saamount) {
+        this.aa_saamount = aa_saamount;
+    }
+
+    public String getIndate() {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        Date date = this.indate;
+        return date != null ? sdf.format(date) :null;
+    }
+
+    public void setIndate(Date indate) {
+        this.indate = indate;
+    }
+
+    public String getAa_iscloseoff() {
+        return aa_iscloseoff;
+    }
+
+    public void setAa_iscloseoff(String aa_iscloseoff) {
+        this.aa_iscloseoff = aa_iscloseoff;
+    }
+
+    public List<FsSale> getFsSaleList() {
+        return fsSaleList;
+    }
+
+    public void setFsSaleList(List<FsSale> fsSaleList) {
+        this.fsSaleList = fsSaleList;
+    }
+
+    public List<Receipt> getReceipts() {
+        return receipts;
+    }
+
+    public void setReceipts(List<Receipt> receipts) {
+        this.receipts = receipts;
+    }
+
+    public List<AccountApplyAttach> getAttaches() {
+        return attaches;
+    }
+
+    public void setAttaches(List<AccountApplyAttach> attaches) {
+        this.attaches = attaches;
+    }
+
+    public Long getCqId() {
+        return cqId;
+    }
+
+    public void setCqId(Long cqId) {
+        this.cqId = cqId;
+    }
+
+    public Long getFauu() {
+        return fauu;
+    }
+
+    public void setFauu(Long fauu) {
+        this.fauu = fauu;
+    }
+
+    public Long getErpId() {
+        return erpId;
+    }
+
+    public void setErpId(Long erpId) {
+        this.erpId = erpId;
+    }
+}

+ 134 - 0
finance-service/src/main/java/com/uas/finance/model/AccountApplyAttach.java

@@ -0,0 +1,134 @@
+package com.uas.finance.model;
+
+import javax.persistence.*;
+import java.io.Serializable;
+
+/**
+ * 出账附件类
+ * created by shicr on 2018/1/27
+ **/
+@Entity
+@Table(name = "accountapplyattach")
+public class AccountApplyAttach implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * id
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Long id;
+
+    /**
+     * 附件名
+     */
+    @Column(name = "name")
+    private String name;
+
+    /**
+     * 附件路径
+     */
+    @Column(name = "path")
+    private String path;
+
+    /**
+     * 文件大小
+     */
+    @Column(name = "size")
+    private Long size;
+
+    /**
+     * 文件所属类别
+     */
+    @Column(name = "type")
+    private String type;
+
+
+    /**
+     * 附件所属的保理公司
+     */
+    @Column(name = "faenuu")
+    private Long fauu;
+
+    /**
+     * 附件删除id
+     */
+    @Column(name = "uid")
+    private Long uid;
+
+    /**
+     * 出账所属的id
+     */
+    @Column(name = "aaid")
+    private Long aaid;
+
+    @ManyToOne(cascade = CascadeType.REFRESH)
+    @JoinColumn(name = "aaid", insertable = false, updatable = false)
+    private AccountApply accountApply;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getPath() {
+        return path;
+    }
+
+    public void setPath(String path) {
+        this.path = path;
+    }
+
+    public Long getSize() {
+        return size;
+    }
+
+    public void setSize(Long size) {
+        this.size = size;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public Long getAaid() {
+        return aaid;
+    }
+
+    public void setAaid(Long aaid) {
+        this.aaid = aaid;
+    }
+
+    public Long getFauu() {
+        return fauu;
+    }
+
+    public void setFauu(Long fauu) {
+        this.fauu = fauu;
+    }
+
+    public Long getUid() {
+        return uid;
+    }
+
+    public void setUid(Long uid) {
+        this.uid = uid;
+    }
+}

+ 217 - 0
finance-service/src/main/java/com/uas/finance/model/AccountInfo.java

@@ -0,0 +1,217 @@
+package com.uas.finance.model;
+
+import javax.persistence.*;
+import java.io.Serializable;
+
+/**
+ * created by shicr on 2017/12/20
+ * 财务数据表
+ **/
+@Entity
+@Table(name = "accountinfo")
+public class AccountInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * ID
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "ai_id")
+    private Long id;
+
+    /**
+     * 企业uu
+     */
+    @Column(name = "ai_enuu")
+    private Long enuu;
+
+    /**
+     * 财务类型情况
+     */
+    @Column(name = "ai_kind")
+    private String ai_kind;
+
+
+    /**
+     * 项目名称
+     */
+    @Column(name = "ai_caname")
+    private String ai_caname;
+
+    /**
+     * 欠款客户全称
+     */
+    @Column(name = "ai_cuname")
+    private String ai_cuname;
+
+    /**
+     * 机构名称
+     */
+    @Column(name = "ai_bank")
+    private String ai_bank;
+
+    /**
+     * 金额
+     */
+    @Column(name = "ai_amount")
+    private String ai_amount;
+
+    /**
+     * 占比
+     */
+    @Column(name = "ai_rate")
+    private Double ai_rate;
+
+    /**
+     * 账龄
+     */
+    @Column(name = "ai_payment")
+    private String ai_payment;
+
+
+    /**
+     * 客户资料表id
+     */
+    @Column(name = "ai_cus_id")
+    private Long cusId;
+
+    /**
+     * 应收账款余额
+     */
+    @Column(name = "ai_leftamount")
+    private Double ai_leftamount;
+
+    /**
+     * 产生原因
+     */
+    @Column(name = "ai_remark")
+    private String ai_remark;
+
+    /**
+     * ERP系统中的主键id
+     */
+    @Column(name = "erpId")
+    private Long erpId;
+
+    /**
+     * 多对一关联客户资料表
+     */
+    @ManyToOne(cascade = CascadeType.REFRESH)
+    @JoinColumn(name = "ai_cus_id", insertable = false, updatable = false)
+    private CustomerInfo customerInfo;
+
+    public Long getErpId() {
+        return erpId;
+    }
+
+    public void setErpId(Long erpId) {
+        this.erpId = erpId;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public String getAi_kind() {
+        return ai_kind;
+    }
+
+    public void setAi_kind(String ai_kind) {
+        this.ai_kind = ai_kind;
+    }
+
+    public String getAi_caname() {
+        return ai_caname;
+    }
+
+    public void setAi_caname(String ai_caname) {
+        this.ai_caname = ai_caname;
+    }
+
+    public String getAi_amount() {
+        return ai_amount;
+    }
+
+    public void setAi_amount(String ai_amount) {
+        this.ai_amount = ai_amount;
+    }
+
+    public Double getAi_rate() {
+        return ai_rate;
+    }
+
+    public void setAi_rate(Double ai_rate) {
+        this.ai_rate = ai_rate;
+    }
+
+    public String getAi_payment() {
+        return ai_payment;
+    }
+
+    public void setAi_payment(String ai_payment) {
+        this.ai_payment = ai_payment;
+    }
+
+    public Long getCusId() {
+        return cusId;
+    }
+
+    public void setCusId(Long cusId) {
+        this.cusId = cusId;
+    }
+
+    public String getAi_cuname() {
+        return ai_cuname;
+    }
+
+    public void setAi_cuname(String ai_cuname) {
+        this.ai_cuname = ai_cuname;
+    }
+
+    /*   public CustomerInfo getCustomerInfo() {
+        return customerInfo;
+    }
+
+    public void setCustomerInfo(CustomerInfo customerInfo) {
+        this.customerInfo = customerInfo;
+    }*/
+
+    public Double getAi_leftamount() {
+        return ai_leftamount;
+    }
+
+    public void setAi_leftamount(Double ai_leftamount) {
+        this.ai_leftamount = ai_leftamount;
+    }
+
+    public String getAi_bank() {
+        return ai_bank;
+    }
+
+    public void setAi_bank(String ai_bank) {
+        this.ai_bank = ai_bank;
+    }
+
+    public String getAi_remark() {
+        return ai_remark;
+    }
+
+    public void setAi_remark(String ai_remark) {
+        this.ai_remark = ai_remark;
+    }
+
+}

+ 168 - 0
finance-service/src/main/java/com/uas/finance/model/AssociateCompany.java

@@ -0,0 +1,168 @@
+package com.uas.finance.model;
+
+import javax.persistence.*;
+import java.io.Serializable;
+
+/**
+ * 关联企业
+ * created by shicr on 2017/12/18
+ **/
+@Entity
+@Table(name = "associate")
+public class AssociateCompany implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * ID
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "as_id")
+    private Long id;
+
+    /**
+     * 企业uu
+     *
+     * @return
+     */
+    @Column(name = "as_enuu")
+    private Long enuu;
+
+    /**
+     * 关联方企业名称
+     */
+    @Column(name = "as_cud_name")
+    private String cud_name;
+
+    /**
+     * 关联关系
+     */
+    @Column(name = "as_cud_association")
+    private String cud_association;
+
+    /**
+     * 法人代表
+     */
+    @Column(name = "as_cud_legalperson")
+    private String cud_legalperson;
+
+    /**
+     * 法人代表股权(占比%)
+     */
+    @Column(name = "as_cud_ratio")
+    private Double cud_ratio;
+
+    /**
+     * 主营业务
+     */
+    @Column(name = "as_cud_product")
+    private String cud_product;
+
+    /**
+     * 注册资本(万元)
+     */
+    @Column(name = "as_cud_amount")
+    private Double cud_amount;
+
+    @Column(name = "as_cus_id")
+    private Long cusId;
+
+    /**
+     * ERP系统中的主键id
+     */
+    @Column(name = "erpId")
+    private Long erpId;
+
+    @ManyToOne(cascade = CascadeType.REFRESH)
+    @JoinColumn(name = "as_cus_id", insertable = false, updatable = false)
+    private CustomerInfo customerInfo;
+
+    public Long getErpId() {
+        return erpId;
+    }
+
+    public void setErpId(Long erpId) {
+        this.erpId = erpId;
+    }
+
+    public Long getCusId() {
+        return cusId;
+    }
+
+    public void setCusId(Long cusId) {
+        this.cusId = cusId;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getCud_name() {
+        return cud_name;
+    }
+
+    public void setCud_name(String cud_name) {
+        this.cud_name = cud_name;
+    }
+
+    public String getCud_association() {
+        return cud_association;
+    }
+
+    public void setCud_association(String cud_association) {
+        this.cud_association = cud_association;
+    }
+
+    public String getCud_legalperson() {
+        return cud_legalperson;
+    }
+
+    public void setCud_legalperson(String cud_legalperson) {
+        this.cud_legalperson = cud_legalperson;
+    }
+
+    public Double getCud_ratio() {
+        return cud_ratio;
+    }
+
+    public void setCud_ratio(Double cud_ratio) {
+        this.cud_ratio = cud_ratio;
+    }
+
+    public String getCud_product() {
+        return cud_product;
+    }
+
+    public void setCud_product(String cud_product) {
+        this.cud_product = cud_product;
+    }
+
+    public Double getCud_amount() {
+        return cud_amount;
+    }
+
+    public void setCud_amount(Double cud_amount) {
+        this.cud_amount = cud_amount;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+  /*  public CustomerInfo getCustomerInfo() {
+        return customerInfo;
+    }
+
+    public void setCustomerInfo(CustomerInfo customerInfo) {
+        this.customerInfo = customerInfo;
+    }*/
+}

+ 134 - 0
finance-service/src/main/java/com/uas/finance/model/Attach.java

@@ -0,0 +1,134 @@
+package com.uas.finance.model;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+import javax.persistence.*;
+import java.io.Serializable;
+
+/**
+ * 附件实体
+ * created by shicr on 2017/12/25
+ **/
+@Entity
+@Table(name = "attach")
+public class Attach implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+
+    /**
+     * 附件id
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Long id;
+
+    /**
+     * 附件名
+     */
+    @Column(name = "name")
+    private String name;
+
+    /**
+     * 附件路径
+     */
+    @Column(name = "path")
+    private String path;
+
+    /**
+     * 文件大小
+     */
+    @Column(name = "size")
+    private Long size;
+
+    /**
+     * 文件所属类别
+     */
+    @Column(name = "type")
+    private String type;
+
+    /**
+     * 附件所属的金融单据
+     */
+    @Column(name = "applyId")
+    private Long applyId;
+
+    /**
+     * 附件所属的保理公司
+     */
+    @Column(name = "faenuu")
+    private Long fauu;
+
+
+    @ManyToOne(cascade = CascadeType.REFRESH)
+    @JoinColumn(name = "applyId", insertable = false, updatable = false)
+    private FinancingApply financingApply;
+
+    public Long getApplyId() {
+        return applyId;
+    }
+
+    public void setApplyId(Long applyId) {
+        this.applyId = applyId;
+    }
+
+    public Long getSize() {
+        return size;
+    }
+
+    public void setSize(Long size) {
+        this.size = size;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getPath() {
+        return path;
+    }
+
+    public void setPath(String path) {
+        this.path = path;
+    }
+
+    public Long getFauu() {
+        return fauu;
+    }
+
+    public void setFauu(Long fauu) {
+        this.fauu = fauu;
+    }
+
+    @JSONField(serialize = false)
+    @JsonIgnore
+    public FinancingApply getFinancingApply() {
+        return financingApply;
+    }
+
+    public void setFinancingApply(FinancingApply financingApply) {
+        this.financingApply = financingApply;
+    }
+}

+ 108 - 0
finance-service/src/main/java/com/uas/finance/model/BusinessCondition.java

@@ -0,0 +1,108 @@
+package com.uas.finance.model;
+
+import javax.persistence.*;
+import java.io.Serializable;
+
+/**
+ * created by shicr on 2017/12/20
+ * 情况描述
+ **/
+@Entity
+@Table(name = "businesscondition")
+public class BusinessCondition implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+
+    /**
+     * ID
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "bc_id")
+    private Long id;
+
+    /**
+     * 企业uu
+     *
+     * @return
+     */
+    @Column(name = "bc_enuu")
+    private Long enuu;
+
+    /**
+     * 经营情况简述
+     */
+    @Column(name = "bc_bcremark")
+    private String bc_bcremark;
+
+    /**
+     * 贸易流程简述
+     *
+     * @return
+     */
+    @Column(name = "bc_sweaterprocess")
+    private String bc_sweaterprocess;
+
+    @Column(name = "bc_cus_id")
+    private Long cusId;
+
+    /**
+     * ERP系统中的主键id
+     */
+    @Column(name = "erpId")
+    private Long erpId;
+
+    @OneToOne(cascade = CascadeType.REFRESH)
+    @JoinColumn(name = "bc_cus_id", insertable = false, updatable = false)
+    private CustomerInfo customerInfo;
+
+    public Long getErpId() {
+        return erpId;
+    }
+
+    public void setErpId(Long erpId) {
+        this.erpId = erpId;
+    }
+
+    public Long getCusId() {
+        return cusId;
+    }
+
+    public void setCusId(Long cusId) {
+        this.cusId = cusId;
+    }
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public String getBc_bcremark() {
+        return bc_bcremark;
+    }
+
+    public void setBc_bcremark(String bc_bcremark) {
+        this.bc_bcremark = bc_bcremark;
+    }
+
+    public String getBc_sweaterprocess() {
+        return bc_sweaterprocess;
+    }
+
+    public void setBc_sweaterprocess(String bc_sweaterprocess) {
+        this.bc_sweaterprocess = bc_sweaterprocess;
+    }
+}

+ 142 - 0
finance-service/src/main/java/com/uas/finance/model/ChangesInstruction.java

@@ -0,0 +1,142 @@
+package com.uas.finance.model;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * created by shicr on 2017/12/20
+ * 变更内容
+ **/
+@Entity
+@Table(name = "changeinstruction")
+public class ChangesInstruction implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * ID
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "ch_id")
+    private Long id;
+
+    /**
+     * 优软账号
+     */
+    @Column(name = "ch_enuu")
+    private Long enuu;
+
+    /**
+     * 变更科目
+     */
+    @Column(name = "cd_type")
+    private String cd_type;
+
+    /**
+     * 变更时间
+     */
+    @Column(name = "cs_date")
+    private Date cs_date;
+
+    /**
+     * 变更前内容
+     */
+    @Column(name = "cs_before")
+    private String cs_before;
+
+    /**
+     * 变更后内容
+     */
+    @Column(name = "cs_after")
+    private String cs_after;
+
+    /**
+     * 客户资料id
+     */
+    @Column(name = "cs_cus_id")
+    private Long cusId;
+
+    /**
+     * ERP系统中的主键id
+     */
+    @Column(name = "erpId")
+    private Long erpId;
+
+    @ManyToOne(cascade = CascadeType.REFRESH)
+    @JoinColumn(name = "cs_cus_id", insertable = false, updatable = false)
+    private CustomerInfo customerInfo;
+
+    public Long getErpId() {
+        return erpId;
+    }
+
+    public void setErpId(Long erpId) {
+        this.erpId = erpId;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public String getCd_type() {
+        return cd_type;
+    }
+
+    public void setCd_type(String cd_type) {
+        this.cd_type = cd_type;
+    }
+
+    public Date getCs_date() {
+        return cs_date;
+    }
+
+    public void setCs_date(Date cs_date) {
+        this.cs_date = cs_date;
+    }
+
+    public String getCs_before() {
+        return cs_before;
+    }
+
+    public void setCs_before(String cs_before) {
+        this.cs_before = cs_before;
+    }
+
+    public String getCs_after() {
+        return cs_after;
+    }
+
+    public void setCs_after(String cs_after) {
+        this.cs_after = cs_after;
+    }
+
+    public Long getCusId() {
+        return cusId;
+    }
+
+    public void setCusId(Long cusId) {
+        this.cusId = cusId;
+    }
+
+   /* public CustomerInfo getCustomerInfo() {
+        return customerInfo;
+    }
+
+    public void setCustomerInfo(CustomerInfo customerInfo) {
+        this.customerInfo = customerInfo;
+    }*/
+}

+ 233 - 0
finance-service/src/main/java/com/uas/finance/model/CustomerExcutive.java

@@ -0,0 +1,233 @@
+package com.uas.finance.model;
+
+import com.uas.finance.util.DateUtils;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * created by shicr on 2017/12/20
+ * 管理层信息
+ **/
+@Entity
+@Table(name = "customerexcutive")
+public class CustomerExcutive implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * ID
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "ce_id")
+    private Long id;
+
+    /**
+     * 企业uu
+     *
+     * @return
+     */
+    @Column(name = "ce_enuu")
+    private Long enuu;
+
+    /**
+     * 高管姓名
+     */
+    @Column(name = "ce_name")
+    private String ce_name;
+
+    /**
+     * 性别
+     */
+    @Column(name = "ce_sex")
+    private String ce_sex;
+
+    /**
+     * 证件类型
+     */
+    @Column(name = "ce_paperstype")
+    private String ce_paperstype;
+
+    /**
+     * 证件号码
+     */
+    @Column(name = "ce_paperscode")
+    private String ce_paperscode;
+
+    /**
+     * 学历
+     */
+    @Column(name = "ce_education")
+    private String ce_education;
+
+    /**
+     * 职务
+     */
+    @Column(name = "ce_position")
+    private String ce_position;
+
+    /**
+     * 担任该职务时间
+     */
+    @Column(name = "ce_stwkfpo")
+    private Date ce_stwkfpo;
+
+    /**
+     * 从事本行业时间
+     */
+    @Column(name = "ce_workeyears")
+    private Integer ce_workeyears;
+
+    /**
+     * 住所
+     */
+    @Column(name = "ce_nowaddress")
+    private String ce_nowaddress;
+
+    /**
+     * 工作简介
+     */
+    @Column(name = "ce_woekexper")
+    private String ce_woekexper;
+
+    /**
+     * 客户资料id
+     */
+    @Column(name = "ce_cus_id")
+    private Long cusId;
+
+    /**
+     * ERP系统中的主键id
+     */
+    @Column(name = "erpId")
+    private Long erpId;
+
+    @ManyToOne(cascade = CascadeType.REFRESH)
+    @JoinColumn(name = "ce_cus_id", insertable = false, updatable = false)
+    private CustomerInfo customerInfo;
+
+    public Long getErpId() {
+        return erpId;
+    }
+
+    public void setErpId(Long erpId) {
+        this.erpId = erpId;
+    }
+
+    public Long getCusId() {
+        return cusId;
+    }
+
+    public void setCusId(Long cusId) {
+        this.cusId = cusId;
+    }
+
+   /* public CustomerInfo getCustomerInfo() {
+        return customerInfo;
+    }
+
+    public void setCustomerInfo(CustomerInfo customerInfo) {
+        this.customerInfo = customerInfo;
+    }*/
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public String getCe_name() {
+        return ce_name;
+    }
+
+    public void setCe_name(String ce_name) {
+        this.ce_name = ce_name;
+    }
+
+    public String getCe_sex() {
+        return ce_sex;
+    }
+
+    public void setCe_sex(String ce_sex) {
+        this.ce_sex = ce_sex;
+    }
+
+    public String getCe_paperstype() {
+        return ce_paperstype;
+    }
+
+    public void setCe_paperstype(String ce_paperstype) {
+        this.ce_paperstype = ce_paperstype;
+    }
+
+    public String getCe_paperscode() {
+        return ce_paperscode;
+    }
+
+    public void setCe_paperscode(String ce_paperscode) {
+        this.ce_paperscode = ce_paperscode;
+    }
+
+    public String getCe_education() {
+        return ce_education;
+    }
+
+    public void setCe_education(String ce_education) {
+        this.ce_education = ce_education;
+    }
+
+    public String getCe_position() {
+        return ce_position;
+    }
+
+    public void setCe_position(String ce_position) {
+        this.ce_position = ce_position;
+    }
+
+    public Date getCe_stwkfpo() {
+        return ce_stwkfpo;
+    }
+
+    public void setCe_stwkfpo(Date ce_stwkfpo) {
+        this.ce_stwkfpo = ce_stwkfpo;
+    }
+
+    public Integer getCe_workeyears() {
+        return ce_workeyears;
+    }
+
+    public void setCe_workeyears(Integer ce_workeyears) {
+        this.ce_workeyears = ce_workeyears;
+    }
+
+    public String getCe_nowaddress() {
+        return ce_nowaddress;
+    }
+
+    public void setCe_nowaddress(String ce_nowaddress) {
+        this.ce_nowaddress = ce_nowaddress;
+    }
+
+    public String getCe_woekexper() {
+        return ce_woekexper;
+    }
+
+    public void setCe_woekexper(String ce_woekexper) {
+        this.ce_woekexper = ce_woekexper;
+    }
+}
+
+

+ 577 - 0
finance-service/src/main/java/com/uas/finance/model/CustomerInfo.java

@@ -0,0 +1,577 @@
+package com.uas.finance.model;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 客户基础信息表
+ * created by shicr on 2017/12/18
+ **/
+@Table
+@Entity(name = "customer")
+
+public class CustomerInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * ID
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "cu_id")
+    private Long id;
+
+    /**
+     * 公司中文名
+     */
+    @Column(name = "cu_name")
+    private String cu_name;
+
+    /**
+     * 公司英文名
+     */
+    @Column(name = "cu_engname")
+    private String cu_engname;
+
+    /**
+     * 公司类型
+     */
+    @Column(name = "cu_enterptype")
+    private String cu_enterptype;
+
+    /**
+     * 成立时间
+     */
+    @Column(name = "cu_licensedate")
+    private Date cu_licensedate;
+
+    /**
+     * 证件类型
+     */
+    @Column(name = "cu_paperstype")
+    private String cu_paperstype;
+
+    /**
+     * 机构类型
+     */
+    @Column(name = "cu_institutype")
+    private String cu_institutype;
+
+    /**
+     * 证件号码
+     */
+    @Column(name = "cu_paperscode")
+    private String cu_paperscode;
+
+    /**
+     * 证件到期日
+     */
+    @Column(name = "cu_ctfduedate")
+    private Date cu_ctfduedate;
+
+    /**
+     * 营业执照号
+     */
+    @Column(name = "cu_businesscode")
+    private String cu_businesscode;
+
+    /**
+     * 国标行业分类
+     */
+    @Column(name = "cu_nastdinducls")
+    private String cu_nastdinducls;
+
+    /**
+     * 注册资本币种
+     */
+    @Column(name = "cu_capcurrency")
+    private String cu_capcurrency;
+
+    /**
+     * 注册资本
+     */
+    @Column(name = "cu_regcapital")
+    private Double cu_regcapital;
+
+    /**
+     * 实缴资本
+     */
+    @Column(name = "cu_paidincapital")
+    private Double cu_paidincapital;
+    /**
+     * 公司注册地
+     */
+    @Column(name = "cu_regadd")
+    private String cu_regadd;
+    /**
+     * 办公地址
+     */
+    @Column(name = "cu_officeadd")
+    private String cu_officeadd;
+
+    /**
+     * 经营范围
+     */
+    @Column(name = "cu_businsscope")
+    private String cu_businsscope;
+
+    /**
+     * 其他情况说明
+     */
+    @Column(name = "cu_others")
+    private String cu_others;
+
+    /**
+     * 企业uu
+     *
+     * @return
+     */
+    @Column(name = "cu_enuu")
+    private Long enuu;
+
+    /**
+     * 最高权力机构
+     *
+     * @return
+     */
+    @Column(name = "cu_highestauthority")
+    private String cu_highestauthority;
+
+    /**
+     * 员工人数
+     *
+     * @return
+     */
+    @Column(name = "cu_employeesnum")
+    private Long cu_employeesnum;
+
+    /**
+     * 部门设置概况
+     *
+     * @return
+     */
+    @Column(name = "cu_departsituation")
+    private String cu_departsituation;
+
+    /**
+     * erp下载状态
+     */
+    @Column(name = "cu_erpstatus")
+    private Integer erpstatus;
+
+    /**
+     * 修改时间
+     */
+    @Column(name = "cu_submittime")
+    private Date submitTime;
+
+    /**
+     * ERP系统中的主键id
+     */
+    @Column(name = "erpId")
+    private Long erpId;
+
+    /**
+     * 财务数据表
+     */
+    @OneToMany(mappedBy = "customerInfo", cascade = CascadeType.REFRESH)
+    private List<AccountInfo> accountInfoList;
+
+    /**
+     * 关联企业
+     */
+    @OneToMany(mappedBy = "customerInfo", cascade = CascadeType.REFRESH)
+    private List<AssociateCompany> associateCompanies;
+
+    /**
+     * 情况描述
+     */
+    @OneToOne(mappedBy = "customerInfo", cascade = CascadeType.MERGE)
+    private BusinessCondition businessCondition;
+
+    /**
+     * 变更内容
+     */
+    @OneToMany(mappedBy = "customerInfo", cascade = CascadeType.REFRESH)
+    private List<ChangesInstruction> changesInstructions;
+
+    /**
+     * 管理层背景
+     */
+    @OneToMany(mappedBy = "customerInfo", cascade = CascadeType.REFRESH)
+    private List<CustomerExcutive> customerExcutives;
+
+    /**
+     * 经营情况描述
+     */
+    @OneToOne(mappedBy = "customerInfo", cascade = CascadeType.MERGE)
+    private FinanceCondition financeCondition;
+
+    @JSONField(serialize = false)
+    @OneToOne(mappedBy = "customerInfo", cascade = CascadeType.REFRESH)
+    private FinancingApply financingApply;
+
+    @OneToMany(mappedBy = "customerInfo", cascade = CascadeType.REFRESH)
+    private List<MFCustInfo> mfCustInfos;
+
+    /**
+     * 经营情况表
+     */
+    @OneToMany(mappedBy = "customerInfo", cascade = CascadeType.REFRESH)
+    private List<ProductMix> productMixes;
+
+    /**
+     * 股东构成
+     */
+    @OneToMany(mappedBy = "customerInfo", cascade = CascadeType.REFRESH)
+    private List<Shareholders> shareholders;
+
+    /**
+     * 供应商客户
+     */
+    @OneToMany(mappedBy = "customerInfo", cascade = CascadeType.REFRESH)
+    @OrderBy("id")
+    private List<Updowncast> updowncasts;
+
+    public Long getErpId() {
+        return erpId;
+    }
+
+    public void setErpId(Long erpId) {
+        this.erpId = erpId;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getCu_name() {
+        return cu_name;
+    }
+
+    public void setCu_name(String cu_name) {
+        this.cu_name = cu_name;
+    }
+
+    public String getCu_engname() {
+        return cu_engname;
+    }
+
+    public void setCu_engname(String cu_engname) {
+        this.cu_engname = cu_engname;
+    }
+
+    public String getCu_paperstype() {
+        return cu_paperstype;
+    }
+
+    public void setCu_paperstype(String cu_paperstype) {
+        this.cu_paperstype = cu_paperstype;
+    }
+
+    public String getCu_institutype() {
+        return cu_institutype;
+    }
+
+    public void setCu_institutype(String cu_institutype) {
+        this.cu_institutype = cu_institutype;
+    }
+
+    public Date getCu_licensedate() {
+        return cu_licensedate;
+    }
+
+    public void setCu_licensedate(Date cu_licensedate) {
+        this.cu_licensedate = cu_licensedate;
+    }
+
+    public String getCu_paperscode() {
+        return cu_paperscode;
+    }
+
+    public void setCu_paperscode(String cu_paperscode) {
+        this.cu_paperscode = cu_paperscode;
+    }
+
+    public Date getCu_ctfduedate() {
+        return cu_ctfduedate;
+    }
+
+    public void setCu_ctfduedate(Date cu_ctfduedate) {
+        this.cu_ctfduedate = cu_ctfduedate;
+    }
+
+    public String getCu_businesscode() {
+        return cu_businesscode;
+    }
+
+    public void setCu_businesscode(String cu_businesscode) {
+        this.cu_businesscode = cu_businesscode;
+    }
+
+    public String getCu_nastdinducls() {
+        return cu_nastdinducls;
+    }
+
+    public void setCu_nastdinducls(String cu_nastdinducls) {
+        this.cu_nastdinducls = cu_nastdinducls;
+    }
+
+    public String getCu_capcurrency() {
+        return cu_capcurrency;
+    }
+
+    public void setCu_capcurrency(String cu_capcurrency) {
+        this.cu_capcurrency = cu_capcurrency;
+    }
+
+    public String getCu_enterptype() {
+        return cu_enterptype;
+    }
+
+    public void setCu_enterptype(String cu_enterptype) {
+        this.cu_enterptype = cu_enterptype;
+    }
+
+    public Double getCu_regcapital() {
+        return cu_regcapital;
+    }
+
+    public void setCu_regcapital(Double cu_regcapital) {
+        this.cu_regcapital = cu_regcapital;
+    }
+
+    public Double getCu_paidincapital() {
+        return cu_paidincapital;
+    }
+
+    public void setCu_paidincapital(Double cu_paidincapital) {
+        this.cu_paidincapital = cu_paidincapital;
+    }
+
+    public String getCu_regadd() {
+        return cu_regadd;
+    }
+
+    public void setCu_regadd(String cu_regadd) {
+        this.cu_regadd = cu_regadd;
+    }
+
+    public String getCu_officeadd() {
+        return cu_officeadd;
+    }
+
+    public void setCu_officeadd(String cu_officeadd) {
+        this.cu_officeadd = cu_officeadd;
+    }
+
+    public String getCu_businsscope() {
+        return cu_businsscope;
+    }
+
+    public void setCu_businsscope(String cu_businsscope) {
+        this.cu_businsscope = cu_businsscope;
+    }
+
+    public String getCu_others() {
+        return cu_others;
+    }
+
+    public void setCu_others(String cu_others) {
+        this.cu_others = cu_others;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public String getCu_highestauthority() {
+        return cu_highestauthority;
+    }
+
+    public void setCu_highestauthority(String cu_highestauthority) {
+        this.cu_highestauthority = cu_highestauthority;
+    }
+
+    public Long getCu_employeesnum() {
+        return cu_employeesnum;
+    }
+
+    public void setCu_employeesnum(Long cu_employeesnum) {
+        this.cu_employeesnum = cu_employeesnum;
+    }
+
+    public String getCu_departsituation() {
+        return cu_departsituation;
+    }
+
+    public void setCu_departsituation(String cu_departsituation) {
+        this.cu_departsituation = cu_departsituation;
+    }
+
+    public FinancingApply getFinancingApply() {
+        return financingApply;
+    }
+
+    public void setFinancingApply(FinancingApply financingApply) {
+        this.financingApply = financingApply;
+    }
+
+    public Integer getErpstatus() {
+        return erpstatus;
+    }
+
+    public void setErpstatus(Integer erpstatus) {
+        this.erpstatus = erpstatus;
+    }
+
+    public List<AccountInfo> getAccountInfoList() {
+        return accountInfoList;
+    }
+
+    public void setAccountInfoList(List<AccountInfo> accountInfoList) {
+        this.accountInfoList = accountInfoList;
+    }
+
+    public List<AssociateCompany> getAssociateCompanies() {
+        return associateCompanies;
+    }
+
+    public void setAssociateCompanies(List<AssociateCompany> associateCompanies) {
+        this.associateCompanies = associateCompanies;
+    }
+
+    public BusinessCondition getBusinessCondition() {
+        return businessCondition;
+    }
+
+    public void setBusinessCondition(BusinessCondition businessCondition) {
+        this.businessCondition = businessCondition;
+    }
+
+    public List<ChangesInstruction> getChangesInstructions() {
+        return changesInstructions;
+    }
+
+    public void setChangesInstructions(List<ChangesInstruction> changesInstructions) {
+        this.changesInstructions = changesInstructions;
+    }
+
+    public List<CustomerExcutive> getCustomerExcutives() {
+        return customerExcutives;
+    }
+
+    public void setCustomerExcutives(List<CustomerExcutive> customerExcutives) {
+        this.customerExcutives = customerExcutives;
+    }
+
+    public FinanceCondition getFinanceCondition() {
+        return financeCondition;
+    }
+
+    public void setFinanceCondition(FinanceCondition financeCondition) {
+        this.financeCondition = financeCondition;
+    }
+
+    /*  public FinancingApply getFinancingApply() {
+        return financingApply;
+    }
+
+    public void setFinancingApply(FinancingApply financingApply) {
+        this.financingApply = financingApply;
+    }*/
+
+    public List<MFCustInfo> getMfCustInfos() {
+        return mfCustInfos;
+    }
+
+    public void setMfCustInfos(List<MFCustInfo> mfCustInfos) {
+        this.mfCustInfos = mfCustInfos;
+    }
+
+    public List<ProductMix> getProductMixes() {
+        return productMixes;
+    }
+
+    public void setProductMixes(List<ProductMix> productMixes) {
+        this.productMixes = productMixes;
+    }
+
+    public List<Shareholders> getShareholders() {
+        return shareholders;
+    }
+
+    public void setShareholders(List<Shareholders> shareholders) {
+        this.shareholders = shareholders;
+    }
+
+    public List<Updowncast> getUpdowncasts() {
+        return updowncasts;
+    }
+
+    public void setUpdowncasts(List<Updowncast> updowncasts) {
+        this.updowncasts = updowncasts;
+    }
+
+    public Date getSubmitTime() {
+        return submitTime;
+    }
+
+    public void setSubmitTime(Date submitTime) {
+        this.submitTime = submitTime;
+    }
+
+
+    public CustomerInfo(CustomerInfo customerInfo) {
+        this.cu_employeesnum = customerInfo.getCu_employeesnum();
+        this.cu_name = customerInfo.getCu_name();
+        this.cu_engname = customerInfo.getCu_engname();
+        this.cu_enterptype = customerInfo.getCu_enterptype();
+        this.cu_licensedate = customerInfo.getCu_licensedate();
+        this.cu_paperstype = customerInfo.getCu_paperstype();
+        this.cu_institutype = customerInfo.getCu_institutype();
+        this.cu_paperscode = customerInfo.getCu_paperscode();
+        this.cu_ctfduedate = customerInfo.getCu_ctfduedate();
+        this.cu_businesscode = customerInfo.getCu_businesscode();
+        this.cu_nastdinducls = customerInfo.getCu_nastdinducls();
+        this.cu_capcurrency = customerInfo.getCu_capcurrency();
+        this.cu_regcapital = customerInfo.getCu_regcapital();
+        this.cu_paidincapital = customerInfo.getCu_paidincapital();
+        this.cu_regadd = customerInfo.getCu_regadd();
+        this.cu_officeadd = customerInfo.getCu_officeadd();
+        this.cu_businsscope = customerInfo.getCu_businsscope();
+        this.cu_others = customerInfo.getCu_others();
+        this.enuu = customerInfo.getEnuu();
+        this.cu_highestauthority = customerInfo.getCu_highestauthority();
+        this.cu_departsituation = customerInfo.getCu_departsituation();
+        this.erpstatus = customerInfo.getErpstatus();
+        this.submitTime = customerInfo.getSubmitTime();
+        this.accountInfoList = customerInfo.getAccountInfoList();
+        this.associateCompanies = customerInfo.getAssociateCompanies();
+        this.businessCondition = customerInfo.getBusinessCondition();
+        this.changesInstructions = customerInfo.getChangesInstructions();
+        this.customerExcutives = customerInfo.getCustomerExcutives();
+        this.financeCondition = customerInfo.getFinanceCondition();
+        this.mfCustInfos = customerInfo.getMfCustInfos();
+        this.productMixes = customerInfo.getProductMixes();
+        this.shareholders = customerInfo.getShareholders();
+        this.updowncasts = customerInfo.getUpdowncasts();
+    }
+   public CustomerInfo(){
+
+   }
+}

+ 94 - 0
finance-service/src/main/java/com/uas/finance/model/Enterprise.java

@@ -0,0 +1,94 @@
+package com.uas.finance.model;
+
+import javax.persistence.*;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+/**
+ * 可以从金融平台获取数据的企业信息
+ *
+ * @author hejq
+ */
+@Entity
+@Table(name = "finance$enterprise")
+public class Enterprise implements Serializable {
+
+    /**
+     * 序列号
+     */
+    private static final long serialVersionUID = 1L;
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "en_uu")
+    private Long uu;
+
+    /**
+     * 公司名称
+     */
+    @NotNull
+    @Column(name = "en_name")
+    private String enName;
+
+    /**
+     * 简称
+     */
+    @Column(name = "en_shortname")
+    private String enShortname;
+
+    /**
+     * 商业登记证号
+     */
+    @Column(name = "en_businesscode")
+    private String enBussinessCode;
+
+    /**
+     * 私钥
+     */
+    @Column(name = "en_accesssecret")
+    private String accessSecret;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public Long getUu() {
+        return uu;
+    }
+
+    public void setUu(Long uu) {
+        this.uu = uu;
+    }
+
+    public String getEnName() {
+        return enName;
+    }
+
+    public void setEnName(String enName) {
+        this.enName = enName;
+    }
+
+    public String getEnShortname() {
+        return enShortname;
+    }
+
+    public void setEnShortname(String enShortname) {
+        this.enShortname = enShortname;
+    }
+
+    public String getEnBussinessCode() {
+        return enBussinessCode;
+    }
+
+    public void setEnBussinessCode(String enBussinessCode) {
+        this.enBussinessCode = enBussinessCode;
+    }
+
+    public String getAccessSecret() {
+        return accessSecret;
+    }
+
+    public void setAccessSecret(String accessSecret) {
+        this.accessSecret = accessSecret;
+    }
+}

+ 166 - 0
finance-service/src/main/java/com/uas/finance/model/ErpLog.java

@@ -0,0 +1,166 @@
+package com.uas.finance.model;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.uas.platform.core.logging.BufferedLogable;
+
+import javax.persistence.*;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 与ERP交互的日志
+ * 
+ * @author yingp
+ * 
+ */
+@Entity
+@Table(name = "log$erp", indexes = { @Index(name = "log$erp_enuu_idx", columnList = "log_enuu") })
+public class ErpLog extends BufferedLogable implements Serializable {
+
+
+	private static final long serialVersionUID = 1L;
+
+	@Id
+	@GeneratedValue(strategy = GenerationType.IDENTITY)
+	@Column(name = "log_id")
+	private Long id;
+
+	@Column(name = "log_enuu")
+	private Long enUU;
+
+
+	@NotNull
+	@Column(name = "log_useruu")
+	private Long userUU;
+
+	/**
+	 * 日志时间
+	 */
+	@Column(name = "log_time")
+	private Long time;
+
+	/**
+	 * ip
+	 */
+	@Column(name = "log_ip")
+	private String ip;
+
+	@Column(name = "log_title")
+	private String title;
+
+	@Column(name = "log_message")
+	private String message;
+
+	/**
+	 * 传输的总数据量
+	 */
+	@Column(name = "log_total")
+	private Integer total;
+
+	@JsonIgnore
+	@JSONField(serialize = false)
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Long getEnUU() {
+		return enUU;
+	}
+
+	public void setEnUU(Long enUU) {
+		this.enUU = enUU;
+	}
+
+	public Long getUserUU() {
+		return userUU;
+	}
+
+	public void setUserUU(Long userUU) {
+		this.userUU = userUU;
+	}
+
+	public Long getTime() {
+		return time;
+	}
+
+	public void setTime(Long time) {
+		this.time = time;
+	}
+
+	public String getIp() {
+		return ip;
+	}
+
+	public void setIp(String ip) {
+		this.ip = ip;
+	}
+
+	public String getTitle() {
+		return title;
+	}
+
+	public void setTitle(String title) {
+		this.title = title;
+	}
+
+	public String getMessage() {
+		return message;
+	}
+
+	public void setMessage(String message) {
+		this.message = message;
+	}
+
+	public Integer getTotal() {
+		return total;
+	}
+
+	public void setTotal(Integer total) {
+		this.total = total;
+	}
+
+
+	public ErpLog() {
+
+	}
+
+	public ErpLog(String title, String message, int total) {
+		this.title = title;
+		this.message = message;
+		this.time = new Date().getTime();
+		this.total = total;
+	}
+
+	public void bufferedLog(String bufferedMessage) {
+		String[] strArray = bufferedMessage.split(separator);
+		if (strArray.length == 7) {
+			this.time = Long.parseLong(strArray[0]);
+			this.ip = strArray[1];
+			this.enUU = Long.parseLong(strArray[2]);
+			this.userUU = Long.parseLong(strArray[3]);
+			this.title = strArray[4];
+			this.message = strArray[5];
+			this.total = Integer.parseInt(strArray[6]);
+		}
+	}
+
+	@Override
+	public String bufferedMessage() {
+		StringBuffer sb = new StringBuffer();
+		sb.append(this.time).append(separator);
+		sb.append(this.ip).append(separator);
+		sb.append(this.enUU).append(separator);
+		sb.append(this.userUU).append(separator);
+		sb.append(this.title).append(separator);
+		sb.append(this.message).append(separator);
+		sb.append(this.total);
+		return sb.toString();
+	}
+
+}

+ 72 - 0
finance-service/src/main/java/com/uas/finance/model/FinanceApplyAttach.java

@@ -0,0 +1,72 @@
+package com.uas.finance.model;
+
+import javax.persistence.*;
+import java.io.Serializable;
+
+/**
+ * created by shicr on 2017/12/25
+ **/
+@Table
+@Entity(name = "financeapplyattach")
+public class FinanceApplyAttach implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * id
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Long id;
+
+    /**
+     * 保理业务申请书
+     */
+    @Column(name = "fat_apply")
+    private String apply;
+
+    /**
+     * 营业执照正副本
+     */
+    @Column(name = "fat_lic")
+    private String license;
+
+    /**
+     * 开户许可证
+     */
+    @Column(name = "fat_permit")
+    private String permit;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getApply() {
+        return apply;
+    }
+
+    public void setApply(String apply) {
+        this.apply = apply;
+    }
+
+    public String getLicense() {
+        return license;
+    }
+
+    public void setLicense(String license) {
+        this.license = license;
+    }
+
+    public String getPermit() {
+        return permit;
+    }
+
+    public void setPermit(String permit) {
+        this.permit = permit;
+    }
+}

+ 228 - 0
finance-service/src/main/java/com/uas/finance/model/FinanceCondition.java

@@ -0,0 +1,228 @@
+package com.uas.finance.model;
+
+
+import javax.persistence.*;
+import java.io.Serializable;
+
+/**
+ * created by shicr on 2017/12/20
+ * 财务情况说明
+ **/
+@Entity
+@Table(name = "financecondition")
+public class FinanceCondition implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+
+    /**
+     * ID
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "fc_id")
+    private Long id;
+
+    /**
+     * 企业uu
+     *
+     * @return
+     */
+    @Column(name = "fc_enuu")
+    private Long enuu;
+
+    /**
+     * 账龄<=3个月
+     */
+    @Column(name = "fc_agingamount1")
+    private Double fc_agingamount1;
+
+    /**
+     * 3个月<帐龄≤6个月
+     */
+    @Column(name = "fc_agingamount2")
+    private Double fc_agingamount2;
+
+    /**
+     * 6个月<帐龄<=1
+     */
+    @Column(name = "fc_agingamount4")
+    private Double fc_agingamount4;
+
+    /**
+     * 帐龄>1
+     */
+    @Column(name = "fc_agingamount3")
+    private Double fc_agingamount3;
+
+    /**
+     * 其他应收账款说明
+     */
+    @Column(name = "fc_otharremark")
+    private String fc_otharremark;
+
+    /**
+     * 其他应付账款说明
+     */
+    @Column(name = "fc_apremark")
+    private String fc_apremark;
+
+    /**
+     * 客户资料id
+     */
+    @Column(name = "fc_cus_id")
+    private Long cusId;
+
+    /**
+     * 截止至XX年
+     */
+    @Column(name = "fc_year")
+    private Integer year;
+
+    /**
+     * 截止至XX月
+     */
+    @Column(name = "fc_month")
+    private Integer month;
+    /**
+     * 余额
+     */
+    @Column(name = "fc_arbalance")
+    private Double fc_arbalance;
+
+    /**
+     * 截止时间,年月的拼接,字段名按UAS表来写,不是手误
+     */
+    @Column(name = "fc_yearmonth")
+    private Integer fc_yeatmonth;
+
+    /**
+     * ERP系统中的主键id
+     */
+    @Column(name = "erpId")
+    private Long erpId;
+
+    @OneToOne(cascade = CascadeType.REFRESH)
+    @JoinColumn(name = "fc_cus_id", insertable = false, updatable = false)
+    private CustomerInfo customerInfo;
+
+    public Long getCusId() {
+        return cusId;
+    }
+
+    public void setCusId(Long cusId) {
+        this.cusId = cusId;
+    }
+
+    public Long getErpId() {
+        return erpId;
+    }
+
+    public void setErpId(Long erpId) {
+        this.erpId = erpId;
+    }
+
+    /* public CustomerInfo getCustomerInfo() {
+        return customerInfo;
+    }
+
+    public void setCustomerInfo(CustomerInfo customerInfo) {
+        this.customerInfo = customerInfo;
+    }*/
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public Double getFc_agingamount1() {
+        return fc_agingamount1;
+    }
+
+    public void setFc_agingamount1(Double fc_agingamount1) {
+        this.fc_agingamount1 = fc_agingamount1;
+    }
+
+    public Double getFc_agingamount2() {
+        return fc_agingamount2;
+    }
+
+    public void setFc_agingamount2(Double fc_agingamount2) {
+        this.fc_agingamount2 = fc_agingamount2;
+    }
+
+    public Double getFc_agingamount4() {
+        return fc_agingamount4;
+    }
+
+    public void setFc_agingamount4(Double fc_agingamount4) {
+        this.fc_agingamount4 = fc_agingamount4;
+    }
+
+    public Double getFc_agingamount3() {
+        return fc_agingamount3;
+    }
+
+    public void setFc_agingamount3(Double fc_agingamount3) {
+        this.fc_agingamount3 = fc_agingamount3;
+    }
+
+    public String getFc_otharremark() {
+        return fc_otharremark;
+    }
+
+    public void setFc_otharremark(String fc_otharremark) {
+        this.fc_otharremark = fc_otharremark;
+    }
+
+    public Integer getYear() {
+        return year;
+    }
+
+    public void setYear(Integer year) {
+        this.year = year;
+    }
+
+    public Integer getMonth() {
+        return month;
+    }
+
+    public void setMonth(Integer month) {
+        this.month = month;
+    }
+
+    public Integer getFc_yeatmonth() {
+        return fc_yeatmonth;
+    }
+
+    public void setFc_yeatmonth(Integer fc_yeatmonth) {
+        this.fc_yeatmonth = fc_yeatmonth;
+    }
+
+    public String getFc_apremark() {
+        return fc_apremark;
+    }
+
+    public void setFc_apremark(String fc_apremark) {
+        this.fc_apremark = fc_apremark;
+    }
+
+    public Double getFc_arbalance() {
+        return fc_arbalance;
+    }
+
+    public void setFc_arbalance(Double fc_arbalance) {
+        this.fc_arbalance = fc_arbalance;
+    }
+}

+ 340 - 0
finance-service/src/main/java/com/uas/finance/model/FinancingApply.java

@@ -0,0 +1,340 @@
+package com.uas.finance.model;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 金融服务申请数据
+ *
+ * @author hejq
+ * @time 创建时间:20171124
+ */
+@Entity
+@Table(name = "financingapply")
+
+public class FinancingApply implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+
+    /**
+     * ID
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "fa_id")
+    private Long id;
+
+    /**
+     * 企业uu
+     */
+    @Column(name = "fa_enuu")
+    private Long enuu;
+
+    /**
+     * 保理UU
+     */
+    @Column(name = "fa_faenuu")
+    private Long fauu;
+
+    /**
+     * 企业名
+     */
+    @Column(name = "fa_enname")
+    private String fa_enname;
+
+    /**
+     * 联系人
+     */
+    @Column(name = "fa_contact")
+    private String fa_contact;
+
+    /**
+     * 联系方式1
+     */
+    @Column(name = "fa_telphone")
+    private String fa_telphone;
+
+    /**
+     * 联系方式2
+     */
+    @Column(name = "fa_phone")
+    private String fa_phone;
+
+    /**
+     * erp下载状态
+     */
+    @Column(name = "fa_erpstatus")
+    private Integer erpstatus;
+
+    /**
+     * 申请金额
+     */
+    @Column(name = "fa_appamount")
+    private Long fa_appamount;
+
+    /**
+     * 申请人
+     */
+    @Column(name = "fa_applyman")
+    private String fa_applyman;
+
+    /**
+     * 申请日期
+     */
+    @Column(name = "fa_applydate")
+    private Date fa_applydate;
+
+    /**
+     * 申请得分
+     */
+    @Transient
+    private Double fa_score;
+
+    /**
+     * UAS数据库融资申请单号
+     */
+    @Column(name = "fa_busincode")
+    private String fa_busincode;
+
+    /**
+     * 保理公司名称
+     */
+    @Column(name = "fa_facorpname")
+    private String fa_facorpname;
+
+    /**
+     * 保理公司
+     */
+    @Transient
+    private String fa_facorpcode;
+
+    /**
+     * 客户资料id
+     */
+    @Column(name = "fa_cus_id")
+    private Long cusId;
+
+    /**
+     * 保理申请单状态
+     * 201:已保存
+     * 202:已提交
+     * 203:已下载
+     * 204:批复额度成功
+     * 205:拒绝批复额度
+     */
+    @Column(name = "fa_status")
+    private Integer status;
+
+    /**
+     * 受理日期
+     */
+    @Column(name = "fa_time")
+    private Date approveTime;
+
+    /**
+     * 提交日期
+     */
+    @Column(name = "fa_subtime")
+    private Date submitTime;
+
+    /**
+     * 0:等待确认
+     * 1:已确认
+     */
+    @Column(name = "fa_check")
+    private Integer checkinfo;
+
+
+    @OneToOne(cascade = CascadeType.REFRESH)
+    @JoinColumn(name = "fa_cus_id", insertable = false, updatable = false)
+
+    private CustomerInfo customerInfo;
+
+    @OneToMany(mappedBy = "financingApply", cascade = CascadeType.REFRESH)
+    private List<Attach> attachList;
+
+    public Integer getCheckinfo() {
+        return checkinfo;
+    }
+
+    public void setCheckinfo(Integer checkinfo) {
+        this.checkinfo = checkinfo;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Integer getErpstatus() {
+        return erpstatus;
+    }
+
+    public void setErpstatus(Integer erpstatus) {
+        this.erpstatus = erpstatus;
+    }
+
+    public List<Attach> getAttachList() {
+        return attachList;
+    }
+
+    public void setAttachList(List<Attach> attachList) {
+        this.attachList = attachList;
+    }
+
+    public Long getCusId() {
+        return cusId;
+    }
+
+    public void setCusId(Long cusId) {
+        this.cusId = cusId;
+    }
+
+    public String getFa_enname() {
+        return fa_enname;
+    }
+
+    public void setFa_enname(String fa_enname) {
+        this.fa_enname = fa_enname;
+    }
+
+    public CustomerInfo getCustomerInfo() {
+        return customerInfo;
+    }
+
+    public void setCustomerInfo(CustomerInfo customerInfo) {
+        this.customerInfo = customerInfo;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public String getFa_contact() {
+        return fa_contact;
+    }
+
+    public void setFa_contact(String fa_contact) {
+        this.fa_contact = fa_contact;
+    }
+
+    public String getFa_telphone() {
+        return fa_telphone;
+    }
+
+    public void setFa_telphone(String fa_telphone) {
+        this.fa_telphone = fa_telphone;
+    }
+
+    public String getFa_phone() {
+        return fa_phone;
+    }
+
+    public void setFa_phone(String fa_phone) {
+        this.fa_phone = fa_phone;
+    }
+
+    public Long getFa_appamount() {
+        return fa_appamount;
+    }
+
+    public void setFa_appamount(Long fa_appamount) {
+        this.fa_appamount = fa_appamount;
+    }
+
+    public String getFa_applyman() {
+        return fa_applyman;
+    }
+
+    public void setFa_applyman(String fa_applyman) {
+        this.fa_applyman = fa_applyman;
+    }
+
+    public Date getFa_applydate() {
+        return fa_applydate;
+    }
+
+    public void setFa_applydate(Date fa_applydate) {
+        this.fa_applydate = fa_applydate;
+    }
+
+    public Double getFa_score() {
+        return fa_score;
+    }
+
+    public void setFa_score(Double fa_score) {
+        this.fa_score = fa_score;
+    }
+
+    public String getFa_busincode() {
+        return fa_busincode;
+    }
+
+    public void setFa_busincode(String fa_busincode) {
+        this.fa_busincode = fa_busincode;
+    }
+
+    public String getFa_facorpname() {
+        return fa_facorpname;
+    }
+
+    public void setFa_facorpname(String fa_facorpname) {
+        this.fa_facorpname = fa_facorpname;
+    }
+
+    public String getFa_facorpcode() {
+        return fa_facorpcode;
+    }
+
+    public void setFa_facorpcode(String fa_facorpcode) {
+        this.fa_facorpcode = fa_facorpcode;
+    }
+
+    public Long getFauu() {
+        return fauu;
+    }
+
+    public void setFauu(Long fauu) {
+        this.fauu = fauu;
+    }
+
+    public Date getApproveTime() {
+        return approveTime;
+    }
+
+    public void setApproveTime(Date approveTime) {
+        this.approveTime = approveTime;
+    }
+
+    public String getSubmitTime() {
+        Date date = this.submitTime;
+        return date !=null ? sdf.format(date) : null;
+    }
+
+    public void setSubmitTime(Date submitTime) {
+        this.submitTime = submitTime;
+    }
+}

+ 128 - 0
finance-service/src/main/java/com/uas/finance/model/FsSale.java

@@ -0,0 +1,128 @@
+package com.uas.finance.model;
+
+import javax.persistence.*;
+import java.io.Serializable;
+
+/**
+ * created by shicr on 2018/1/16
+ * 基础合同信息表
+ **/
+@Entity
+@Table(name = "fasale")
+public class FsSale implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * ID
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Long id;
+
+    /**
+     * 出账id
+     */
+    @Column(name = "aa_id")
+    private Long aa_id;
+
+    /**
+     * 基础合同编号
+     */
+    @Column(name = "sa_contractno")
+    private String sa_contractno;
+
+    /**
+     * 合同金额
+     */
+    @Column(name = "sa_contractamount")
+    private Double sa_contractamount;
+
+    /**
+     * 订单编号
+     */
+    @Column(name = "sa_code")
+    private String sa_code;
+
+    /**
+     * 订单金额
+     */
+    @Column(name = "sa_total")
+    private Double sa_total;
+
+    /**
+     * 收款方式
+     */
+    @Column(name = "sa_payment")
+    private String sa_payment;
+
+    @ManyToOne(cascade = CascadeType.REFRESH)
+    @JoinColumn(name = "aa_id",insertable = false,updatable = false)
+    private AccountApply accountApply;
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getAa_id() {
+        return aa_id;
+    }
+
+    public void setAa_id(Long aa_id) {
+        this.aa_id = aa_id;
+    }
+
+    public String getSa_contractno() {
+        return sa_contractno;
+    }
+
+    public void setSa_contractno(String sa_contractno) {
+        this.sa_contractno = sa_contractno;
+    }
+
+    public Double getSa_contractamount() {
+        return sa_contractamount;
+    }
+
+    public void setSa_contractamount(Double sa_contractamount) {
+        this.sa_contractamount = sa_contractamount;
+    }
+
+    public String getSa_code() {
+        return sa_code;
+    }
+
+    public void setSa_code(String sa_code) {
+        this.sa_code = sa_code;
+    }
+
+    public Double getSa_total() {
+        return sa_total;
+    }
+
+    public void setSa_total(Double sa_total) {
+        this.sa_total = sa_total;
+    }
+
+    public String getSa_payment() {
+        return sa_payment;
+    }
+
+    public void setSa_payment(String sa_payment) {
+        this.sa_payment = sa_payment;
+    }
+
+  /*  public AccountApply getAccountApply() {
+        return accountApply;
+    }
+
+    public void setAccountApply(AccountApply accountApply) {
+        this.accountApply = accountApply;
+    }*/
+}

+ 356 - 0
finance-service/src/main/java/com/uas/finance/model/MFCustInfo.java

@@ -0,0 +1,356 @@
+package com.uas.finance.model;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * created by shicr on 2017/12/20
+ * 买方客户资料
+ **/
+@Entity
+@Table(name = "mfcustinfo")
+public class MFCustInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * ID
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "mf_id")
+    private Long id;
+
+    /**
+     * 企业uu
+     *
+     * @return
+     */
+    @Column(name = "mf_enuu")
+    private Long enuu;
+
+    /**
+     * 买方名称
+     */
+    @Column(name = "mf_custname")
+    private String mf_custname;
+
+    /**
+     * 额度申请
+     */
+    @Column(name = "mf_credit")
+    private Double mf_credit;
+
+    /**
+     * 法人代表
+     */
+    @Column(name = "mf_legrep")
+    private String mf_legrep;
+
+
+    /**
+     * 注册资本(万元)
+     */
+    @Column(name = "mf_regcapital")
+    private Double mf_regcapital;
+
+    /**
+     * 经营地址
+     */
+    @Column(name = "mf_addr")
+    private String mf_addr;
+
+    /**
+     * 成立时间
+     */
+    @Column(name = "mf_estabtime")
+    private Date mf_estabtime;
+
+    /**
+     * 联系人
+     */
+    @Column(name = "mf_contact")
+    private String mf_contact;
+
+    /**
+     * 联系电话
+     */
+    @Column(name = "mf_contactnum")
+    private String mf_contactnum;
+
+    /**
+     * 传真
+     */
+    @Column(name = "mf_fax")
+    private String mf_fax;
+
+
+    /**
+     * 电子邮箱
+     */
+    @Column(name = "mf_email")
+    private String mf_email;
+
+    /**
+     * 结算开户行
+     */
+    @Column(name = "mf_balancebank")
+    private String mf_balancebank;
+
+    /**
+     * 银行账户
+     */
+    @Column(name = "mf_bankaccount")
+    private String mf_bankaccount;
+
+    /**
+     * 交易产品
+     */
+    @Column(name = "mf_tradprod")
+    private String mf_tradprod;
+
+    /**
+     * 付款条件
+     */
+    @Column(name = "mf_payterm")
+    private String mf_payterm;
+
+    /**
+     * 股东占比(%)
+     */
+    @Column(name = "mf_shareholder")
+    private Double mf_shareholder;
+
+    /**
+     * 经营范围
+     */
+    @Column(name = "mf_businsscope")
+    private String mf_businsscope;
+
+    /**
+     * 客户资料id
+     */
+    @Column(name = "mf_cus_id")
+    private Long cusId;
+
+    /**
+     * 是否与其他保理商合作
+     * -1:true 0:false
+     */
+    @Column(name = "mf_coopohers")
+    private Short mf_coopohers;
+
+    /**
+     * 保险公司取得保险额度
+     * -1:true 0:false
+     */
+    @Column(name = "mf_hasinslimit")
+    private Short mf_hasinslimit;
+
+    /**
+     * ERP系统中的主键id
+     */
+    @Column(name = "erpId")
+    private Long erpId;
+
+    @OneToMany(mappedBy = "mfCustInfo", cascade = CascadeType.REFRESH)
+    private List<MFCustInfoDetail> mfCustInfoDetailList;
+
+    @ManyToOne(cascade = CascadeType.REFRESH)
+    @JoinColumn(name = "mf_cus_id", insertable = false, updatable = false)
+    private CustomerInfo customerInfo;
+
+    public Long getErpId() {
+        return erpId;
+    }
+
+    public void setErpId(Long erpId) {
+        this.erpId = erpId;
+    }
+
+    public Long getCusId() {
+        return cusId;
+    }
+
+    public void setCusId(Long cusId) {
+        this.cusId = cusId;
+    }
+
+    /*public CustomerInfo getCustomerInfo() {
+        return customerInfo;
+    }
+
+    public void setCustomerInfo(CustomerInfo customerInfo) {
+        this.customerInfo = customerInfo;
+    }
+*/
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public String getMf_custname() {
+        return mf_custname;
+    }
+
+    public void setMf_custname(String mf_custname) {
+        this.mf_custname = mf_custname;
+    }
+
+    public Double getMf_credit() {
+        return mf_credit;
+    }
+
+    public void setMf_credit(Double mf_credit) {
+        this.mf_credit = mf_credit;
+    }
+
+    public String getMf_legrep() {
+        return mf_legrep;
+    }
+
+    public void setMf_legrep(String mf_legrep) {
+        this.mf_legrep = mf_legrep;
+    }
+
+    public Double getMf_regcapital() {
+        return mf_regcapital;
+    }
+
+    public void setMf_regcapital(Double mf_regcapital) {
+        this.mf_regcapital = mf_regcapital;
+    }
+
+    public String getMf_addr() {
+        return mf_addr;
+    }
+
+    public void setMf_addr(String mf_addr) {
+        this.mf_addr = mf_addr;
+    }
+
+    public Date getMf_estabtime() {
+        return mf_estabtime;
+    }
+
+    public void setMf_estabtime(Date mf_estabtime) {
+        this.mf_estabtime = mf_estabtime;
+    }
+
+    public String getMf_contact() {
+        return mf_contact;
+    }
+
+    public void setMf_contact(String mf_contact) {
+        this.mf_contact = mf_contact;
+    }
+
+    public String getMf_contactnum() {
+        return mf_contactnum;
+    }
+
+    public void setMf_contactnum(String mf_contactnum) {
+        this.mf_contactnum = mf_contactnum;
+    }
+
+    public String getMf_fax() {
+        return mf_fax;
+    }
+
+    public void setMf_fax(String mf_fax) {
+        this.mf_fax = mf_fax;
+    }
+
+    public String getMf_email() {
+        return mf_email;
+    }
+
+    public void setMf_email(String mf_email) {
+        this.mf_email = mf_email;
+    }
+
+    public String getMf_balancebank() {
+        return mf_balancebank;
+    }
+
+    public void setMf_balancebank(String mf_balancebank) {
+        this.mf_balancebank = mf_balancebank;
+    }
+
+    public String getMf_bankaccount() {
+        return mf_bankaccount;
+    }
+
+    public void setMf_bankaccount(String mf_bankaccount) {
+        this.mf_bankaccount = mf_bankaccount;
+    }
+
+    public String getMf_tradprod() {
+        return mf_tradprod;
+    }
+
+    public void setMf_tradprod(String mf_tradprod) {
+        this.mf_tradprod = mf_tradprod;
+    }
+
+    public String getMf_payterm() {
+        return mf_payterm;
+    }
+
+    public void setMf_payterm(String mf_payterm) {
+        this.mf_payterm = mf_payterm;
+    }
+
+    public Double getMf_shareholder() {
+        return mf_shareholder;
+    }
+
+    public void setMf_shareholder(Double mf_shareholder) {
+        this.mf_shareholder = mf_shareholder;
+    }
+
+    public String getMf_businsscope() {
+        return mf_businsscope;
+    }
+
+    public void setMf_businsscope(String mf_businsscope) {
+        this.mf_businsscope = mf_businsscope;
+    }
+
+    public Short getMf_coopohers() {
+        return mf_coopohers;
+    }
+
+    public void setMf_coopohers(Short mf_coopohers) {
+        this.mf_coopohers = mf_coopohers;
+    }
+
+    public Short getMf_hasinslimit() {
+        return mf_hasinslimit;
+    }
+
+    public void setMf_hasinslimit(Short mf_hasinslimit) {
+        this.mf_hasinslimit = mf_hasinslimit;
+    }
+
+    public List<MFCustInfoDetail> getMfCustInfoDetailList() {
+        return mfCustInfoDetailList;
+    }
+
+    public void setMfCustInfoDetailList(List<MFCustInfoDetail> mfCustInfoDetailList) {
+        this.mfCustInfoDetailList = mfCustInfoDetailList;
+    }
+}

+ 142 - 0
finance-service/src/main/java/com/uas/finance/model/MFCustInfoDetail.java

@@ -0,0 +1,142 @@
+package com.uas.finance.model;
+
+import javax.persistence.*;
+import java.io.Serializable;
+
+/**
+ * created by shicr on 2017/12/24
+ * 买方信息明细
+ **/
+@Entity
+@Table(name = "mfcustinfodetail")
+public class MFCustInfoDetail implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * ID
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "mfd_id")
+    private Long id;
+
+    /**
+     * 年度
+     */
+    @Column(name = "mfd_year")
+    private Integer mfd_year;
+
+    /**
+     * 购买总额
+     */
+    @Column(name = "mfd_amount")
+    private Double mfd_amount;
+
+    /**
+     * 赊账总额
+     */
+    @Column(name = "mfd_chargeamount")
+    private Double mfd_chargeamount;
+
+    /**
+     * 折扣金额
+     */
+    @Column(name = "mfd_discountamount")
+    private Double mfd_discountamount;
+
+    /**
+     * 有无逾期
+     */
+    @Column(name = "mfd_overdue")
+    private String mfd_overdue;
+
+
+    /**
+     * 买方信息id
+     */
+    @Column(name = "mfd_mf_id")
+    private Long mfId;
+
+    /**
+     * ERP系统中的主键id
+     */
+    @Column(name = "erpId")
+    private Long erpId;
+
+    @ManyToOne(cascade = CascadeType.REFRESH)
+    @JoinColumn(name = "mfd_mf_id", insertable = false, updatable = false)
+    private MFCustInfo mfCustInfo;
+
+    public Long getErpId() {
+        return erpId;
+    }
+
+    public void setErpId(Long erpId) {
+        this.erpId = erpId;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Integer getMfd_year() {
+        return mfd_year;
+    }
+
+    public void setMfd_year(Integer mfd_year) {
+        this.mfd_year = mfd_year;
+    }
+
+    public Double getMfd_amount() {
+        return mfd_amount;
+    }
+
+    public void setMfd_amount(Double mfd_amount) {
+        this.mfd_amount = mfd_amount;
+    }
+
+    public Double getMfd_chargeamount() {
+        return mfd_chargeamount;
+    }
+
+    public void setMfd_chargeamount(Double mfd_chargeamount) {
+        this.mfd_chargeamount = mfd_chargeamount;
+    }
+
+    public Double getMfd_discountamount() {
+        return mfd_discountamount;
+    }
+
+    public void setMfd_discountamount(Double mfd_discountamount) {
+        this.mfd_discountamount = mfd_discountamount;
+    }
+
+    public String getMfd_overdue() {
+        return mfd_overdue;
+    }
+
+    public void setMfd_overdue(String mfd_overdue) {
+        this.mfd_overdue = mfd_overdue;
+    }
+
+    public Long getMfId() {
+        return mfId;
+    }
+
+    public void setMfId(Long mfId) {
+        this.mfId = mfId;
+    }
+
+  /*  public MFCustInfo getMfCustInfo() {
+        return mfCustInfo;
+    }
+
+    public void setMfCustInfo(MFCustInfo mfCustInfo) {
+        this.mfCustInfo = mfCustInfo;
+    }*/
+}

+ 158 - 0
finance-service/src/main/java/com/uas/finance/model/ProductMix.java

@@ -0,0 +1,158 @@
+package com.uas.finance.model;
+
+import javax.persistence.*;
+import java.io.Serializable;
+
+/**
+ * created by shicr on 2017/12/20
+ * 经营情况表
+ **/
+@Entity
+@Table(name = "productmix")
+public class ProductMix implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * ID
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "pm_id")
+    private Long id;
+
+    /**
+     * 企业UU
+     */
+    @Column(name = "pm_enuu")
+    private Long enuu;
+
+    /**
+     * 产品/服务种类
+     */
+    @Column(name = "pm_kind")
+    private String pm_kind;
+
+    /**
+     * 今年营业收入
+     */
+    @Column(name = "pm_tannualrevenue")
+    private Double pm_tannualrevenue;
+
+    /**
+     * 占今年总收入比例
+     */
+    @Column(name = "pm_tratio")
+    private Double pm_tratio;
+
+    /**
+     * 上年营业收入
+     */
+    @Column(name = "pm_annualrevenue")
+    private Double pm_annualrevenue;
+
+    /**
+     * 占总收入比例
+     */
+    @Column(name = "pm_ratio")
+    private Double pm_ratio;
+
+    /**
+     * 客户资料id
+     */
+    @Column(name = "pm_cus_id")
+    private Long cusId;
+
+    /**
+     * ERP系统中的主键id
+     */
+    @Column(name = "erpId")
+    private Long erpId;
+
+    /**
+     * 多对一关联客户资料主表
+     */
+    @ManyToOne(cascade = CascadeType.REFRESH)
+    @JoinColumn(name = "pm_cus_id", insertable = false, updatable = false)
+    private CustomerInfo customerInfo;
+
+    public Long getErpId() {
+        return erpId;
+    }
+
+    public void setErpId(Long erpId) {
+        this.erpId = erpId;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public Long getCusId() {
+        return cusId;
+    }
+
+    public void setCusId(Long cusId) {
+        this.cusId = cusId;
+    }
+
+   /* public CustomerInfo getCustomerInfo() {
+        return customerInfo;
+    }
+
+    public void setCustomerInfo(CustomerInfo customerInfo) {
+        this.customerInfo = customerInfo;
+    }*/
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public String getPm_kind() {
+        return pm_kind;
+    }
+
+    public void setPm_kind(String pm_kind) {
+        this.pm_kind = pm_kind;
+    }
+
+    public Double getPm_tannualrevenue() {
+        return pm_tannualrevenue;
+    }
+
+    public void setPm_tannualrevenue(Double pm_tannualrevenue) {
+        this.pm_tannualrevenue = pm_tannualrevenue;
+    }
+
+    public Double getPm_tratio() {
+        return pm_tratio;
+    }
+
+    public void setPm_tratio(Double pm_tratio) {
+        this.pm_tratio = pm_tratio;
+    }
+
+    public Double getPm_annualrevenue() {
+        return pm_annualrevenue;
+    }
+
+    public void setPm_annualrevenue(Double pm_annualrevenue) {
+        this.pm_annualrevenue = pm_annualrevenue;
+    }
+
+    public Double getPm_ratio() {
+        return pm_ratio;
+    }
+
+    public void setPm_ratio(Double pm_ratio) {
+        this.pm_ratio = pm_ratio;
+    }
+}

+ 115 - 0
finance-service/src/main/java/com/uas/finance/model/Receipt.java

@@ -0,0 +1,115 @@
+package com.uas.finance.model;
+
+
+import com.uas.finance.util.DateUtils;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * created by shicr on 2018/1/25
+ * 基础发票信息
+ **/
+@Entity
+@Table(name = "receipt")
+public class Receipt implements Serializable{
+
+    private static final long serialVersionUID = 1L;
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Long id;
+
+    /**
+     * 关联出账表的外键
+     */
+    @Column(name = "aa_id")
+    private Long aa_id;
+
+    /**
+     * 发票号码
+     */
+    @Column(name = "aai_invoiceno")
+    private String aai_invoiceno;
+
+    /**
+     * 销售方纳税人识别号
+     */
+    @Column(name = "aai_salesno")
+    private String aai_salesno;
+
+    /**
+     * 开票日期
+     */
+    @Column(name = "aai_billdate")
+    private Date aai_billdate;
+
+    /**
+     * 开票金额(元)
+     */
+    @Column(name = "aai_amount")
+    private Double aai_amount;
+
+
+    @ManyToOne(cascade = CascadeType.REFRESH)
+    @JoinColumn(name = "aa_id",insertable = false,updatable = false)
+    private AccountApply accountApply;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getAai_invoiceno() {
+        return aai_invoiceno;
+    }
+
+    public void setAai_invoiceno(String aai_invoiceno) {
+        this.aai_invoiceno = aai_invoiceno;
+    }
+
+    public String getAai_salesno() {
+        return aai_salesno;
+    }
+
+    public void setAai_salesno(String aai_salesno) {
+        this.aai_salesno = aai_salesno;
+    }
+
+    public String getAai_billdate() {
+        return DateUtils.getMinMonthDateS(this.aai_billdate);
+    }
+
+    public void setAai_billdate(Date aai_billdate) {
+        this.aai_billdate = aai_billdate;
+    }
+
+    public Double getAai_amount() {
+        return aai_amount;
+    }
+
+    public void setAai_amount(Double aai_amount) {
+        this.aai_amount = aai_amount;
+    }
+
+    public Long getAa_id() {
+        return aa_id;
+    }
+
+    public void setAa_id(Long aa_id) {
+        this.aa_id = aa_id;
+    }
+
+/*    public AccountApply getAccountApply() {
+        return accountApply;
+    }
+
+    public void setAccountApply(AccountApply accountApply) {
+        this.accountApply = accountApply;
+    }*/
+}

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio