commit
f0131507ce
@ -0,0 +1,6 @@
|
||||
/src/main/webapp/WEB-INF/classes/
|
||||
/src/main/webapp/WEB-INF/classes/
|
||||
.idea/
|
||||
*.iml
|
||||
/target/
|
||||
/src/main/webapp/WEB-INF/lib
|
@ -0,0 +1,794 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>sf</groupId>
|
||||
<artifactId>nhet</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<packaging>war</packaging>
|
||||
<name>nenghui</name>
|
||||
|
||||
<!-- 项目属性 -->
|
||||
<properties>
|
||||
|
||||
<!-- version setting -->
|
||||
<spring.version>4.1.7.RELEASE</spring.version>
|
||||
<hibernate.version>4.2.0.Final</hibernate.version>
|
||||
<hibernate-search.version>4.2.0.Final</hibernate-search.version>
|
||||
<hibernate-validator.version>5.0.1.Final</hibernate-validator.version>
|
||||
<druid.version>1.0.31</druid.version>
|
||||
<ocrapi.version>2.0.2</ocrapi.version>
|
||||
<shiro.version>1.13.0</shiro.version>
|
||||
<ehcache.version>2.6.6</ehcache.version>
|
||||
<sitemesh.version>2.4.2</sitemesh.version>
|
||||
<slf4j.version>1.7.5</slf4j.version>
|
||||
<log4j.version>1.2.17</log4j.version>
|
||||
<commons-lang3.version>3.8</commons-lang3.version>
|
||||
<commons-io.version>2.4</commons-io.version>
|
||||
<commons-codec.version>1.8</commons-codec.version>
|
||||
<commons-fileupload.version>1.3</commons-fileupload.version>
|
||||
<commons-beanutils.version>1.8.3</commons-beanutils.version>
|
||||
<jackson.version>2.2.1</jackson.version>
|
||||
<xstream.version>1.4.3</xstream.version>
|
||||
<guava.version>14.0.1</guava.version>
|
||||
<dozer.version>5.4.0</dozer.version>
|
||||
<poi.version>3.9</poi.version>
|
||||
<freemarker.version>2.3.19</freemarker.version>
|
||||
<zxing.version>2.1</zxing.version>
|
||||
|
||||
<!-- jdbc driver setting -->
|
||||
<mysql.driver.version>8.0.11</mysql.driver.version>
|
||||
|
||||
<!-- other setting -->
|
||||
<jdk.version>1.7</jdk.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<downloadSources>false</downloadSources>
|
||||
|
||||
</properties>
|
||||
|
||||
<!-- 依赖项定义 -->
|
||||
<dependencies>
|
||||
|
||||
<!--消息队列 sqs包-->
|
||||
<dependency>
|
||||
<groupId>com.amazonaws</groupId>
|
||||
<artifactId>aws-java-sdk-sqs</artifactId>
|
||||
<version>1.11.293</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- 国网加密工具-->
|
||||
<dependency>
|
||||
<groupId>com.gfyunAESUtil</groupId>
|
||||
<artifactId>gfyunAESUtil-webapi</artifactId>
|
||||
<version>1.0</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/gfyunAESUtil.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- 条形码 依赖-->
|
||||
<dependency>
|
||||
<groupId>net.sf.barcode4j</groupId>
|
||||
<artifactId>barcode4j-light</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.kingdee</groupId>
|
||||
<artifactId>k3cloud-webapi</artifactId>
|
||||
<version>sdk8.0.5</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/k3cloud-webapi-sdk8.0.5.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<!--企企开放平台SDK-->
|
||||
<dependency>
|
||||
<groupId>com.q7link.openapi</groupId>
|
||||
<artifactId>openapi-client</artifactId>
|
||||
<version>2.2.0</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/openapi-client-2.2.0.jar</systemPath>
|
||||
</dependency>
|
||||
<!-- 图片服务器 -->
|
||||
<!-- <dependency>
|
||||
<groupId>com.sf</groupId>
|
||||
<artifactId>sf-file-core</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/sf-file-core-0.0.1-SNAPSHOT.jar</systemPath>
|
||||
</dependency>-->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-pool2</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 图片服务器 -->
|
||||
|
||||
<!-- SPRING begin -->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-core</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun.oss</groupId>
|
||||
<artifactId>aliyun-sdk-oss</artifactId>
|
||||
<version>2.8.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.amazonaws</groupId>
|
||||
<artifactId>aws-java-sdk-core</artifactId>
|
||||
<version>1.11.772</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.amazonaws</groupId>
|
||||
<artifactId>aws-java-sdk-s3</artifactId>
|
||||
<version>1.11.772</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.amazonaws</groupId>
|
||||
<artifactId>aws-java-sdk-opensdk</artifactId>
|
||||
<version>1.11.772</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-beans</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context-support</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-aop</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-tx</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.zxing</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>3.3.0</version>
|
||||
</dependency>
|
||||
<!--spring websocket-->
|
||||
<!-- <dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-websocket</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>-->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-messaging</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.jhlabs</groupId>
|
||||
<artifactId>filters</artifactId>
|
||||
<version>2.0.235-1</version>
|
||||
</dependency>
|
||||
<!--okhttp3 依赖-->
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>4.9.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-core</artifactId>
|
||||
<version>5.8.21</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.7.7</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<!-- spring orm -->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-orm</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-jdbc</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--定时-->
|
||||
<dependency>
|
||||
<groupId>it.sauronsoftware.cron4j</groupId>
|
||||
<artifactId>cron4j</artifactId>
|
||||
<version>2.2.5</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- AOP begin -->
|
||||
<dependency>
|
||||
<groupId>org.aspectj</groupId>
|
||||
<artifactId>aspectjrt</artifactId>
|
||||
<version>1.7.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.aspectj</groupId>
|
||||
<artifactId>aspectjweaver</artifactId>
|
||||
<version>1.7.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cglib</groupId>
|
||||
<artifactId>cglib</artifactId>
|
||||
<version>3.1</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<!-- AOP end -->
|
||||
|
||||
<!-- PERSISTENCE begin -->
|
||||
<!-- Hibernate -->
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-core</artifactId>
|
||||
<version>${hibernate.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-ehcache</artifactId>
|
||||
<version>${hibernate.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-validator</artifactId>
|
||||
<version>${hibernate-validator.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-configuration</groupId>
|
||||
<artifactId>commons-configuration</artifactId>
|
||||
<version>1.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-pool2</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</dependency>
|
||||
<!-- 中文分词 alipay-sdk-java-3.7.73.ALL-->
|
||||
<!-- <dependency>
|
||||
<groupId>org.wltea</groupId>my
|
||||
<artifactId>analyzer</artifactId>
|
||||
<version>2012_u6</version>
|
||||
</dependency>-->
|
||||
|
||||
<!-- connection pool -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
<version>${druid.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>ocr_api20210707</artifactId>
|
||||
<version>${ocrapi.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- jdbc driver -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>${mysql.driver.version}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- PERSISTENCE end -->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpcore</artifactId>
|
||||
<version>4.4.1</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.5.9</version>
|
||||
</dependency>
|
||||
|
||||
<!--阿里云短信-->
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>aliyun-java-sdk-core</artifactId>
|
||||
<version>4.1.0</version>
|
||||
</dependency>
|
||||
<!-- httpclient end -->
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/com.itextpdf/itextpdf -->
|
||||
<dependency>
|
||||
<groupId>com.itextpdf</groupId>
|
||||
<artifactId>itextpdf</artifactId>
|
||||
<version>5.5.13</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.itextpdf/itext-asian -->
|
||||
<dependency>
|
||||
<groupId>com.itextpdf</groupId>
|
||||
<artifactId>itext-asian</artifactId>
|
||||
<version>5.2.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- WEB begin -->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-webmvc</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-oxm</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>opensymphony</groupId>
|
||||
<artifactId>sitemesh</artifactId>
|
||||
<version>${sitemesh.version}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>taglibs</groupId>
|
||||
<artifactId>standard</artifactId>
|
||||
<version>1.1.2</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>jstl</artifactId>
|
||||
<version>1.2</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet.jsp</groupId>
|
||||
<artifactId>jsp-api</artifactId>
|
||||
<version>2.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- WEB end -->
|
||||
|
||||
<!-- EHCACHE begin -->
|
||||
<dependency>
|
||||
<groupId>net.sf.ehcache</groupId>
|
||||
<artifactId>ehcache-core</artifactId>
|
||||
<version>${ehcache.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sf.ehcache</groupId>
|
||||
<artifactId>ehcache-web</artifactId>
|
||||
<version>2.0.4</version>
|
||||
</dependency>
|
||||
<!-- EHCACHE end -->
|
||||
|
||||
<!-- SECURITY begin -->
|
||||
<dependency>
|
||||
<groupId>org.apache.shiro</groupId>
|
||||
<artifactId>shiro-core</artifactId>
|
||||
<version>${shiro.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.shiro</groupId>
|
||||
<artifactId>shiro-spring</artifactId>
|
||||
<version>${shiro.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.shiro</groupId>
|
||||
<artifactId>shiro-web</artifactId>
|
||||
<version>${shiro.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.shiro</groupId>
|
||||
<artifactId>shiro-ehcache</artifactId>
|
||||
<version>${shiro.version}</version>
|
||||
</dependency>
|
||||
<!-- SECURITY end -->
|
||||
|
||||
<!-- LOGGING begin -->
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>${slf4j.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>${slf4j.version}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<!-- common-logging 实际调用slf4j -->
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jcl-over-slf4j</artifactId>
|
||||
<version>${slf4j.version}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<!-- java.util.logging 实际调用slf4j -->
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jul-to-slf4j</artifactId>
|
||||
<version>${slf4j.version}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<!-- log4j -->
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>${log4j.version}</version>
|
||||
</dependency>
|
||||
<!-- log4jdbc -->
|
||||
<dependency>
|
||||
<groupId>org.lazyluke</groupId>
|
||||
<artifactId>log4jdbc-remix</artifactId>
|
||||
<version>0.2.7</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<!-- LOGGING end -->
|
||||
|
||||
<!-- GENERAL UTILS begin -->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>${commons-lang3.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>${commons-io.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>${commons-codec.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-fileupload</groupId>
|
||||
<artifactId>commons-fileupload</artifactId>
|
||||
<version>${commons-fileupload.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-beanutils</groupId>
|
||||
<artifactId>commons-beanutils</artifactId>
|
||||
<version>${commons-beanutils.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- google java library -->
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>${guava.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- jackson json -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-core</artifactId>
|
||||
<version>${jackson.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>${jackson.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
<version>${jackson.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.module</groupId>
|
||||
<artifactId>jackson-module-jaxb-annotations</artifactId>
|
||||
<version>${jackson.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- xstream xml -->
|
||||
<dependency>
|
||||
<groupId>com.thoughtworks.xstream</groupId>
|
||||
<artifactId>xstream</artifactId>
|
||||
<version>${xstream.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- pojo copy -->
|
||||
<dependency>
|
||||
<groupId>net.sf.dozer</groupId>
|
||||
<artifactId>dozer</artifactId>
|
||||
<version>${dozer.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- freemarker engine -->
|
||||
<dependency>
|
||||
<groupId>org.freemarker</groupId>
|
||||
<artifactId>freemarker</artifactId>
|
||||
<version>${freemarker.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- email -->
|
||||
<!-- <dependency>
|
||||
<groupId>javax.mail</groupId>
|
||||
<artifactId>mail</artifactId>
|
||||
<version>1.4.7</version>
|
||||
</dependency>-->
|
||||
<dependency>
|
||||
<groupId>javax.activation</groupId>
|
||||
<artifactId>activation</artifactId>
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- poi office -->
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi</artifactId>
|
||||
<version>${poi.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>${poi.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml-schemas</artifactId>
|
||||
<version>${poi.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-scratchpad</artifactId>
|
||||
<version>${poi.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-excelant</artifactId>
|
||||
<version>${poi.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- image util -->
|
||||
<dependency>
|
||||
<groupId>com.drewnoakes</groupId>
|
||||
<artifactId>metadata-extractor</artifactId>
|
||||
<version>2.6.2</version>
|
||||
</dependency>
|
||||
<!-- GENERAL UTILS end -->
|
||||
|
||||
|
||||
<!-- TEST begin -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.11</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<!-- TEST end -->
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.8.5</version>
|
||||
</dependency>
|
||||
|
||||
<!-- redis start -->
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
<version>2.9.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-redis</artifactId>
|
||||
<version>1.5.0.RELEASE</version>
|
||||
</dependency>
|
||||
<!-- redis end -->
|
||||
|
||||
<dependency>
|
||||
<groupId>joda-time</groupId>
|
||||
<artifactId>joda-time</artifactId>
|
||||
<version>2.9.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jfinal</groupId>
|
||||
<artifactId>jfinal</artifactId>
|
||||
<version>3.1</version>
|
||||
</dependency>
|
||||
<!--<dependency>
|
||||
<groupId>sf.common</groupId>
|
||||
<artifactId>sf-common</artifactId>
|
||||
<version>2.0.1</version>
|
||||
</dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.liyiorg</groupId>
|
||||
<artifactId>weixin-popular</artifactId>
|
||||
<version>2.8.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sf.json-lib</groupId>
|
||||
<artifactId>json-lib</artifactId>
|
||||
<version>2.4</version>
|
||||
<classifier>jdk15</classifier>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains</groupId>
|
||||
<artifactId>annotations-java5</artifactId>
|
||||
<version>RELEASE</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.flowable</groupId>
|
||||
<artifactId>flowable-engine</artifactId>
|
||||
<version>6.5.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.flowable</groupId>
|
||||
<artifactId>flowable-spring</artifactId>
|
||||
<version>6.5.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>RELEASE</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<outputDirectory>${project.basedir}/src/main/webapp/WEB-INF/classes/</outputDirectory>
|
||||
<plugins>
|
||||
<!-- Compiler 插件, 设定JDK版本 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.5.1</version>
|
||||
<configuration>
|
||||
<source>8</source>
|
||||
<target>8</target>
|
||||
<showWarnings>true</showWarnings>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- war 打包插件, 设定war包名称不带版本号 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>2.3</version>
|
||||
<configuration>
|
||||
<warName>${project.artifactId}</warName>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- Eclipse 插件 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-eclipse-plugin</artifactId>
|
||||
<version>2.9</version>
|
||||
<configuration>
|
||||
<downloadSources>${downloadSources}</downloadSources>
|
||||
<downloadJavadocs>false</downloadJavadocs>
|
||||
<wtpversion>2.0</wtpversion>
|
||||
<sourceIncludes>
|
||||
<sourceInclude>**/*.xml</sourceInclude>
|
||||
<sourceInclude>**/*.jsp</sourceInclude>
|
||||
</sourceIncludes>
|
||||
<additionalConfig>
|
||||
<file>
|
||||
<name>.settings/org.eclipse.core.resources.prefs</name>
|
||||
<content>
|
||||
<![CDATA[eclipse.preferences.version=1${line.separator}encoding/<project>=${project.build.sourceEncoding}${line.separator}]]>
|
||||
</content>
|
||||
</file>
|
||||
</additionalConfig>
|
||||
<additionalProjectnatures>
|
||||
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
|
||||
</additionalProjectnatures>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- 拷贝插件 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy</id>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.basedir}/src/main/webapp/WEB-INF/lib</outputDirectory>
|
||||
<excludeScope>provided</excludeScope>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- resource插件 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.5</version>
|
||||
</plugin>
|
||||
|
||||
<!-- install插件 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-install-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
</plugin>
|
||||
|
||||
<!-- clean插件 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<version>2.5</version>
|
||||
</plugin>
|
||||
|
||||
<!-- ant插件 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<version>1.7</version>
|
||||
</plugin>
|
||||
|
||||
<!-- dependency插件 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>2.5.1</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@ -0,0 +1,127 @@
|
||||
package com.baidu.ueditor;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.baidu.ueditor.define.ActionMap;
|
||||
import com.baidu.ueditor.define.AppInfo;
|
||||
import com.baidu.ueditor.define.BaseState;
|
||||
import com.baidu.ueditor.define.State;
|
||||
import com.baidu.ueditor.hunter.FileManager;
|
||||
import com.baidu.ueditor.hunter.ImageHunter;
|
||||
import com.baidu.ueditor.upload.Uploader;
|
||||
|
||||
public class ActionEnter {
|
||||
|
||||
private HttpServletRequest request = null;
|
||||
|
||||
private String rootPath = null;
|
||||
private String contextPath = null;
|
||||
|
||||
private String actionType = null;
|
||||
|
||||
private ConfigManager configManager = null;
|
||||
|
||||
public ActionEnter ( HttpServletRequest request, String rootPath ) {
|
||||
|
||||
this.request = request;
|
||||
this.rootPath = rootPath;
|
||||
this.actionType = request.getParameter( "action" );
|
||||
this.contextPath = request.getContextPath();
|
||||
this.configManager = ConfigManager.getInstance( this.rootPath, this.contextPath, request.getRequestURI() );
|
||||
|
||||
}
|
||||
|
||||
public String exec () {
|
||||
|
||||
String callbackName = this.request.getParameter("callback");
|
||||
|
||||
if ( callbackName != null ) {
|
||||
|
||||
if ( !validCallbackName( callbackName ) ) {
|
||||
return new BaseState( false, AppInfo.ILLEGAL ).toJSONString();
|
||||
}
|
||||
|
||||
return callbackName+"("+this.invoke()+");";
|
||||
|
||||
} else {
|
||||
return this.invoke();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public String invoke() {
|
||||
|
||||
if ( actionType == null || !ActionMap.mapping.containsKey( actionType ) ) {
|
||||
return new BaseState( false, AppInfo.INVALID_ACTION ).toJSONString();
|
||||
}
|
||||
|
||||
if ( this.configManager == null || !this.configManager.valid() ) {
|
||||
return new BaseState( false, AppInfo.CONFIG_ERROR ).toJSONString();
|
||||
}
|
||||
|
||||
State state = null;
|
||||
|
||||
int actionCode = ActionMap.getType( this.actionType );
|
||||
|
||||
Map<String, Object> conf = null;
|
||||
|
||||
switch ( actionCode ) {
|
||||
|
||||
case ActionMap.CONFIG:
|
||||
return this.configManager.getAllConfig().toString();
|
||||
|
||||
case ActionMap.UPLOAD_IMAGE:
|
||||
case ActionMap.UPLOAD_SCRAWL:
|
||||
case ActionMap.UPLOAD_VIDEO:
|
||||
case ActionMap.UPLOAD_FILE:
|
||||
conf = this.configManager.getConfig( actionCode );
|
||||
state = new Uploader( request, conf ).doExec();
|
||||
break;
|
||||
|
||||
case ActionMap.CATCH_IMAGE:
|
||||
conf = configManager.getConfig( actionCode );
|
||||
String[] list = this.request.getParameterValues( (String)conf.get( "fieldName" ) );
|
||||
state = new ImageHunter( conf ).capture( list );
|
||||
break;
|
||||
|
||||
case ActionMap.LIST_IMAGE:
|
||||
case ActionMap.LIST_FILE:
|
||||
conf = configManager.getConfig( actionCode );
|
||||
int start = this.getStartIndex();
|
||||
state = new FileManager( conf ).listFile( start );
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
return state.toJSONString();
|
||||
|
||||
}
|
||||
|
||||
public int getStartIndex () {
|
||||
|
||||
String start = this.request.getParameter( "start" );
|
||||
|
||||
try {
|
||||
return Integer.parseInt( start );
|
||||
} catch ( Exception e ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* callback参数验证
|
||||
*/
|
||||
public boolean validCallbackName ( String name ) {
|
||||
|
||||
if ( name.matches( "^[a-zA-Z_]+[\\w0-9_]*$" ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.baidu.ueditor;
|
||||
|
||||
public class Encoder {
|
||||
|
||||
public static String toUnicode ( String input ) {
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
char[] chars = input.toCharArray();
|
||||
|
||||
for ( char ch : chars ) {
|
||||
|
||||
if ( ch < 256 ) {
|
||||
builder.append( ch );
|
||||
} else {
|
||||
builder.append( "\\u" + Integer.toHexString( ch& 0xffff ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return builder.toString();
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,157 @@
|
||||
package com.baidu.ueditor;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class PathFormat {
|
||||
|
||||
private static final String TIME = "time";
|
||||
private static final String FULL_YEAR = "yyyy";
|
||||
private static final String YEAR = "yy";
|
||||
private static final String MONTH = "mm";
|
||||
private static final String DAY = "dd";
|
||||
private static final String HOUR = "hh";
|
||||
private static final String MINUTE = "ii";
|
||||
private static final String SECOND = "ss";
|
||||
private static final String RAND = "rand";
|
||||
|
||||
private static Date currentDate = null;
|
||||
|
||||
public static String parse ( String input ) {
|
||||
|
||||
Pattern pattern = Pattern.compile( "\\{([^\\}]+)\\}", Pattern.CASE_INSENSITIVE );
|
||||
Matcher matcher = pattern.matcher(input);
|
||||
|
||||
PathFormat.currentDate = new Date();
|
||||
|
||||
StringBuffer sb = new StringBuffer();
|
||||
|
||||
while ( matcher.find() ) {
|
||||
|
||||
matcher.appendReplacement(sb, PathFormat.getString( matcher.group( 1 ) ) );
|
||||
|
||||
}
|
||||
|
||||
matcher.appendTail(sb);
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 格式化路径, 把windows路径替换成标准路径
|
||||
* @param input 待格式化的路径
|
||||
* @return 格式化后的路径
|
||||
*/
|
||||
public static String format ( String input ) {
|
||||
|
||||
return input.replace( "\\", "/" );
|
||||
|
||||
}
|
||||
|
||||
public static String parse ( String input, String filename ) {
|
||||
|
||||
Pattern pattern = Pattern.compile( "\\{([^\\}]+)\\}", Pattern.CASE_INSENSITIVE );
|
||||
Matcher matcher = pattern.matcher(input);
|
||||
String matchStr = null;
|
||||
|
||||
PathFormat.currentDate = new Date();
|
||||
|
||||
StringBuffer sb = new StringBuffer();
|
||||
|
||||
while ( matcher.find() ) {
|
||||
|
||||
matchStr = matcher.group( 1 );
|
||||
if ( matchStr.indexOf( "filename" ) != -1 ) {
|
||||
filename = filename.replace( "$", "\\$" ).replaceAll( "[\\/:*?\"<>|]", "" );
|
||||
matcher.appendReplacement(sb, filename );
|
||||
} else {
|
||||
matcher.appendReplacement(sb, PathFormat.getString( matchStr ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
matcher.appendTail(sb);
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
private static String getString ( String pattern ) {
|
||||
|
||||
pattern = pattern.toLowerCase();
|
||||
|
||||
// time 处理
|
||||
if ( pattern.indexOf( PathFormat.TIME ) != -1 ) {
|
||||
return PathFormat.getTimestamp();
|
||||
} else if ( pattern.indexOf( PathFormat.FULL_YEAR ) != -1 ) {
|
||||
return PathFormat.getFullYear();
|
||||
} else if ( pattern.indexOf( PathFormat.YEAR ) != -1 ) {
|
||||
return PathFormat.getYear();
|
||||
} else if ( pattern.indexOf( PathFormat.MONTH ) != -1 ) {
|
||||
return PathFormat.getMonth();
|
||||
} else if ( pattern.indexOf( PathFormat.DAY ) != -1 ) {
|
||||
return PathFormat.getDay();
|
||||
} else if ( pattern.indexOf( PathFormat.HOUR ) != -1 ) {
|
||||
return PathFormat.getHour();
|
||||
} else if ( pattern.indexOf( PathFormat.MINUTE ) != -1 ) {
|
||||
return PathFormat.getMinute();
|
||||
} else if ( pattern.indexOf( PathFormat.SECOND ) != -1 ) {
|
||||
return PathFormat.getSecond();
|
||||
} else if ( pattern.indexOf( PathFormat.RAND ) != -1 ) {
|
||||
return PathFormat.getRandom( pattern );
|
||||
}
|
||||
|
||||
return pattern;
|
||||
|
||||
}
|
||||
|
||||
private static String getTimestamp () {
|
||||
return System.currentTimeMillis() + "";
|
||||
}
|
||||
|
||||
private static String getFullYear () {
|
||||
return new SimpleDateFormat( "yyyy" ).format( PathFormat.currentDate );
|
||||
}
|
||||
|
||||
private static String getYear () {
|
||||
return new SimpleDateFormat( "yy" ).format( PathFormat.currentDate );
|
||||
}
|
||||
|
||||
private static String getMonth () {
|
||||
return new SimpleDateFormat( "MM" ).format( PathFormat.currentDate );
|
||||
}
|
||||
|
||||
private static String getDay () {
|
||||
return new SimpleDateFormat( "dd" ).format( PathFormat.currentDate );
|
||||
}
|
||||
|
||||
private static String getHour () {
|
||||
return new SimpleDateFormat( "HH" ).format( PathFormat.currentDate );
|
||||
}
|
||||
|
||||
private static String getMinute () {
|
||||
return new SimpleDateFormat( "mm" ).format( PathFormat.currentDate );
|
||||
}
|
||||
|
||||
private static String getSecond () {
|
||||
return new SimpleDateFormat( "ss" ).format( PathFormat.currentDate );
|
||||
}
|
||||
|
||||
private static String getRandom ( String pattern ) {
|
||||
|
||||
int length = 0;
|
||||
pattern = pattern.split( ":" )[ 1 ].trim();
|
||||
|
||||
length = Integer.parseInt( pattern );
|
||||
|
||||
return ( Math.random() + "" ).replace( ".", "" ).substring( 0, length );
|
||||
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package com.baidu.ueditor.define;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* 定义请求action类型
|
||||
* @author hancong03@baidu.com
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public final class ActionMap {
|
||||
|
||||
public static final Map<String, Integer> mapping;
|
||||
// 获取配置请求
|
||||
public static final int CONFIG = 0;
|
||||
public static final int UPLOAD_IMAGE = 1;
|
||||
public static final int UPLOAD_SCRAWL = 2;
|
||||
public static final int UPLOAD_VIDEO = 3;
|
||||
public static final int UPLOAD_FILE = 4;
|
||||
public static final int CATCH_IMAGE = 5;
|
||||
public static final int LIST_FILE = 6;
|
||||
public static final int LIST_IMAGE = 7;
|
||||
|
||||
static {
|
||||
mapping = new HashMap<String, Integer>(){{
|
||||
put( "config", ActionMap.CONFIG );
|
||||
put( "uploadimage", ActionMap.UPLOAD_IMAGE );
|
||||
put( "uploadscrawl", ActionMap.UPLOAD_SCRAWL );
|
||||
put( "uploadvideo", ActionMap.UPLOAD_VIDEO );
|
||||
put( "uploadfile", ActionMap.UPLOAD_FILE );
|
||||
put( "catchimage", ActionMap.CATCH_IMAGE );
|
||||
put( "listfile", ActionMap.LIST_FILE );
|
||||
put( "listimage", ActionMap.LIST_IMAGE );
|
||||
}};
|
||||
}
|
||||
|
||||
public static int getType ( String key ) {
|
||||
return ActionMap.mapping.get( key );
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
package com.baidu.ueditor.define;
|
||||
|
||||
public enum ActionState {
|
||||
UNKNOW_ERROR
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package com.baidu.ueditor.define;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public final class AppInfo {
|
||||
|
||||
public static final int SUCCESS = 0;
|
||||
public static final int MAX_SIZE = 1;
|
||||
public static final int PERMISSION_DENIED = 2;
|
||||
public static final int FAILED_CREATE_FILE = 3;
|
||||
public static final int IO_ERROR = 4;
|
||||
public static final int NOT_MULTIPART_CONTENT = 5;
|
||||
public static final int PARSE_REQUEST_ERROR = 6;
|
||||
public static final int NOTFOUND_UPLOAD_DATA = 7;
|
||||
public static final int NOT_ALLOW_FILE_TYPE = 8;
|
||||
|
||||
public static final int INVALID_ACTION = 101;
|
||||
public static final int CONFIG_ERROR = 102;
|
||||
|
||||
public static final int PREVENT_HOST = 201;
|
||||
public static final int CONNECTION_ERROR = 202;
|
||||
public static final int REMOTE_FAIL = 203;
|
||||
|
||||
public static final int NOT_DIRECTORY = 301;
|
||||
public static final int NOT_EXIST = 302;
|
||||
|
||||
public static final int ILLEGAL = 401;
|
||||
|
||||
public static Map<Integer, String> info = new HashMap<Integer, String>(){{
|
||||
|
||||
put( AppInfo.SUCCESS, "SUCCESS" );
|
||||
|
||||
// 无效的Action
|
||||
put( AppInfo.INVALID_ACTION, "\u65E0\u6548\u7684Action" );
|
||||
// 配置文件初始化失败
|
||||
put( AppInfo.CONFIG_ERROR, "\u914D\u7F6E\u6587\u4EF6\u521D\u59CB\u5316\u5931\u8D25" );
|
||||
// 抓取远程图片失败
|
||||
put( AppInfo.REMOTE_FAIL, "\u6293\u53D6\u8FDC\u7A0B\u56FE\u7247\u5931\u8D25" );
|
||||
|
||||
// 被阻止的远程主机
|
||||
put( AppInfo.PREVENT_HOST, "\u88AB\u963B\u6B62\u7684\u8FDC\u7A0B\u4E3B\u673A" );
|
||||
// 远程连接出错
|
||||
put( AppInfo.CONNECTION_ERROR, "\u8FDC\u7A0B\u8FDE\u63A5\u51FA\u9519" );
|
||||
|
||||
// "文件大小超出限制"
|
||||
put( AppInfo.MAX_SIZE, "\u6587\u4ef6\u5927\u5c0f\u8d85\u51fa\u9650\u5236" );
|
||||
// 权限不足, 多指写权限
|
||||
put( AppInfo.PERMISSION_DENIED, "\u6743\u9650\u4E0D\u8DB3" );
|
||||
// 创建文件失败
|
||||
put( AppInfo.FAILED_CREATE_FILE, "\u521B\u5EFA\u6587\u4EF6\u5931\u8D25" );
|
||||
// IO错误
|
||||
put( AppInfo.IO_ERROR, "IO\u9519\u8BEF" );
|
||||
// 上传表单不是multipart/form-data类型
|
||||
put( AppInfo.NOT_MULTIPART_CONTENT, "\u4E0A\u4F20\u8868\u5355\u4E0D\u662Fmultipart/form-data\u7C7B\u578B" );
|
||||
// 解析上传表单错误
|
||||
put( AppInfo.PARSE_REQUEST_ERROR, "\u89E3\u6790\u4E0A\u4F20\u8868\u5355\u9519\u8BEF" );
|
||||
// 未找到上传数据
|
||||
put( AppInfo.NOTFOUND_UPLOAD_DATA, "\u672A\u627E\u5230\u4E0A\u4F20\u6570\u636E" );
|
||||
// 不允许的文件类型
|
||||
put( AppInfo.NOT_ALLOW_FILE_TYPE, "\u4E0D\u5141\u8BB8\u7684\u6587\u4EF6\u7C7B\u578B" );
|
||||
|
||||
// 指定路径不是目录
|
||||
put( AppInfo.NOT_DIRECTORY, "\u6307\u5B9A\u8DEF\u5F84\u4E0D\u662F\u76EE\u5F55" );
|
||||
// 指定路径并不存在
|
||||
put( AppInfo.NOT_EXIST, "\u6307\u5B9A\u8DEF\u5F84\u5E76\u4E0D\u5B58\u5728" );
|
||||
|
||||
// callback参数名不合法
|
||||
put( AppInfo.ILLEGAL, "Callback\u53C2\u6570\u540D\u4E0D\u5408\u6CD5" );
|
||||
|
||||
}};
|
||||
|
||||
public static String getStateInfo ( int key ) {
|
||||
return AppInfo.info.get( key );
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,90 @@
|
||||
package com.baidu.ueditor.define;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baidu.ueditor.Encoder;
|
||||
|
||||
public class BaseState implements State {
|
||||
|
||||
private boolean state = false;
|
||||
private String info = null;
|
||||
|
||||
private Map<String, String> infoMap = new HashMap<String, String>();
|
||||
|
||||
public BaseState () {
|
||||
this.state = true;
|
||||
}
|
||||
|
||||
public BaseState ( boolean state ) {
|
||||
this.setState( state );
|
||||
}
|
||||
|
||||
public BaseState ( boolean state, String info ) {
|
||||
this.setState( state );
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public BaseState ( boolean state, int infoCode ) {
|
||||
this.setState( state );
|
||||
this.info = AppInfo.getStateInfo( infoCode );
|
||||
}
|
||||
|
||||
public boolean isSuccess () {
|
||||
return this.state;
|
||||
}
|
||||
|
||||
public void setState ( boolean state ) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public void setInfo ( String info ) {
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public void setInfo ( int infoCode ) {
|
||||
this.info = AppInfo.getStateInfo( infoCode );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toJSONString() {
|
||||
return this.toString();
|
||||
}
|
||||
|
||||
public String toString () {
|
||||
|
||||
String key = null;
|
||||
String stateVal = this.isSuccess() ? AppInfo.getStateInfo( AppInfo.SUCCESS ) : this.info;
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
builder.append( "{\"state\": \"" + stateVal + "\"" );
|
||||
|
||||
Iterator<String> iterator = this.infoMap.keySet().iterator();
|
||||
|
||||
while ( iterator.hasNext() ) {
|
||||
|
||||
key = iterator.next();
|
||||
|
||||
builder.append( ",\"" + key + "\": \"" + this.infoMap.get(key) + "\"" );
|
||||
|
||||
}
|
||||
|
||||
builder.append( "}" );
|
||||
|
||||
return Encoder.toUnicode( builder.toString() );
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putInfo(String name, String val) {
|
||||
this.infoMap.put(name, val);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putInfo(String name, long val) {
|
||||
this.putInfo(name, val+"");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.baidu.ueditor.define;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class FileType {
|
||||
|
||||
public static final String JPG = "JPG";
|
||||
|
||||
private static final Map<String, String> types = new HashMap<String, String>(){{
|
||||
|
||||
put( FileType.JPG, ".jpg" );
|
||||
|
||||
}};
|
||||
|
||||
public static String getSuffix ( String key ) {
|
||||
return FileType.types.get( key );
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据给定的文件名,获取其后缀信息
|
||||
* @param filename
|
||||
* @return
|
||||
*/
|
||||
public static String getSuffixByFilename ( String filename ) {
|
||||
|
||||
return filename.substring( filename.lastIndexOf( "." ) ).toLowerCase();
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.baidu.ueditor.define;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class MIMEType {
|
||||
|
||||
public static final Map<String, String> types = new HashMap<String, String>(){{
|
||||
put( "image/gif", ".gif" );
|
||||
put( "image/jpeg", ".jpg" );
|
||||
put( "image/jpg", ".jpg" );
|
||||
put( "image/png", ".png" );
|
||||
put( "image/bmp", ".bmp" );
|
||||
}};
|
||||
|
||||
public static String getSuffix ( String mime ) {
|
||||
return MIMEType.types.get( mime );
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,112 @@
|
||||
package com.baidu.ueditor.define;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baidu.ueditor.Encoder;
|
||||
|
||||
/**
|
||||
* 多状态集合状态
|
||||
* 其包含了多个状态的集合, 其本身自己也是一个状态
|
||||
* @author hancong03@baidu.com
|
||||
*
|
||||
*/
|
||||
public class MultiState implements State {
|
||||
|
||||
private boolean state = false;
|
||||
private String info = null;
|
||||
private Map<String, Long> intMap = new HashMap<String, Long>();
|
||||
private Map<String, String> infoMap = new HashMap<String, String>();
|
||||
private List<String> stateList = new ArrayList<String>();
|
||||
|
||||
public MultiState ( boolean state ) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public MultiState ( boolean state, String info ) {
|
||||
this.state = state;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public MultiState ( boolean state, int infoKey ) {
|
||||
this.state = state;
|
||||
this.info = AppInfo.getStateInfo( infoKey );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSuccess() {
|
||||
return this.state;
|
||||
}
|
||||
|
||||
public void addState ( State state ) {
|
||||
stateList.add( state.toJSONString() );
|
||||
}
|
||||
|
||||
/**
|
||||
* 该方法调用无效果
|
||||
*/
|
||||
@Override
|
||||
public void putInfo(String name, String val) {
|
||||
this.infoMap.put(name, val);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toJSONString() {
|
||||
|
||||
String stateVal = this.isSuccess() ? AppInfo.getStateInfo( AppInfo.SUCCESS ) : this.info;
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
builder.append( "{\"state\": \"" + stateVal + "\"" );
|
||||
|
||||
// 数字转换
|
||||
Iterator<String> iterator = this.intMap.keySet().iterator();
|
||||
|
||||
while ( iterator.hasNext() ) {
|
||||
|
||||
stateVal = iterator.next();
|
||||
|
||||
builder.append( ",\""+ stateVal +"\": " + this.intMap.get( stateVal ) );
|
||||
|
||||
}
|
||||
|
||||
iterator = this.infoMap.keySet().iterator();
|
||||
|
||||
while ( iterator.hasNext() ) {
|
||||
|
||||
stateVal = iterator.next();
|
||||
|
||||
builder.append( ",\""+ stateVal +"\": \"" + this.infoMap.get( stateVal ) + "\"" );
|
||||
|
||||
}
|
||||
|
||||
builder.append( ", list: [" );
|
||||
|
||||
|
||||
iterator = this.stateList.iterator();
|
||||
|
||||
while ( iterator.hasNext() ) {
|
||||
|
||||
builder.append( iterator.next() + "," );
|
||||
|
||||
}
|
||||
|
||||
if ( this.stateList.size() > 0 ) {
|
||||
builder.deleteCharAt( builder.length() - 1 );
|
||||
}
|
||||
|
||||
builder.append( " ]}" );
|
||||
|
||||
return Encoder.toUnicode( builder.toString() );
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putInfo(String name, long val) {
|
||||
this.intMap.put( name, val );
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.baidu.ueditor.define;
|
||||
|
||||
/**
|
||||
* 处理状态接口
|
||||
* @author hancong03@baidu.com
|
||||
*
|
||||
*/
|
||||
public interface State {
|
||||
|
||||
public boolean isSuccess ();
|
||||
|
||||
public void putInfo( String name, String val );
|
||||
|
||||
public void putInfo ( String name, long val );
|
||||
|
||||
public String toJSONString ();
|
||||
|
||||
}
|
@ -0,0 +1,112 @@
|
||||
package com.baidu.ueditor.hunter;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import com.baidu.ueditor.PathFormat;
|
||||
import com.baidu.ueditor.define.AppInfo;
|
||||
import com.baidu.ueditor.define.BaseState;
|
||||
import com.baidu.ueditor.define.MultiState;
|
||||
import com.baidu.ueditor.define.State;
|
||||
|
||||
public class FileManager {
|
||||
|
||||
private String dir = null;
|
||||
private String rootPath = null;
|
||||
private String[] allowFiles = null;
|
||||
private int count = 0;
|
||||
|
||||
public FileManager ( Map<String, Object> conf ) {
|
||||
|
||||
this.rootPath = (String)conf.get( "rootPath" );
|
||||
this.dir = this.rootPath + (String)conf.get( "dir" );
|
||||
this.allowFiles = this.getAllowFiles( conf.get("allowFiles") );
|
||||
this.count = (Integer)conf.get( "count" );
|
||||
|
||||
}
|
||||
|
||||
public State listFile ( int index ) {
|
||||
|
||||
File dir = new File( this.dir );
|
||||
State state = null;
|
||||
|
||||
if ( !dir.exists() ) {
|
||||
return new BaseState( false, AppInfo.NOT_EXIST );
|
||||
}
|
||||
|
||||
if ( !dir.isDirectory() ) {
|
||||
return new BaseState( false, AppInfo.NOT_DIRECTORY );
|
||||
}
|
||||
|
||||
Collection<File> list = FileUtils.listFiles( dir, this.allowFiles, true );
|
||||
|
||||
if ( index < 0 || index > list.size() ) {
|
||||
state = new MultiState( true );
|
||||
} else {
|
||||
Object[] fileList = Arrays.copyOfRange( list.toArray(), index, index + this.count );
|
||||
state = this.getState( fileList );
|
||||
}
|
||||
|
||||
state.putInfo( "start", index );
|
||||
state.putInfo( "total", list.size() );
|
||||
|
||||
return state;
|
||||
|
||||
}
|
||||
|
||||
private State getState ( Object[] files ) {
|
||||
|
||||
MultiState state = new MultiState( true );
|
||||
BaseState fileState = null;
|
||||
|
||||
File file = null;
|
||||
|
||||
for ( Object obj : files ) {
|
||||
if ( obj == null ) {
|
||||
break;
|
||||
}
|
||||
file = (File)obj;
|
||||
fileState = new BaseState( true );
|
||||
fileState.putInfo( "url", PathFormat.format( this.getPath( file ) ) );
|
||||
state.addState( fileState );
|
||||
}
|
||||
|
||||
return state;
|
||||
|
||||
}
|
||||
|
||||
private String getPath ( File file ) {
|
||||
|
||||
String path = file.getAbsolutePath();
|
||||
|
||||
return path.replace( this.rootPath, "/" );
|
||||
|
||||
}
|
||||
|
||||
private String[] getAllowFiles ( Object fileExt ) {
|
||||
|
||||
String[] exts = null;
|
||||
String ext = null;
|
||||
|
||||
if ( fileExt == null ) {
|
||||
return new String[ 0 ];
|
||||
}
|
||||
|
||||
exts = (String[])fileExt;
|
||||
|
||||
for ( int i = 0, len = exts.length; i < len; i++ ) {
|
||||
|
||||
ext = exts[ i ];
|
||||
exts[ i ] = ext.replace( ".", "" );
|
||||
|
||||
}
|
||||
|
||||
return exts;
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,133 @@
|
||||
package com.baidu.ueditor.hunter;
|
||||
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baidu.ueditor.PathFormat;
|
||||
import com.baidu.ueditor.define.AppInfo;
|
||||
import com.baidu.ueditor.define.BaseState;
|
||||
import com.baidu.ueditor.define.MIMEType;
|
||||
import com.baidu.ueditor.define.MultiState;
|
||||
import com.baidu.ueditor.define.State;
|
||||
import com.baidu.ueditor.upload.StorageManager;
|
||||
|
||||
/**
|
||||
* 图片抓取器
|
||||
* @author hancong03@baidu.com
|
||||
*
|
||||
*/
|
||||
public class ImageHunter {
|
||||
|
||||
private String filename = null;
|
||||
private String savePath = null;
|
||||
private String rootPath = null;
|
||||
private List<String> allowTypes = null;
|
||||
private long maxSize = -1;
|
||||
|
||||
private List<String> filters = null;
|
||||
|
||||
public ImageHunter ( Map<String, Object> conf ) {
|
||||
|
||||
this.filename = (String)conf.get( "filename" );
|
||||
this.savePath = (String)conf.get( "savePath" );
|
||||
this.rootPath = (String)conf.get( "rootPath" );
|
||||
this.maxSize = (Long)conf.get( "maxSize" );
|
||||
this.allowTypes = Arrays.asList( (String[])conf.get( "allowFiles" ) );
|
||||
this.filters = Arrays.asList( (String[])conf.get( "filter" ) );
|
||||
|
||||
}
|
||||
|
||||
public State capture ( String[] list ) {
|
||||
|
||||
MultiState state = new MultiState( true );
|
||||
|
||||
for ( String source : list ) {
|
||||
state.addState( captureRemoteData( source ) );
|
||||
}
|
||||
|
||||
return state;
|
||||
|
||||
}
|
||||
|
||||
public State captureRemoteData ( String urlStr ) {
|
||||
|
||||
HttpURLConnection connection = null;
|
||||
URL url = null;
|
||||
String suffix = null;
|
||||
|
||||
try {
|
||||
url = new URL( urlStr );
|
||||
|
||||
if ( !validHost( url.getHost() ) ) {
|
||||
return new BaseState( false, AppInfo.PREVENT_HOST );
|
||||
}
|
||||
|
||||
connection = (HttpURLConnection) url.openConnection();
|
||||
|
||||
connection.setInstanceFollowRedirects( true );
|
||||
connection.setUseCaches( true );
|
||||
|
||||
if ( !validContentState( connection.getResponseCode() ) ) {
|
||||
return new BaseState( false, AppInfo.CONNECTION_ERROR );
|
||||
}
|
||||
|
||||
suffix = MIMEType.getSuffix( connection.getContentType() );
|
||||
|
||||
if ( !validFileType( suffix ) ) {
|
||||
return new BaseState( false, AppInfo.NOT_ALLOW_FILE_TYPE );
|
||||
}
|
||||
|
||||
if ( !validFileSize( connection.getContentLength() ) ) {
|
||||
return new BaseState( false, AppInfo.MAX_SIZE );
|
||||
}
|
||||
|
||||
String savePath = this.getPath( this.savePath, this.filename, suffix );
|
||||
String physicalPath = this.rootPath + savePath;
|
||||
|
||||
State state = StorageManager.saveFileByInputStream( connection.getInputStream(), physicalPath );
|
||||
|
||||
if ( state.isSuccess() ) {
|
||||
// state.putInfo( "url", st);
|
||||
state.putInfo( "source", urlStr );
|
||||
}
|
||||
|
||||
return state;
|
||||
|
||||
} catch ( Exception e ) {
|
||||
return new BaseState( false, AppInfo.REMOTE_FAIL );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private String getPath ( String savePath, String filename, String suffix ) {
|
||||
|
||||
return PathFormat.parse( savePath + suffix, filename );
|
||||
|
||||
}
|
||||
|
||||
private boolean validHost ( String hostname ) {
|
||||
|
||||
return !filters.contains( hostname );
|
||||
|
||||
}
|
||||
|
||||
private boolean validContentState ( int code ) {
|
||||
|
||||
return HttpURLConnection.HTTP_OK == code;
|
||||
|
||||
}
|
||||
|
||||
private boolean validFileType ( String type ) {
|
||||
|
||||
return this.allowTypes.contains( type );
|
||||
|
||||
}
|
||||
|
||||
private boolean validFileSize ( int size ) {
|
||||
return size < this.maxSize;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.baidu.ueditor.upload;
|
||||
|
||||
import com.baidu.ueditor.PathFormat;
|
||||
import com.baidu.ueditor.define.AppInfo;
|
||||
import com.baidu.ueditor.define.BaseState;
|
||||
import com.baidu.ueditor.define.FileType;
|
||||
import com.baidu.ueditor.define.State;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
|
||||
public final class Base64Uploader {
|
||||
|
||||
public static State save(String content, Map<String, Object> conf) {
|
||||
|
||||
byte[] data = decode(content);
|
||||
|
||||
long maxSize = ((Long) conf.get("maxSize")).longValue();
|
||||
|
||||
if (!validSize(data, maxSize)) {
|
||||
return new BaseState(false, AppInfo.MAX_SIZE);
|
||||
}
|
||||
|
||||
String suffix = FileType.getSuffix("JPG");
|
||||
|
||||
String savePath = PathFormat.parse((String) conf.get("savePath"),
|
||||
(String) conf.get("filename"));
|
||||
|
||||
savePath = savePath + suffix;
|
||||
String physicalPath = (String) conf.get("rootPath") + savePath;
|
||||
|
||||
State storageState = StorageManager.saveBinaryFile(data, physicalPath);
|
||||
|
||||
if (storageState.isSuccess()) {
|
||||
storageState.putInfo("url", PathFormat.format(savePath));
|
||||
storageState.putInfo("type", suffix);
|
||||
storageState.putInfo("original", "");
|
||||
}
|
||||
|
||||
return storageState;
|
||||
}
|
||||
|
||||
private static byte[] decode(String content) {
|
||||
return Base64.decodeBase64(content);
|
||||
}
|
||||
|
||||
private static boolean validSize(byte[] data, long length) {
|
||||
return data.length <= length;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
package com.baidu.ueditor.upload;
|
||||
|
||||
import com.baidu.ueditor.PathFormat;
|
||||
import com.baidu.ueditor.define.AppInfo;
|
||||
import com.baidu.ueditor.define.BaseState;
|
||||
import com.baidu.ueditor.define.FileType;
|
||||
import com.baidu.ueditor.define.State;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import org.apache.commons.fileupload.FileItemIterator;
|
||||
import org.apache.commons.fileupload.FileItemStream;
|
||||
import org.apache.commons.fileupload.FileUploadException;
|
||||
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
|
||||
import org.apache.commons.fileupload.servlet.ServletFileUpload;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
public class BinaryUploader {
|
||||
|
||||
public static final State save(HttpServletRequest request,
|
||||
Map<String, Object> conf) {
|
||||
FileItemStream fileStream = null;
|
||||
boolean isAjaxUpload = request.getHeader( "X_Requested_With" ) != null;
|
||||
|
||||
if (!ServletFileUpload.isMultipartContent(request)) {
|
||||
return new BaseState(false, AppInfo.NOT_MULTIPART_CONTENT);
|
||||
}
|
||||
|
||||
ServletFileUpload upload = new ServletFileUpload(
|
||||
new DiskFileItemFactory());
|
||||
|
||||
if ( isAjaxUpload ) {
|
||||
upload.setHeaderEncoding( "UTF-8" );
|
||||
}
|
||||
|
||||
try {
|
||||
FileItemIterator iterator = upload.getItemIterator(request);
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
fileStream = iterator.next();
|
||||
|
||||
if (!fileStream.isFormField())
|
||||
break;
|
||||
fileStream = null;
|
||||
}
|
||||
|
||||
if (fileStream == null) {
|
||||
return new BaseState(false, AppInfo.NOTFOUND_UPLOAD_DATA);
|
||||
}
|
||||
|
||||
String savePath = (String) conf.get("savePath");
|
||||
String originFileName = fileStream.getName();
|
||||
String suffix = FileType.getSuffixByFilename(originFileName);
|
||||
|
||||
originFileName = originFileName.substring(0,
|
||||
originFileName.length() - suffix.length());
|
||||
savePath = savePath + suffix;
|
||||
|
||||
long maxSize = ((Long) conf.get("maxSize")).longValue();
|
||||
|
||||
if (!validType(suffix, (String[]) conf.get("allowFiles"))) {
|
||||
return new BaseState(false, AppInfo.NOT_ALLOW_FILE_TYPE);
|
||||
}
|
||||
|
||||
savePath = PathFormat.parse(savePath, originFileName);
|
||||
|
||||
String physicalPath = (String) conf.get("rootPath") + savePath;
|
||||
|
||||
InputStream is = fileStream.openStream();
|
||||
State storageState = StorageManager.saveFileByInputStream(is,
|
||||
physicalPath, maxSize);
|
||||
is.close();
|
||||
|
||||
if (storageState.isSuccess()) {
|
||||
Map jsonMap = new Gson().fromJson(storageState.toJSONString(), Map.class);
|
||||
//String url = JSONObject.fromObject(storageState.toJSONString()).getString("url");
|
||||
String url = String.valueOf(jsonMap.get("url"));
|
||||
if(StringUtils.isNotBlank(url)){
|
||||
storageState.putInfo("url", url);
|
||||
}else{
|
||||
storageState.putInfo("url", PathFormat.format(savePath));
|
||||
}
|
||||
storageState.putInfo("type", suffix);
|
||||
storageState.putInfo("original", originFileName + suffix);
|
||||
}
|
||||
|
||||
return storageState;
|
||||
} catch (FileUploadException e) {
|
||||
return new BaseState(false, AppInfo.PARSE_REQUEST_ERROR);
|
||||
} catch (IOException e) {
|
||||
}
|
||||
return new BaseState(false, AppInfo.IO_ERROR);
|
||||
}
|
||||
|
||||
private static boolean validType(String type, String[] allowTypes) {
|
||||
List<String> list = Arrays.asList(allowTypes);
|
||||
|
||||
return list.contains(type);
|
||||
}
|
||||
}
|
@ -0,0 +1,200 @@
|
||||
package com.baidu.ueditor.upload;
|
||||
|
||||
import com.baidu.ueditor.define.AppInfo;
|
||||
import com.baidu.ueditor.define.BaseState;
|
||||
import com.baidu.ueditor.define.State;
|
||||
|
||||
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import com.sifang.modules.alioss.AliyunOSSClientUtil;
|
||||
import com.sifang.modules.sunshine.SystemSetting.utils.StringUtil;
|
||||
import com.sifang.modules.sys.common.utils.SpringContextHolder;
|
||||
import com.sifang.modules.sys.util.IOUtil;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
public class StorageManager {
|
||||
public static final int BUFFER_SIZE = 8192;
|
||||
|
||||
public StorageManager() {
|
||||
}
|
||||
|
||||
public static State saveBinaryFile(byte[] data, String path) {
|
||||
File file = new File(path);
|
||||
|
||||
State state = valid(file);
|
||||
|
||||
if (!state.isSuccess()) {
|
||||
return state;
|
||||
}
|
||||
|
||||
try {
|
||||
BufferedOutputStream bos = new BufferedOutputStream(
|
||||
new FileOutputStream(file));
|
||||
bos.write(data);
|
||||
bos.flush();
|
||||
bos.close();
|
||||
|
||||
} catch (IOException ioe) {
|
||||
return new BaseState(false, AppInfo.IO_ERROR);
|
||||
}
|
||||
|
||||
state = new BaseState(true, file.getAbsolutePath());
|
||||
state.putInfo( "size", data.length );
|
||||
state.putInfo( "title", file.getName() );
|
||||
|
||||
state = saveSfFiles(IOUtil.byte2InputStream(data), path);
|
||||
System.out.println(state.toJSONString());
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
public static State saveFileByInputStream(InputStream is, String path,
|
||||
long maxSize) {
|
||||
State state = null;
|
||||
|
||||
File tmpFile = getTmpFile();
|
||||
|
||||
//byte[] dataBuf = new byte[ 2048 ];
|
||||
//BufferedInputStream bis = new BufferedInputStream(is, StorageManager.BUFFER_SIZE);
|
||||
|
||||
try {
|
||||
/*BufferedOutputStream bos = new BufferedOutputStream(
|
||||
new FileOutputStream(tmpFile), StorageManager.BUFFER_SIZE);
|
||||
|
||||
int count = 0;
|
||||
while ((count = bis.read(dataBuf)) != -1) {
|
||||
bos.write(dataBuf, 0, count);
|
||||
}
|
||||
bos.flush();
|
||||
bos.close();
|
||||
|
||||
if (tmpFile.length() > maxSize) {
|
||||
tmpFile.delete();
|
||||
return new BaseState(false, AppInfo.MAX_SIZE);
|
||||
}*/
|
||||
|
||||
//state = saveTmpFile(tmpFile, path);
|
||||
state = saveSfFiles(is, path);
|
||||
System.out.println(state.toJSONString());
|
||||
|
||||
if (!state.isSuccess()) {
|
||||
tmpFile.delete();
|
||||
}
|
||||
|
||||
return state;
|
||||
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return new BaseState(false, AppInfo.IO_ERROR);
|
||||
}
|
||||
|
||||
public static State saveFileByInputStream(InputStream is, String path) {
|
||||
State state = null;
|
||||
|
||||
File tmpFile = getTmpFile();
|
||||
|
||||
//byte[] dataBuf = new byte[ 2048 ];
|
||||
//BufferedInputStream bis = new BufferedInputStream(is, StorageManager.BUFFER_SIZE);
|
||||
|
||||
try {
|
||||
/*BufferedOutputStream bos = new BufferedOutputStream(
|
||||
new FileOutputStream(tmpFile), StorageManager.BUFFER_SIZE);
|
||||
|
||||
int count = 0;
|
||||
while ((count = bis.read(dataBuf)) != -1) {
|
||||
bos.write(dataBuf, 0, count);
|
||||
}
|
||||
bos.flush();
|
||||
bos.close();*/
|
||||
|
||||
//state = saveTmpFile(tmpFile, path);
|
||||
state = saveSfFiles(is, path);
|
||||
System.out.println(state.toJSONString());
|
||||
|
||||
if (!state.isSuccess()) {
|
||||
tmpFile.delete();
|
||||
}
|
||||
|
||||
return state;
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return new BaseState(false, AppInfo.IO_ERROR);
|
||||
}
|
||||
|
||||
private static File getTmpFile() {
|
||||
File tmpDir = FileUtils.getTempDirectory();
|
||||
String tmpFileName = (Math.random() * 10000 + "").replace(".", "");
|
||||
return new File(tmpDir, tmpFileName);
|
||||
}
|
||||
|
||||
private static State saveTmpFile(File tmpFile, String path) {
|
||||
State state = null;
|
||||
File targetFile = new File(path);
|
||||
|
||||
if (targetFile.canWrite()) {
|
||||
return new BaseState(false, AppInfo.PERMISSION_DENIED);
|
||||
}
|
||||
try {
|
||||
FileUtils.moveFile(tmpFile, targetFile);
|
||||
} catch (IOException e) {
|
||||
return new BaseState(false, AppInfo.IO_ERROR);
|
||||
}
|
||||
|
||||
state = new BaseState(true);
|
||||
state.putInfo( "size", targetFile.length() );
|
||||
state.putInfo( "title", targetFile.getName() );
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
private static State valid(File file) {
|
||||
File parentPath = file.getParentFile();
|
||||
|
||||
if ((!parentPath.exists()) && (!parentPath.mkdirs())) {
|
||||
return new BaseState(false, AppInfo.FAILED_CREATE_FILE);
|
||||
}
|
||||
|
||||
if (!parentPath.canWrite()) {
|
||||
return new BaseState(false, AppInfo.PERMISSION_DENIED);
|
||||
}
|
||||
|
||||
return new BaseState(true);
|
||||
}
|
||||
|
||||
public static State saveSfFiles(InputStream is, String path){
|
||||
State state = null;
|
||||
|
||||
String extName = StringUtil.getFileExtName(path);
|
||||
|
||||
try {
|
||||
//String webPath = ContextLoader.getCurrentWebApplicationContext().getServletContext().getRealPath("/");
|
||||
/*File tempDir = new File(webPath + File.separator + "temp");
|
||||
if (!tempDir.exists()) {
|
||||
tempDir.mkdirs();
|
||||
}
|
||||
String tempFilePath = tempDir.getAbsolutePath() + File.separator + IdGen.uuid() + "." + extName;
|
||||
ImageUtil.compressImage(is, tempFilePath, 1024);
|
||||
File tempFile = new File(tempFilePath);*/
|
||||
byte[] isByte = IOUtil.in2byte(is);
|
||||
String fileInfo = AliyunOSSClientUtil.uploadImage(isByte, extName,"");
|
||||
/*if(StringUtils.isNotBlank(fileInfo.getPath())){
|
||||
//上传成功,需要删除临时文件
|
||||
FileUtils.deleteQuietly(tempFile);
|
||||
System.out.println(fileInfo.toString());
|
||||
}*/
|
||||
state = new BaseState(true);
|
||||
state.putInfo( "size", isByte.length);
|
||||
state.putInfo( "title", "");
|
||||
state.putInfo("url", StringUtil.trasferBackslash(fileInfo));
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
state = new BaseState(false);
|
||||
}
|
||||
return state;
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.baidu.ueditor.upload;
|
||||
|
||||
import com.baidu.ueditor.define.State;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
public class Uploader {
|
||||
private HttpServletRequest request = null;
|
||||
private Map<String, Object> conf = null;
|
||||
|
||||
public Uploader(HttpServletRequest request, Map<String, Object> conf) {
|
||||
this.request = request;
|
||||
this.conf = conf;
|
||||
}
|
||||
|
||||
public final State doExec() {
|
||||
String filedName = (String) this.conf.get("fieldName");
|
||||
State state = null;
|
||||
|
||||
if ("true".equals(this.conf.get("isBase64"))) {
|
||||
state = Base64Uploader.save(this.request.getParameter(filedName),
|
||||
this.conf);
|
||||
} else {
|
||||
state = BinaryUploader.save(this.request, this.conf);
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
/**
|
||||
*/
|
||||
package ${packageName}.${moduleName}.web${subModuleName};
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import ivan.common.config.Global;
|
||||
import ivan.common.persistence.Page;
|
||||
import com.sifang.modules.sys.web.BaseExceptionController;;
|
||||
import com.sifang.modules.sunshine.SystemSetting.utils.StringUtil;
|
||||
import com.sifang.modules.sys.common.entity.User;
|
||||
import com.sifang.modules.sys.common.UserUtils;
|
||||
import ${packageName}.${moduleName}.entity${subModuleName}.${ClassName};
|
||||
import ${packageName}.${moduleName}.service${subModuleName}.${ClassName}Service;
|
||||
|
||||
/**
|
||||
* ${functionName}Controller
|
||||
* @author ${classAuthor}
|
||||
* @version ${classVersion}
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping(value = "${r"${adminPath}"}/${urlPrefix}")
|
||||
public class ${ClassName}Controller extends BaseExceptionController {
|
||||
|
||||
@Autowired
|
||||
private ${ClassName}Service ${className}Service;
|
||||
|
||||
@ModelAttribute
|
||||
public ${ClassName} get(@RequestParam(required=false) String id) {
|
||||
if (StringUtils.isNotBlank(id)){
|
||||
return ${className}Service.get(id);
|
||||
}else{
|
||||
return new ${ClassName}();
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresPermissions("${permissionPrefix}:view")
|
||||
@RequestMapping(value = {"list", ""})
|
||||
public String list(${ClassName} ${className}, HttpServletRequest request, HttpServletResponse response, Model model) {
|
||||
User user = UserUtils.getUser();
|
||||
if (!user.isAdmin()){
|
||||
//${className}.setCreateBy(user);
|
||||
}
|
||||
Page<${ClassName}> page = ${className}Service.find(new Page<${ClassName}>(request, response), ${className});
|
||||
model.addAttribute("page", page);
|
||||
return "modules/" + "${viewPrefix}List";
|
||||
}
|
||||
|
||||
@RequiresPermissions("${permissionPrefix}:view")
|
||||
@RequestMapping(value = "form")
|
||||
public String form(${ClassName} ${className}, Model model) {
|
||||
model.addAttribute("${className}", ${className});
|
||||
return "modules/" + "${viewPrefix}Form";
|
||||
}
|
||||
|
||||
@RequiresPermissions("${permissionPrefix}:edit")
|
||||
@RequestMapping(value = "save")
|
||||
public String save(${ClassName} ${className}, Model model, RedirectAttributes redirectAttributes) {
|
||||
if (!beanValidator(model, ${className})){
|
||||
return form(${className}, model);
|
||||
}
|
||||
${className}Service.save(${className});
|
||||
addMessage(redirectAttributes, "保存${functionName}'" + ${className}.getName() + "'成功");
|
||||
return "redirect:"+Global.getAdminPath()+"/${viewPrefix}/?repage";
|
||||
}
|
||||
|
||||
@RequiresPermissions("${permissionPrefix}:edit")
|
||||
@RequestMapping(value = "delete")
|
||||
public String delete(String id, RedirectAttributes redirectAttributes) {
|
||||
${className}Service.delete(id);
|
||||
addMessage(redirectAttributes, "删除${functionName}成功");
|
||||
return "redirect:"+Global.getAdminPath()+"/${viewPrefix}/?repage";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
/**
|
||||
*/
|
||||
package ${packageName}.${moduleName}.dao${subModuleName};
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.sifang.modules.sys.common.persistence.BaseDao;
|
||||
import com.sifang.modules.sys.common.persistence.Parameter;
|
||||
import ${packageName}.${moduleName}.entity${subModuleName}.${ClassName};
|
||||
|
||||
/**
|
||||
* ${functionName}DAO接口
|
||||
* @author ${classAuthor}
|
||||
* @version ${classVersion}
|
||||
*/
|
||||
@Repository
|
||||
public class ${ClassName}Dao extends BaseDao<${ClassName}> {
|
||||
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
/**
|
||||
*/
|
||||
package ${packageName}.${moduleName}.entity${subModuleName};
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.hibernate.annotations.Cache;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* ${functionName}Entity
|
||||
* @author ${classAuthor}
|
||||
* @version ${classVersion}
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "${tableName}")
|
||||
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class ${ClassName} implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String id; // 编号
|
||||
private String name; // 名称
|
||||
|
||||
public ${ClassName}() {
|
||||
super();
|
||||
}
|
||||
|
||||
public ${ClassName}(String id){
|
||||
this();
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Length(min=1, max=200)
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,54 @@
|
||||
/**
|
||||
*/
|
||||
package ${packageName}.${moduleName}.service${subModuleName};
|
||||
|
||||
import org.hibernate.criterion.DetachedCriteria;
|
||||
import org.hibernate.criterion.Order;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import ivan.common.persistence.Page;
|
||||
import com.sifang.modules.sys.common.service.BaseService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import ${packageName}.${moduleName}.entity${subModuleName}.${ClassName};
|
||||
import ${packageName}.${moduleName}.dao${subModuleName}.${ClassName}Dao;
|
||||
|
||||
/**
|
||||
* ${functionName}Service
|
||||
* @author ${classAuthor}
|
||||
* @version ${classVersion}
|
||||
*/
|
||||
@Component
|
||||
@Transactional(readOnly = true)
|
||||
public class ${ClassName}Service extends BaseService {
|
||||
|
||||
@Autowired
|
||||
private ${ClassName}Dao ${className}Dao;
|
||||
|
||||
public ${ClassName} get(String id) {
|
||||
return ${className}Dao.get(id);
|
||||
}
|
||||
|
||||
public Page<${ClassName}> find(Page<${ClassName}> page, ${ClassName} ${className}) {
|
||||
DetachedCriteria dc = ${className}Dao.createDetachedCriteria();
|
||||
if (StringUtils.isNotEmpty(${className}.getId())){
|
||||
dc.add(Restrictions.like("name", "%"+${className}.getId()+"%"));
|
||||
}
|
||||
dc.add(Restrictions.eq("delFlag", "0"));
|
||||
dc.addOrder(Order.desc("id"));
|
||||
return ${className}Dao.find(page, dc);
|
||||
}
|
||||
|
||||
@Transactional(readOnly = false)
|
||||
public void save(${ClassName} ${className}) {
|
||||
${className}Dao.save(${className});
|
||||
}
|
||||
|
||||
@Transactional(readOnly = false)
|
||||
public void delete(String id) {
|
||||
${className}Dao.deleteById(id);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" %>
|
||||
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title>${functionName}管理</title>
|
||||
<meta name="decorator" content="default"/>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#name").focus();
|
||||
$("#inputForm").validate({
|
||||
submitHandler: function(form){
|
||||
loading('正在提交,请稍等...');
|
||||
form.submit();
|
||||
},
|
||||
errorContainer: "#messageBox",
|
||||
errorPlacement: function(error, element) {
|
||||
$("#messageBox").text("输入有误,请先更正。");
|
||||
if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
|
||||
error.appendTo(element.parent().parent());
|
||||
} else {
|
||||
error.insertAfter(element);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<ul class="nav nav-tabs">
|
||||
<li><a href="${r"${ctx}"}/${urlPrefix}/">${functionName}列表</a></li>
|
||||
<li class="active"><a href="${r"${ctx}"}/${urlPrefix}/form?id=${"${"+className+".id}"}">${functionName}<shiro:hasPermission name="${permissionPrefix}:edit">${r"${not empty "+className+".id?'修改':'添加'}"}</shiro:hasPermission><shiro:lacksPermission name="${permissionPrefix}:edit">查看</shiro:lacksPermission></a></li>
|
||||
</ul><br/>
|
||||
<form:form id="inputForm" modelAttribute="${className}" action="${r"${ctx}"}/${urlPrefix}/save" method="post" class="form-horizontal">
|
||||
<form:hidden path="id"/>
|
||||
<tags:message content="${r"${message}"}"/>
|
||||
<div class="control-group">
|
||||
<label class="control-label">名称:</label>
|
||||
<div class="controls">
|
||||
<form:input path="name" htmlEscape="false" maxlength="200" class="required"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">备注:</label>
|
||||
<div class="controls">
|
||||
<form:textarea path="remarks" htmlEscape="false" rows="4" maxlength="200" class="input-xxlarge"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<shiro:hasPermission name="${permissionPrefix}:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/> </shiro:hasPermission>
|
||||
<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
|
||||
</div>
|
||||
</form:form>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,27 @@
|
||||
package com.sifang.modules.account.constant;
|
||||
|
||||
public class TraderAccountSettleDetailConstants {
|
||||
|
||||
/**
|
||||
* 账户类型:0.待结算账户 1.质保金账户
|
||||
*/
|
||||
public static final String OBJ_TYPE_DJS = "0";
|
||||
public static final String OBJ_TYPE_ZBJ = "1";
|
||||
|
||||
/**
|
||||
* 结算类型:0.预结算 1.分包并网结算 2.电站整改(减) 3.质保金 4.奖励政策 5.并网惩罚政策(减)
|
||||
*/
|
||||
public static final String TYPE_YJS = "0";
|
||||
public static final String TYPE_FBBWJS = "1";
|
||||
public static final String TYPE_DZZG = "2";
|
||||
public static final String TYPE_ZBJ = "3";
|
||||
public static final String TYPE_REWARD = "4";
|
||||
public static final String TYPE_PUNISH= "5";
|
||||
|
||||
/**
|
||||
* 请款标记:0.可请款 1.冻结 2.已提现 3.未生效 4.已失效
|
||||
*/
|
||||
public static final String FLAG_CAN_CASH_OUT = "0";
|
||||
public static final String FLAG_DJ = "1";
|
||||
public static final String FLAG_SX="4";
|
||||
}
|
@ -0,0 +1,107 @@
|
||||
package com.sifang.modules.account.controller;
|
||||
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.sifang.modules.account.entity.CrmTraderAccount;
|
||||
import com.sifang.modules.account.entity.CrmTraderSupportSettleDetails;
|
||||
import com.sifang.modules.account.service.CrmTraderSupportSettleDetailsService;
|
||||
import com.sifang.modules.account.service.TraderAccountService;
|
||||
import com.sifang.modules.customer.constant.UserConstants;
|
||||
import com.sifang.modules.flowable.utils.FormUtils;
|
||||
import com.sifang.modules.flowpath.entity.ExamineInfo;
|
||||
import com.sifang.modules.sunshine.SystemSetting.entity.CrmTrader;
|
||||
import com.sifang.modules.sunshine.SystemSetting.service.TraderService;
|
||||
import com.sifang.modules.supply.order.service.SupplyOrderAuditService;
|
||||
import com.sifang.modules.sys.common.UserUtils;
|
||||
import com.sifang.modules.sys.common.entity.User;
|
||||
import com.sifang.modules.sys.common.utils.StringUtil;
|
||||
import com.sifang.modules.sys.util.CrmUtils;
|
||||
import com.sifang.modules.sys.util.LayuiPage;
|
||||
import com.sifang.modules.sys.web.BaseExceptionController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
//支架账户
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/supportAccount")
|
||||
public class CrmTraderSupportSettleDetailsController extends BaseExceptionController {
|
||||
|
||||
@Autowired
|
||||
private TraderService traderService;
|
||||
|
||||
@Autowired
|
||||
private CrmTraderSupportSettleDetailsService supportSettleDetailsService;
|
||||
|
||||
@Autowired
|
||||
private TraderAccountService accountService;
|
||||
|
||||
@Autowired
|
||||
SupplyOrderAuditService supplyOrderService;
|
||||
|
||||
/**
|
||||
* 支架账户--支架账户
|
||||
*/
|
||||
@RequestMapping(value = "toSupportAccountDetail")
|
||||
public String toSupportAccountDetail(HttpServletRequest request, Model model){
|
||||
//代理商列表
|
||||
List<Record> traderList = traderService.getTopTrader2();
|
||||
model.addAttribute("traderList", traderList);
|
||||
User user = UserUtils.getUser();
|
||||
model.addAttribute("user", user);
|
||||
if (UserConstants.TYPE_TRADER.equals(user.getUserType())) {
|
||||
CrmTrader trader = traderService.getTraderBuserId(user.getId());
|
||||
CrmTraderAccount account = accountService.findByTraderId(trader.getId());
|
||||
model.addAttribute("arrearsAmount", "");
|
||||
}
|
||||
return "modules/yangguang/account/zj/supportAccountList";
|
||||
}
|
||||
|
||||
//待结算账户 变动明细列表数据
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "supportAccountListData")
|
||||
public String supportAccountListData(HttpServletRequest request){
|
||||
Map<String, String> map = getParams(request);
|
||||
User user = UserUtils.getUser();
|
||||
if (UserConstants.TYPE_TRADER.equals(user.getUserType())) {
|
||||
CrmTrader trader = traderService.getTraderBuserId(user.getId());
|
||||
map.put("traderId",trader.getId());
|
||||
}else if(User.USER_TYPE_ADVISOR.equals(user.getUserType())){
|
||||
String traderId = CrmUtils.getUserRelId(user);
|
||||
CrmTrader trader = traderService.getById(traderId);
|
||||
map.put("traderId",trader.getId());
|
||||
}if(User.USER_TYPE_WXG.equals(user.getUserType())){
|
||||
//平台人员
|
||||
//获取当前人员所负责代理商
|
||||
Record rd = CrmUtils.getByUserId(user);
|
||||
String trader_id=rd.getStr("trader_id");
|
||||
if(StringUtil.isNotBlank(trader_id)){
|
||||
map.put("traderId",trader_id);
|
||||
}
|
||||
}
|
||||
LayuiPage page = new LayuiPage(request);
|
||||
supportSettleDetailsService.supportAccountListData(page,map);
|
||||
return page.renderJson();
|
||||
}
|
||||
|
||||
// 详情 页面
|
||||
@RequestMapping(value = "/supportAccountDetailPage")
|
||||
public String supportAccountDetailPage(HttpServletRequest request, Model model){
|
||||
String id=request.getParameter("id");
|
||||
CrmTraderSupportSettleDetails details= supportSettleDetailsService.getById(id);
|
||||
model.addAttribute("details",details);
|
||||
model.addAttribute("orderType",details.getType());
|
||||
// 订单详情
|
||||
Record order=supplyOrderService.orderDetail(details.getRelateOrderId());
|
||||
model.addAttribute("order",order);
|
||||
//物料信息
|
||||
List<Record> mates=supplyOrderService.getOrderMaterials(details.getRelateOrderId());
|
||||
model.addAttribute("details",mates);
|
||||
return "modules/yangguang/account/zj/supportAccountDetailPage";
|
||||
}
|
||||
}
|
@ -0,0 +1,128 @@
|
||||
package com.sifang.modules.account.controller;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.sifang.modules.account.service.TotalAssetDetailsService;
|
||||
import com.sifang.modules.setting.service.MemberService;
|
||||
import com.sifang.modules.sunshine.SystemSetting.service.PlanService;
|
||||
import com.sifang.modules.sunshine.SystemSetting.service.TraderService;
|
||||
import com.sifang.modules.sunshine.SystemSetting.utils.StringUtil;
|
||||
import com.sifang.modules.sunshine.partnerManagement.entity.CrmPartner;
|
||||
import com.sifang.modules.sunshine.partnerManagement.service.PartnerService;
|
||||
import com.sifang.modules.sys.common.UserUtils;
|
||||
import com.sifang.modules.sys.common.entity.User;
|
||||
import com.sifang.modules.sys.common.utils.DateUtils;
|
||||
import com.sifang.modules.sys.entity.Operator;
|
||||
import com.sifang.modules.sys.util.CrmUtils;
|
||||
import com.sifang.modules.sys.util.LayuiPage;
|
||||
import com.sifang.modules.sys.web.BaseController;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
//总资产明细
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/accountMagement/accountDetail")
|
||||
public class TotalAssetDetailsController extends BaseController {
|
||||
|
||||
Logger logger = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Autowired
|
||||
private TraderService traderService;
|
||||
|
||||
@Autowired
|
||||
private PartnerService partnerService;
|
||||
|
||||
@Autowired
|
||||
private MemberService memberService;
|
||||
|
||||
@Autowired
|
||||
private PlanService planService;
|
||||
|
||||
@Autowired
|
||||
private TotalAssetDetailsService detailsService;
|
||||
|
||||
@RequestMapping(value = "detailListPage")
|
||||
public String detailListPage(Model model){
|
||||
User user = UserUtils.getUser();
|
||||
//代理商列表
|
||||
List<Record> traderList = traderService.listTraderRecords(null, new HashMap<String, String>());
|
||||
model.addAttribute("traderList", traderList);
|
||||
|
||||
//产品编号
|
||||
List<Record> projectList = null;
|
||||
CrmPartner partner;
|
||||
if(User.USER_TYPE_HZS.equals(user.getUserType())){
|
||||
String parId = CrmUtils.getPartnerId(user.getId());
|
||||
partner = partnerService.getById(parId);
|
||||
projectList = memberService.getProjectListByIds(partner.getAuthorizedId());
|
||||
}else if(User.USER_TYPE_PARTNER.equals(user.getUserType())){
|
||||
partner= partnerService.findByUserId(user.getId());
|
||||
projectList = memberService.getProjectListByIds(partner.getAuthorizedId());
|
||||
}else{
|
||||
projectList = memberService.getProjectLists();
|
||||
}
|
||||
model.addAttribute("projectList", projectList);
|
||||
|
||||
//匹配方案
|
||||
List<Record> plans = planService.findAllPlan();
|
||||
|
||||
model.addAttribute("plans", plans);
|
||||
return "modules/yangguang/account/accountManagement/detailListPage";
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("/ajaxForWaitOrder")
|
||||
public Object ajaxForWaitOrder(HttpServletRequest request){
|
||||
Date now = new Date();
|
||||
String sn = DateUtils.formatDate(now, "yyyyMMddHHmmss");
|
||||
long s1 = System.currentTimeMillis();
|
||||
LayuiPage<Record> page = new LayuiPage<>(request);
|
||||
Map<String, String> map = getParams(request);
|
||||
User user = UserUtils.getUser();
|
||||
Operator operator = Operator.of(user.getId(), user.getUserName(),user.getUserType());
|
||||
detailsService.entryListAccount(page, map, operator);
|
||||
long s2 = System.currentTimeMillis();
|
||||
logger.info(" >>获取项目信息列表 时间统计 [{}] end doSave use {}ms ", sn, (s2 - s1));
|
||||
return page.renderJson();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "toImportCustomerEntryGe")
|
||||
public String toImport() {
|
||||
return "modules/yangguang/account/accountManagement/importCustomerEntryGe";
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "checkImportCustomerEntryGe")
|
||||
public Object checkImportBarcode(MultipartFile file) throws IOException {
|
||||
Map<String, String> params = Maps.newHashMap();
|
||||
params.put("extName", StringUtil.getFileExtName(file.getOriginalFilename()));
|
||||
Map<String, Object> retMap = detailsService.checkImportBarcode(params, file.getInputStream());
|
||||
return JSONObject.fromObject(retMap);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "importCustomerEntryGe")
|
||||
@ResponseBody
|
||||
public Object importBarcode(MultipartFile file) throws IOException {
|
||||
Map<String, String> params = Maps.newHashMap();
|
||||
params.put("fileName", file.getOriginalFilename());
|
||||
Map<String, Object> retMap = detailsService.importBarcode(params, file.getInputStream());
|
||||
return retMap;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.sifang.modules.account.dao;
|
||||
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.sifang.modules.account.entity.CrmTraderSupportSettleDetails;
|
||||
import com.sifang.modules.sunshine.SystemSetting.utils.StringUtil;
|
||||
import com.sifang.modules.sys.common.persistence.BaseDao;
|
||||
import com.sifang.modules.sys.util.LayuiPage;
|
||||
import com.sifang.modules.sys.util.SqlBuilder;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Repository
|
||||
public class CrmTraderSupportSettleDetailsDao extends BaseDao<CrmTraderSupportSettleDetails> {
|
||||
|
||||
public void supportAccountListData(LayuiPage<Record> page, Map<String, String> map){
|
||||
//DATE_FORMAT(s.create_time,'%Y-%m-%d %H:%i:%s') AS createTime
|
||||
SqlBuilder sqlBuilder=new SqlBuilder();
|
||||
sqlBuilder.line(" SELECT s.id,s.number,s.type,s.relate_order_number,s.amount,s.trader_id,s.take_amount_unit, ");
|
||||
sqlBuilder.line(" s.take_amount_account,s.rate,t.name AS traderName,s.create_time,DATE_FORMAT(s.create_time,'%Y-%m-%d %H:%i:%s') AS createTime,relate_order_id ");
|
||||
sqlBuilder.line(" FROM `crm_trader_support_settle_details` s LEFT JOIN `crm_trader` t ON s.trader_id=t.id ");
|
||||
sqlBuilder.line(" WHERE s.status='1' ");
|
||||
getCondition(map,sqlBuilder);
|
||||
sqlBuilder.line(" ORDER BY create_time DESC ");
|
||||
if(page!=null){
|
||||
sqlBuilder.line(" limit " + page.getLimit() + " offset " + (page.getPage() - 1) * page.getLimit());
|
||||
Long count = getSupportAccountListCount(map);
|
||||
page.setCount(count);
|
||||
}
|
||||
List<Record> list=Db.find(sqlBuilder.build(),sqlBuilder.params());
|
||||
page.setData(list);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public Long getSupportAccountListCount(Map<String,String> map){
|
||||
SqlBuilder sqlBuilder=new SqlBuilder();
|
||||
sqlBuilder.line(" SELECT COUNT(s.id) FROM `crm_trader_support_settle_details` s ");
|
||||
sqlBuilder.line(" WHERE s.status='1' ");
|
||||
getCondition(map,sqlBuilder);
|
||||
return Db.queryLong(sqlBuilder.build(), sqlBuilder.params());
|
||||
}
|
||||
|
||||
public void getCondition(Map<String, String> map, SqlBuilder sf){
|
||||
if(StringUtil.isNotBlank(map.get("type"))){
|
||||
sf.line(" AND s.type = ? ", map.get("type"));
|
||||
}
|
||||
if(StringUtil.isNotBlank(map.get("createTimeSta"))) {
|
||||
sf.line("AND s.create_time >= ?", map.get("createTimeSta") + " 00:00:00");
|
||||
}
|
||||
if(StringUtil.isNotBlank(map.get("createTimeEnd"))) {
|
||||
sf.line("AND s.create_time <= ?", map.get("createTimeEnd") + " 23:59:59");
|
||||
}
|
||||
if (StringUtil.isNotBlank(map.get("traderId"))) {
|
||||
sf.inst(" AND s.trader_id in ", map.get("traderId").split(","));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,255 @@
|
||||
package com.sifang.modules.account.dao;
|
||||
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.sifang.modules.account.entity.CrmTraderAccountSettleDetail;
|
||||
import com.sifang.modules.platform.utils.PlantformUtils;
|
||||
import com.sifang.modules.sunshine.SystemSetting.entity.CrmPlanMaterialEntry;
|
||||
import com.sifang.modules.sys.common.persistence.BaseDao;
|
||||
import com.sifang.modules.sys.common.persistence.Parameter;
|
||||
import com.sifang.modules.sys.common.utils.StringUtil;
|
||||
import com.sifang.modules.sys.util.LayuiPage;
|
||||
import com.sifang.modules.sys.util.SqlBuilder;
|
||||
import org.hibernate.Query;
|
||||
import org.hibernate.SQLQuery;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Repository
|
||||
public class TraderAccountSettleDetailDao extends BaseDao<CrmTraderAccountSettleDetail> {
|
||||
|
||||
Logger logger= LoggerFactory.getLogger(getClass());
|
||||
|
||||
public List<Record> listSettleDetails(Map<String, String> queryParams, LayuiPage page) {
|
||||
SqlBuilder builder = new SqlBuilder();
|
||||
builder.line("select d.id, d.entry_id, d.power_station_code, d.trader_name,d.unit_price,d.capacity, d.type, d.amount, e.roof_type, e.scheme_type, e.scheme_type_name")
|
||||
.line(",e.tenant_name,d.settle_number, e.mobile,e.partner_name, d.project_code, d.project_name, d.create_time, d.end_time,d.flag,e.create_trader_name as createTraderName,e.create_trader_id,e.distributor_id,e.in_coming_time,e.province ")
|
||||
.line("from crm_trader_account_settle_detail d")
|
||||
.line("left join crm_trader t on d.trader_id=t.id")
|
||||
.line("left join crm_customer_entry e on d.entry_id=e.id")
|
||||
.line("where 1=1");
|
||||
appendSettleDetailsCondition(builder, queryParams);
|
||||
builder.line("order by d.create_time desc");
|
||||
builder.limit(page.getPage(), page.getLimit());
|
||||
return Db.find(builder.build(), builder.params());
|
||||
}
|
||||
|
||||
public Long countSettleDetails(Map<String, String> queryParams) {
|
||||
SqlBuilder builder = new SqlBuilder();
|
||||
builder.line("select count(*)")
|
||||
.line("from crm_trader_account_settle_detail d")
|
||||
.line("left join crm_trader t on d.trader_id=t.id")
|
||||
.line("left join crm_customer_entry e on d.entry_id=e.id")
|
||||
.line("where 1=1");
|
||||
appendSettleDetailsCondition(builder, queryParams);
|
||||
return Db.queryLong(builder.build(), builder.params());
|
||||
}
|
||||
|
||||
private void appendSettleDetailsCondition(SqlBuilder builder, Map<String, String> queryParams){
|
||||
if (StringUtil.checkParamValid(queryParams.get("objType"))) {
|
||||
builder.line("and d.obj_type = ?", queryParams.get("objType"));
|
||||
}
|
||||
if (StringUtil.checkParamValid(queryParams.get("partner"))) {
|
||||
builder.line("and e.partner_id = ?", queryParams.get("partner"));
|
||||
}
|
||||
if (StringUtil.checkParamValid(queryParams.get("projectId"))) {
|
||||
builder.line("and e.project_id = ?", queryParams.get("projectId"));
|
||||
}
|
||||
if (StringUtil.checkParamValid(queryParams.get("powerStationCode"))) {
|
||||
builder.like("and d.power_station_code like ?", queryParams.get("powerStationCode"));
|
||||
}
|
||||
if (StringUtil.checkParamValid(queryParams.get("projectName"))) {
|
||||
builder.like("and e.project_name like ?", queryParams.get("projectName"));
|
||||
}
|
||||
if (StringUtil.checkParamValid(queryParams.get("powerStationCode"))) {
|
||||
builder.like("and d.power_station_code like ?", queryParams.get("powerStationCode"));
|
||||
}
|
||||
if (StringUtil.checkParamValid(queryParams.get("traderIds"))) {
|
||||
builder.inst("and d.trader_id in ", queryParams.get("traderIds").split(","));
|
||||
}
|
||||
if(StringUtil.checkParamValid(queryParams.get("traderId"))){
|
||||
builder.line(" and d.trader_id = ? ",queryParams.get("traderId"));
|
||||
}
|
||||
if (StringUtil.checkParamValid(queryParams.get("traderName"))) {
|
||||
builder.like("and d.trader_name like ?", queryParams.get("traderName"));
|
||||
}
|
||||
if (StringUtil.checkParamValid(queryParams.get("traderMobile"))) {
|
||||
builder.like("and t.telephone like ?", queryParams.get("traderMobile"));
|
||||
}
|
||||
if (StringUtil.checkParamValid(queryParams.get("tenantName"))) {
|
||||
builder.like("and d.tenant_name like ?", queryParams.get("tenantName"));
|
||||
}
|
||||
if (StringUtil.checkParamValid(queryParams.get("mobile"))) {
|
||||
builder.like("and d.mobile like ?", queryParams.get("mobile"));
|
||||
}
|
||||
if (StringUtil.checkParamValid(queryParams.get("roofType"))) {
|
||||
builder.line("and e.roof_type = ?", queryParams.get("roofType"));
|
||||
}
|
||||
if (StringUtil.checkParamValid(queryParams.get("type"))) {
|
||||
builder.line("and d.type = ?", queryParams.get("type"));
|
||||
}
|
||||
if (StringUtil.checkParamValid(queryParams.get("flag"))) {
|
||||
if("1".equals(queryParams.get("flag"))){
|
||||
builder.line(" and (d.flag!='2' or d.flag is null) ");
|
||||
}else {
|
||||
builder.line("and d.flag = ?", queryParams.get("flag"));
|
||||
}
|
||||
}
|
||||
if(StringUtil.checkParamValid(queryParams.get("twoTrader"))){
|
||||
builder.line(" and e.create_trader_id =? ",queryParams.get("twoTrader"));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询结算明细
|
||||
*
|
||||
* @param traderId 代理商id
|
||||
* @param objType 账户类型:0.待结算账户 1.质保金账户
|
||||
* @param type 结算类型:0.预结算 1.分包并网结算 2.电站整改(减) 3.质保金
|
||||
*/
|
||||
public CrmTraderAccountSettleDetail findOneByCondition(String traderId, String objType, String type,String entryId) {
|
||||
// SqlBuilder sb = new SqlBuilder();
|
||||
// sb.line("SELECT sd.*");
|
||||
// sb.line("FROM crm_trader_account_settle_detail sd");
|
||||
// sb.line("WHERE sd.trader_id = ?", traderId);
|
||||
// sb.line("AND sd.obj_type = ?", objType);
|
||||
// sb.line("AND sd.type = ?", type);
|
||||
// sb.line("ORDER BY sd.create_time DESC LIMIT 1");
|
||||
// return Db.queryColumn(sb.build(), sb.params());
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("from CrmTraderAccountSettleDetail ");
|
||||
sb.append("where traderId=:p1 and objType=:p2 and type=:p3 and entryId=:p4 ");
|
||||
sb.append("ORDER BY createTime DESC");
|
||||
List<CrmTraderAccountSettleDetail> list = find(sb.toString(), new Parameter(traderId,objType,type,entryId));
|
||||
if (list != null && !list.isEmpty()) {
|
||||
return list.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<CrmTraderAccountSettleDetail> findListByEntry(String entryId, String types) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("from CrmTraderAccountSettleDetail ");
|
||||
sb.append("where entryId=:p1 ");
|
||||
if (StringUtil.isNotBlank(types)) {
|
||||
sb.append("and type in (").append(StringUtil.joinInSql(types.split(","))).append(") ");;
|
||||
}
|
||||
sb.append("ORDER BY createTime DESC");
|
||||
return find(sb.toString(), new Parameter(entryId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建结算明细
|
||||
*/
|
||||
public CrmTraderAccountSettleDetail createOne(String entryId, String powerStationCode, String traderId, String traderName, String flag,
|
||||
String objType, String type, BigDecimal amount, String roogType, String schemeType, String schemeTypeId,
|
||||
String schemeTypeName, String tenantName, String mobile, String projectCode, String projectName,
|
||||
BigDecimal unitPrice,BigDecimal capacity,
|
||||
String createBy, Date createTime) {
|
||||
CrmTraderAccountSettleDetail detail = new CrmTraderAccountSettleDetail();
|
||||
detail.setEntryId(entryId);
|
||||
detail.setPowerStationCode(powerStationCode);
|
||||
detail.setTraderId(traderId);
|
||||
detail.setTraderName(traderName);
|
||||
detail.setFlag(flag);
|
||||
detail.setObjType(objType);
|
||||
detail.setType(type);
|
||||
detail.setAmount(amount);
|
||||
detail.setRoofType(roogType);
|
||||
detail.setSchemeType(schemeType);
|
||||
detail.setSchemeTypeId(schemeTypeId);
|
||||
detail.setSchemeTypeName(schemeTypeName);
|
||||
detail.setTenantName(tenantName);
|
||||
detail.setMobile(mobile);
|
||||
detail.setProjectCode(projectCode);
|
||||
detail.setProjectName(projectName);
|
||||
detail.setCreateBy(createBy);
|
||||
detail.setCreateTime(createTime);
|
||||
detail.setNumber("ZG"+PlantformUtils.getOrderNumber());
|
||||
detail.setUnitPrice(unitPrice);
|
||||
detail.setCapacity(capacity);
|
||||
return detail;
|
||||
}
|
||||
|
||||
//奖励政策(每月的定时任务生成奖励政策时调用)
|
||||
public void saveSettle(String entryId,String powerStationCode,String traderId,String traderName,BigDecimal amount,Date date,String settleNumber){
|
||||
CrmTraderAccountSettleDetail detail = new CrmTraderAccountSettleDetail();
|
||||
detail.setEntryId(entryId);
|
||||
detail.setPowerStationCode(powerStationCode);
|
||||
detail.setTraderId(traderId);
|
||||
detail.setTraderName(traderName);
|
||||
detail.setFlag("3"); //奖励政策生成的时候,是未生效状态,到了越秀的投放款付款申请状态通过后 才生效
|
||||
detail.setObjType("0");
|
||||
detail.setType("4");
|
||||
detail.setAmount(amount);
|
||||
detail.setCreateBy("系统自动生成");
|
||||
detail.setCreateTime(date);
|
||||
detail.setNumber("ZG"+PlantformUtils.getOrderNumber());
|
||||
detail.setSettleNumber(settleNumber);
|
||||
save(detail);
|
||||
}
|
||||
|
||||
//修改奖励政策的生效状态(越秀投放审查状态通过后调用)
|
||||
public void changeRewardSettleStatus(String entryId){
|
||||
logger.info(">>>>>>>>>>>changeRewardSettleStatus entryId:{}",entryId);
|
||||
SQLQuery sqlQuery = getSession().createSQLQuery(" UPDATE `crm_trader_account_settle_detail` SET flag='0' WHERE obj_type='0' AND type='4' AND flag='3' AND entry_id=:entryId ");
|
||||
sqlQuery.setParameter("entryId", entryId);
|
||||
int cou = sqlQuery.executeUpdate();
|
||||
logger.info(">>>>>>>>>>>>changeRewardSettleStatus entryId:{},cun:{} ",entryId,cou);
|
||||
}
|
||||
|
||||
// 删除记录
|
||||
public boolean deleteDetail(CrmTraderAccountSettleDetail detail){
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append(" INSERT INTO crm_trader_account_settle_detail_del (id,entry_id,power_station_code,trader_id,trader_name,")
|
||||
.append("flag,obj_type,type,amount,roof_type,scheme_type,scheme_type_id,scheme_type_name,tenant_name,mobile,")
|
||||
.append("project_code,project_name,create_by,create_time,end_time,king_dee_id,number,")
|
||||
.append("settle_number,unit_price,capacity,delete_time)")
|
||||
.append(" VALUES (:id,:entry_id,:power_station_code,:trader_id,:trader_name,:flag,:obj_type,:type,:amount,")
|
||||
.append(":roof_type,:scheme_type,:scheme_type_id,:scheme_type_name,:tenant_name,:mobile,:project_code,:project_name,")
|
||||
.append(":create_by,:create_time,:end_time,:king_dee_id,:number,:settle_number,")
|
||||
.append(":unit_price,:capacity,NOW())");
|
||||
Query query = getSession().createSQLQuery(sql.toString());
|
||||
query.setParameter("id", detail.getId());
|
||||
query.setParameter("entry_id", detail.getEntryId());
|
||||
query.setParameter("power_station_code", detail.getPowerStationCode());
|
||||
query.setParameter("trader_id", detail.getTraderId());
|
||||
query.setParameter("trader_name", detail.getTraderName());
|
||||
query.setParameter("flag", detail.getFlag());
|
||||
query.setParameter("obj_type", detail.getObjType());
|
||||
query.setParameter("type", detail.getType());
|
||||
query.setParameter("amount", detail.getAmount());
|
||||
query.setParameter("roof_type", detail.getRoofType());
|
||||
query.setParameter("scheme_type", detail.getSchemeType());
|
||||
query.setParameter("scheme_type_id", detail.getSchemeTypeId());
|
||||
query.setParameter("scheme_type_name", detail.getSchemeTypeName());
|
||||
query.setParameter("tenant_name", detail.getTenantName());
|
||||
query.setParameter("mobile", detail.getMobile());
|
||||
query.setParameter("project_code", detail.getProjectCode());
|
||||
query.setParameter("project_name", detail.getProjectName());
|
||||
query.setParameter("create_by", detail.getCreateBy());
|
||||
query.setParameter("create_time", detail.getCreateTime());
|
||||
query.setParameter("end_time", detail.getEndTime());
|
||||
query.setParameter("king_dee_id", detail.getKingDeeId());
|
||||
query.setParameter("number", detail.getNumber());
|
||||
query.setParameter("settle_number", detail.getSettleNumber());
|
||||
query.setParameter("unit_price", detail.getUnitPrice());
|
||||
query.setParameter("capacity", detail.getCapacity());
|
||||
int update = query.executeUpdate();
|
||||
if (update < 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
SQLQuery deleteQuery = getSession().createSQLQuery("DELETE FROM crm_trader_account_settle_detail WHERE id=:id");
|
||||
deleteQuery.setParameter("id", detail.getId());
|
||||
int executed = deleteQuery.executeUpdate();
|
||||
return executed > 0;
|
||||
}
|
||||
}
|
@ -0,0 +1,297 @@
|
||||
package com.sifang.modules.account.entity;
|
||||
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Entity
|
||||
@Table(name = "crm_trader_account")
|
||||
public class CrmTraderAccount implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String id;
|
||||
private String traderId;
|
||||
private BigDecimal bzjAmount;
|
||||
private BigDecimal basicQuotaAmount;
|
||||
private BigDecimal basicQuotaAmountBzj;
|
||||
private BigDecimal basicQuotaAmountBalance;
|
||||
private BigDecimal maxQuotaAmount;
|
||||
private BigDecimal maxQuotaAmountBzj;
|
||||
private BigDecimal maxQuotaAmountBalance;
|
||||
private BigDecimal settleAmount;
|
||||
private BigDecimal settleAmountYsjs;
|
||||
private BigDecimal qaAmount;
|
||||
private BigDecimal qaAmountUsable;
|
||||
private BigDecimal qaAmountFreeze;
|
||||
private BigDecimal qaAmountIncdec;
|
||||
private Date createTime;
|
||||
private BigDecimal settleDeductionAmount;
|
||||
|
||||
private BigDecimal bondAmountLimit;
|
||||
|
||||
private BigDecimal arrearsAmount;
|
||||
|
||||
private BigDecimal sendOutGoodsCount;
|
||||
|
||||
private BigDecimal paidAmount;
|
||||
|
||||
private BigDecimal settleRewardsPunishAmount;
|
||||
|
||||
private BigDecimal ykBzjAmount;
|
||||
private BigDecimal ykDeliverTotalCapacity;
|
||||
private BigDecimal ykYazTotalCapacity;
|
||||
private BigDecimal ykYbwTotalCapacity;
|
||||
private BigDecimal ykTklTotalCapacity;
|
||||
|
||||
public BigDecimal getYkBzjAmount() {
|
||||
return ykBzjAmount;
|
||||
}
|
||||
|
||||
public void setYkBzjAmount(BigDecimal ykBzjAmount) {
|
||||
this.ykBzjAmount = ykBzjAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getYkDeliverTotalCapacity() {
|
||||
return ykDeliverTotalCapacity;
|
||||
}
|
||||
|
||||
public void setYkDeliverTotalCapacity(BigDecimal ykDeliverTotalCapacity) {
|
||||
this.ykDeliverTotalCapacity = ykDeliverTotalCapacity;
|
||||
}
|
||||
|
||||
public BigDecimal getYkYazTotalCapacity() {
|
||||
return ykYazTotalCapacity;
|
||||
}
|
||||
|
||||
public void setYkYazTotalCapacity(BigDecimal ykYazTotalCapacity) {
|
||||
this.ykYazTotalCapacity = ykYazTotalCapacity;
|
||||
}
|
||||
|
||||
public BigDecimal getYkYbwTotalCapacity() {
|
||||
return ykYbwTotalCapacity;
|
||||
}
|
||||
|
||||
public void setYkYbwTotalCapacity(BigDecimal ykYbwTotalCapacity) {
|
||||
this.ykYbwTotalCapacity = ykYbwTotalCapacity;
|
||||
}
|
||||
|
||||
public BigDecimal getYkTklTotalCapacity() {
|
||||
return ykTklTotalCapacity;
|
||||
}
|
||||
|
||||
public void setYkTklTotalCapacity(BigDecimal ykTklTotalCapacity) {
|
||||
this.ykTklTotalCapacity = ykTklTotalCapacity;
|
||||
}
|
||||
|
||||
public CrmTraderAccount() {
|
||||
super();
|
||||
this.bzjAmount = BigDecimal.ZERO;
|
||||
this.basicQuotaAmount = BigDecimal.ZERO;
|
||||
this.basicQuotaAmountBzj = BigDecimal.ZERO;
|
||||
this.basicQuotaAmountBalance = BigDecimal.ZERO;
|
||||
this.maxQuotaAmount = BigDecimal.ZERO;
|
||||
this.maxQuotaAmountBzj = BigDecimal.ZERO;
|
||||
this.maxQuotaAmountBalance = BigDecimal.ZERO;
|
||||
this.settleAmount = BigDecimal.ZERO;
|
||||
this.settleAmountYsjs = BigDecimal.ZERO;
|
||||
this.qaAmount = BigDecimal.ZERO;
|
||||
this.qaAmountUsable = BigDecimal.ZERO;
|
||||
this.qaAmountFreeze = BigDecimal.ZERO;
|
||||
this.qaAmountIncdec = BigDecimal.ZERO;
|
||||
this.settleDeductionAmount=BigDecimal.ZERO;
|
||||
this.arrearsAmount=BigDecimal.ZERO;
|
||||
this.sendOutGoodsCount=BigDecimal.ZERO;
|
||||
this.paidAmount=BigDecimal.ZERO;
|
||||
this.settleRewardsPunishAmount=BigDecimal.ZERO;
|
||||
this.ykBzjAmount=BigDecimal.ZERO;
|
||||
this.ykDeliverTotalCapacity=BigDecimal.ZERO;
|
||||
this.ykYazTotalCapacity=BigDecimal.ZERO;
|
||||
this.ykYbwTotalCapacity=BigDecimal.ZERO;
|
||||
this.ykTklTotalCapacity=BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
@Id
|
||||
@GeneratedValue(generator = "idGenerator")
|
||||
@GenericGenerator(name = "idGenerator", strategy = "uuid")
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTraderId() {
|
||||
return traderId;
|
||||
}
|
||||
|
||||
public void setTraderId(String traderId) {
|
||||
this.traderId = traderId;
|
||||
}
|
||||
|
||||
public BigDecimal getBzjAmount() {
|
||||
return bzjAmount;
|
||||
}
|
||||
|
||||
public void setBzjAmount(BigDecimal bzjAmount) {
|
||||
this.bzjAmount = bzjAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getBasicQuotaAmount() {
|
||||
return basicQuotaAmount;
|
||||
}
|
||||
|
||||
public void setBasicQuotaAmount(BigDecimal basicQuotaAmount) {
|
||||
this.basicQuotaAmount = basicQuotaAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getBasicQuotaAmountBzj() {
|
||||
return basicQuotaAmountBzj;
|
||||
}
|
||||
|
||||
public void setBasicQuotaAmountBzj(BigDecimal basicQuotaAmountBzj) {
|
||||
this.basicQuotaAmountBzj = basicQuotaAmountBzj;
|
||||
}
|
||||
|
||||
public BigDecimal getBasicQuotaAmountBalance() {
|
||||
return basicQuotaAmountBalance;
|
||||
}
|
||||
|
||||
public void setBasicQuotaAmountBalance(BigDecimal basicQuotaAmountBalance) {
|
||||
this.basicQuotaAmountBalance = basicQuotaAmountBalance;
|
||||
}
|
||||
|
||||
public BigDecimal getMaxQuotaAmount() {
|
||||
return maxQuotaAmount;
|
||||
}
|
||||
|
||||
public void setMaxQuotaAmount(BigDecimal maxQuotaAmount) {
|
||||
this.maxQuotaAmount = maxQuotaAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getMaxQuotaAmountBzj() {
|
||||
return maxQuotaAmountBzj;
|
||||
}
|
||||
|
||||
public void setMaxQuotaAmountBzj(BigDecimal maxQuotaAmountBzj) {
|
||||
this.maxQuotaAmountBzj = maxQuotaAmountBzj;
|
||||
}
|
||||
|
||||
public BigDecimal getMaxQuotaAmountBalance() {
|
||||
return maxQuotaAmountBalance;
|
||||
}
|
||||
|
||||
public void setMaxQuotaAmountBalance(BigDecimal maxQuotaAmountBalance) {
|
||||
this.maxQuotaAmountBalance = maxQuotaAmountBalance;
|
||||
}
|
||||
|
||||
public BigDecimal getSettleAmount() {
|
||||
return settleAmount;
|
||||
}
|
||||
|
||||
public void setSettleAmount(BigDecimal settleAmount) {
|
||||
this.settleAmount = settleAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getSettleAmountYsjs() {
|
||||
return settleAmountYsjs;
|
||||
}
|
||||
|
||||
public void setSettleAmountYsjs(BigDecimal settleAmountYsjs) {
|
||||
this.settleAmountYsjs = settleAmountYsjs;
|
||||
}
|
||||
|
||||
public BigDecimal getQaAmount() {
|
||||
return qaAmount;
|
||||
}
|
||||
|
||||
public void setQaAmount(BigDecimal qaAmount) {
|
||||
this.qaAmount = qaAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getQaAmountUsable() {
|
||||
return qaAmountUsable;
|
||||
}
|
||||
|
||||
public void setQaAmountUsable(BigDecimal qaAmountUsable) {
|
||||
this.qaAmountUsable = qaAmountUsable;
|
||||
}
|
||||
|
||||
public BigDecimal getQaAmountFreeze() {
|
||||
return qaAmountFreeze;
|
||||
}
|
||||
|
||||
public void setQaAmountFreeze(BigDecimal qaAmountFreeze) {
|
||||
this.qaAmountFreeze = qaAmountFreeze;
|
||||
}
|
||||
|
||||
public BigDecimal getQaAmountIncdec() {
|
||||
return qaAmountIncdec;
|
||||
}
|
||||
|
||||
public void setQaAmountIncdec(BigDecimal qaAmountIncdec) {
|
||||
this.qaAmountIncdec = qaAmountIncdec;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public BigDecimal getSettleDeductionAmount() {
|
||||
return settleDeductionAmount;
|
||||
}
|
||||
|
||||
public void setSettleDeductionAmount(BigDecimal settleDeductionAmount) {
|
||||
this.settleDeductionAmount = settleDeductionAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getBondAmountLimit() {
|
||||
return bondAmountLimit;
|
||||
}
|
||||
|
||||
public void setBondAmountLimit(BigDecimal bondAmountLimit) {
|
||||
this.bondAmountLimit = bondAmountLimit;
|
||||
}
|
||||
|
||||
public BigDecimal getArrearsAmount() {
|
||||
return arrearsAmount;
|
||||
}
|
||||
|
||||
public void setArrearsAmount(BigDecimal arrearsAmount) {
|
||||
this.arrearsAmount = arrearsAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getSendOutGoodsCount() {
|
||||
return sendOutGoodsCount;
|
||||
}
|
||||
|
||||
public void setSendOutGoodsCount(BigDecimal sendOutGoodsCount) {
|
||||
this.sendOutGoodsCount = sendOutGoodsCount;
|
||||
}
|
||||
|
||||
public BigDecimal getPaidAmount() {
|
||||
return paidAmount;
|
||||
}
|
||||
|
||||
public void setPaidAmount(BigDecimal paidAmount) {
|
||||
this.paidAmount = paidAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getSettleRewardsPunishAmount() {
|
||||
return settleRewardsPunishAmount;
|
||||
}
|
||||
|
||||
public void setSettleRewardsPunishAmount(BigDecimal settleRewardsPunishAmount) {
|
||||
this.settleRewardsPunishAmount = settleRewardsPunishAmount;
|
||||
}
|
||||
}
|
@ -0,0 +1,253 @@
|
||||
package com.sifang.modules.account.entity;
|
||||
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Entity
|
||||
@Table(name = "crm_trader_account_settle_detail")
|
||||
public class CrmTraderAccountSettleDetail implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String id;
|
||||
private String entryId;
|
||||
private String powerStationCode;
|
||||
private String traderId;
|
||||
private String traderName;
|
||||
private String flag;
|
||||
private String objType;
|
||||
private String type;
|
||||
private BigDecimal amount;
|
||||
private String roofType;
|
||||
private String schemeType;
|
||||
private String schemeTypeId;
|
||||
private String schemeTypeName;
|
||||
private String tenantName;
|
||||
private String mobile;
|
||||
private String projectCode;
|
||||
private String projectName;
|
||||
private String createBy;
|
||||
private Date createTime;
|
||||
private Date endTime;
|
||||
|
||||
private String kingDeeId;
|
||||
|
||||
private String number;
|
||||
|
||||
private String settleNumber;//结算方案编号
|
||||
|
||||
private BigDecimal unitPrice; // 结算单价
|
||||
|
||||
private BigDecimal capacity; // 安装容量
|
||||
|
||||
|
||||
public String getKingDeeId() {
|
||||
return kingDeeId;
|
||||
}
|
||||
|
||||
public void setKingDeeId(String kingDeeId) {
|
||||
this.kingDeeId = kingDeeId;
|
||||
}
|
||||
|
||||
public String getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber(String number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
@Id
|
||||
@GeneratedValue(generator = "idGenerator")
|
||||
@GenericGenerator(name = "idGenerator", strategy = "uuid")
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getEntryId() {
|
||||
return entryId;
|
||||
}
|
||||
|
||||
public void setEntryId(String entryId) {
|
||||
this.entryId = entryId;
|
||||
}
|
||||
|
||||
public String getPowerStationCode() {
|
||||
return powerStationCode;
|
||||
}
|
||||
|
||||
public void setPowerStationCode(String powerStationCode) {
|
||||
this.powerStationCode = powerStationCode;
|
||||
}
|
||||
|
||||
public String getTraderId() {
|
||||
return traderId;
|
||||
}
|
||||
|
||||
public void setTraderId(String traderId) {
|
||||
this.traderId = traderId;
|
||||
}
|
||||
|
||||
public String getTraderName() {
|
||||
return traderName;
|
||||
}
|
||||
|
||||
public void setTraderName(String traderName) {
|
||||
this.traderName = traderName;
|
||||
}
|
||||
|
||||
public String getFlag() {
|
||||
return flag;
|
||||
}
|
||||
|
||||
public void setFlag(String flag) {
|
||||
this.flag = flag;
|
||||
}
|
||||
|
||||
public String getObjType() {
|
||||
return objType;
|
||||
}
|
||||
|
||||
public void setObjType(String objType) {
|
||||
this.objType = objType;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public BigDecimal getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setAmount(BigDecimal amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public String getRoofType() {
|
||||
return roofType;
|
||||
}
|
||||
|
||||
public void setRoofType(String roofType) {
|
||||
this.roofType = roofType;
|
||||
}
|
||||
|
||||
public String getSchemeType() {
|
||||
return schemeType;
|
||||
}
|
||||
|
||||
public void setSchemeType(String schemeType) {
|
||||
this.schemeType = schemeType;
|
||||
}
|
||||
|
||||
public String getSchemeTypeId() {
|
||||
return schemeTypeId;
|
||||
}
|
||||
|
||||
public void setSchemeTypeId(String schemeTypeId) {
|
||||
this.schemeTypeId = schemeTypeId;
|
||||
}
|
||||
|
||||
public String getSchemeTypeName() {
|
||||
return schemeTypeName;
|
||||
}
|
||||
|
||||
public void setSchemeTypeName(String schemeTypeName) {
|
||||
this.schemeTypeName = schemeTypeName;
|
||||
}
|
||||
|
||||
public String getTenantName() {
|
||||
return tenantName;
|
||||
}
|
||||
|
||||
public void setTenantName(String tenantName) {
|
||||
this.tenantName = tenantName;
|
||||
}
|
||||
|
||||
public String getMobile() {
|
||||
return mobile;
|
||||
}
|
||||
|
||||
public void setMobile(String mobile) {
|
||||
this.mobile = mobile;
|
||||
}
|
||||
|
||||
public String getProjectCode() {
|
||||
return projectCode;
|
||||
}
|
||||
|
||||
public void setProjectCode(String projectCode) {
|
||||
this.projectCode = projectCode;
|
||||
}
|
||||
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(String createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Date getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(Date endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public String getSettleNumber() {
|
||||
return settleNumber;
|
||||
}
|
||||
|
||||
public void setSettleNumber(String settleNumber) {
|
||||
this.settleNumber = settleNumber;
|
||||
}
|
||||
|
||||
public BigDecimal getUnitPrice() {
|
||||
return unitPrice;
|
||||
}
|
||||
|
||||
public void setUnitPrice(BigDecimal unitPrice) {
|
||||
this.unitPrice =unitPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getCapacity() {
|
||||
return capacity;
|
||||
}
|
||||
|
||||
public void setCapacity(BigDecimal capacity) {
|
||||
this.capacity = capacity;
|
||||
}
|
||||
}
|
@ -0,0 +1,152 @@
|
||||
package com.sifang.modules.account.entity;
|
||||
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Entity
|
||||
@Table(name = "crm_trader_support_settle_details")
|
||||
public class CrmTraderSupportSettleDetails implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String id;
|
||||
|
||||
private String number;
|
||||
|
||||
private String type;
|
||||
|
||||
private String relateOrderNumber;
|
||||
private String relateOrderId;
|
||||
|
||||
|
||||
private BigDecimal amount;
|
||||
|
||||
private String traderId;
|
||||
|
||||
private String takeAmountUnit;
|
||||
|
||||
private String takeAmountAccount;
|
||||
|
||||
private BigDecimal rate;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private String createBy;
|
||||
|
||||
private String status;
|
||||
|
||||
|
||||
@Id
|
||||
@GeneratedValue(generator = "idGenerator")
|
||||
@GenericGenerator(name = "idGenerator", strategy = "uuid")
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber(String number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getRelateOrderNumber() {
|
||||
return relateOrderNumber;
|
||||
}
|
||||
|
||||
public void setRelateOrderNumber(String relateOrderNumber) {
|
||||
this.relateOrderNumber = relateOrderNumber;
|
||||
}
|
||||
|
||||
public BigDecimal getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setAmount(BigDecimal amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public String getTraderId() {
|
||||
return traderId;
|
||||
}
|
||||
|
||||
public void setTraderId(String traderId) {
|
||||
this.traderId = traderId;
|
||||
}
|
||||
|
||||
public String getTakeAmountUnit() {
|
||||
return takeAmountUnit;
|
||||
}
|
||||
|
||||
public void setTakeAmountUnit(String takeAmountUnit) {
|
||||
this.takeAmountUnit = takeAmountUnit;
|
||||
}
|
||||
|
||||
public String getTakeAmountAccount() {
|
||||
return takeAmountAccount;
|
||||
}
|
||||
|
||||
public void setTakeAmountAccount(String takeAmountAccount) {
|
||||
this.takeAmountAccount = takeAmountAccount;
|
||||
}
|
||||
|
||||
public BigDecimal getRate() {
|
||||
return rate;
|
||||
}
|
||||
|
||||
public void setRate(BigDecimal rate) {
|
||||
this.rate = rate;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(String createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getRelateOrderId() {
|
||||
return relateOrderId;
|
||||
}
|
||||
|
||||
public void setRelateOrderId(String relateOrderId) {
|
||||
this.relateOrderId = relateOrderId;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.sifang.modules.account.service;
|
||||
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.sifang.modules.account.dao.CrmTraderSupportSettleDetailsDao;
|
||||
import com.sifang.modules.account.entity.CrmTraderSupportSettleDetails;
|
||||
import com.sifang.modules.sys.common.service.BaseService;
|
||||
import com.sifang.modules.sys.util.LayuiPage;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class CrmTraderSupportSettleDetailsService extends BaseService {
|
||||
|
||||
@Autowired
|
||||
private CrmTraderSupportSettleDetailsDao supportSettleDetailsDao;
|
||||
|
||||
public CrmTraderSupportSettleDetails getById(String id){
|
||||
return supportSettleDetailsDao.get(id);
|
||||
}
|
||||
|
||||
public void supportAccountListData(LayuiPage<Record> page, Map<String, String> map){
|
||||
supportSettleDetailsDao.supportAccountListData(page,map);
|
||||
}
|
||||
}
|
@ -0,0 +1,122 @@
|
||||
package com.sifang.modules.account.service;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.sifang.modules.account.dao.TotalAssetDetailsDao;
|
||||
import com.sifang.modules.account.handler.CustomerEntryGeExcelImportHandler;
|
||||
import com.sifang.modules.customer.dao.CustomerEntryDao;
|
||||
import com.sifang.modules.customer.entity.CustomerEntry;
|
||||
import com.sifang.modules.order.utils.excelExt.ExcelReader;
|
||||
import com.sifang.modules.sunshine.SystemSetting.utils.Result;
|
||||
import com.sifang.modules.sys.common.service.BaseService;
|
||||
import com.sifang.modules.sys.entity.Operator;
|
||||
import com.sifang.modules.sys.util.LayuiPage;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class TotalAssetDetailsService extends BaseService {
|
||||
|
||||
@Autowired
|
||||
private TotalAssetDetailsDao detailsDao;
|
||||
@Autowired
|
||||
private CustomerEntryDao customerDao;
|
||||
|
||||
public void entryListAccount(LayuiPage<Record> page, Map<String, String> map, Operator operator) {
|
||||
page.setData(detailsDao.entryListAccount(page, map, operator));
|
||||
page.setCount(detailsDao.countEntryListAccount(map, operator));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Map<String, Object> checkImportBarcode(Map<String, String> params, InputStream in) {
|
||||
Map<String, Object> resultMap = Maps.newHashMap();
|
||||
resultMap.put("operType", "check");
|
||||
CustomerEntryGeExcelImportHandler handler = new CustomerEntryGeExcelImportHandler();
|
||||
handler.setStartSheet(1);
|
||||
handler.setStartRow(1);
|
||||
try {
|
||||
new ExcelReader().check(in, params.get("extName"), handler);
|
||||
Map<String, Object> map = (Map<String, Object>) handler.getHandlerResult();
|
||||
String errorMsg = (String) map.get("TemplateError");
|
||||
if (!handler.isCheckFlag()) {
|
||||
handler.appendErrorDetail("<p>未填充数据</p>");
|
||||
}
|
||||
String errorDetail = handler.getErrorDetail();
|
||||
if (StringUtils.isNotBlank(errorMsg)) {
|
||||
resultMap.put("errorDetail", errorMsg);
|
||||
resultMap.put("errorMessage", "y");
|
||||
} else if (StringUtils.isNotBlank(errorDetail)) {
|
||||
resultMap.put("errorDetail", errorDetail);
|
||||
resultMap.put("errorMessage", "y");
|
||||
} else if ("overLimit".equalsIgnoreCase((String) map.get("overLimit"))) {
|
||||
resultMap.put("overLimit", "y");
|
||||
} else {
|
||||
resultMap.put("pass", "y");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
in.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, Object> importBarcode(Map<String, String> params, InputStream in) {
|
||||
Map<String, Object> retMap = Maps.newHashMap();
|
||||
retMap.put("operType", "import");
|
||||
CustomerEntryGeExcelImportHandler handler = new CustomerEntryGeExcelImportHandler();
|
||||
handler.setStartSheet(1);
|
||||
handler.setStartRow(2);
|
||||
|
||||
try {
|
||||
new ExcelReader().readExcel(in, params.get("fileName"), handler);
|
||||
|
||||
retMap.put("pass", "y");
|
||||
List<CustomerEntry> exeSqlParams = handler.getRetList();
|
||||
if (exeSqlParams != null && exeSqlParams.size() > 0) {
|
||||
importProjectContract(exeSqlParams);
|
||||
}
|
||||
retMap.put("successCount", exeSqlParams.size());//成功条数
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
retMap.put("pass", "no");
|
||||
} finally {
|
||||
if (in != null) {
|
||||
try {
|
||||
in.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return retMap;
|
||||
}
|
||||
|
||||
public Result importProjectContract(List<CustomerEntry> paramList) {
|
||||
List<CustomerEntry> entryList = new ArrayList<>();
|
||||
for (CustomerEntry item : paramList) {
|
||||
CustomerEntry entry = customerDao.get(item.getId());
|
||||
entry.setEtd(item.getEtd());
|
||||
entry.setEto(item.getEto());
|
||||
entry.setEtdc(item.getEtdc());
|
||||
entry.setEtoc(item.getEtoc());
|
||||
entryList.add(entry);
|
||||
}
|
||||
customerDao.save(entryList);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package com.sifang.modules.account.service;
|
||||
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.sifang.modules.account.dao.TraderAccountSettleDetailDao;
|
||||
import com.sifang.modules.sunshine.SystemSetting.entity.CrmTrader;
|
||||
import com.sifang.modules.sunshine.SystemSetting.service.TraderService;
|
||||
import com.sifang.modules.sys.common.UserUtils;
|
||||
import com.sifang.modules.sys.common.entity.User;
|
||||
import com.sifang.modules.sys.common.utils.StringUtil;
|
||||
import com.sifang.modules.sys.util.CrmUtils;
|
||||
import com.sifang.modules.sys.util.LayuiPage;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class TraderAccountSettleDetailService {
|
||||
|
||||
@Autowired
|
||||
private TraderAccountSettleDetailDao settleDetailDao;
|
||||
|
||||
@Autowired
|
||||
TraderService traderService;
|
||||
|
||||
public void listSettleDetail(Map<String, String> queryParams, LayuiPage page){
|
||||
User user= UserUtils.getUser();
|
||||
String traderId="";
|
||||
if(User.USER_TYPE_KJ.equals(user.getUserType())){ //代理商
|
||||
traderId = CrmUtils.getUserRelId(user);
|
||||
}else if(User.USER_TYPE_ADVISOR.equals(user.getUserType())){ //代理商人员
|
||||
traderId = CrmUtils.getUserRelId(user);
|
||||
}if(User.USER_TYPE_WXG.equals(user.getUserType())){
|
||||
//平台人员
|
||||
//获取当前人员所负责代理商
|
||||
Record rd = CrmUtils.getByUserId(user);
|
||||
String trader_id=rd.getStr("trader_id");
|
||||
if(StringUtil.isNotBlank(trader_id)){
|
||||
traderId=trader_id;
|
||||
}
|
||||
}
|
||||
queryParams.put("traderIds",traderId);
|
||||
List<Record> list = settleDetailDao.listSettleDetails(queryParams, page);
|
||||
Long count = settleDetailDao.countSettleDetails(queryParams);
|
||||
page.setData(list);
|
||||
page.setCount(count);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package com.sifang.modules.alioss;
|
||||
|
||||
/**
|
||||
* 文件描述
|
||||
*/
|
||||
public class BladeFileInfo implements java.io.Serializable {
|
||||
|
||||
private String name;
|
||||
private String url;
|
||||
|
||||
|
||||
public BladeFileInfo(String name, String url) {
|
||||
this.name = name;
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "FastDfsInfo{" + "name='" + name + '\'' +
|
||||
", url='" + url + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.sifang.modules.alioss;
|
||||
|
||||
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
*
|
||||
|
||||
* @ClassName: OSSClientConstants
|
||||
|
||||
* @Description: OSS阿里云常用变量
|
||||
|
||||
*
|
||||
|
||||
*/
|
||||
|
||||
public class OSSClientConstants {
|
||||
|
||||
|
||||
|
||||
public static String ENDPOINT = "https://oss-cn-shanghai.aliyuncs.com";
|
||||
|
||||
public static String ACCESS_KEY_ID = "LTAI5tQ8EQiqXDoUp5RovX18";
|
||||
|
||||
public static String ACCESS_KEY_SECRET = "HFwIIPGAbmA0B8nyGyZRtZufSfNYzs";
|
||||
|
||||
public static String WEATHER_APP_CODE = "2b4117afed2b4c728d69b7f620197c5a";
|
||||
|
||||
//阿里云API的bucket名称
|
||||
public static final String BACKET_NAME = "nhet";
|
||||
|
||||
//阿里云API的文件夹名称
|
||||
public static final String FOLDER="energy_img/";
|
||||
|
||||
public static final String FOLDER_VIDEO="video/";
|
||||
|
||||
public static final String FORMAT = new SimpleDateFormat("yyyyMMdd").format(new Date());
|
||||
|
||||
public static final String FORMATS = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
|
||||
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package com.sifang.modules.alioss;
|
||||
|
||||
|
||||
|
||||
import com.amazonaws.services.s3.AmazonS3Client;
|
||||
import com.amazonaws.services.s3.model.CannedAccessControlList;
|
||||
import com.amazonaws.services.s3.model.ObjectMetadata;
|
||||
import com.amazonaws.services.s3.model.PutObjectRequest;
|
||||
import com.sifang.modules.sunshine.SystemSetting.utils.StringUtil;
|
||||
import com.sifang.modules.sys.common.global.Global;
|
||||
import com.sifang.modules.sys.common.utils.IdGen;
|
||||
import com.sifang.modules.sys.util.SpringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.sifang.modules.alioss.AliyunOSSClientUtil.getContentType;
|
||||
|
||||
public class S3ClientUtil {
|
||||
|
||||
public static String uploadImage(byte[] b, String extName, String filename) {
|
||||
String dateFmt = new SimpleDateFormat("yyyyMMdd").format(new Date());
|
||||
|
||||
if (extName != null && extName.startsWith(".")) {
|
||||
extName = extName.substring(1);
|
||||
}
|
||||
|
||||
String fileName;
|
||||
if (StringUtil.isNotBlank(filename) && filename.startsWith(extName)) {
|
||||
fileName = filename;
|
||||
} else {
|
||||
fileName = IdGen.uuid() + "." + extName;
|
||||
}
|
||||
String filePath = OSSClientConstants.FOLDER + extName + "/" + dateFmt + "/" + UUID.randomUUID().toString().replaceAll("-", "") + "/" + fileName;
|
||||
|
||||
AmazonS3Client c = SpringUtils.getBean(AmazonS3Client.class);
|
||||
String name = Global.getConfig("s3.bucket");
|
||||
ObjectMetadata m = new ObjectMetadata();
|
||||
m.setContentLength(b.length);
|
||||
m.setContentType(getContentType("." + extName));
|
||||
String ctrl = Global.getConfig("s3.ctrl");
|
||||
if (StringUtils.isNotBlank(ctrl)) {
|
||||
m.setCacheControl(ctrl);
|
||||
}
|
||||
PutObjectRequest req = new PutObjectRequest(name, filePath, new ByteArrayInputStream(b), m);
|
||||
req.withCannedAcl(CannedAccessControlList.PublicRead);
|
||||
c.putObject(req);
|
||||
return filePath;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package com.sifang.modules.bestsign;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.sifang.modules.bestsign.vo.BestSignCallBackRes;
|
||||
import com.sifang.modules.bestsign.vo.BestSignOperationVo;
|
||||
import com.sifang.modules.sunshine.SystemSetting.service.CrmTraderContractService;
|
||||
import com.sifang.modules.sunshine.SystemSetting.utils.BusinessException;
|
||||
import com.sifang.modules.sunshine.SystemSetting.utils.Result;
|
||||
import com.sifang.modules.sys.web.BaseExceptionController;
|
||||
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;
|
||||
|
||||
//上上签 回调
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/main/bestSignCallBack")
|
||||
public class BestSignCallBackController extends BaseExceptionController {
|
||||
Logger logger= LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Autowired
|
||||
private CrmTraderContractService crmTraderContractService;
|
||||
|
||||
//签约回调
|
||||
@ResponseBody
|
||||
@RequestMapping("/signedPush")
|
||||
public Result signedPush(@RequestBody JSONObject json){
|
||||
logger.info(">>>>>>>>>>>>>上上签回调 signedPush json:{}",json);
|
||||
try {
|
||||
String type=json.getString("type");
|
||||
logger.info(">>>>>>>>>>>>>上上签回调 signedPush type:{}",type);
|
||||
if("CONTRACT_COMPLETE".equals(type)){ //签署完成
|
||||
BestSignCallBackRes backRes = JSONObject.parseObject(json.toString(), BestSignCallBackRes.class);
|
||||
logger.info(">>>>>>>>>>>>>>>上上签回调 signedPush backRes:{}", backRes.toString());
|
||||
crmTraderContractService.signedPush(backRes);
|
||||
}else if("OPERATION_COMPLETE".equals(type)){ //合同被收件人签署
|
||||
BestSignOperationVo backRes = JSONObject.parseObject(json.toString(), BestSignOperationVo.class);
|
||||
logger.info(">>>>>>>>>>>>>>>上上签回调 signedPush OperationVo:{}", backRes.toString());
|
||||
crmTraderContractService.operationSignPush(backRes);
|
||||
}
|
||||
} catch (BusinessException c) {
|
||||
c.printStackTrace();
|
||||
logger.error(">>>>>>>>>>>>>>>>>>上上签回调 signedPush c:{}", c.getMessage());
|
||||
return Result.fail("");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error(">>>>>>>>>>>>>>>>>>上上签回调 signedPush e:{}", e);
|
||||
return Result.fail("");
|
||||
}
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.sifang.modules.bestsign.constant;
|
||||
|
||||
public class TraderContractConstant {
|
||||
|
||||
/**
|
||||
* 状态 0删除 1暂存 2代理商待签约 3能辉待签约 4生效中 5已过期 6已作废
|
||||
*/
|
||||
public static final String CONTRACT_DELETE="0";
|
||||
|
||||
public static final String CONTRACT_TEMP_SAVE="1";
|
||||
|
||||
public static final String CONTRACT_TRADER_SIGN="2";
|
||||
|
||||
public static final String CONTRACT_NH_SIGN="3";
|
||||
|
||||
public static final String CONTRACT_USE="4";
|
||||
|
||||
public static final String CONTRACT_VALID="5";
|
||||
|
||||
public static final String CONTRACT_CANCEL="6";
|
||||
}
|
@ -0,0 +1,192 @@
|
||||
package com.sifang.modules.bestsign.utils;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import okhttp3.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.Base64;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class BestSignClient {
|
||||
|
||||
private static final MediaType JSON_TYPE = MediaType.parse("application/json; charset=utf-8");
|
||||
|
||||
/**
|
||||
* 系统的地址
|
||||
*/
|
||||
private String host;
|
||||
|
||||
/**
|
||||
* BestSign分配的客户端编号
|
||||
*/
|
||||
private String clientId;
|
||||
|
||||
/**
|
||||
* 客户端凭证
|
||||
*/
|
||||
private String clientSecret;
|
||||
|
||||
/**
|
||||
* 私钥
|
||||
*/
|
||||
private String privateKey;
|
||||
|
||||
/**
|
||||
* Token的缓存
|
||||
*/
|
||||
private String tokenCache;
|
||||
|
||||
public BestSignClient(String host, String clientId, String clientSecret, String privateKey) {
|
||||
this.host = host;
|
||||
this.clientId = clientId;
|
||||
this.clientSecret = clientSecret;
|
||||
this.privateKey = privateKey;
|
||||
}
|
||||
|
||||
private final ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
//shared perform best
|
||||
private final OkHttpClient okHttpClient = new OkHttpClient
|
||||
.Builder()
|
||||
.readTimeout(1, TimeUnit.MINUTES)
|
||||
.build();
|
||||
|
||||
/**
|
||||
* @param uriWithParam 请求的URL和参数
|
||||
* @param method HTTP请求动词
|
||||
* @param requestData 请求的内容
|
||||
*
|
||||
* @return JSON字符串
|
||||
*/
|
||||
public String executeRequest(String uriWithParam, String method, Object requestData) {
|
||||
return executeRequest(uriWithParam, method, requestData, 3);
|
||||
}
|
||||
|
||||
private String executeRequest(String uriWithParam, String method, Object requestData, int retryTime) {
|
||||
while (retryTime > 0) {
|
||||
try {
|
||||
String token = queryToken();
|
||||
Long timestamp = System.currentTimeMillis();
|
||||
String urlWithQueryParam = String.format("%s%s", host, uriWithParam);
|
||||
final String signRSA = signRequest(uriWithParam, timestamp, requestData);
|
||||
Headers headers = new Headers
|
||||
.Builder()
|
||||
.add("Authorization", "bearer " + token)
|
||||
.add("bestsign-sign-timestamp", timestamp.toString())
|
||||
.add("bestsign-client-id", clientId)
|
||||
.add("bestsign-signature-type", "RSA256")
|
||||
.add("bestsign-signature", signRSA)
|
||||
.build();
|
||||
|
||||
final Request.Builder requestBuilder = new Request
|
||||
.Builder()
|
||||
.url(urlWithQueryParam)
|
||||
.headers(headers);
|
||||
|
||||
if (Objects.equals(method.toUpperCase(), "GET")) {
|
||||
requestBuilder.get();
|
||||
} else {
|
||||
|
||||
final RequestBody requestBody = RequestBody.create(JSON_TYPE, requestData == null ? "" : objectMapper.writeValueAsString(requestData));
|
||||
requestBuilder.method(method.toUpperCase(), requestBody);
|
||||
}
|
||||
|
||||
final Response response = okHttpClient.newCall(requestBuilder.build()).execute();
|
||||
|
||||
if (response.code() == 401) {
|
||||
// token失效, 重新获取token
|
||||
invalidToken(token);
|
||||
} else if (response.code() == 200) {
|
||||
if(response.headers().get("Content-Type").equals("application/zip") || response.headers().get("Content-Type").equals("application/pdf")
|
||||
|| response.headers().get("Content-Type").equals("application/octet-stream")) {
|
||||
return Base64.getEncoder().encodeToString(response.body().bytes());
|
||||
}
|
||||
return response.body() != null ? response.body().string() : null;
|
||||
}
|
||||
retryTime--;
|
||||
} catch (Exception ex) {
|
||||
retryTime--;
|
||||
}
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private String signRequest(String uriWithParam, Long timestamp, Object requestData) throws Exception {
|
||||
String content = String.format(
|
||||
"bestsign-client-id=%sbestsign-sign-timestamp=%sbestsign-signature-type=%srequest-body=%suri=%s",
|
||||
clientId,
|
||||
timestamp.toString(),
|
||||
"RSA256",
|
||||
MD5Utils.stringMD5(requestData == null ? "" : objectMapper.writeValueAsString(requestData)),
|
||||
uriWithParam);
|
||||
|
||||
return RSAUtils.signRSA(content, privateKey);
|
||||
}
|
||||
|
||||
public synchronized String queryToken() throws IOException {
|
||||
if (null == tokenCache) {
|
||||
Map<String, String> requestData = new HashMap<>(2);
|
||||
requestData.put("clientId", clientId);
|
||||
requestData.put("clientSecret", clientSecret);
|
||||
final RequestBody requestBody = RequestBody.create(JSON_TYPE, objectMapper.writeValueAsString(requestData));
|
||||
Request request = new Request
|
||||
.Builder()
|
||||
.url(String.format("%s/api/oa2/client-credentials/token", host))
|
||||
.post(requestBody)
|
||||
.build();
|
||||
|
||||
final Response response = okHttpClient.newCall(request).execute();
|
||||
if (response.body() != null) {
|
||||
tokenCache = objectMapper.readTree(response.body().string()).get("data").get("accessToken").asText();
|
||||
return tokenCache;
|
||||
}
|
||||
} else {
|
||||
return tokenCache;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private synchronized void invalidToken(String oldToken) {
|
||||
if (oldToken.equals(tokenCache)) {
|
||||
tokenCache = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 外部渠道替换图片域名
|
||||
*/
|
||||
public static String replaceDomainName(String text, String needUrl) {
|
||||
text = text.replaceAll("http://", "");
|
||||
text = text.replaceAll("https://", "");
|
||||
text = text.substring(text.indexOf("/"), text.length());
|
||||
return needUrl + text;
|
||||
}
|
||||
|
||||
public static String shortUrl2Long(String shortUrl){
|
||||
HttpURLConnection urlConnection = null;
|
||||
try {
|
||||
URL u = new URL(shortUrl);
|
||||
urlConnection = (HttpURLConnection) u.openConnection();
|
||||
urlConnection.getHeaderFields();
|
||||
URL url = urlConnection.getURL();
|
||||
return url.toString();
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (urlConnection != null) {
|
||||
urlConnection.disconnect();
|
||||
}
|
||||
}
|
||||
return shortUrl;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
package com.sifang.modules.bestsign.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class BestSignCallBackDataRes {
|
||||
|
||||
private String bizNo;
|
||||
private List<String> contractIds;
|
||||
private String senderUserAccount;
|
||||
private String senderBusinessLine;
|
||||
private String senderEnterpriseName;
|
||||
|
||||
public void setBizNo(String bizNo) {
|
||||
this.bizNo = bizNo;
|
||||
}
|
||||
|
||||
public void setContractIds(List<String> contractIds) {
|
||||
this.contractIds = contractIds;
|
||||
}
|
||||
|
||||
public void setSenderUserAccount(String senderUserAccount) {
|
||||
this.senderUserAccount = senderUserAccount;
|
||||
}
|
||||
|
||||
public void setSenderBusinessLine(String senderBusinessLine) {
|
||||
this.senderBusinessLine = senderBusinessLine;
|
||||
}
|
||||
|
||||
public void setSenderEnterpriseName(String senderEnterpriseName) {
|
||||
this.senderEnterpriseName = senderEnterpriseName;
|
||||
}
|
||||
|
||||
public String getBizNo() {
|
||||
return bizNo;
|
||||
}
|
||||
|
||||
public List<String> getContractIds() {
|
||||
return contractIds;
|
||||
}
|
||||
|
||||
public String getSenderUserAccount() {
|
||||
return senderUserAccount;
|
||||
}
|
||||
|
||||
public String getSenderBusinessLine() {
|
||||
return senderBusinessLine;
|
||||
}
|
||||
|
||||
public String getSenderEnterpriseName() {
|
||||
return senderEnterpriseName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BestSignCallBackDataRes{" +
|
||||
"bizNo='" + bizNo + '\'' +
|
||||
", contractIds=" + contractIds +
|
||||
", senderUserAccount='" + senderUserAccount + '\'' +
|
||||
", senderBusinessLine='" + senderBusinessLine + '\'' +
|
||||
", senderEnterpriseName='" + senderEnterpriseName + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.sifang.modules.bestsign.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class BestSignCallBackRes {
|
||||
|
||||
private String timestamp;
|
||||
private String clientId;
|
||||
private String type;
|
||||
private BestSignCallBackDataRes responseData;
|
||||
|
||||
public String getTimestamp() {
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
public void setTimestamp(String timestamp) {
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
public String getClientId() {
|
||||
return clientId;
|
||||
}
|
||||
|
||||
public void setClientId(String clientId) {
|
||||
this.clientId = clientId;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public BestSignCallBackDataRes getResponseData() {
|
||||
return responseData;
|
||||
}
|
||||
|
||||
public void setResponseData(BestSignCallBackDataRes responseData) {
|
||||
this.responseData = responseData;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BestSignCallBackRes{" +
|
||||
"timestamp='" + timestamp + '\'' +
|
||||
", clientId='" + clientId + '\'' +
|
||||
", type='" + type + '\'' +
|
||||
", responseData=" + responseData +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.sifang.modules.bestsign.vo;
|
||||
|
||||
public class BestSignOperationResVo {
|
||||
|
||||
private String bizNo;
|
||||
private String contractId;
|
||||
private String receiverId;
|
||||
private String operationStatus;
|
||||
|
||||
private String roleName;
|
||||
|
||||
public String getBizNo() {
|
||||
return bizNo;
|
||||
}
|
||||
|
||||
public void setBizNo(String bizNo) {
|
||||
this.bizNo = bizNo;
|
||||
}
|
||||
|
||||
public String getContractId() {
|
||||
return contractId;
|
||||
}
|
||||
|
||||
public void setContractId(String contractId) {
|
||||
this.contractId = contractId;
|
||||
}
|
||||
|
||||
public String getReceiverId() {
|
||||
return receiverId;
|
||||
}
|
||||
|
||||
public void setReceiverId(String receiverId) {
|
||||
this.receiverId = receiverId;
|
||||
}
|
||||
|
||||
public String getOperationStatus() {
|
||||
return operationStatus;
|
||||
}
|
||||
|
||||
public void setOperationStatus(String operationStatus) {
|
||||
this.operationStatus = operationStatus;
|
||||
}
|
||||
|
||||
public String getRoleName() {
|
||||
return roleName;
|
||||
}
|
||||
|
||||
public void setRoleName(String roleName) {
|
||||
this.roleName = roleName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BestSignOperationResVo{" +
|
||||
"bizNo='" + bizNo + '\'' +
|
||||
", contractId='" + contractId + '\'' +
|
||||
", receiverId='" + receiverId + '\'' +
|
||||
", operationStatus='" + operationStatus + '\'' +
|
||||
", roleName='" + roleName + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package com.sifang.modules.bestsign.vo;
|
||||
|
||||
public class BestSignOperationVo {
|
||||
|
||||
private String timestamp;
|
||||
private String clientId;
|
||||
private String type;
|
||||
|
||||
private BestSignOperationResVo responseData;
|
||||
|
||||
public String getTimestamp() {
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
public void setTimestamp(String timestamp) {
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
public String getClientId() {
|
||||
return clientId;
|
||||
}
|
||||
|
||||
public void setClientId(String clientId) {
|
||||
this.clientId = clientId;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
|
||||
public BestSignOperationResVo getResponseData() {
|
||||
return responseData;
|
||||
}
|
||||
|
||||
public void setResponseData(BestSignOperationResVo responseData) {
|
||||
this.responseData = responseData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BestSignOperationVo{" +
|
||||
"timestamp='" + timestamp + '\'' +
|
||||
", clientId='" + clientId + '\'' +
|
||||
", type='" + type + '\'' +
|
||||
", responseData=" + responseData +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.sifang.modules.changes.constant;
|
||||
|
||||
public class CustomerEntryChangeDesignConstant {
|
||||
|
||||
/**
|
||||
* status 状态 0.待审核 1.审核通过 2.不通过 3.已撤回
|
||||
*/
|
||||
public static final String AUDIT_STATUS_WAIT = "0";
|
||||
public static final String AUDIT_STATUS_PASS = "1";
|
||||
public static final String AUDIT_STATUS_REJECT = "2";
|
||||
public static final String AUDIT_STATUS_CANCEL = "3";
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package com.sifang.modules.changes.controller;
|
||||
|
||||
import com.sifang.modules.customer.Service.CustomerEntryService;
|
||||
import com.sifang.modules.sunshine.SystemSetting.entity.CrmTrader;
|
||||
import com.sifang.modules.sunshine.SystemSetting.service.TraderService;
|
||||
import com.sifang.modules.sys.common.UserUtils;
|
||||
import com.sifang.modules.sys.common.entity.User;
|
||||
import com.sifang.modules.sys.util.CrmUtils;
|
||||
import com.sifang.modules.sys.web.BaseExceptionController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/change/common")
|
||||
public class ChangeCommonController extends BaseExceptionController {
|
||||
@Autowired
|
||||
TraderService traderService;
|
||||
@Autowired
|
||||
CustomerEntryService entryService;
|
||||
|
||||
//选择资方页面
|
||||
|
||||
/**
|
||||
* type 1.客户信息变更 2.勘测变更 3.设计变更 4.完工变更 5.并网变更 6.物料变更
|
||||
*/
|
||||
@RequestMapping("/choosePartner")
|
||||
public String choosePartner(HttpServletRequest request , Model model) {
|
||||
String type = request.getParameter("type");
|
||||
// 获取代理商
|
||||
User user = UserUtils.getUser();
|
||||
CrmTrader trader;
|
||||
if (User.USER_TYPE_ADVISOR.equals(user.getUserType())) {
|
||||
String traderId = CrmUtils.getUserRelId(user);
|
||||
trader = traderService.getById(traderId);
|
||||
} else {
|
||||
trader = traderService.getTraderBuserId(user.getId());
|
||||
}
|
||||
String traderId = trader.getId();
|
||||
if ("2".equals(trader.getType())) {
|
||||
traderId = trader.getParentId();
|
||||
}
|
||||
// 获取代理商对应资方
|
||||
model.addAttribute("capital", entryService.getCapital(traderId));
|
||||
model.addAttribute("type",type);//区分哪个变更
|
||||
return "modules/yangguang/changes/common/choosePartner";
|
||||
}
|
||||
}
|
@ -0,0 +1,444 @@
|
||||
package com.sifang.modules.changes.controller;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.sifang.modules.changes.entity.CustomerEntryCompletionChangeRecord;
|
||||
import com.sifang.modules.changes.entity.CustomerEntryCompletionChangeRecordDetail;
|
||||
import com.sifang.modules.changes.service.CrmCompletionInfoChangeService;
|
||||
import com.sifang.modules.changes.dao.CrmCompletionInfoChangeDao;
|
||||
import com.sifang.modules.changes.vo.CrmCompletionInfoChangeDTO;
|
||||
import com.sifang.modules.changes.vo.SurveyAuditVo;
|
||||
import com.sifang.modules.customer.Service.CustomerEntryService;
|
||||
import com.sifang.modules.customer.Service.CustomerEntrySurveyRecordService;
|
||||
import com.sifang.modules.customer.constant.PartnerConstants;
|
||||
import com.sifang.modules.customer.constant.UserConstants;
|
||||
import com.sifang.modules.customer.dao.CrmAcceptingReportDetailDao;
|
||||
import com.sifang.modules.customer.dao.CrmCustomerIncomingApplicationInsuranceDao;
|
||||
import com.sifang.modules.customer.entity.CrmAcceptingReport;
|
||||
import com.sifang.modules.customer.entity.CrmAcceptingReportDetail;
|
||||
import com.sifang.modules.customer.entity.CustomerEntry;
|
||||
import com.sifang.modules.customer.entity.CustomerEntrySurveyRecord;
|
||||
import com.sifang.modules.customer.form.AddReportReq;
|
||||
import com.sifang.modules.platform.utils.AddressUtils;
|
||||
import com.sifang.modules.sunshine.SystemSetting.dao.TraderDao;
|
||||
import com.sifang.modules.sunshine.SystemSetting.entity.CrmProjectSetting;
|
||||
import com.sifang.modules.sunshine.SystemSetting.entity.CrmTraderEmploye;
|
||||
import com.sifang.modules.sunshine.SystemSetting.service.FormSetService;
|
||||
import com.sifang.modules.sunshine.SystemSetting.service.ProjectInfoSettingService;
|
||||
import com.sifang.modules.sunshine.SystemSetting.service.TraderEmployeService;
|
||||
import com.sifang.modules.sunshine.SystemSetting.utils.Result;
|
||||
import com.sifang.modules.sunshine.SystemSetting.utils.StringUtil;
|
||||
import com.sifang.modules.sunshine.partnerManagement.entity.CrmPartner;
|
||||
import com.sifang.modules.sunshine.partnerManagement.service.PartnerService;
|
||||
import com.sifang.modules.sys.common.UserUtils;
|
||||
import com.sifang.modules.sys.common.entity.User;
|
||||
import com.sifang.modules.sys.entity.Operator;
|
||||
import com.sifang.modules.sys.util.CrmUtils;
|
||||
import com.sifang.modules.sys.util.FormSetUtils;
|
||||
import com.sifang.modules.sys.util.LayuiPage;
|
||||
import com.sifang.modules.sys.web.BaseExceptionController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/completion/change")
|
||||
public class CrmCompletionInfoChangeController extends BaseExceptionController {
|
||||
|
||||
@Autowired
|
||||
CrmCompletionInfoChangeService changeService;
|
||||
|
||||
@Autowired
|
||||
CrmCompletionInfoChangeDao changeDao;
|
||||
|
||||
@Autowired
|
||||
private PartnerService partnerService;
|
||||
|
||||
@Autowired
|
||||
TraderEmployeService traderEmployeService;
|
||||
|
||||
@Autowired
|
||||
CustomerEntryService entryService;
|
||||
|
||||
@Autowired
|
||||
ProjectInfoSettingService projectService;
|
||||
|
||||
@Autowired
|
||||
CustomerEntrySurveyRecordService surveyRecordService;
|
||||
|
||||
@Autowired
|
||||
CustomerEntryService customerEntryService;
|
||||
|
||||
@Autowired
|
||||
TraderDao traderDao;
|
||||
|
||||
@Autowired
|
||||
private CrmCustomerIncomingApplicationInsuranceDao insuranceDao;
|
||||
|
||||
@Autowired
|
||||
private FormSetService formSetService;
|
||||
|
||||
@Autowired
|
||||
private CrmAcceptingReportDetailDao crmAcceptingReportDetailDao;
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value = "findCompletionChangeList")
|
||||
public String customerContractList(HttpServletRequest request, Model model) {
|
||||
User user = UserUtils.getUser();
|
||||
model.addAttribute("user", user);
|
||||
return "modules/yangguang/changes/complete/completionInfoChange";
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "completionChangeList")
|
||||
public Object bankCardListDate(HttpServletRequest request) {
|
||||
LayuiPage<Record> page = new LayuiPage<>(request);
|
||||
Map<String, String> params = getParams(request);
|
||||
User user = UserUtils.getUser();
|
||||
if (User.USER_TYPE_HZS.equals(user.getUserType())) {
|
||||
String parId = CrmUtils.getPartnerId(user.getId());
|
||||
CrmPartner partner = partnerService.getById(parId);
|
||||
params.put("authorizedId", partner.getAuthorizedId());
|
||||
} else if (User.USER_TYPE_PARTNER.equals(user.getUserType())) {
|
||||
CrmPartner partner = partnerService.findByUserId(user.getId());
|
||||
params.put("authorizedId", partner.getAuthorizedId());
|
||||
} else if (User.USER_TYPE_ADVISOR.equals(user.getUserType())) {
|
||||
CrmTraderEmploye employe = traderEmployeService.findByUserId(user.getId());
|
||||
params.put("engineerId", employe.getId());
|
||||
}
|
||||
Operator operator = Operator.of(user.getId(), CrmUtils.getUserXM(user),user.getUserType());
|
||||
changeService.listData(page, params, "0", operator);
|
||||
return page.renderJson();
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("changeRecord")
|
||||
public String record(){
|
||||
return "modules/yangguang/changes/complete/completionInfoChangeRecord";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 变更记录列表数据
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "recordData")
|
||||
public Object recordData(HttpServletRequest request) {
|
||||
LayuiPage<Record> page = new LayuiPage<>(request);
|
||||
Map<String, String> params = getParams(request);
|
||||
User user = UserUtils.getUser();
|
||||
if(User.USER_TYPE_HZS.equals(user.getUserType())){
|
||||
String parId = CrmUtils.getPartnerId(user.getId());
|
||||
CrmPartner partner = partnerService.getById(parId);
|
||||
params.put("authorizedId", partner.getAuthorizedId());
|
||||
}else if(User.USER_TYPE_PARTNER.equals(user.getUserType())){
|
||||
CrmPartner partner = partnerService.findByUserId(user.getId());
|
||||
params.put("authorizedId", partner.getAuthorizedId());
|
||||
} else if (User.USER_TYPE_ADVISOR.equals(user.getUserType())) {
|
||||
CrmTraderEmploye employe = traderEmployeService.findByUserId(user.getId());
|
||||
params.put("engineerId", employe.getId());
|
||||
}
|
||||
Operator operator = Operator.of(user.getId(), CrmUtils.getUserXM(user),user.getUserType());
|
||||
changeService.listData(page, params, "1", operator);
|
||||
return page.renderJson();
|
||||
}
|
||||
|
||||
@RequestMapping("/toAddPage")
|
||||
public String toAddPage(HttpServletRequest request,Model model) {
|
||||
String partnerId = request.getParameter("partnerId");
|
||||
model.addAttribute("partnerId", partnerId);
|
||||
if (PartnerConstants.PARTNER_ID_HR.equals(partnerId)){
|
||||
return "modules/yangguang/changes/complete/addCompletionChangeHR";
|
||||
}
|
||||
return "modules/yangguang/changes/complete/addComplete";
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据电站编号获取电站信息
|
||||
* @param stationCode
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("selectNumber/{stationCode}")
|
||||
public Result selectNumber(@PathVariable("stationCode") String stationCode) {
|
||||
Result ret = Result.ok();
|
||||
Map<String, Object> resMap = Maps.newHashMap();
|
||||
CustomerEntry customerEntry = entryService.findCustomerEntryById(stationCode);
|
||||
if (customerEntry == null) {
|
||||
ret = Result.fail("未找到电站信息");
|
||||
return ret;
|
||||
}
|
||||
|
||||
//判断电站与角色是否相符
|
||||
User user = UserUtils.getUser();
|
||||
Operator operator = Operator.of(user.getId(), CrmUtils.getUserXM(user),user.getUserType());
|
||||
if(StringUtil.equalsAny(operator.getUserType(), UserConstants.TYPE_TRADER, User.USER_TYPE_ADVISOR)){
|
||||
Record record= CrmUtils.getUserTrader(operator.getUserType(),operator.getUserId());
|
||||
String traderId =record.getStr("id");
|
||||
if(UserConstants.TYPE_TRADER.equals(operator.getUserType())){ //代理商
|
||||
if ("1".equals(record.getStr("type"))){ // 1.一级代理商 2.二级代理商
|
||||
if (!customerEntry.getDistributorId().equals(traderId)) {
|
||||
ret = Result.fail("未找到电站信息");
|
||||
return ret;
|
||||
}
|
||||
}else{ //二级代理商
|
||||
if (UserConstants.TYPE_TRADER.equals(operator.getUserType())) {
|
||||
//代理商只能查看自己的
|
||||
if (!traderId.equals(customerEntry.getCreateTraderId())) {
|
||||
ret = Result.fail("未找到电站信息");
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
}else { //代理商人员
|
||||
if (!traderId.equals(customerEntry.getCreateTraderId())) {
|
||||
ret = Result.fail("未找到电站信息");
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* if (!StringUtil.equalsAny(customerEntry.getStatus(), CustomerEntryConstants.ENTRY_STATUS_DBW, CustomerEntryConstants.ENTRY_STATUS_YSBH
|
||||
, CustomerEntryConstants.ENTRY_STATUS_DYS)) {
|
||||
ret = Result.fail("电站状态不可进行该操作");
|
||||
return ret;
|
||||
}*/
|
||||
// 验收报告
|
||||
CrmAcceptingReport report = new CrmAcceptingReport();
|
||||
if (StringUtil.isNotBlank(customerEntry.getReceivingReportId())) {
|
||||
report = customerEntryService.getReportById(customerEntry.getReceivingReportId());
|
||||
}
|
||||
resMap.put("report", report);
|
||||
CustomerEntrySurveyRecord surveyRecord = surveyRecordService.findByEntryId(customerEntry.getId());
|
||||
resMap.put("customerEntry", customerEntry);
|
||||
resMap.put("surveyRecord", surveyRecord);
|
||||
resMap.put("project", projectService.getById(customerEntry.getProjectId()));
|
||||
resMap.put("formSet", FormSetUtils.getFormPartSetByStep(null, "", "09", customerEntry.getPartnerId(), false));
|
||||
resMap.put("formSetMerge", FormSetUtils.getFormPartSetByStep(null, "", "10", customerEntry.getPartnerId(), false));
|
||||
List<String> needUploadImg=formSetService.getMustFillFlag("10",customerEntry.getPartnerId());
|
||||
resMap.put("mergeInfoSet",needUploadImg);
|
||||
resMap.put("insurances", insuranceDao.getByEntryIds(customerEntry.getId()));
|
||||
//获取电力公司
|
||||
String powerCompany=AddressUtils.findProCodeNameByCode(customerEntry.getProvinceCode());
|
||||
resMap.put("powerCompany",powerCompany);
|
||||
if (PartnerConstants.PARTNER_ID_HR.equals(customerEntry.getPartnerId())){
|
||||
List<Record> projectList = projectService.getEntryProjectByEntryId(customerEntry.getId());
|
||||
//华融多产品
|
||||
for(Record record : projectList){
|
||||
CrmAcceptingReportDetail acceptReport = crmAcceptingReportDetailDao.findByEntryIdAndProjectId(customerEntry.getId(),record.getStr("projectId"));
|
||||
record.set("acceptReport", acceptReport);
|
||||
}
|
||||
resMap.put("projectList",projectList);
|
||||
}
|
||||
ret.setData(resMap);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* 去选择电站页面
|
||||
*/
|
||||
@RequestMapping("/toSelectEntry")
|
||||
public String toSelectEntry(HttpServletRequest request ,Model model) {
|
||||
User user = UserUtils.getUser();
|
||||
//地址信息
|
||||
List<Record> pros = AddressUtils.findProvinceListByTraderId(CrmUtils.getCurrentTraderId(user.getId()), null);
|
||||
model.addAttribute("province", pros);
|
||||
model.addAttribute("partnerId", request.getParameter("partnerId"));
|
||||
return "modules/yangguang/changes/complete/selectEntry";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加变更记录/暂存变更记录/修改变更记录
|
||||
* @param recordVo
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("addChangeRecord")
|
||||
public Result addChangeRecord(CrmCompletionInfoChangeDTO recordVo) {
|
||||
return changeService.addChangeRecord(recordVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加变更记录--华融
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("addHRChangeRecord")
|
||||
public Result addHRChangeRecord(@RequestBody AddReportReq req) {
|
||||
return changeService.addHRChangeRecord(req);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核页面
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("audit/{id}")
|
||||
public String toAuditPage(@PathVariable("id") String id, Model model) {
|
||||
CustomerEntryCompletionChangeRecord record = changeService.selectById(id);
|
||||
CustomerEntryCompletionChangeRecord oldRecord = changeService.selectPre(record.getEntryId(), record.getNum());
|
||||
CustomerEntry customerEntry = entryService.getById(record.getEntryId());
|
||||
CrmProjectSetting projectSetting = projectService.getById(customerEntry.getProjectId());
|
||||
model.addAttribute("customerEntry", customerEntry);
|
||||
model.addAttribute("project", projectSetting);
|
||||
model.addAttribute("change", record);
|
||||
model.addAttribute("oldChange", oldRecord);
|
||||
model.addAttribute("formSet", JSONObject.toJSONString(FormSetUtils.getFormPartSetByStep(null, "", "09", customerEntry.getPartnerId(), false)));
|
||||
if (PartnerConstants.PARTNER_ID_HR.equals(customerEntry.getPartnerId())){
|
||||
model.addAttribute("info2",formSetService.getListByCondition("09", customerEntry.getPartnerId()) );
|
||||
List<Record> projectList = projectService.getEntryProjectByEntryId(customerEntry.getId());
|
||||
model.addAttribute("projectDetailList",projectList);
|
||||
//华融多产品--获取更新的记录
|
||||
List<CustomerEntryCompletionChangeRecordDetail> newList=changeService.getByRecordId(record.getId());
|
||||
model.addAttribute("newList",newList);
|
||||
Map<String, CustomerEntryCompletionChangeRecordDetail> newEntryChangeMap = newList.stream().collect(Collectors.toMap(e -> e.getProjectId(), e -> e, (a, b) -> a));
|
||||
model.addAttribute("newListMap",newEntryChangeMap);
|
||||
List<CustomerEntryCompletionChangeRecordDetail> oldList=changeService.getByRecordId(oldRecord.getId());
|
||||
model.addAttribute("oldList",oldList);
|
||||
Map<String, CustomerEntryCompletionChangeRecordDetail> oldEntryChangeMap = oldList.stream().collect(Collectors.toMap(e -> e.getProjectId(), e -> e, (a, b) -> a));
|
||||
model.addAttribute("oldListMap",oldEntryChangeMap);
|
||||
model.addAttribute("from","audit");
|
||||
model.addAttribute("completionChange", record);
|
||||
model.addAttribute("remarks",record.getRemarks());
|
||||
return "modules/yangguang/changes/complete/completeChangeDetailHR";
|
||||
}
|
||||
return "modules/yangguang/changes/complete/completeChangeAudit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核通过
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("pass")
|
||||
public Result pass(SurveyAuditVo auditVo) {
|
||||
Result ret = null;
|
||||
try {
|
||||
ret = changeService.pass(auditVo);
|
||||
} catch (IllegalArgumentException e) {
|
||||
ret = Result.fail(e.getMessage());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
ret = Result.fail("操作失败");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* 备注暂存
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("tempRemark")
|
||||
public Result tempRemark(SurveyAuditVo auditVo) {
|
||||
Result ret = null;
|
||||
try {
|
||||
ret = changeService.tempRemark(auditVo);
|
||||
} catch (IllegalArgumentException e) {
|
||||
ret = Result.fail(e.getMessage());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
ret = Result.fail("操作失败");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 审核通过
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("passHR")
|
||||
public Result passHR(SurveyAuditVo auditVo) {
|
||||
Result ret = null;
|
||||
try {
|
||||
ret = changeService.passHR(auditVo);
|
||||
} catch (IllegalArgumentException e) {
|
||||
ret = Result.fail(e.getMessage());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
ret = Result.fail("操作失败");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核不通过
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("refuse")
|
||||
public Result refuse(SurveyAuditVo auditVo) {
|
||||
return changeService.refuse(auditVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 变更详情
|
||||
* @param id
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/toComDetail/{id}")
|
||||
public String toComDetail(@PathVariable("id") String id, Model model) {
|
||||
CustomerEntryCompletionChangeRecord record = changeService.selectById(id);
|
||||
CustomerEntryCompletionChangeRecord oldRecord = changeService.selectPre(record.getEntryId(), record.getNum());
|
||||
CustomerEntry customerEntry = entryService.getById(record.getEntryId());
|
||||
CrmProjectSetting projectSetting = projectService.getById(customerEntry.getProjectId());
|
||||
model.addAttribute("customerEntry", customerEntry);
|
||||
model.addAttribute("project", projectSetting);
|
||||
model.addAttribute("change", record);
|
||||
model.addAttribute("oldChange", oldRecord);
|
||||
model.addAttribute("formSet", JSONObject.toJSONString(FormSetUtils.getFormPartSetByStep(null, "", "09", customerEntry.getPartnerId(), false)));
|
||||
|
||||
if (PartnerConstants.PARTNER_ID_HR.equals(customerEntry.getPartnerId())){
|
||||
model.addAttribute("info2",formSetService.getListByCondition("09", customerEntry.getPartnerId()) );
|
||||
List<Record> projectList = projectService.getEntryProjectByEntryId(customerEntry.getId());
|
||||
model.addAttribute("projectDetailList",projectList);
|
||||
//华融多产品--获取更新的记录
|
||||
List<CustomerEntryCompletionChangeRecordDetail> newList=changeService.getByRecordId(record.getId());
|
||||
model.addAttribute("newList",newList);
|
||||
Map<String, CustomerEntryCompletionChangeRecordDetail> newEntryChangeMap = newList.stream().collect(Collectors.toMap(e -> e.getProjectId(), e -> e, (a, b) -> a));
|
||||
model.addAttribute("newListMap",newEntryChangeMap);
|
||||
List<CustomerEntryCompletionChangeRecordDetail> oldList=changeService.getByRecordId(oldRecord.getId());
|
||||
model.addAttribute("oldList",oldList);
|
||||
Map<String, CustomerEntryCompletionChangeRecordDetail> oldEntryChangeMap = oldList.stream().collect(Collectors.toMap(e -> e.getProjectId(), e -> e, (a, b) -> a));
|
||||
model.addAttribute("oldListMap",oldEntryChangeMap);
|
||||
model.addAttribute("from","detail");
|
||||
return "modules/yangguang/changes/complete/completeChangeDetailHR";
|
||||
}
|
||||
return "modules/yangguang/changes/complete/complateChangeDetail";
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤回
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("cancel/{id}")
|
||||
public Result cancel(@PathVariable("id") String id) {
|
||||
return changeService.back(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,525 @@
|
||||
package com.sifang.modules.changes.controller;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.gson.Gson;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.sifang.modules.changes.dao.CrmCustomerEntryChangeDesignDetailDao;
|
||||
import com.sifang.modules.changes.entity.CrmCustomerEntryChangeDesign;
|
||||
import com.sifang.modules.changes.service.CustomerEntryChangeDesignComponentService;
|
||||
import com.sifang.modules.changes.service.CustomerEntryChangeDesignService;
|
||||
import com.sifang.modules.changes.vo.AddDesignChangeReq;
|
||||
import com.sifang.modules.changes.vo.DesignChangeAuditReq;
|
||||
import com.sifang.modules.customer.Service.CrmCustomerEntrySurveyRecordDetailService;
|
||||
import com.sifang.modules.customer.Service.CustomerEntryComponentService;
|
||||
import com.sifang.modules.customer.Service.CustomerEntryService;
|
||||
import com.sifang.modules.customer.constant.CustomerEntryConstants;
|
||||
import com.sifang.modules.customer.constant.PartnerConstants;
|
||||
import com.sifang.modules.customer.constant.UserConstants;
|
||||
import com.sifang.modules.customer.dao.CrmAcceptingReportDetailDao;
|
||||
import com.sifang.modules.customer.dao.CrmCustomerEntryDesignDao;
|
||||
import com.sifang.modules.customer.dao.CrmCustomerEntryProjectDao;
|
||||
import com.sifang.modules.customer.dao.CrmCustomerEntrySurveyRecordDetailDao;
|
||||
import com.sifang.modules.customer.entity.CrmAcceptingReportDetail;
|
||||
import com.sifang.modules.customer.entity.CrmCustomerEntryDesign;
|
||||
import com.sifang.modules.customer.entity.CrmCustomerEntrySurveyRecordDetail;
|
||||
import com.sifang.modules.customer.entity.CustomerEntry;
|
||||
import com.sifang.modules.platform.utils.AddressUtils;
|
||||
import com.sifang.modules.sunshine.SystemSetting.entity.CrmProjectSetting;
|
||||
import com.sifang.modules.sunshine.SystemSetting.entity.CrmTraderEmploye;
|
||||
import com.sifang.modules.sunshine.SystemSetting.service.*;
|
||||
import com.sifang.modules.sunshine.SystemSetting.utils.BusinessException;
|
||||
import com.sifang.modules.sunshine.SystemSetting.utils.Result;
|
||||
import com.sifang.modules.sunshine.SystemSetting.utils.StringUtil;
|
||||
import com.sifang.modules.sunshine.partnerManagement.dao.PartnerDao;
|
||||
import com.sifang.modules.sys.common.UserUtils;
|
||||
import com.sifang.modules.sys.common.entity.User;
|
||||
import com.sifang.modules.sys.entity.Operator;
|
||||
import com.sifang.modules.sys.util.CrmUtils;
|
||||
import com.sifang.modules.sys.util.FormSetUtils;
|
||||
import com.sifang.modules.sys.util.LayuiPage;
|
||||
import com.sifang.modules.sys.web.BaseController;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/entryChanges/designInfo")
|
||||
public class CrmCustomerEntryChangeDesignController extends BaseController {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(CrmCustomerEntryChangeDesignController.class);
|
||||
@Autowired
|
||||
CustomerEntryChangeDesignService customerEntryChangeDesignService;
|
||||
@Autowired
|
||||
CustomerEntryChangeDesignComponentService designComponentService;
|
||||
@Autowired
|
||||
TraderEmployeService traderEmployeService;
|
||||
@Autowired
|
||||
CustomerEntryComponentService customerEntryComponentService;
|
||||
@Autowired
|
||||
PlanService planService;
|
||||
@Autowired
|
||||
CustomerEntryService customerService;
|
||||
@Autowired
|
||||
ProjectInfoSettingService projectService;
|
||||
@Autowired
|
||||
ProjectInstallService projectInstallService;
|
||||
@Autowired
|
||||
private FormSetService formSetService;
|
||||
@Autowired
|
||||
private PartnerDao partnerDao;
|
||||
@Autowired
|
||||
TraderService traderService;
|
||||
@Autowired
|
||||
private CrmCustomerEntryProjectDao crmCustomerEntryProjectDao;
|
||||
@Autowired
|
||||
private CrmCustomerEntryDesignDao crmCustomerEntryDesignDao;
|
||||
@Autowired
|
||||
private CrmCustomerEntrySurveyRecordDetailDao crmCustomerEntrySurveyRecordDetailDao;
|
||||
@Autowired
|
||||
private CrmCustomerEntryChangeDesignDetailDao changeDesignDetailDao;
|
||||
@ResponseBody
|
||||
@RequestMapping("addDesignChange")
|
||||
public Result addDesignChange(@Validated @RequestBody AddDesignChangeReq req) {
|
||||
try {
|
||||
return customerEntryChangeDesignService.addChangeDesign(req);
|
||||
} catch (BusinessException ex) {
|
||||
return Result.fail(ex.getMessage());
|
||||
} catch (Exception ex) {
|
||||
logger.error("add design change error", ex);
|
||||
return Result.fail("系统内部错误,设计变更申请失败!");
|
||||
}
|
||||
}
|
||||
@ResponseBody
|
||||
@RequestMapping("addDesignChangeHR")
|
||||
public Result addDesignChangeHR(@RequestBody List<AddDesignChangeReq> req) {
|
||||
try {
|
||||
return customerEntryChangeDesignService.addChangeDesignHR(req);
|
||||
} catch (BusinessException ex) {
|
||||
return Result.fail(ex.getMessage());
|
||||
} catch (Exception ex) {
|
||||
logger.error("add design change error", ex);
|
||||
return Result.fail("系统内部错误,设计变更申请失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 去选择电站页面
|
||||
*/
|
||||
@RequestMapping("/toSelectEntry")
|
||||
public String toSelectEntry(HttpServletRequest request,Model model) {
|
||||
User user = UserUtils.getUser();
|
||||
//地址信息
|
||||
List<Record> pros = AddressUtils.findProvinceListByTraderId(CrmUtils.getCurrentTraderId(user.getId()), null);
|
||||
model.addAttribute("province", pros);
|
||||
model.addAttribute("partnerId", request.getParameter("partnerId"));
|
||||
return "modules/yangguang/changes/designInfoChange/selectEntry";
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("cancelAddDesign/{id}")
|
||||
public Result cancelAddDesign(@PathVariable("id") String id) {
|
||||
try {
|
||||
return customerEntryChangeDesignService.cancelAddDesign(id);
|
||||
} catch (Exception ex) {
|
||||
logger.error("cancel design change error", ex);
|
||||
return Result.fail("系统内部错误,设计变更申请失败!");
|
||||
}
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("tempDesignChange")
|
||||
public Result tempDesignChange(@RequestBody DesignChangeAuditReq req) {
|
||||
try {
|
||||
return customerEntryChangeDesignService.tempDesignChange(req);
|
||||
} catch (BusinessException ex) {
|
||||
logger.error("design change error", ex);
|
||||
return Result.fail(ex.getMessage());
|
||||
} catch (Exception ex) {
|
||||
logger.error("design change error", ex);
|
||||
return Result.fail("系统内部错误,审核失败!");
|
||||
}
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("auditDesignChange")
|
||||
public Result auditDesignChange(@RequestBody DesignChangeAuditReq req) {
|
||||
try {
|
||||
return customerEntryChangeDesignService.auditDesignChange(req);
|
||||
} catch (BusinessException ex) {
|
||||
logger.error("design change error", ex);
|
||||
return Result.fail(ex.getMessage());
|
||||
} catch (Exception ex) {
|
||||
logger.error("design change error", ex);
|
||||
return Result.fail("系统内部错误,审核失败!");
|
||||
}
|
||||
}
|
||||
@ResponseBody
|
||||
@RequestMapping("auditDesignChangeHR")
|
||||
public Result auditDesignChangeHR(@RequestBody DesignChangeAuditReq req) {
|
||||
try {
|
||||
return customerEntryChangeDesignService.auditDesignChangeHR(req);
|
||||
} catch (BusinessException ex) {
|
||||
logger.error("design change error", ex);
|
||||
return Result.fail(ex.getMessage());
|
||||
} catch (Exception ex) {
|
||||
logger.error("design change error", ex);
|
||||
return Result.fail("系统内部错误,审核失败!");
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("/toAddDesignChangePage")
|
||||
public String toAddDesignChangePage(HttpServletRequest request ,Model model) {
|
||||
String partnerId = request.getParameter("partnerId");
|
||||
model.addAttribute("partnerId",partnerId);
|
||||
if (PartnerConstants.PARTNER_ID_HR.equals(partnerId)) {
|
||||
return "modules/yangguang/changes/designInfoChange/addDesignChangeHR";
|
||||
}else {
|
||||
return "modules/yangguang/changes/designInfoChange/addDesignChange";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void common(Model model, String id) {
|
||||
CrmCustomerEntryChangeDesign design = customerEntryChangeDesignService.get(id);
|
||||
String entryId = design.getEntryId();
|
||||
CustomerEntry entry = customerService.getById(entryId);
|
||||
model.addAttribute("design", design);
|
||||
model.addAttribute("entry", entry);
|
||||
model.addAttribute("info2", formSetService.getListByCondition("08", entry.getPartnerId()));
|
||||
//多产品参数获取
|
||||
List<Record> entryProject = crmCustomerEntryProjectDao.getProjectsByEntryId(entry.getId());
|
||||
model.addAttribute("entryProject",entryProject);
|
||||
List<Record> changeDetails = changeDesignDetailDao.getDesignDetailsByNumber(design.getNumber());
|
||||
model.addAttribute("changeDetails", changeDetails);
|
||||
List<Record> componentList = designComponentService.findByDesignId(id);
|
||||
List<Record> preComponentList = componentList.stream().filter(e -> Objects.equals("0", e.getStr("flag"))).collect(Collectors.toList());
|
||||
List<Record> postComponentList = componentList.stream().filter(e -> Objects.equals("1", e.getStr("flag"))).collect(Collectors.toList());
|
||||
for (Record changeDetail : changeDetails) {
|
||||
String projectId = changeDetail.getStr("project_id");
|
||||
List<Record> preComList = preComponentList.stream().filter(r -> r.getStr("project_id").equals(projectId)).collect(Collectors.toList());
|
||||
List<Record> itemType = preComList.stream().filter(r -> r.getStr("item_type").equals("3")).collect(Collectors.toList());
|
||||
int preDesignCapacity = 0;
|
||||
for (Record record : itemType) {
|
||||
preDesignCapacity = preDesignCapacity + Integer.parseInt(record.getStr("model")) * record.getInt("num");
|
||||
}
|
||||
changeDetail.set("preDesignCapacity", preDesignCapacity);
|
||||
changeDetail.set("preComponentList", preComList);
|
||||
List<Record> postComList = postComponentList.stream().filter(r -> r.getStr("project_id").equals(projectId)).collect(Collectors.toList());
|
||||
changeDetail.set("postComponentList", postComList);
|
||||
List<Record> itemType1 = postComList.stream().filter(r -> r.getStr("item_type").equals("3")).collect(Collectors.toList());
|
||||
int postDesignCapacity = 0;
|
||||
for (Record record : itemType1) {
|
||||
postDesignCapacity = postDesignCapacity + Integer.parseInt(record.getStr("model")) * record.getInt("num");
|
||||
}
|
||||
changeDetail.set("postDesignCapacity", postDesignCapacity);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 审核页面
|
||||
*/
|
||||
@RequestMapping("/toAuditPage/{id}/{partnerId}")
|
||||
public String toAuditPage(@PathVariable("id") String id,@PathVariable("partnerId") String partnerId , Model model) {
|
||||
model.addAttribute("id", id);
|
||||
model.addAttribute("fromAudit", "1");
|
||||
if (PartnerConstants.PARTNER_ID_HR.equals(partnerId)){
|
||||
common(model, id);
|
||||
return "modules/yangguang/changes/designInfoChange/designChangeDetailHR";
|
||||
}
|
||||
return "modules/yangguang/changes/designInfoChange/designChangeDetail";
|
||||
}
|
||||
|
||||
@RequestMapping("/toChangeDetail/{id}/{partnerId}")
|
||||
public String toChangeDetail(@PathVariable("id") String id,@PathVariable("partnerId") String partnerId , Model model) {
|
||||
model.addAttribute("id", id);
|
||||
model.addAttribute("fromAudit", "2");
|
||||
if (PartnerConstants.PARTNER_ID_HR.equals(partnerId)){
|
||||
common(model, id);
|
||||
return "modules/yangguang/changes/designInfoChange/designChangeDetailHR";
|
||||
}else {
|
||||
return "modules/yangguang/changes/designInfoChange/designChangeDetail";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 待审核列表
|
||||
*/
|
||||
@RequestMapping("waitAuditList")
|
||||
public String waitAuditList(Model model) {
|
||||
User user = UserUtils.getUser();
|
||||
model.addAttribute("user", user);
|
||||
return "modules/yangguang/changes/designInfoChange/waitAuditList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 变更记录
|
||||
*/
|
||||
@RequestMapping("changeList")
|
||||
public String changeList(Model model) {
|
||||
User user = UserUtils.getUser();
|
||||
model.addAttribute("user", user);
|
||||
String partnerIds="";
|
||||
if(User.USER_TYPE_KJ.equals(user.getUserType()) || User.USER_TYPE_ADVISOR.equals(user.getUserType())){
|
||||
//获取关联资方
|
||||
partnerIds=traderService.getPartnerIdByTraderId(user.getTraderId());
|
||||
}
|
||||
model.addAttribute("partnerList",partnerDao.partnerList(partnerIds));
|
||||
return "modules/yangguang/changes/designInfoChange/changeList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 待审核列表数据
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "listData")
|
||||
public Object listData(HttpServletRequest request) {
|
||||
LayuiPage<Record> page = new LayuiPage<>(request);
|
||||
Map<String, String> params = getParams(request);
|
||||
params.put("status", "0");
|
||||
User user = UserUtils.getUser();
|
||||
extractTraderEmployee(user, params);
|
||||
Operator operator = Operator.of(user.getId(), CrmUtils.getUserXM(user), user.getUserType());
|
||||
customerEntryChangeDesignService.listData(page, params, operator);
|
||||
return page.renderJson();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 变更记录列表
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "changeListData")
|
||||
public Object changeListData(HttpServletRequest request) {
|
||||
LayuiPage<Record> page = new LayuiPage<>(request);
|
||||
Map<String, String> params = getParams(request);
|
||||
params.put("status", "1,2,3");
|
||||
User user = UserUtils.getUser();
|
||||
extractTraderEmployee(user, params);
|
||||
customerEntryChangeDesignService.listData(page, params, Operator.of(user.getId(), CrmUtils.getUserXM(user), user.getUserType()));
|
||||
return page.renderJson();
|
||||
}
|
||||
|
||||
private void extractTraderEmployee(User user, Map<String, String> params) {
|
||||
CrmTraderEmploye employee = traderEmployeService.findByUserId(user.getId());
|
||||
if (employee != null) {
|
||||
params.put("engineerId", employee.getId());
|
||||
}
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("selectNumber/{stationCode}")
|
||||
public Result selectNumber(@PathVariable("stationCode") String stationCode) {
|
||||
Result ret = Result.ok();
|
||||
Map<String, Object> resMap = Maps.newHashMap();
|
||||
CustomerEntry customerEntry = customerService.findCustomerEntryById(stationCode);
|
||||
if (customerEntry == null) {
|
||||
ret = Result.fail("未找到电站信息!");
|
||||
return ret;
|
||||
}
|
||||
// if (!CustomerEntryChangeDesignService.validStatus(customerEntry.getStatus())) {
|
||||
// return Result.fail(CustomerEntryChangeDesignService.invalidStatusMsg());
|
||||
// }
|
||||
|
||||
//判断电站与角色是否相符
|
||||
User user = UserUtils.getUser();
|
||||
Operator operator = Operator.of(user.getId(), CrmUtils.getUserXM(user), user.getUserType());
|
||||
if (StringUtil.equalsAny(operator.getUserType(), UserConstants.TYPE_TRADER, User.USER_TYPE_ADVISOR)) {
|
||||
Record record = CrmUtils.getUserTrader(operator.getUserType(), operator.getUserId());
|
||||
String traderId = record.getStr("id");
|
||||
if (UserConstants.TYPE_TRADER.equals(operator.getUserType())) { //代理商
|
||||
if ("1".equals(record.getStr("type"))) { // 1.一级代理商 2.二级代理商
|
||||
if (!customerEntry.getDistributorId().equals(traderId)) {
|
||||
ret = Result.fail("未找到电站信息!");
|
||||
return ret;
|
||||
}
|
||||
} else { //二级代理商
|
||||
if (UserConstants.TYPE_TRADER.equals(operator.getUserType())) {
|
||||
//代理商只能查看自己的
|
||||
if (!traderId.equals(customerEntry.getCreateTraderId())) {
|
||||
ret = Result.fail("未找到电站信息!");
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else { //代理商人员
|
||||
if (!traderId.equals(customerEntry.getCreateTraderId())) {
|
||||
ret = Result.fail("未找到电站信息!");
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resMap.put("customerEntry", customerEntry);
|
||||
if (PartnerConstants.PARTNER_ID_HR.equals(customerEntry.getPartnerId())){
|
||||
List<Record> projectList = projectService.getEntryProjectByEntryId(customerEntry.getId());
|
||||
resMap.put("projectList",projectList);
|
||||
}else {
|
||||
resMap.put("project", projectService.getById(customerEntry.getProjectId()));
|
||||
}
|
||||
resMap.put("insta", projectInstallService.findProjectInstalls());
|
||||
|
||||
List<Record> componentList = customerEntryComponentService.findByEntryId(customerEntry.getId());
|
||||
List<Record> assemblyList = componentList.stream().filter(r -> r.getStr("item_type").equals("3")).collect(Collectors.toList());
|
||||
List<Record> inverterList = componentList.stream().filter(r -> r.getStr("item_type").equals("1")).collect(Collectors.toList());
|
||||
List<Record> gridConnectionList = componentList.stream().filter(r -> r.getStr("item_type").equals("2")).collect(Collectors.toList());
|
||||
List<Record> gridSupportList = componentList.stream().filter(r -> r.getStr("item_type").equals("4")).collect(Collectors.toList());
|
||||
setVal(assemblyList, "组件");
|
||||
setVal(inverterList, "逆变器");
|
||||
setVal(gridConnectionList, "并网箱");
|
||||
setVal(gridSupportList, "支架");
|
||||
resMap.put("assemblyList", assemblyList);
|
||||
resMap.put("inverterList", inverterList);
|
||||
resMap.put("gridConnectionList", gridConnectionList);
|
||||
resMap.put("gridSupportList", gridSupportList);
|
||||
|
||||
String projectId = customerEntry.getProjectId();
|
||||
if(PartnerConstants.PARTNER_ID_HR.equals(customerEntry.getPartnerId())){
|
||||
List<Record> projects = crmCustomerEntryProjectDao.getProjectsByEntryId(customerEntry.getId());
|
||||
projectId = projects.get(0).getStr("id");
|
||||
}
|
||||
CrmProjectSetting pro = projectService.getById(projectId);
|
||||
|
||||
// 获取系统设置的电器材料
|
||||
List<Record> allElectric = planService.findAllElectric();
|
||||
List<Record> records = planService.getElectricSet("3");
|
||||
List<Record> sysAssemblyList = new ArrayList<>();
|
||||
if(!PartnerConstants.PARTNER_ID_HR.equals(customerEntry.getPartnerId())){
|
||||
for (Record record : records) {
|
||||
if (Integer.valueOf(record.get("model")) >= pro.getAssemblySpecs()){
|
||||
sysAssemblyList.add(record);
|
||||
}
|
||||
}
|
||||
resMap.put("sysAssemblyList", sysAssemblyList);
|
||||
}
|
||||
List<Record> sysInverterList = allElectric.stream().filter(r -> r.getStr("type").equals("1")).collect(Collectors.toList());
|
||||
List<Record> sysGridConnectionList = allElectric.stream().filter(r -> r.getStr("type").equals("2")).collect(Collectors.toList());
|
||||
List<Record> sysGridSupportList = allElectric.stream().filter(r -> r.getStr("type").equals("4")).collect(Collectors.toList());
|
||||
resMap.put("sysInverterList", sysInverterList);
|
||||
resMap.put("sysGridConnectionList", sysGridConnectionList);
|
||||
resMap.put("sysGridSupportList", sysGridSupportList);
|
||||
resMap.put("formSet", FormSetUtils.getFormPartSetByStep(null, "2", "08", customerEntry.getPartnerId(), false));
|
||||
resMap.put("info2", formSetService.getListByCondition("08", pro.getManagement()));
|
||||
if(PartnerConstants.PARTNER_ID_HR.equals(customerEntry.getPartnerId())){
|
||||
List<Record> entryProject = crmCustomerEntryProjectDao.getProjectsByEntryId(customerEntry.getId());
|
||||
List<CrmCustomerEntryDesign> entryDesigns = crmCustomerEntryDesignDao.findByEntryId(customerEntry.getId());
|
||||
List<CrmCustomerEntrySurveyRecordDetail> entrySurveys = crmCustomerEntrySurveyRecordDetailDao.findByEntryId(customerEntry.getId());
|
||||
if (CustomerEntryConstants.SCHEME_TYPE_TWO.equals(customerEntry.getSchemeType())) {
|
||||
resMap.put("compose", customerService.findPlanInfoEntryId(customerEntry.getId()));
|
||||
} else {//标准方案
|
||||
List<Record> composeOnes = new ArrayList<>();
|
||||
for(CrmCustomerEntryDesign entryDesign:entryDesigns){
|
||||
Record composeOne = customerService.findByEntrySchemeId(entryDesign.getSchemeId());
|
||||
if(composeOne!=null){
|
||||
composeOne.set("projectId",entryDesign.getProjectId());
|
||||
}
|
||||
composeOnes.add(composeOne);
|
||||
}
|
||||
resMap.put("composeOneHr", composeOnes);
|
||||
}
|
||||
for(Record project:entryProject){
|
||||
if(project!=null&&StringUtil.isNotBlank(project.getStr("id"))){
|
||||
for (Record record : records) {
|
||||
if (Integer.valueOf(record.get("model")) >= project.getInt("assembly_specs")){
|
||||
Record record1 = new Record().setColumns(record);
|
||||
record1.set("projectId",project.getStr("id"));
|
||||
sysAssemblyList.add(record1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
resMap.put("sysAssemblyList", sysAssemblyList);
|
||||
resMap.put("entryDesigns",entryDesigns);
|
||||
}
|
||||
ret.setData(resMap);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("designChangeDetail/{id}")
|
||||
public Result designChangeDetail(@PathVariable("id") String id) {
|
||||
Result ret = Result.ok();
|
||||
CrmCustomerEntryChangeDesign design = customerEntryChangeDesignService.get(id);
|
||||
String entryId = design.getEntryId();
|
||||
CustomerEntry customerEntry = customerService.getById(entryId);
|
||||
Map<String, Object> resMap = Maps.newHashMap();
|
||||
|
||||
resMap.put("design", design);
|
||||
resMap.put("customerEntry", customerEntry);
|
||||
resMap.put("project", projectService.getById(customerEntry.getProjectId()));
|
||||
resMap.put("insta", projectInstallService.findProjectInstalls());
|
||||
|
||||
List<Record> componentList = designComponentService.findByDesignId(id);
|
||||
List<Record> preComponentList = componentList.stream().filter(e -> Objects.equals("0", e.getStr("flag"))).collect(Collectors.toList());
|
||||
List<Record> postComponentList = componentList.stream().filter(e -> Objects.equals("1", e.getStr("flag"))).collect(Collectors.toList());
|
||||
|
||||
List<Record> assemblyList = preComponentList.stream().filter(r -> r.getStr("item_type").equals("3")).collect(Collectors.toList());
|
||||
List<Record> inverterList = preComponentList.stream().filter(r -> r.getStr("item_type").equals("1")).collect(Collectors.toList());
|
||||
List<Record> gridConnectionList = preComponentList.stream().filter(r -> r.getStr("item_type").equals("2")).collect(Collectors.toList());
|
||||
List<Record> gridSupportList = preComponentList.stream().filter(r -> r.getStr("item_type").equals("4")).collect(Collectors.toList());
|
||||
setVal(assemblyList, "组件");
|
||||
setVal(inverterList, "逆变器");
|
||||
setVal(gridConnectionList, "并网箱");
|
||||
setVal(gridSupportList, "支架");
|
||||
|
||||
List<Record> postAssemblyList = postComponentList.stream().filter(r -> r.getStr("item_type").equals("3")).collect(Collectors.toList());
|
||||
List<Record> postInverterList = postComponentList.stream().filter(r -> r.getStr("item_type").equals("1")).collect(Collectors.toList());
|
||||
List<Record> postGridConnectionList = postComponentList.stream().filter(r -> r.getStr("item_type").equals("2")).collect(Collectors.toList());
|
||||
List<Record> postGridSupportList = postComponentList.stream().filter(r -> r.getStr("item_type").equals("4")).collect(Collectors.toList());
|
||||
setVal(postAssemblyList, "组件");
|
||||
setVal(postInverterList, "逆变器");
|
||||
setVal(postGridConnectionList, "并网箱");
|
||||
setVal(postGridSupportList, "支架");
|
||||
|
||||
resMap.put("assemblyList", assemblyList);
|
||||
resMap.put("inverterList", inverterList);
|
||||
resMap.put("gridConnectionList", gridConnectionList);
|
||||
resMap.put("gridSupportList", gridSupportList);
|
||||
resMap.put("postAssemblyList", postAssemblyList);
|
||||
resMap.put("postInverterList", postInverterList);
|
||||
resMap.put("postGridConnectionList", postGridConnectionList);
|
||||
resMap.put("postGridSupportList", postGridSupportList);
|
||||
|
||||
resMap.put("preCapacity", calcCapacity(assemblyList));
|
||||
resMap.put("postCapacity", calcCapacity(postAssemblyList));
|
||||
resMap.put("formSet", FormSetUtils.getFormPartSetByStep(null, "2", "08", customerEntry.getPartnerId(), false));
|
||||
resMap.put("info2", formSetService.getListByCondition("08", customerEntry.getPartnerId()));
|
||||
ret.setData(resMap);
|
||||
return ret;
|
||||
}
|
||||
|
||||
private String calcCapacity(List<Record> assemblyList) {
|
||||
try {
|
||||
long total = 0L;
|
||||
for (Record r : assemblyList) {
|
||||
String model = r.getStr("model");
|
||||
Integer num = r.getInt("num");
|
||||
total += Long.parseLong(model) * num;
|
||||
}
|
||||
return Long.toString(total);
|
||||
} catch (Exception ex) {
|
||||
logger.error("calc capacity error", ex);
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
|
||||
private void setVal(List<Record> list, String name) {
|
||||
for (Record record : list) {
|
||||
record.set("label", name);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,358 @@
|
||||
package com.sifang.modules.changes.controller;
|
||||
|
||||
import com.jfinal.kit.JsonKit;
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.sifang.modules.changes.dao.CrmMaterialInformationChangeApplyDetailDao;
|
||||
import com.sifang.modules.changes.entity.CrmMaterialInformationChangeApply;
|
||||
import com.sifang.modules.changes.entity.CustomerEntrySurveyChangeRecord;
|
||||
import com.sifang.modules.changes.service.CrmMaterialInformationChangeApplyService;
|
||||
import com.sifang.modules.changes.vo.AnyProductMaterialChangeVo;
|
||||
import com.sifang.modules.changes.vo.MaterialAuditVo;
|
||||
import com.sifang.modules.changes.vo.MaterialInformationChangeVo;
|
||||
import com.sifang.modules.changes.vo.SurveyAuditVo;
|
||||
import com.sifang.modules.customer.Service.CustomerEntryService;
|
||||
import com.sifang.modules.customer.constant.PartnerConstants;
|
||||
import com.sifang.modules.customer.dao.CustomerEntryDao;
|
||||
import com.sifang.modules.customer.entity.CustomerEntry;
|
||||
import com.sifang.modules.platform.service.AddressService;
|
||||
import com.sifang.modules.platform.utils.AddressUtils;
|
||||
import com.sifang.modules.sunshine.SystemSetting.dao.PlanMaterialEntryDao;
|
||||
import com.sifang.modules.sunshine.SystemSetting.entity.CrmPlanMaterialEntry;
|
||||
import com.sifang.modules.sunshine.SystemSetting.entity.CrmProjectSetting;
|
||||
import com.sifang.modules.sunshine.SystemSetting.service.ProjectInfoSettingService;
|
||||
import com.sifang.modules.sunshine.SystemSetting.utils.BusinessException;
|
||||
import com.sifang.modules.sunshine.SystemSetting.utils.Result;
|
||||
import com.sifang.modules.sys.common.UserUtils;
|
||||
import com.sifang.modules.sys.common.entity.User;
|
||||
import com.sifang.modules.sys.entity.Operator;
|
||||
import com.sifang.modules.sys.util.CrmUtils;
|
||||
import com.sifang.modules.sys.util.LayuiPage;
|
||||
import com.sifang.modules.sys.web.BaseController;
|
||||
import com.sifang.modules.youkua.service.NhPowerStationService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* 物料信息变更
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/entryChanges/materialInformationChange")
|
||||
public class CrmMaterialInformationChangeController extends BaseController {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(CrmCustomerEntryChangeDesignController.class);
|
||||
@Autowired
|
||||
private CrmMaterialInformationChangeApplyService applyService;
|
||||
@Autowired
|
||||
private AddressService addressService;
|
||||
@Autowired
|
||||
private CustomerEntryDao customerEntryDao;
|
||||
@Autowired
|
||||
private PlanMaterialEntryDao planMaterialEntryDao;
|
||||
@Autowired
|
||||
private ProjectInfoSettingService projectService;
|
||||
@Autowired
|
||||
private CrmMaterialInformationChangeApplyDetailDao detailDao;
|
||||
@Autowired
|
||||
private ProjectInfoSettingService projectInfoSettingService;
|
||||
@Autowired
|
||||
private NhPowerStationService nhPowerStationService;
|
||||
@Autowired
|
||||
CustomerEntryService customerService;
|
||||
/**
|
||||
* 去待审核页面
|
||||
*/
|
||||
@RequestMapping("/changeWaitAuditList")
|
||||
public String toChangeWaitAuditList(Model model) {
|
||||
User user = UserUtils.getUser();
|
||||
model.addAttribute("user", user);
|
||||
return "modules/yangguang/changes/materialInformationChange/changeWaitAuditList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 去变更记录页面
|
||||
*/
|
||||
@RequestMapping("/changeList")
|
||||
public String toChangeList(Model model) {
|
||||
return "modules/yangguang/changes/materialInformationChange/changeMaterialList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 去新增物料信息变更申请
|
||||
*/
|
||||
@RequestMapping("/toAddApplyPage")
|
||||
public String toAddApplyPage(HttpServletRequest request ,Model model) {
|
||||
User user = UserUtils.getUser();
|
||||
Operator operator = Operator.of(user.getId(), CrmUtils.getUserXM(user),user.getUserType());
|
||||
String userName = operator.getUserName();
|
||||
Date date = new Date();
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String now = format.format(date);
|
||||
model.addAttribute("now",now);
|
||||
model.addAttribute("userName",userName);
|
||||
String partnerId = request.getParameter("partnerId");
|
||||
model.addAttribute("partnerId",partnerId);
|
||||
if (PartnerConstants.PARTNER_ID_HR.equals(partnerId)) {
|
||||
return "modules/yangguang/changes/materialInformationChange/addMaterialChangeApplyHR";
|
||||
}else {
|
||||
return "modules/yangguang/changes/materialInformationChange/addMaterialChangeApply";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 去选择电站页面
|
||||
*/
|
||||
@RequestMapping("/toCheckEntry")
|
||||
public String toCheckEntry(HttpServletRequest request,Model model) {
|
||||
User user = UserUtils.getUser();
|
||||
//地址信息
|
||||
List<Record> pros = AddressUtils.findProvinceListByTraderId(CrmUtils.getCurrentTraderId(user.getId()), null);
|
||||
model.addAttribute("province", pros);
|
||||
model.addAttribute("partnerId", request.getParameter("partnerId"));
|
||||
return "modules/yangguang/changes/materialInformationChange/checkEntry";
|
||||
}
|
||||
|
||||
/**
|
||||
* 选择条码页面
|
||||
*/
|
||||
@RequestMapping("/toCheckBarcode")
|
||||
public String toCheckBarcode(String code ,String id, Model model) {
|
||||
model.addAttribute("materialCode", code);
|
||||
model.addAttribute("uniqueId", id);
|
||||
return "modules/yangguang/changes/materialInformationChange/checkBarcode";
|
||||
}
|
||||
@ResponseBody
|
||||
@RequestMapping("/findEntryById")
|
||||
public Object findEntryById(String id){
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
CustomerEntry customerEntry = customerEntryDao.get(id);
|
||||
map.put("customerEntry",customerEntry);
|
||||
if (PartnerConstants.PARTNER_ID_HR.equals(customerEntry.getPartnerId())){
|
||||
List<Record> projectList = projectInfoSettingService.getEntryProjectByEntryId(id);
|
||||
for(Record record : projectList){
|
||||
Map<String, Object> materialList = customerService.findUsedMaterialByprojectId(customerEntry.getId(), record.getStr("projectId"));
|
||||
record.set("zjList", materialList.get("zj"));
|
||||
record.set("nbqList", materialList.get("nbq"));
|
||||
}
|
||||
map.put("projectList",projectList);
|
||||
}else {
|
||||
List<Record> materialEntries = planMaterialEntryDao.findMaterialListByEntryId(id);
|
||||
List<Record> nbqList = materialEntries.stream().filter(r -> "逆变器".equals(r.getStr("type"))).collect(Collectors.toList());
|
||||
List<Record> zjList = materialEntries.stream().filter(r -> "组件".equals(r.getStr("type"))).collect(Collectors.toList());
|
||||
map.put("nbqList",nbqList);
|
||||
map.put("zjList",zjList);
|
||||
}
|
||||
return map ;
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表数据
|
||||
* type 1.待审核 2.变更记录
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("/getChangeListDate")
|
||||
public Object getChangeListDate(HttpServletRequest request){
|
||||
LayuiPage<Record> page = new LayuiPage<>(request);
|
||||
Map<String, String> params = getParams(request);
|
||||
User user = UserUtils.getUser();
|
||||
Operator operator = Operator.of(user.getId(), CrmUtils.getUserXM(user),user.getUserType());
|
||||
return applyService.getPageData(page,params,operator);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "addMaterialInformationChange")
|
||||
public Result addMaterialInformationChange(@RequestBody MaterialInformationChangeVo materialVo) {
|
||||
try {
|
||||
return applyService.addMaterialInformationChange(materialVo);
|
||||
}catch (BusinessException ex){
|
||||
logger.error("addMaterialInformationChange error", ex);
|
||||
return Result.fail(ex.getMessage());
|
||||
}catch (Exception ex){
|
||||
logger.error("addMaterialInformationChange error", ex);
|
||||
return Result.fail(ex.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "addMaterialInformationChangeHR")
|
||||
public Result addMaterialInformationChange(@RequestBody AnyProductMaterialChangeVo materialVo) {
|
||||
try {
|
||||
return applyService.addMaterialInformationChangeHR(materialVo);
|
||||
}catch (BusinessException ex){
|
||||
logger.error("addMaterialInformationChange error", ex);
|
||||
return Result.fail(ex.getMessage());
|
||||
}catch (Exception ex){
|
||||
logger.error("addMaterialInformationChange error", ex);
|
||||
return Result.fail(ex.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*审核页面
|
||||
*/
|
||||
@RequestMapping("materialAudit/{id}")
|
||||
public String toAuditPage(@PathVariable("id") String id, Model model) {
|
||||
CrmMaterialInformationChangeApply apply = applyService.selectById(id);
|
||||
CustomerEntry entry = customerEntryDao.get(apply.getEntryId());
|
||||
model.addAttribute("apply",apply);
|
||||
model.addAttribute("entry",entry);
|
||||
List<Record> records = detailDao.findMaterialDetailsByApplyId(apply.getId());
|
||||
if (PartnerConstants.PARTNER_ID_HR.equals(entry.getPartnerId())){
|
||||
List<Record> projectList = projectService.getEntryProjectByEntryId(entry.getId());
|
||||
for (Record project : projectList) {
|
||||
String projectId = project.getStr("projectId");
|
||||
List<Record> materialList = records.stream().filter(r -> projectId.equals(r.getStr("project_id"))).collect(Collectors.toList());
|
||||
List<Record> zjList = materialList.stream().filter(record -> "1".equals(record.getStr("type"))).collect(Collectors.toList());
|
||||
List<Record> nbqList = materialList.stream().filter(record -> "2".equals(record.getStr("type"))).collect(Collectors.toList());
|
||||
project.set("zjList",zjList);
|
||||
project.set("nbqList",nbqList);
|
||||
}
|
||||
model.addAttribute("projectList",projectList);
|
||||
return "modules/yangguang/changes/materialInformationChange/materialAuditHR";
|
||||
}else {
|
||||
CrmProjectSetting project = projectService.getById(entry.getProjectId());
|
||||
List<Record> zjList = records.stream().filter(record -> "1".equals(record.getStr("type"))).collect(Collectors.toList());
|
||||
List<Record> nbqList = records.stream().filter(record -> "2".equals(record.getStr("type"))).collect(Collectors.toList());
|
||||
model.addAttribute("project",project);
|
||||
model.addAttribute("zjList",zjList);
|
||||
model.addAttribute("nbqList",nbqList);
|
||||
return "modules/yangguang/changes/materialInformationChange/materialAudit";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 暂存
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("temp")
|
||||
public Result temp(MaterialAuditVo materialAuditVo) {
|
||||
return applyService.temp(materialAuditVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核不通过
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("refuse")
|
||||
public Result refuse(MaterialAuditVo materialAuditVo) {
|
||||
return applyService.refuse(materialAuditVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核通过
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("pass")
|
||||
public Result pass(MaterialAuditVo materialAuditVo) {
|
||||
try {
|
||||
CrmMaterialInformationChangeApply apply = applyService.selectById(materialAuditVo.getId());
|
||||
CustomerEntry entry = customerEntryDao.get(apply.getEntryId());
|
||||
Result result = null;
|
||||
if (PartnerConstants.PARTNER_ID_HR.equals(entry.getPartnerId())){
|
||||
result = applyService.passHR(materialAuditVo);
|
||||
}else {
|
||||
result = applyService.pass(materialAuditVo);
|
||||
}
|
||||
|
||||
if(result.isOk()){
|
||||
//同步能辉数据到监控运维平台
|
||||
//添加电站成功标识
|
||||
String entryId=result.getData().toString();
|
||||
boolean addStationFlag = Db.queryLong(" select count(1) from nh_yw_interface_process where status = '0' and type = '1' and add_type = '0' and station_id = ?", entryId) > 0;
|
||||
if(addStationFlag){
|
||||
try{
|
||||
//那么要推送物料信息变更的信息到监控系统
|
||||
nhPowerStationService.materialChangeCauseDeviceChange(entryId);
|
||||
}catch (Exception e){
|
||||
logger.error(">>>推送物料信息变更的信息到监控系统 e:",e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}catch (BusinessException ex){
|
||||
logger.error("materialChangeAuditPass error", ex);
|
||||
return Result.fail(ex.getMessage());
|
||||
}catch (Exception ex){
|
||||
logger.error("materialChangeAuditPass error", ex);
|
||||
return Result.fail(ex.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取变更后的条码列表
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("getChangeBarCodeList")
|
||||
public Object getChangeBarCodeList(String materialCode, String newBarcode){
|
||||
List<Record> list = applyService.getChangeBarCode(materialCode, newBarcode);
|
||||
return JsonKit.toJson(list);
|
||||
}
|
||||
|
||||
/**
|
||||
*申请单详情页面
|
||||
*/
|
||||
@RequestMapping("materialDetail/{id}")
|
||||
public String toAuditDetailPage(@PathVariable("id") String id, Model model) {
|
||||
CrmMaterialInformationChangeApply apply = applyService.selectById(id);
|
||||
CustomerEntry entry = customerEntryDao.get(apply.getEntryId());
|
||||
model.addAttribute("apply",apply);
|
||||
model.addAttribute("entry",entry);
|
||||
List<Record> records = detailDao.findMaterialDetailsByApplyId(apply.getId());
|
||||
if (PartnerConstants.PARTNER_ID_HR.equals(entry.getPartnerId())){
|
||||
List<Record> projectList = projectService.getEntryProjectByEntryId(entry.getId());
|
||||
for (Record project : projectList) {
|
||||
String projectId = project.getStr("projectId");
|
||||
List<Record> materialList = records.stream().filter(r -> projectId.equals(r.getStr("project_id"))).collect(Collectors.toList());
|
||||
List<Record> zjList = materialList.stream().filter(record -> "1".equals(record.getStr("type"))).collect(Collectors.toList());
|
||||
List<Record> nbqList = materialList.stream().filter(record -> "2".equals(record.getStr("type"))).collect(Collectors.toList());
|
||||
project.set("zjList",zjList);
|
||||
project.set("nbqList",nbqList);
|
||||
}
|
||||
model.addAttribute("projectList",projectList);
|
||||
return "modules/yangguang/changes/materialInformationChange/materialDetailHR";
|
||||
}else {
|
||||
CrmProjectSetting project = projectService.getById(entry.getProjectId());
|
||||
List<Record> zjList = records.stream().filter(record -> "1".equals(record.getStr("type"))).collect(Collectors.toList());
|
||||
List<Record> nbqList = records.stream().filter(record -> "2".equals(record.getStr("type"))).collect(Collectors.toList());
|
||||
model.addAttribute("project",project);
|
||||
model.addAttribute("zjList",zjList);
|
||||
model.addAttribute("nbqList",nbqList);
|
||||
return "modules/yangguang/changes/materialInformationChange/materialDetail";
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
*撤回
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("cancel/{id}")
|
||||
public Result cancel(@PathVariable("id") String id) {
|
||||
return applyService.cancel(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,466 @@
|
||||
package com.sifang.modules.changes.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.sifang.modules.changes.entity.CustomerEntrySurveyChangeRecord;
|
||||
import com.sifang.modules.changes.entity.CustomerEntrySurveyChangeRecordDetail;
|
||||
import com.sifang.modules.changes.service.CustomerEntrySurveyChangeRecordService;
|
||||
import com.sifang.modules.changes.vo.AddSurveyChangeRecordVo;
|
||||
import com.sifang.modules.changes.vo.AnyProductSurveryChangeVo;
|
||||
import com.sifang.modules.changes.vo.SurveyAuditVo;
|
||||
import com.sifang.modules.customer.Service.CrmCustomerEntrySurveyRecordDetailService;
|
||||
import com.sifang.modules.customer.Service.CustomerEntryService;
|
||||
import com.sifang.modules.customer.Service.CustomerEntrySurveyRecordService;
|
||||
import com.sifang.modules.customer.constant.CustomerEntryConstants;
|
||||
import com.sifang.modules.customer.constant.PartnerConstants;
|
||||
import com.sifang.modules.customer.constant.UserConstants;
|
||||
import com.sifang.modules.customer.entity.CrmCustomerEntrySurveyRecordDetail;
|
||||
import com.sifang.modules.customer.entity.CustomerEntry;
|
||||
import com.sifang.modules.customer.entity.CustomerEntryOrgFiles;
|
||||
import com.sifang.modules.customer.entity.CustomerEntrySurveyRecord;
|
||||
import com.sifang.modules.platform.utils.AddressUtils;
|
||||
import com.sifang.modules.sunshine.SystemSetting.entity.CrmProjectSetting;
|
||||
import com.sifang.modules.sunshine.SystemSetting.entity.CrmTrader;
|
||||
import com.sifang.modules.sunshine.SystemSetting.entity.CrmTraderEmploye;
|
||||
import com.sifang.modules.sunshine.SystemSetting.service.FormSetService;
|
||||
import com.sifang.modules.sunshine.SystemSetting.service.ProjectInfoSettingService;
|
||||
import com.sifang.modules.sunshine.SystemSetting.service.TraderEmployeService;
|
||||
import com.sifang.modules.sunshine.SystemSetting.service.TraderService;
|
||||
import com.sifang.modules.sunshine.SystemSetting.utils.Result;
|
||||
import com.sifang.modules.sunshine.SystemSetting.utils.StringUtil;
|
||||
import com.sifang.modules.sunshine.partnerManagement.dao.PartnerDao;
|
||||
import com.sifang.modules.sunshine.partnerManagement.entity.CrmPartner;
|
||||
import com.sifang.modules.sunshine.partnerManagement.service.PartnerService;
|
||||
import com.sifang.modules.sys.common.UserUtils;
|
||||
import com.sifang.modules.sys.common.entity.User;
|
||||
import com.sifang.modules.sys.entity.Operator;
|
||||
import com.sifang.modules.sys.util.CrmUtils;
|
||||
import com.sifang.modules.sys.util.FormSetUtils;
|
||||
import com.sifang.modules.sys.util.LayuiPage;
|
||||
import com.sifang.modules.sys.web.BaseController;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* @author DQChen
|
||||
* @date 2024-03-27 10:08
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/customer/entry/change/survey")
|
||||
public class CustomerEntrySurveyChangeRecordController extends BaseController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(CustomerEntrySurveyChangeRecordController.class);
|
||||
@Autowired
|
||||
CustomerEntrySurveyChangeRecordService changeRecordService;
|
||||
|
||||
@Autowired
|
||||
CustomerEntryService entryService;
|
||||
|
||||
@Autowired
|
||||
CustomerEntrySurveyRecordService surveyRecordService;
|
||||
|
||||
@Autowired
|
||||
ProjectInfoSettingService projectService;
|
||||
|
||||
@Autowired
|
||||
private PartnerService partnerService;
|
||||
@Autowired
|
||||
private CrmCustomerEntrySurveyRecordDetailService recordDetailService;
|
||||
@Autowired
|
||||
TraderEmployeService traderEmployeService;
|
||||
@Autowired
|
||||
private FormSetService formSetService;
|
||||
@Autowired
|
||||
private PartnerDao partnerDao;
|
||||
@Autowired
|
||||
TraderService traderService;
|
||||
|
||||
@RequestMapping("list")
|
||||
public String list(Model model){
|
||||
User user = UserUtils.getUser();
|
||||
model.addAttribute("user", user);
|
||||
return "modules/yangguang/changes/surveyChange/auditList";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 待审核列表数据
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "listData")
|
||||
public Object listData(HttpServletRequest request) {
|
||||
LayuiPage<Record> page = new LayuiPage<>(request);
|
||||
Map<String, String> params = getParams(request);
|
||||
User user = UserUtils.getUser();
|
||||
if(User.USER_TYPE_HZS.equals(user.getUserType())){
|
||||
String parId = CrmUtils.getPartnerId(user.getId());
|
||||
CrmPartner partner = partnerService.getById(parId);
|
||||
params.put("authorizedId", partner.getAuthorizedId());
|
||||
}else if(User.USER_TYPE_PARTNER.equals(user.getUserType())){
|
||||
CrmPartner partner = partnerService.findByUserId(user.getId());
|
||||
params.put("authorizedId", partner.getAuthorizedId());
|
||||
} else if (User.USER_TYPE_ADVISOR.equals(user.getUserType())) {
|
||||
CrmTraderEmploye employe = traderEmployeService.findByUserId(user.getId());
|
||||
params.put("engineerId", employe.getId());
|
||||
}
|
||||
Operator operator = Operator.of(user.getId(), CrmUtils.getUserXM(user),user.getUserType());
|
||||
changeRecordService.listData(page, params, "0", operator);
|
||||
return page.renderJson();
|
||||
}
|
||||
|
||||
@RequestMapping("changeList")
|
||||
public String record(Model model){
|
||||
User user = UserUtils.getUser();
|
||||
model.addAttribute("user", user);
|
||||
String partnerIds="";
|
||||
if(User.USER_TYPE_KJ.equals(user.getUserType()) || User.USER_TYPE_ADVISOR.equals(user.getUserType())){
|
||||
//获取关联资方
|
||||
partnerIds=traderService.getPartnerIdByTraderId(user.getTraderId());
|
||||
}
|
||||
model.addAttribute("partnerList",partnerDao.partnerList(partnerIds));
|
||||
return "modules/yangguang/changes/surveyChange/changeList";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 变更记录列表数据
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "recordData")
|
||||
public Object recordData(HttpServletRequest request) {
|
||||
LayuiPage<Record> page = new LayuiPage<>(request);
|
||||
Map<String, String> params = getParams(request);
|
||||
User user = UserUtils.getUser();
|
||||
if(User.USER_TYPE_HZS.equals(user.getUserType())){
|
||||
String parId = CrmUtils.getPartnerId(user.getId());
|
||||
CrmPartner partner = partnerService.getById(parId);
|
||||
params.put("authorizedId", partner.getAuthorizedId());
|
||||
}else if(User.USER_TYPE_PARTNER.equals(user.getUserType())){
|
||||
CrmPartner partner = partnerService.findByUserId(user.getId());
|
||||
params.put("authorizedId", partner.getAuthorizedId());
|
||||
} else if (User.USER_TYPE_ADVISOR.equals(user.getUserType())) {
|
||||
CrmTraderEmploye employe = traderEmployeService.findByUserId(user.getId());
|
||||
params.put("engineerId", employe.getId());
|
||||
}
|
||||
Operator operator = Operator.of(user.getId(), CrmUtils.getUserXM(user),user.getUserType());
|
||||
changeRecordService.listData(page, params, "1", operator);
|
||||
return page.renderJson();
|
||||
}
|
||||
|
||||
@RequestMapping("/toAddSurveyPage")
|
||||
public String toAddSurveyPage(HttpServletRequest request,Model model) {
|
||||
String partnerId = request.getParameter("partnerId");
|
||||
model.addAttribute("partnerId", partnerId);
|
||||
if (PartnerConstants.PARTNER_ID_HR.equals(partnerId)){
|
||||
return "modules/yangguang/changes/surveyChange/addSurveyHR";
|
||||
}else {
|
||||
return "modules/yangguang/changes/surveyChange/addSurvey";
|
||||
}
|
||||
}
|
||||
//选择资方页面
|
||||
@RequestMapping("/choosePartner")
|
||||
public String choosePartner(Model model) {
|
||||
// 获取代理商
|
||||
User user = UserUtils.getUser();
|
||||
CrmTrader trader;
|
||||
if (User.USER_TYPE_ADVISOR.equals(user.getUserType())) {
|
||||
String traderId = CrmUtils.getUserRelId(user);
|
||||
trader = traderService.getById(traderId);
|
||||
} else {
|
||||
trader = traderService.getTraderBuserId(user.getId());
|
||||
}
|
||||
String traderId = trader.getId();
|
||||
if ("2".equals(trader.getType())) {
|
||||
traderId = trader.getParentId();
|
||||
}
|
||||
// 获取代理商对应资方
|
||||
model.addAttribute("capital", entryService.getCapital(traderId));
|
||||
model.addAttribute("type","2");//区分哪个变更
|
||||
return "modules/yangguang/changes/common/choosePartner";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据电站编号获取电站信息
|
||||
* @param stationCode
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("selectNumber/{stationCode}")
|
||||
public Result selectNumber(@PathVariable("stationCode") String stationCode) {
|
||||
Result ret = Result.ok();
|
||||
Map<String, Object> resMap = Maps.newHashMap();
|
||||
CustomerEntry customerEntry = entryService.findCustomerEntryById(stationCode);
|
||||
if (customerEntry == null) {
|
||||
ret = Result.fail("未找到电站信息");
|
||||
return ret;
|
||||
}
|
||||
|
||||
//判断电站与角色是否相符
|
||||
User user = UserUtils.getUser();
|
||||
Operator operator = Operator.of(user.getId(), CrmUtils.getUserXM(user),user.getUserType());
|
||||
if(StringUtil.equalsAny(operator.getUserType(), UserConstants.TYPE_TRADER, User.USER_TYPE_ADVISOR)){
|
||||
Record record= CrmUtils.getUserTrader(operator.getUserType(),operator.getUserId());
|
||||
String traderId =record.getStr("id");
|
||||
if(UserConstants.TYPE_TRADER.equals(operator.getUserType())){ //代理商
|
||||
if ("1".equals(record.getStr("type"))){ // 1.一级代理商 2.二级代理商
|
||||
if (!customerEntry.getDistributorId().equals(traderId)) {
|
||||
ret = Result.fail("未找到电站信息");
|
||||
return ret;
|
||||
}
|
||||
}else{ //二级代理商
|
||||
if (UserConstants.TYPE_TRADER.equals(operator.getUserType())) {
|
||||
//代理商只能查看自己的
|
||||
if (!traderId.equals(customerEntry.getCreateTraderId())) {
|
||||
ret = Result.fail("未找到电站信息");
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
}else { //代理商人员
|
||||
if (!traderId.equals(customerEntry.getCreateTraderId())) {
|
||||
ret = Result.fail("未找到电站信息");
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
//校验数据
|
||||
/*boolean checkResult = false;
|
||||
if (CustomerEntryConstants.ENTRY_STATUS_DSH.equals(customerEntry.getStatus()) && StringUtil.equalsAny(customerEntry.getDesignAuditFlag()
|
||||
, CustomerEntryConstants.DESIGN_AUDIT_FLAG_DZS, CustomerEntryConstants.DESIGN_AUDIT_FLAG_ZSBH, CustomerEntryConstants.DESIGN_AUDIT_FLAG_ZSTG
|
||||
, CustomerEntryConstants.DESIGN_AUDIT_FLAG_SJSHBH, CustomerEntryConstants.DESIGN_AUDIT_FLAG_SJSHTG, CustomerEntryConstants.DESIGN_AUDIT_FLAG_JJSHBH
|
||||
, CustomerEntryConstants.DESIGN_AUDIT_FLAG_JJSHZ, CustomerEntryConstants.DESIGN_AUDIT_FLAG_JJSHTG)) {
|
||||
checkResult = true;
|
||||
} else if (StringUtil.equalsAny(customerEntry.getStatus(), CustomerEntryConstants.ENTRY_STATUS_SHBTG, CustomerEntryConstants.ENTRY_STATUS_DXD
|
||||
, CustomerEntryConstants.ENTRY_STATUS_DAZ, CustomerEntryConstants.ENTRY_STATUS_DAZYS, CustomerEntryConstants.ENTRY_STATUS_AZYSTH
|
||||
, CustomerEntryConstants.ENTRY_STATUS_DBW, CustomerEntryConstants.ENTRY_STATUS_DYS, CustomerEntryConstants.ENTRY_STATUS_YSBH
|
||||
, CustomerEntryConstants.ENTRY_STATUS_AZYSTH)) {
|
||||
checkResult = true;
|
||||
} else if (StringUtil.equalsAny(customerEntry.getStatus(), CustomerEntryConstants.ENTRY_STATUS_KCZS, CustomerEntryConstants.ENTRY_STATUS_AZZS)) {
|
||||
checkResult = true;
|
||||
}
|
||||
|
||||
if (!checkResult) {
|
||||
ret = Result.fail("操作失败,只有待踏勘之后并网验收之前的电站才可提交变更申请");
|
||||
return ret;
|
||||
}*/
|
||||
CustomerEntrySurveyRecord surveyRecord = surveyRecordService.findByEntryId(customerEntry.getId());
|
||||
resMap.put("customerEntry", customerEntry);
|
||||
if (PartnerConstants.PARTNER_ID_HR.equals(customerEntry.getPartnerId())){
|
||||
List<Record> projectList = projectService.getEntryProjectByEntryId(customerEntry.getId());
|
||||
resMap.put("projectList",projectList);
|
||||
//华融多产品-勘测返回
|
||||
List<Record> surveyDetail = recordDetailService.getEntryDetail(customerEntry.getId());
|
||||
resMap.put("projectDetailList",surveyDetail);
|
||||
}else {
|
||||
resMap.put("surveyRecord", surveyRecord);
|
||||
resMap.put("project", projectService.getById(customerEntry.getProjectId()));
|
||||
}
|
||||
|
||||
resMap.put("formSet", FormSetUtils.getFormPartSetByStep(null, "2", "07", customerEntry.getPartnerId(), false));
|
||||
ret.setData(resMap);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* 去选择电站页面
|
||||
*/
|
||||
@RequestMapping("/toSelectEntry")
|
||||
public String toSelectEntry(HttpServletRequest request ,Model model) {
|
||||
User user = UserUtils.getUser();
|
||||
//地址信息
|
||||
List<Record> pros = AddressUtils.findProvinceListByTraderId(CrmUtils.getCurrentTraderId(user.getId()), null);
|
||||
model.addAttribute("province", pros);
|
||||
model.addAttribute("partnerId", request.getParameter("partnerId"));
|
||||
return "modules/yangguang/changes/surveyChange/selectEntry";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加变更记录/暂存变更记录/修改变更记录
|
||||
* @param recordVo
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("addChangeRecord")
|
||||
public Result addChangeRecord(AddSurveyChangeRecordVo recordVo) {
|
||||
return changeRecordService.addChangeRecord(recordVo);
|
||||
}
|
||||
|
||||
//添加变更记录,多产品
|
||||
@ResponseBody
|
||||
@RequestMapping("addAnyProductSurveyChangeRecord")
|
||||
public Result addAnyProductSurveyChangeRecord(@RequestBody AnyProductSurveryChangeVo anyProductChangeVo) {
|
||||
return changeRecordService.addAnyProductChangeRecord(anyProductChangeVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核页面
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("surveyAudit/{id}")
|
||||
public String toAuditPage(@PathVariable("id") String id, Model model) {
|
||||
CustomerEntrySurveyChangeRecord record = changeRecordService.selectById(id);
|
||||
CustomerEntrySurveyChangeRecord oldRecord = changeRecordService.selectPre(record.getEntryId(), record.getNum());
|
||||
CustomerEntry customerEntry = entryService.getById(record.getEntryId());
|
||||
CrmProjectSetting projectSetting = projectService.getById(customerEntry.getProjectId());
|
||||
model.addAttribute("customerEntry", customerEntry);
|
||||
model.addAttribute("project", projectSetting);
|
||||
model.addAttribute("change", record);
|
||||
model.addAttribute("oldChange", oldRecord);
|
||||
model.addAttribute("formSet", JSONObject.toJSONString(FormSetUtils.getFormPartSetByStep(null, "2", "07", customerEntry.getPartnerId(), false)));
|
||||
model.addAttribute("info2",formSetService.getListByCondition("07", customerEntry.getPartnerId()) );
|
||||
if (PartnerConstants.PARTNER_ID_HR.equals(customerEntry.getPartnerId())){
|
||||
model.addAttribute("info2",formSetService.getListByCondition("07", customerEntry.getPartnerId()) );
|
||||
List<Record> projectList = projectService.getEntryProjectByEntryId(customerEntry.getId());
|
||||
model.addAttribute("projectDetailList",projectList);
|
||||
//华融多产品--获取更新的记录
|
||||
List<CustomerEntrySurveyChangeRecordDetail> newList=changeRecordService.getBySurveyChangeId(record.getId());
|
||||
model.addAttribute("newList",newList);
|
||||
|
||||
List<CustomerEntrySurveyChangeRecordDetail> oldList=changeRecordService.getBySurveyChangeId(oldRecord.getId());
|
||||
model.addAttribute("oldList",oldList);
|
||||
Map<String, CustomerEntrySurveyChangeRecordDetail> oldEntrySurveysMap = oldList.stream().collect(Collectors.toMap(e -> e.getProjectId(), e -> e, (a, b) -> a));
|
||||
model.addAttribute("oldListMap",oldEntrySurveysMap);
|
||||
model.addAttribute("from","audit");
|
||||
model.addAttribute("auditRemark",record.getAuditRemark());
|
||||
return "modules/yangguang/changes/surveyChange/surveryAuditHR";
|
||||
}
|
||||
return "modules/yangguang/changes/surveyChange/surveyAudit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 暂存
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("temp")
|
||||
public Result temp(SurveyAuditVo auditVo) {
|
||||
Result ret = null;
|
||||
try {
|
||||
ret = changeRecordService.temp(auditVo);
|
||||
} catch (IllegalArgumentException e) {
|
||||
ret = Result.fail(e.getMessage());
|
||||
e.printStackTrace();
|
||||
logger.info("SurveyChangeController.pass error:{}", e.getMessage());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
ret = Result.fail("操作失败");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核通过
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("pass")
|
||||
public Result pass(SurveyAuditVo auditVo) {
|
||||
Result ret = null;
|
||||
try {
|
||||
ret = changeRecordService.pass(auditVo);
|
||||
} catch (IllegalArgumentException e) {
|
||||
ret = Result.fail(e.getMessage());
|
||||
e.printStackTrace();
|
||||
logger.info("SurveyChangeController.pass error:{}", e.getMessage());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
ret = Result.fail("操作失败");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ResponseBody
|
||||
@RequestMapping("passHR")
|
||||
public Result passHR(SurveyAuditVo auditVo) {
|
||||
Result ret = null;
|
||||
try {
|
||||
ret = changeRecordService.passHR(auditVo);
|
||||
} catch (IllegalArgumentException e) {
|
||||
ret = Result.fail(e.getMessage());
|
||||
e.printStackTrace();
|
||||
logger.info("SurveyChangeController.passHR error:{}", e.getMessage());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
ret = Result.fail("操作失败");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 审核不通过
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("refuse")
|
||||
public Result refuse(SurveyAuditVo auditVo) {
|
||||
return changeRecordService.refuse(auditVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤回
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("cancel/{id}")
|
||||
public Result cancel(@PathVariable("id") String id) {
|
||||
return changeRecordService.back(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 变更详情
|
||||
* @param id
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/toSurveyDetail/{id}")
|
||||
public String toSurveyDetail(@PathVariable("id") String id, Model model) {
|
||||
CustomerEntrySurveyChangeRecord record = changeRecordService.selectById(id);
|
||||
CustomerEntrySurveyChangeRecord oldRecord = changeRecordService.selectPre(record.getEntryId(), record.getNum());
|
||||
CustomerEntry customerEntry = entryService.getById(record.getEntryId());
|
||||
CrmProjectSetting projectSetting = projectService.getById(customerEntry.getProjectId());
|
||||
model.addAttribute("customerEntry", customerEntry);
|
||||
model.addAttribute("project", projectSetting);
|
||||
model.addAttribute("change", record);
|
||||
model.addAttribute("oldChange", oldRecord);
|
||||
model.addAttribute("formSet", JSONObject.toJSONString(FormSetUtils.getFormPartSetByStep(null, "2", "07", customerEntry.getPartnerId(), false)));
|
||||
|
||||
if (PartnerConstants.PARTNER_ID_HR.equals(customerEntry.getPartnerId())){
|
||||
model.addAttribute("info2",formSetService.getListByCondition("07", customerEntry.getPartnerId()) );
|
||||
List<Record> projectList = projectService.getEntryProjectByEntryId(customerEntry.getId());
|
||||
model.addAttribute("projectDetailList",projectList);
|
||||
//华融多产品--获取更新的记录
|
||||
List<CustomerEntrySurveyChangeRecordDetail> newList=changeRecordService.getBySurveyChangeId(record.getId());
|
||||
model.addAttribute("newList",newList);
|
||||
|
||||
List<CustomerEntrySurveyChangeRecordDetail> oldList=changeRecordService.getBySurveyChangeId(oldRecord.getId());
|
||||
model.addAttribute("oldList",oldList);
|
||||
Map<String, CustomerEntrySurveyChangeRecordDetail> oldEntrySurveysMap = oldList.stream().collect(Collectors.toMap(e -> e.getProjectId(), e -> e, (a, b) -> a));
|
||||
model.addAttribute("oldListMap",oldEntrySurveysMap);
|
||||
model.addAttribute("from","detail");
|
||||
return "modules/yangguang/changes/surveyChange/surveryAuditHR";
|
||||
}
|
||||
return "modules/yangguang/changes/surveyChange/surveyDetail";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,231 @@
|
||||
package com.sifang.modules.changes.controller;
|
||||
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.sifang.modules.changes.service.CustomerInformationChangeService;
|
||||
import com.sifang.modules.changes.vo.CustomerInformationChangeVo;
|
||||
import com.sifang.modules.customer.Service.CustomerEntrySurveyRecordService;
|
||||
import com.sifang.modules.customer.constant.CustomerEntryConstants;
|
||||
import com.sifang.modules.customer.constant.UserConstants;
|
||||
import com.sifang.modules.customer.dao.CustomerEntryDao;
|
||||
import com.sifang.modules.customer.entity.CustomerEntry;
|
||||
import com.sifang.modules.customer.entity.CustomerEntrySurveyRecord;
|
||||
import com.sifang.modules.customer.utils.EmployeRoleUtils;
|
||||
import com.sifang.modules.insurance.entity.CrmCustomerEntryInsuranceInsured;
|
||||
import com.sifang.modules.platform.utils.AddressUtils;
|
||||
import com.sifang.modules.sunshine.SystemSetting.entity.CrmTraderEmploye;
|
||||
import com.sifang.modules.sunshine.SystemSetting.service.FormSetService;
|
||||
import com.sifang.modules.sunshine.SystemSetting.service.TraderEmployeService;
|
||||
import com.sifang.modules.sunshine.SystemSetting.utils.BusinessException;
|
||||
import com.sifang.modules.sunshine.SystemSetting.utils.Result;
|
||||
import com.sifang.modules.sunshine.SystemSetting.utils.StringUtil;
|
||||
import com.sifang.modules.sunshine.partnerManagement.entity.CrmPartner;
|
||||
import com.sifang.modules.sunshine.partnerManagement.service.PartnerService;
|
||||
import com.sifang.modules.sys.common.UserUtils;
|
||||
import com.sifang.modules.sys.common.entity.User;
|
||||
import com.sifang.modules.sys.entity.Operator;
|
||||
import com.sifang.modules.sys.util.CrmUtils;
|
||||
import com.sifang.modules.sys.util.LayuiPage;
|
||||
import com.sifang.modules.sys.web.BaseExceptionController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
//客户信息变更
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/entryChanges/customerInformationChange")
|
||||
public class CustomerInformationChangeController extends BaseExceptionController {
|
||||
|
||||
@Autowired
|
||||
private CustomerInformationChangeService informationChangeService;
|
||||
|
||||
@Autowired
|
||||
private PartnerService partnerService;
|
||||
|
||||
@Autowired
|
||||
TraderEmployeService traderEmployeService;
|
||||
|
||||
@Autowired
|
||||
private CustomerEntryDao customerEntryDao;
|
||||
|
||||
@Autowired
|
||||
private FormSetService formSetService;
|
||||
|
||||
//待审核页面
|
||||
@RequestMapping(value = "changeWaitAuditList")
|
||||
public String changeWaitAuditList(HttpServletRequest request, Model model){
|
||||
User user=UserUtils.getUser();
|
||||
model.addAttribute("user",user);
|
||||
return "modules/yangguang/changes/customerInformationChange/changeWaitAuditList";
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "getListData")
|
||||
public Object getListData(HttpServletRequest request) {
|
||||
LayuiPage<Record> page = new LayuiPage<>(request);
|
||||
Map<String, String> params = getParams(request);
|
||||
User user = UserUtils.getUser();
|
||||
|
||||
if(!StringUtil.equalsAny(user.getUserType(),User.USER_TYPE_YYS,User.USER_TYPE_WXG)){
|
||||
if(params.get("status").contains("2")){
|
||||
params.put("status","1,2");
|
||||
}
|
||||
}
|
||||
if(User.USER_TYPE_WXG.equals(user.getUserType())){ //平台员工
|
||||
EmployeRoleUtils.getUserDataAuthority(user.getId(),params);
|
||||
}
|
||||
Operator operator = Operator.of(user.getId(), CrmUtils.getUserXM(user), user.getUserType());
|
||||
informationChangeService.getListData(page, params, operator);
|
||||
return page.renderJson();
|
||||
}
|
||||
|
||||
//变更记录页面
|
||||
@RequestMapping(value = "changeList")
|
||||
public String changeList(HttpServletRequest request,Model model){
|
||||
return "modules/yangguang/changes/customerInformationChange/changeList";
|
||||
}
|
||||
|
||||
//新增、修改页面
|
||||
@RequestMapping(value = "savaEntryChangePage")
|
||||
public String savaEntryChangePage(HttpServletRequest request,Model model){
|
||||
String id=request.getParameter("id");
|
||||
String firstApply="";
|
||||
String tssBankNum="";
|
||||
String tssBankNumName="";
|
||||
if(StringUtil.isNotBlank(id)){ //修改
|
||||
Record changeRecord= informationChangeService.getByChangeId(id);
|
||||
List<Record> details= informationChangeService.getDetails(id);
|
||||
Map<String,Record> mapDetails=details.stream().collect(Collectors.toMap(e -> e.getStr("item_code"), e -> e, (a, b) -> a));
|
||||
model.addAttribute("changeRecord",changeRecord);
|
||||
model.addAttribute("mapDetails",mapDetails);
|
||||
model.addAttribute("details",details);
|
||||
firstApply=changeRecord.getStr("first_apply_status");
|
||||
if(StringUtil.isNotBlank(mapDetails.get("tssBankNumName").getStr("after_change"))){
|
||||
tssBankNum=mapDetails.get("tssBankNum").getStr("after_change");
|
||||
tssBankNumName=mapDetails.get("tssBankNumName").getStr("after_change");
|
||||
}
|
||||
}
|
||||
model.addAttribute("firstApply",firstApply);
|
||||
model.addAttribute("tssBankNum",tssBankNum);
|
||||
model.addAttribute("tssBankNumName",tssBankNumName);
|
||||
return "modules/yangguang/changes/customerInformationChange/savaEntryChangePage";
|
||||
}
|
||||
|
||||
//新增变更记录
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "savaEntryChange")
|
||||
public Result savaEntryChange(@RequestBody @Validated CustomerInformationChangeVo changeVo){
|
||||
String code= informationChangeService.savaEntryChange(changeVo);
|
||||
if(!"200".equals(code)){
|
||||
String msg = "";
|
||||
if ("208".equals(code)){
|
||||
msg = "修改的内容涉及重新再次进件,是否确认提交变更?";
|
||||
}else if ("209".equals(code)){
|
||||
msg = "修改的内容涉及合同重签,是否确认提交变更?";
|
||||
}
|
||||
return Result.fail("208",msg);
|
||||
}
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
//审核页面
|
||||
@RequestMapping(value = "toChangeAudit")
|
||||
public String toChangeAudit(HttpServletRequest request,Model model){
|
||||
String id=request.getParameter("id");
|
||||
String form=request.getParameter("form");
|
||||
Record changeRecord= informationChangeService.getByChangeId(id);
|
||||
List<Record> details= informationChangeService.getDetails(id);
|
||||
Map<String,Record> mapDetails=details.stream().collect(Collectors.toMap(e -> e.getStr("item_code"), e -> e, (a, b) -> a));
|
||||
model.addAttribute("changeRecord",changeRecord);
|
||||
model.addAttribute("mapDetails",mapDetails);
|
||||
model.addAttribute("details",details);
|
||||
model.addAttribute("form",form); //form=look 那么是查看
|
||||
String entryId = changeRecord.getStr("entry_id");
|
||||
CustomerEntry customerEntry = customerEntryDao.get(entryId);
|
||||
model.addAttribute("customerEntry",customerEntry);
|
||||
model.addAttribute("formSet", formSetService.getListByCondition("06", customerEntry.getPartnerId()));
|
||||
return "modules/yangguang/changes/customerInformationChange/changeAuditPage";
|
||||
}
|
||||
|
||||
//审核驳回
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "changeRecordBack")
|
||||
public Result changeRecordBack(HttpServletRequest request){
|
||||
String id=request.getParameter("id");
|
||||
String auditRemarks=request.getParameter("auditRemarks");
|
||||
informationChangeService.changeRecordBack(id,auditRemarks);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
//申请撤回
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "revokeChangeRecord")
|
||||
public Result revokeChangeRecord(HttpServletRequest request){
|
||||
String id=request.getParameter("id");
|
||||
informationChangeService.revokeChangeRecord(id);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
//审核通过
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "changeRecordApprove")
|
||||
public Result changeRecordApprove(HttpServletRequest request){
|
||||
String id=request.getParameter("id");
|
||||
String auditRemarks=request.getParameter("auditRemarks");
|
||||
String confirmTrue=request.getParameter("confirmTrue");
|
||||
informationChangeService.changeRecordApprove(id,auditRemarks,confirmTrue);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
//暂存
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "changeRecordTemp")
|
||||
public Result changeRecordTemp(HttpServletRequest request){
|
||||
String id=request.getParameter("id");
|
||||
String auditRemarks=request.getParameter("auditRemarks");
|
||||
informationChangeService.changeRecordTemp(id,auditRemarks);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据电站编号获取电站信息(客户信息变更)
|
||||
* @param stationCode
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("selectNumber/{stationCode}")
|
||||
public Result selectNumber(@PathVariable("stationCode") String stationCode) {
|
||||
Map<String,Object> map= informationChangeService.getCanChangeEntry(stationCode);
|
||||
return Result.success(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 去选择电站页面
|
||||
*/
|
||||
@RequestMapping("/toSelectEntry")
|
||||
public String toSelectEntry(Model model,HttpServletRequest request) {
|
||||
User user = UserUtils.getUser();
|
||||
//地址信息
|
||||
List<Record> pros = AddressUtils.findProvinceListByTraderId(CrmUtils.getCurrentTraderId(user.getId()), null);
|
||||
model.addAttribute("province", pros);
|
||||
String status=request.getParameter("status");
|
||||
if(StringUtil.isBlank(status)){
|
||||
status="khxxbgStatus";
|
||||
}
|
||||
model.addAttribute("status",status);
|
||||
return "modules/yangguang/changes/customerInformationChange/selectEntry";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,197 @@
|
||||
package com.sifang.modules.changes.dao;
|
||||
|
||||
import com.jfinal.kit.StrKit;
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.sifang.modules.changes.entity.CustomerEntryCompletionChangeRecord;
|
||||
import com.sifang.modules.changes.entity.CustomerEntrySurveyChangeRecord;
|
||||
import com.sifang.modules.customer.constant.UserConstants;
|
||||
import com.sifang.modules.site.siteInfo.service.SiteEmployeeService;
|
||||
import com.sifang.modules.sunshine.SystemSetting.utils.StringUtil;
|
||||
import com.sifang.modules.sys.common.entity.User;
|
||||
import com.sifang.modules.sys.common.persistence.BaseDao;
|
||||
import com.sifang.modules.sys.dao.UserDao;
|
||||
import com.sifang.modules.sys.entity.Operator;
|
||||
import com.sifang.modules.sys.util.CrmUtils;
|
||||
import com.sifang.modules.sys.util.LayuiPage;
|
||||
import com.sifang.modules.sys.util.SqlBuilder;
|
||||
import com.sifang.modules.taskdispatch.util.ItemDispatchUtil;
|
||||
import org.hibernate.Query;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author hz
|
||||
*/
|
||||
|
||||
@Repository
|
||||
public class CrmCompletionInfoChangeDao extends BaseDao<CustomerEntryCompletionChangeRecord> {
|
||||
|
||||
@Autowired
|
||||
UserDao userDao;
|
||||
@Autowired
|
||||
SiteEmployeeService siteEmployeeService;
|
||||
|
||||
public List<Record> selectList(LayuiPage<Record> page, Map<String, String> map, String flag, Operator operator) {
|
||||
SqlBuilder sf = new SqlBuilder();
|
||||
sf.line(" select a.id,a.number,a.power_station_code,a.`status`,a.num,a.creator,a.create_time,b.tenant_name,b.id_code,a.audit_time,a.create_by,m.assign_audit_user_id,b.partner_name");
|
||||
sf.line(" ,r.change_status,r.change_reason from crm_customer_entry_completion_change_record a");
|
||||
sf.line(" inner join crm_customer_entry b on a.entry_id=b.id");
|
||||
sf.line("left join crm_item_manage as m on m.process_instance_id=a.id");
|
||||
sf.line(" left join crm_customer_entry_change_record r on r.change_id=a.id");
|
||||
sf.line(" where a.num>0");
|
||||
if ("1".equals(flag)) {
|
||||
sf.line(" and a.status in('1','2','3')");
|
||||
} else {
|
||||
sf.line(" and a.status ='0'");
|
||||
}
|
||||
getOrderMap(sf, map, operator);
|
||||
sf.line(" order by a.create_time desc");
|
||||
if (page != null) {
|
||||
sf.line(" limit " + page.getLimit() + " offset " + (page.getPage() - 1) * page.getLimit());
|
||||
Long count = getCount(map, flag, operator);
|
||||
page.setCount(count);
|
||||
}
|
||||
List<Record> records = Db.find(sf.toString(), sf.params());
|
||||
ItemDispatchUtil.setReviewFlag(records);
|
||||
return records;
|
||||
}
|
||||
|
||||
public long getCount(Map<String, String> map, String flag,Operator operator) {
|
||||
SqlBuilder sf = new SqlBuilder();
|
||||
sf.line(" select count(*)");
|
||||
sf.line(" from crm_customer_entry_completion_change_record a");
|
||||
sf.line(" inner join crm_customer_entry b on a.entry_id=b.id");
|
||||
sf.line(" where a.num>0 ");
|
||||
if ("1".equals(flag)) {
|
||||
sf.line(" and a.status in('1','2','3')");
|
||||
} else {
|
||||
sf.line(" and a.status ='0'");
|
||||
}
|
||||
getOrderMap(sf, map, operator);
|
||||
return Db.queryLong(sf.toString(), sf.params());
|
||||
}
|
||||
|
||||
public String getOrderMap(SqlBuilder sf, Map<String, String> map, Operator operator) {
|
||||
if(StringUtil.equalsAny(operator.getUserType(), UserConstants.TYPE_TRADER, User.USER_TYPE_ADVISOR)){
|
||||
Record record= CrmUtils.getUserTrader(operator.getUserType(),operator.getUserId());
|
||||
String traderId =record.getStr("id");
|
||||
String type = record.getStr("type");
|
||||
if(UserConstants.TYPE_TRADER.equals(operator.getUserType())){ //代理商
|
||||
if ("1".equals(type)){ // 1.一级代理商 2.二级代理商
|
||||
sf.line(" and b.distributor_id =?" , traderId );
|
||||
}else{ //二级代理商
|
||||
if (UserConstants.TYPE_TRADER.equals(operator.getUserType())) {
|
||||
//代理商只能查看自己的
|
||||
sf.line(" and b.create_trader_id =?" , traderId );
|
||||
}
|
||||
}
|
||||
}else { //代理商人员
|
||||
String dataAuthority=record.getStr("data_authority");
|
||||
if("1".equals(type) && UserConstants.DATA_AUTHORITY_ALL.equals(dataAuthority)) {
|
||||
sf.line(" and b.distributor_id =?" , traderId );
|
||||
}else {
|
||||
sf.line(" and b.create_trader_id =?" , traderId );
|
||||
if(StringUtil.isBlank(dataAuthority) || UserConstants.DATA_AUTHORITY_ONLY.equals(dataAuthority)){
|
||||
sf.line(" and a.create_by =? ", operator.getUserId());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
long checkRo= userDao.isDefaultPlatRole(operator.getUserId());
|
||||
if (checkRo>0) {
|
||||
List<Record> employeeRole = siteEmployeeService.findEmployeeByUserId(operator.getUserId());
|
||||
List<String> provinceList = appendColumns(employeeRole, "provices");
|
||||
List<String> cityList = appendColumns(employeeRole, "city");
|
||||
List<String> numberList = appendColumns(employeeRole, "project_number");
|
||||
List<String> traderList = appendColumns(employeeRole, "trader_id");
|
||||
if (!provinceList.isEmpty()) {
|
||||
sf.inst("and b.province in ", provinceList);
|
||||
}
|
||||
if (!cityList.isEmpty()) {
|
||||
sf.inst("and b.city in ", cityList);
|
||||
}
|
||||
if (!numberList.isEmpty()) {
|
||||
sf.inst("and b.project_id in ", numberList);
|
||||
}
|
||||
|
||||
if (!traderList.isEmpty()) {
|
||||
if (map.get("traderId") != null && !map.get("traderId").isEmpty()){
|
||||
// builder.inst(" and e.distributor_id in ('"+ map.get("traderId") + "')");
|
||||
}else {
|
||||
sf.inst(" and b.distributor_id in ",traderList);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtil.checkParamsValid(map.get("authorizedId"))) {
|
||||
sf.inst("and b.project_id IN ", Arrays.asList(map.get("authorizedId").split(",")));
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("number"))) {
|
||||
sf.like("and a.number like ?", map.get("number"));
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("stationCode"))) {
|
||||
sf.like("and a.power_station_code like ? ", map.get("stationCode"));
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("tenantName"))) {
|
||||
sf.like("and b.tenant_name like ? ", map.get("tenantName"));
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("createTimeMin"))) {
|
||||
sf.line("and a.create_time >= ? ", map.get("createTimeMin") + " 00:00:00");
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("createTimeMax"))) {
|
||||
sf.line("and a.create_time <= ? ", map.get("createTimeMax") + " 23:59:59");
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("auditTimeMin"))) {
|
||||
sf.line("and a.audit_time >= ? ", map.get("auditTimeMin") + " 00:00:00");
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("auditTimeMax"))) {
|
||||
sf.line("and a.audit_time <= ? ", map.get("auditTimeMax") + " 23:59:59");
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("status"))) {
|
||||
sf.line("and a.status = ? ", map.get("status"));
|
||||
}
|
||||
return sf.toString();
|
||||
}
|
||||
|
||||
private List<String> appendColumns(List<Record> records, String column) {
|
||||
List<String> ret = new ArrayList<>();
|
||||
for (Record record : records) {
|
||||
String value = record.getStr(column);
|
||||
if (StrKit.notBlank(value)) {
|
||||
ret.addAll(Arrays.asList(value.split(",")));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public Integer selectMaxNum(String entryId) {
|
||||
return Db.queryInt("select max(num) from crm_customer_entry_completion_change_record where entry_id=? and status in('1','2','3')", entryId);
|
||||
}
|
||||
|
||||
public long selectNoAudited(String entryId, String id) {
|
||||
SqlBuilder sb = new SqlBuilder();
|
||||
sb.line("select count(1) from crm_customer_entry_completion_change_record where entry_id=? and status ='0'", entryId);
|
||||
if (StringUtil.isNotBlank(id)) {
|
||||
sb.line("and id <>?", id);
|
||||
}
|
||||
return Db.queryLong(sb.build(), sb.params());
|
||||
}
|
||||
|
||||
public CustomerEntryCompletionChangeRecord selectPre(String entryId, int num) {
|
||||
Query query = getSession().createQuery(" from CustomerEntryCompletionChangeRecord where entryId=:p1 and num<:p2 and status='1' order by num desc");
|
||||
query.setParameter("p1", entryId);
|
||||
query.setParameter("p2", num);
|
||||
List<CustomerEntryCompletionChangeRecord> list = query.list();
|
||||
return list.get(0);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.sifang.modules.changes.dao;
|
||||
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.sifang.modules.changes.entity.CrmCustomerEntryChangeDesignDetail;
|
||||
import com.sifang.modules.sys.common.persistence.BaseDao;
|
||||
import com.sifang.modules.sys.common.persistence.Parameter;
|
||||
import com.sifang.modules.sys.util.SqlBuilder;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public class CrmCustomerEntryChangeDesignDetailDao extends BaseDao<CrmCustomerEntryChangeDesignDetail> {
|
||||
public List<Record> getDesignDetailsByNumber(String number){
|
||||
SqlBuilder builder = new SqlBuilder();
|
||||
builder.line(" select * from crm_customer_entry_change_design_detail where number = ?",number);
|
||||
return Db.find(builder.build(),builder.params());
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,155 @@
|
||||
package com.sifang.modules.changes.dao;
|
||||
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.sifang.modules.changes.entity.CrmCustomerEntryTenantChangeRecord;
|
||||
import com.sifang.modules.customer.constant.UserConstants;
|
||||
import com.sifang.modules.customer.entity.CustomerEntry;
|
||||
import com.sifang.modules.sunshine.SystemSetting.utils.StringUtil;
|
||||
import com.sifang.modules.sys.common.entity.User;
|
||||
import com.sifang.modules.sys.common.persistence.BaseDao;
|
||||
import com.sifang.modules.sys.entity.Operator;
|
||||
import com.sifang.modules.sys.util.CrmUtils;
|
||||
import com.sifang.modules.sys.util.LayuiPage;
|
||||
import com.sifang.modules.sys.util.SqlBuilder;
|
||||
import com.sifang.modules.taskdispatch.util.ItemDispatchUtil;
|
||||
import org.hibernate.Query;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Repository
|
||||
public class CrmCustomerEntryTenantChangeRecordDao extends BaseDao<CrmCustomerEntryTenantChangeRecord> {
|
||||
|
||||
public void getListData(LayuiPage<Record> page, Map<String,String> map,Operator operator){
|
||||
SqlBuilder sf = new SqlBuilder();
|
||||
sf.line(" SELECT r.id,r.number,r.entry_id,r.create_name,DATE_FORMAT(r.create_time, '%Y-%m-%d %H:%i:%s') AS createTime,r.change_count ");
|
||||
sf.line(" ,r.status,e.power_station_code,e.tenant_name,e.id_code,a.change_status,a.change_reason,a.change_type ");
|
||||
sf.line(" ,DATE_FORMAT(r.audit_time, '%Y-%m-%d %H:%i:%s') AS auditTime,r.create_by,m.assign_audit_user_id ");
|
||||
sf.line(" FROM `crm_customer_entry_tenant_change_record` r ");
|
||||
sf.line(" LEFT JOIN `crm_customer_entry` e ON r.entry_id=e.id");
|
||||
sf.line("left join crm_item_manage as m on m.process_instance_id=r.id");
|
||||
sf.line(" left join crm_customer_entry_change_record a on a.change_id=r.id");
|
||||
sf.line(" WHERE 1=1 ");
|
||||
getOrderMap(sf,map,operator);
|
||||
sf.line(" order by r.create_time desc");
|
||||
if (page != null) {
|
||||
sf.line(" limit " + page.getLimit() + " offset " + (page.getPage() - 1) * page.getLimit());
|
||||
Long count = getListCount(map,operator);
|
||||
page.setCount(count);
|
||||
}
|
||||
List<Record> list=Db.find(sf.toString(), sf.params());
|
||||
ItemDispatchUtil.setReviewFlag(list);
|
||||
page.setData(list);
|
||||
}
|
||||
|
||||
public Long getListCount(Map<String,String> map,Operator operator){
|
||||
SqlBuilder sf = new SqlBuilder();
|
||||
sf.line("SELECT COUNT(r.id) ");
|
||||
sf.line(" FROM `crm_customer_entry_tenant_change_record` r ");
|
||||
sf.line(" LEFT JOIN `crm_customer_entry` e ON r.entry_id=e.id");
|
||||
sf.line(" WHERE 1=1 ");
|
||||
getOrderMap(sf,map,operator);
|
||||
return Db.queryLong(sf.toString(),sf.params());
|
||||
}
|
||||
|
||||
public void getOrderMap(SqlBuilder sf, Map<String, String> map, Operator operator) {
|
||||
if(StringUtil.equalsAny(operator.getUserType(), UserConstants.TYPE_TRADER, User.USER_TYPE_ADVISOR)){
|
||||
Record record= CrmUtils.getUserTrader(operator.getUserType(),operator.getUserId());
|
||||
String traderId =record.getStr("id");
|
||||
String type = record.getStr("type");
|
||||
if(UserConstants.TYPE_TRADER.equals(operator.getUserType())){ //代理商
|
||||
if ("1".equals(type)){ // 1.一级代理商 2.二级代理商
|
||||
sf.line(" and e.distributor_id =?" , traderId );
|
||||
}else{ //二级代理商
|
||||
if (UserConstants.TYPE_TRADER.equals(operator.getUserType())) {
|
||||
//代理商只能查看自己的
|
||||
sf.line(" and e.create_trader_id =?" , traderId );
|
||||
}
|
||||
}
|
||||
}else { //代理商人员
|
||||
String dataAuthority=record.getStr("data_authority");
|
||||
if("1".equals(type) && UserConstants.DATA_AUTHORITY_ALL.equals(dataAuthority)) {
|
||||
sf.line(" and e.distributor_id =?" , traderId );
|
||||
}else {
|
||||
sf.line(" and e.create_trader_id =?" , traderId );
|
||||
if(StringUtil.isBlank(dataAuthority) || UserConstants.DATA_AUTHORITY_ONLY.equals(dataAuthority)){
|
||||
sf.line(" and r.create_by =? ", operator.getUserId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtil.checkParamsValid(map.get("authorizedId"))) {
|
||||
sf.inst("and e.project_id IN ", Arrays.asList(map.get("authorizedId").split(",")));
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("number"))) {
|
||||
sf.like("and r.number like ?", map.get("number"));
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("powerStationCode"))) {
|
||||
sf.like("and e.power_station_code like ? ", map.get("powerStationCode"));
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("tenantName"))) {
|
||||
sf.like("and e.tenant_name like ? ", map.get("tenantName"));
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("createTimeMin"))) {
|
||||
sf.line("and r.create_time >= ? ", map.get("createTimeMin") + " 00:00:00");
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("createTimeMax"))) {
|
||||
sf.line("and r.create_time <= ? ", map.get("createTimeMax") + " 23:59:59");
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("auditStartTime"))) {
|
||||
sf.line("and r.create_time >= ? ", map.get("auditStartTime") + " 00:00:00");
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("auditEndTime"))) {
|
||||
sf.line("and r.create_time <= ? ", map.get("auditEndTime") + " 23:59:59");
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("status"))) {
|
||||
sf.inst("and r.status in ", map.get("status").split(","));
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("auditStatus"))) {
|
||||
sf.line("and r.status =? ", map.get("auditStatus"));
|
||||
}
|
||||
|
||||
if(StringUtil.isNotBlank(map.get("provinceE"))){
|
||||
sf.inst(" and e.province in ",map.get("provinceE").split(","));
|
||||
}
|
||||
if(StringUtil.isNotBlank(map.get("cityE"))){
|
||||
sf.inst(" and e.city in ",map.get("cityE").split(","));
|
||||
}
|
||||
if(StringUtil.isNotBlank(map.get("traderIdsE"))){
|
||||
sf.inst(" and e.create_trader_id in ",map.get("traderIdsE").split(","));
|
||||
}
|
||||
if (StringUtil.isNotBlank(map.get("projectNumberE"))) {
|
||||
sf.inst(" and e.project_id in ", map.get("projectNumberE").split(","));
|
||||
}
|
||||
}
|
||||
|
||||
public Long getNumber(String entryId){
|
||||
return Db.queryLong(" SELECT COUNT(r.id) FROM crm_customer_entry_tenant_change_record r WHERE r.entry_id=? ",entryId);
|
||||
}
|
||||
|
||||
public Long getIfHaveChangeRecord(String entryId){
|
||||
return Db.queryLong(" SELECT COUNT(r.id) FROM crm_customer_entry_tenant_change_record r WHERE r.entry_id=? AND r.status='2' ",entryId);
|
||||
}
|
||||
|
||||
public Record getByChangeId(String id){
|
||||
return Db.findFirst(" SELECT r.id,r.number,r.entry_id,r.power_station_code,r.create_name,r.create_time,r.change_reason,e.first_apply_status,r.entry_status,r.audit_remarks " +
|
||||
" ,e.tenant_name,r.status,e.trader_name,e.project_company_name,e.project_name,e.id_code,e.province,e.city,e.area,e.street,e.address,CONCAT(e.province,e.city,e.area,e.address) AS customerAddress "+
|
||||
" FROM `crm_customer_entry_tenant_change_record` r " +
|
||||
" LEFT JOIN `crm_customer_entry` e ON e.id=r.entry_id "+
|
||||
" WHERE r.id=? ",id);
|
||||
}
|
||||
|
||||
public CustomerEntry getCanChangeEntry(String powerStationCode, Map<String,String> map){
|
||||
StringBuilder sb=new StringBuilder();
|
||||
sb.append(" from CustomerEntry where powerStationCode='"+powerStationCode+"' ");
|
||||
if(StringUtil.isNotBlank(map.get("traderId"))){
|
||||
sb.append(" and createTraderId in ("+StringUtil.joinInSql(map.get("traderId").split(","))+")");
|
||||
}
|
||||
Query query =getSession().createQuery(sb.toString());
|
||||
return (CustomerEntry)query.uniqueResult();
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.sifang.modules.changes.dao;
|
||||
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.sifang.modules.changes.entity.CrmCustomerEntryTenantChangeRecordDetail;
|
||||
import com.sifang.modules.customer.dao.CustomerEntryDao;
|
||||
import com.sifang.modules.customer.entity.CustomerEntry;
|
||||
import com.sifang.modules.sys.common.persistence.BaseDao;
|
||||
import com.sifang.modules.sys.util.SqlBuilder;
|
||||
import org.hibernate.Query;
|
||||
import org.hibernate.SQLQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Repository
|
||||
public class CrmCustomerEntryTenantChangeRecordDetailDao extends BaseDao<CrmCustomerEntryTenantChangeRecordDetail> {
|
||||
|
||||
@Autowired
|
||||
private CustomerEntryDao customerEntryDao;
|
||||
|
||||
public void deleteDetails(String mainId){
|
||||
SQLQuery sqlQuery = getSession().createSQLQuery("DELETE FROM crm_customer_entry_tenant_change_record_detail WHERE main_id=:mainId");
|
||||
sqlQuery.setParameter("mainId", mainId);
|
||||
sqlQuery.executeUpdate();
|
||||
}
|
||||
|
||||
public List<Record> getDetails(String mainId){
|
||||
return Db.find(" SELECT * FROM `crm_customer_entry_tenant_change_record_detail` d WHERE main_id=? ORDER BY sort ASC ",mainId);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,159 @@
|
||||
package com.sifang.modules.changes.dao;
|
||||
|
||||
import com.jfinal.kit.StrKit;
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.sifang.modules.changes.entity.CrmMaterialInformationChangeApply;
|
||||
import com.sifang.modules.changes.vo.MaterialInformationChangeVo;
|
||||
import com.sifang.modules.customer.constant.UserConstants;
|
||||
import com.sifang.modules.customer.entity.CustomerEntry;
|
||||
import com.sifang.modules.platform.utils.PlantformUtils;
|
||||
import com.sifang.modules.sunshine.SystemSetting.utils.StringUtil;
|
||||
import com.sifang.modules.sys.common.entity.User;
|
||||
import com.sifang.modules.sys.common.persistence.BaseDao;
|
||||
import com.sifang.modules.sys.entity.Operator;
|
||||
import com.sifang.modules.sys.util.CrmUtils;
|
||||
import com.sifang.modules.sys.util.LayuiPage;
|
||||
import com.sifang.modules.sys.util.SqlBuilder;
|
||||
import com.sifang.modules.taskdispatch.util.ItemDispatchUtil;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Repository
|
||||
public class CrmMaterialInformationChangeApplyDao extends BaseDao<CrmMaterialInformationChangeApply> {
|
||||
|
||||
/**
|
||||
* 校验是否存在流程中的申请单
|
||||
*/
|
||||
public boolean checkRepeatByEntryId(String entryId) {
|
||||
return Db.queryLong("SELECT COUNT(1) FROM crm_material_information_change_apply WHERE entry_id = ? AND unique_key = '1'", entryId) > 0;
|
||||
}
|
||||
|
||||
public Long getMaxChangeTime(String entryId){
|
||||
return Db.queryColumn("SELECT IFNULL(max(change_time),0) from crm_material_information_change_apply where entry_id = ? ",entryId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建申请单
|
||||
*/
|
||||
public CrmMaterialInformationChangeApply createOne(String reason, CustomerEntry entry, Operator operator, Date now){
|
||||
CrmMaterialInformationChangeApply apply = new CrmMaterialInformationChangeApply();
|
||||
apply.setUniqueKey("1");
|
||||
apply.setNumber(PlantformUtils.getOrderNumber());
|
||||
apply.setEntryId(entry.getId());
|
||||
apply.setPowerStationCode(entry.getPowerStationCode());
|
||||
apply.setChangeReason(reason);
|
||||
Long maxChangeTime = getMaxChangeTime(entry.getId());
|
||||
apply.setChangeTime((int) (maxChangeTime+1));
|
||||
apply.setStatus("0");
|
||||
apply.setCreateBy(operator.getUserId());
|
||||
apply.setCreator(operator.getUserName());
|
||||
apply.setCreateTime(now);
|
||||
apply.setAuditRemarks("");
|
||||
save(apply);
|
||||
return apply;
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表数据
|
||||
*/
|
||||
public List<Record> findPageData(LayuiPage page, Map<String, String> map, Operator operator) {
|
||||
SqlBuilder sql = new SqlBuilder();
|
||||
sql.line("SELECT a.* ,b.tenant_name,b.id_code,m.assign_audit_user_id ,r.change_status,r.change_reason ");
|
||||
sql.line("FROM crm_material_information_change_apply a");
|
||||
sql.line("LEFT JOIN crm_customer_entry b ON b.id = a.entry_id");
|
||||
sql.line("left join crm_item_manage as m on m.process_instance_id=a.id");
|
||||
sql.line(" left join crm_customer_entry_change_record r on r.change_id=a.id");
|
||||
sql.line("WHERE 1 = 1");
|
||||
queryCondition(sql, map, operator);
|
||||
sql.line("ORDER BY a.create_time DESC");
|
||||
if (StrKit.notNull(page)) {
|
||||
sql.limit(page.getPage(), page.getLimit());
|
||||
}
|
||||
List<Record> records = Db.find(sql.build(), sql.params());
|
||||
ItemDispatchUtil.setReviewFlag(records);
|
||||
return records;
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表数据统计
|
||||
*/
|
||||
public long findPageCount(Map<String, String> map, Operator operator) {
|
||||
SqlBuilder sql = new SqlBuilder();
|
||||
sql.line("SELECT COUNT(1)");
|
||||
sql.line("FROM crm_material_information_change_apply a");
|
||||
sql.line("LEFT JOIN crm_customer_entry b ON b.id = a.entry_id");
|
||||
sql.line("WHERE 1 = 1");
|
||||
queryCondition(sql, map, operator);
|
||||
return Db.queryLong(sql.build(), sql.params());
|
||||
}
|
||||
|
||||
private void queryCondition(SqlBuilder sql, Map<String, String> map, Operator operator) {
|
||||
if(StringUtil.equalsAny(operator.getUserType(), UserConstants.TYPE_TRADER, User.USER_TYPE_ADVISOR)){
|
||||
Record record= CrmUtils.getUserTrader(operator.getUserType(),operator.getUserId());
|
||||
String traderId =record.getStr("id");
|
||||
String type = record.getStr("type");
|
||||
if(UserConstants.TYPE_TRADER.equals(operator.getUserType())){ //代理商
|
||||
if ("1".equals(type)){ // 1.一级代理商 2.二级代理商
|
||||
sql.line(" and b.distributor_id =?" , traderId );
|
||||
}else{ //二级代理商
|
||||
if (UserConstants.TYPE_TRADER.equals(operator.getUserType())) {
|
||||
//代理商只能查看自己的
|
||||
sql.line(" and b.create_trader_id =?" , traderId );
|
||||
}
|
||||
}
|
||||
}else { //代理商人员
|
||||
String dataAuthority=record.getStr("data_authority");
|
||||
//一级代理商人员 且拥有查看所有数据的权限 则可以查看到一二级所有数据
|
||||
if("1".equals(type) && UserConstants.DATA_AUTHORITY_ALL.equals(dataAuthority)) {
|
||||
sql.line(" and b.distributor_id =?", traderId);
|
||||
}else {
|
||||
sql.line(" and b.create_trader_id =?" , traderId );
|
||||
if(StringUtil.isBlank(dataAuthority) || UserConstants.DATA_AUTHORITY_ONLY.equals(dataAuthority)){
|
||||
sql.line(" and a.create_by =? ", operator.getUserId());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//type 1.待审核 2.变更记录
|
||||
if ("1".equals(map.get("type"))){
|
||||
sql.line("AND a.status = '0' ");
|
||||
} else if ("2".equals(map.get("type"))) {
|
||||
sql.line("AND a.status in('1','2','3') ");
|
||||
}
|
||||
// 变更单号
|
||||
if (StringUtil.checkParamsValid(map.get("number"))) {
|
||||
sql.line("AND a.number like concat('%', ?, '%')", map.get("number"));
|
||||
}
|
||||
// 电站编码
|
||||
if (StringUtil.checkParamsValid(map.get("powerStationCode"))) {
|
||||
sql.line("AND a.power_station_code like concat('%', ?, '%')", map.get("powerStationCode"));
|
||||
}
|
||||
// 状态
|
||||
if (StringUtil.checkParamsValid(map.get("status"))) {
|
||||
sql.line("AND a.status = ?", map.get("status"));
|
||||
}
|
||||
// 业主姓名
|
||||
if (StringUtil.checkParamsValid(map.get("tenantName"))) {
|
||||
sql.line("AND b.tenant_name like concat('%', ?, '%')", map.get("tenantName"));
|
||||
}
|
||||
// 申请时间
|
||||
if (StringUtil.checkParamsValid(map.get("createTimeSta"))) {
|
||||
sql.line("AND a.create_time >= concat(?, ' 00:00:00')", map.get("createTimeSta"));
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("endEndTime"))) {
|
||||
sql.line("AND a.create_time <= concat(?, ' 23:59:59')", map.get("endEndTime"));
|
||||
}
|
||||
// 审核时间
|
||||
if (StringUtil.checkParamsValid(map.get("auditTimeSta"))) {
|
||||
sql.line("AND a.audit_time >= concat(?, ' 00:00:00')", map.get("auditTimeSta"));
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("auditTimeEnd"))) {
|
||||
sql.line("AND a.audit_time <= concat(?, ' 23:59:59')", map.get("auditTimeEnd"));
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.sifang.modules.changes.dao;
|
||||
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.sifang.modules.changes.entity.CrmMaterialInformationChangeApplyDetail;
|
||||
import com.sifang.modules.sys.common.persistence.BaseDao;
|
||||
import com.sifang.modules.sys.util.SqlBuilder;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public class CrmMaterialInformationChangeApplyDetailDao extends BaseDao<CrmMaterialInformationChangeApplyDetail> {
|
||||
|
||||
/**
|
||||
* 创建申请单详情
|
||||
*/
|
||||
public CrmMaterialInformationChangeApplyDetail createApplyDetail(String applyId,CrmMaterialInformationChangeApplyDetail applyDetail,String type) {
|
||||
CrmMaterialInformationChangeApplyDetail detail = new CrmMaterialInformationChangeApplyDetail();
|
||||
detail.setApplyId(applyId);
|
||||
detail.setType(type);
|
||||
detail.setMaterialId(applyDetail.getMaterialId());
|
||||
detail.setMaterialCode(applyDetail.getMaterialCode());
|
||||
detail.setMaterialName(applyDetail.getMaterialName());
|
||||
detail.setMaterialSpec(applyDetail.getMaterialSpec());
|
||||
detail.setMaterialBrand(applyDetail.getMaterialBrand());
|
||||
detail.setBarcode(applyDetail.getBarcode());
|
||||
detail.setNewBarcode(applyDetail.getNewBarcode());
|
||||
detail.setSn(applyDetail.getSn());
|
||||
detail.setNewSn(applyDetail.getNewSn());
|
||||
detail.setNbqSn(applyDetail.getNbqSn());
|
||||
detail.setNewNbqSn(applyDetail.getNewNbqSn());
|
||||
detail.setYzCode(applyDetail.getYzCode());
|
||||
detail.setNewYzCode(applyDetail.getNewYzCode());
|
||||
save(detail);
|
||||
return detail;
|
||||
}
|
||||
public CrmMaterialInformationChangeApplyDetail createApplyDetail(String applyId,CrmMaterialInformationChangeApplyDetail applyDetail,String type,String projectId) {
|
||||
CrmMaterialInformationChangeApplyDetail detail = new CrmMaterialInformationChangeApplyDetail();
|
||||
detail.setApplyId(applyId);
|
||||
detail.setProjectId(projectId);
|
||||
detail.setType(type);
|
||||
detail.setMaterialId(applyDetail.getMaterialId());
|
||||
detail.setMaterialCode(applyDetail.getMaterialCode());
|
||||
detail.setMaterialName(applyDetail.getMaterialName());
|
||||
detail.setMaterialSpec(applyDetail.getMaterialSpec());
|
||||
detail.setMaterialBrand(applyDetail.getMaterialBrand());
|
||||
detail.setBarcode(applyDetail.getBarcode());
|
||||
detail.setNewBarcode(applyDetail.getNewBarcode());
|
||||
detail.setSn(applyDetail.getSn());
|
||||
detail.setNewSn(applyDetail.getNewSn());
|
||||
detail.setNbqSn(applyDetail.getNbqSn());
|
||||
detail.setNewNbqSn(applyDetail.getNewNbqSn());
|
||||
detail.setYzCode(applyDetail.getYzCode());
|
||||
detail.setNewYzCode(applyDetail.getNewYzCode());
|
||||
save(detail);
|
||||
return detail;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据申请单id查找物料详情
|
||||
*/
|
||||
public List<Record> findMaterialDetailsByApplyId(String applyId) {
|
||||
SqlBuilder builder = new SqlBuilder();
|
||||
builder.line(" select * from crm_material_information_change_apply_detail a ")
|
||||
.line(" where a.apply_id = ? order by a.project_id asc ",applyId);
|
||||
return Db.find(builder.build(),builder.params());
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package com.sifang.modules.changes.dao;
|
||||
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.sifang.modules.changes.entity.CrmCustomerEntryChangeDesignComponent;
|
||||
import com.sifang.modules.changes.vo.DesignChangeAuditVo;
|
||||
import com.sifang.modules.sys.common.persistence.BaseDao;
|
||||
import com.sifang.modules.sys.util.SqlBuilder;
|
||||
import org.hibernate.SQLQuery;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public class CustomerEntryChangeDesignComponentDao extends BaseDao<CrmCustomerEntryChangeDesignComponent> {
|
||||
|
||||
public int audit(DesignChangeAuditVo req) {
|
||||
SqlBuilder sb = new SqlBuilder()
|
||||
.line("update crm_customer_entry_change_design")
|
||||
.line("set audit_by=:auditBy,auditor=:auditor,audit_time=:auditTime,audit_remark=:remark,status=:status")
|
||||
.line("where id=:id and status='0'");
|
||||
|
||||
SQLQuery query = getSession().createSQLQuery(sb.build());
|
||||
query.setString("auditBy", req.getUserId());
|
||||
query.setString("auditor", req.getUserName());
|
||||
query.setParameter("auditTime", new Date());
|
||||
query.setString("remark", req.getMsg());
|
||||
query.setString("status", req.getValue());
|
||||
query.setString("id", req.getChangeId());
|
||||
return query.executeUpdate();
|
||||
}
|
||||
|
||||
public List<Record> findByDesignId(String designId) {
|
||||
SqlBuilder sb = new SqlBuilder()
|
||||
.line("select c.*,concat(ifnull(e.material_model,''),'|',e.model) as material_model from crm_customer_entry_change_design_component c left join crm_electric_set e on c.item_id = e.id ")
|
||||
.line("where c.design_change_id=? order by c.item_type desc ", designId);
|
||||
return Db.find(sb.build(), sb.params());
|
||||
}
|
||||
|
||||
public List<Record> findByDesignId1(String designId) {
|
||||
SqlBuilder sb = new SqlBuilder()
|
||||
.line("select c.*,e.material_model from crm_customer_entry_change_design_component c left join crm_electric_set e on c.item_id = e.id ")
|
||||
.line("where c.design_change_id=? and flag = '1' ", designId);
|
||||
return Db.find(sb.build(), sb.params());
|
||||
}
|
||||
}
|
@ -0,0 +1,196 @@
|
||||
package com.sifang.modules.changes.dao;
|
||||
|
||||
import com.jfinal.kit.StrKit;
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.sifang.modules.changes.entity.CrmCustomerEntryChangeDesign;
|
||||
import com.sifang.modules.customer.constant.UserConstants;
|
||||
import com.sifang.modules.site.siteInfo.service.SiteEmployeeService;
|
||||
import com.sifang.modules.sunshine.SystemSetting.service.TraderService;
|
||||
import com.sifang.modules.sunshine.SystemSetting.utils.StringUtil;
|
||||
import com.sifang.modules.sys.common.entity.User;
|
||||
import com.sifang.modules.sys.common.persistence.BaseDao;
|
||||
import com.sifang.modules.sys.dao.UserDao;
|
||||
import com.sifang.modules.sys.entity.Operator;
|
||||
import com.sifang.modules.sys.util.CrmUtils;
|
||||
import com.sifang.modules.sys.util.LayuiPage;
|
||||
import com.sifang.modules.sys.util.SqlBuilder;
|
||||
import com.sifang.modules.taskdispatch.util.ItemDispatchUtil;
|
||||
import org.hibernate.SQLQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Repository
|
||||
public class CustomerEntryChangeDesignDao extends BaseDao<CrmCustomerEntryChangeDesign> {
|
||||
|
||||
@Autowired
|
||||
UserDao userDao;
|
||||
|
||||
@Autowired
|
||||
SiteEmployeeService siteEmployeeService;
|
||||
@Autowired
|
||||
private TraderService traderService;
|
||||
|
||||
public void selectList(LayuiPage<Record> page, Map<String, String> map, Operator operator) {
|
||||
SqlBuilder sf = new SqlBuilder();
|
||||
sf.line(" select a.id,a.number,a.power_station_code,a.`status`,a.num,a.creator,a.create_time,b.tenant_name,b.id_code,a.audit_time,a.create_by,m.assign_audit_user_id");
|
||||
sf.line(",b.partner_name,b.partner_id,r.change_status,r.change_reason from crm_customer_entry_change_design a");
|
||||
sf.line(" inner join crm_customer_entry b on a.entry_id=b.id");
|
||||
sf.line(" left join crm_customer_entry_change_record r on r.change_id=a.id");
|
||||
sf.line("left join crm_item_manage as m on m.process_instance_id=a.id");
|
||||
sf.line(" where 1=1");
|
||||
if(UserConstants.TYPE_TRADER.equals(operator.getUserType())) {
|
||||
String partnerIds = traderService.getPartnerIdByTraderId(operator.getUserId());
|
||||
if(StringUtil.isNotBlank(partnerIds)){
|
||||
sf.inst(" and b.partner_id in ",partnerIds);
|
||||
}
|
||||
}
|
||||
getOrderMap(sf, map, operator);
|
||||
sf.line(" order by a.create_time desc");
|
||||
if (page != null) {
|
||||
sf.limit(page.getPage(), page.getLimit());
|
||||
Long count = getCount(map, operator);
|
||||
page.setCount(count);
|
||||
List<Record> records = Db.find(sf.toString(), sf.params());
|
||||
ItemDispatchUtil.setReviewFlag(records);
|
||||
page.setData(records);
|
||||
}
|
||||
}
|
||||
|
||||
public long getCount(Map<String, String> map, Operator operator) {
|
||||
SqlBuilder sf = new SqlBuilder();
|
||||
sf.line(" select count(*)");
|
||||
sf.line(" from crm_customer_entry_change_design a");
|
||||
sf.line(" inner join crm_customer_entry b on a.entry_id=b.id");
|
||||
sf.line(" where 1=1 ");
|
||||
|
||||
getOrderMap(sf, map, operator);
|
||||
return Db.queryLong(sf.build(), sf.params());
|
||||
}
|
||||
|
||||
public void getOrderMap(SqlBuilder sf, Map<String, String> map, Operator operator) {
|
||||
if (StringUtil.equalsAny(operator.getUserType(), UserConstants.TYPE_TRADER, User.USER_TYPE_ADVISOR)) {
|
||||
Record record = CrmUtils.getUserTrader(operator.getUserType(), operator.getUserId());
|
||||
String traderId = record.getStr("id");
|
||||
String type = record.getStr("type");
|
||||
if (UserConstants.TYPE_TRADER.equals(operator.getUserType())) { //代理商
|
||||
if ("1".equals(type)) { // 1.一级代理商 2.二级代理商
|
||||
sf.line(" and b.distributor_id =?", traderId);
|
||||
} else { //二级代理商
|
||||
if (UserConstants.TYPE_TRADER.equals(operator.getUserType())) {
|
||||
//代理商只能查看自己的
|
||||
sf.line(" and b.create_trader_id =?", traderId);
|
||||
}
|
||||
}
|
||||
} else { //代理商人员
|
||||
String dataAuthority = record.getStr("data_authority");
|
||||
if("1".equals(type) && UserConstants.DATA_AUTHORITY_ALL.equals(dataAuthority)) {
|
||||
sf.line(" and b.distributor_id =?", traderId);
|
||||
}else {
|
||||
sf.line(" and b.create_trader_id =?", traderId);
|
||||
if (StringUtil.isBlank(dataAuthority) || UserConstants.DATA_AUTHORITY_ONLY.equals(dataAuthority)) {
|
||||
sf.line(" and a.create_by =? ", operator.getUserId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
long checkRo= userDao.isDefaultPlatRole(operator.getUserId());
|
||||
if (checkRo>0) {
|
||||
List<Record> employeeRole = siteEmployeeService.findEmployeeByUserId(operator.getUserId());
|
||||
List<String> provinceList = appendColumns(employeeRole, "provices");
|
||||
List<String> cityList = appendColumns(employeeRole, "city");
|
||||
List<String> numberList = appendColumns(employeeRole, "project_number");
|
||||
List<String> traderList = appendColumns(employeeRole, "trader_id");
|
||||
if (!provinceList.isEmpty()) {
|
||||
sf.inst("and b.province in ", provinceList);
|
||||
}
|
||||
if (!cityList.isEmpty()) {
|
||||
sf.inst("and b.city in ", cityList);
|
||||
}
|
||||
if (!numberList.isEmpty()) {
|
||||
sf.inst("and b.project_id in ", numberList);
|
||||
}
|
||||
|
||||
if (!traderList.isEmpty()) {
|
||||
if (map.get("traderId") != null && !map.get("traderId").isEmpty()){
|
||||
// builder.inst(" and e.distributor_id in ('"+ map.get("traderId") + "')");
|
||||
}else {
|
||||
sf.inst(" and b.distributor_id in ",traderList);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtil.isNotBlank(map.get("number"))) {
|
||||
sf.like("and a.number like ?", map.get("number"));
|
||||
}
|
||||
if (StringUtil.isNotBlank(map.get("stationCode"))) {
|
||||
sf.like("and a.power_station_code like ? ", map.get("stationCode"));
|
||||
}
|
||||
if (StringUtil.isNotBlank(map.get("tenantName"))) {
|
||||
sf.like("and b.tenant_name like ? ", map.get("tenantName"));
|
||||
}
|
||||
if (StringUtil.isNotBlank(map.get("createTimeMax"))) {
|
||||
sf.line("and a.create_time <= ? ", map.get("createTimeMax") + " 23:59:59");
|
||||
}
|
||||
if (StringUtil.isNotBlank(map.get("createTimeMin"))) {
|
||||
sf.line("and a.create_time >= ? ", map.get("createTimeMin") + " 00:00:00");
|
||||
}
|
||||
if (StringUtil.isNotBlank(map.get("auditTimeMax"))) {
|
||||
sf.line("and a.audit_time <= ? ", map.get("auditTimeMax") + " 23:59:59");
|
||||
}
|
||||
if (StringUtil.isNotBlank(map.get("auditTimeMin"))) {
|
||||
sf.line("and a.audit_time >= ? ", map.get("auditTimeMin") + " 00:00:00");
|
||||
}
|
||||
if (StringUtil.isNotBlank(map.get("auditStatus"))) {
|
||||
sf.line("and a.status = ? ", map.get("auditStatus"));
|
||||
}
|
||||
if (StringUtil.isNotBlank(map.get("status"))) {
|
||||
String status = map.get("status");
|
||||
String[] statusList = status.split(",");
|
||||
if (statusList.length > 1) {
|
||||
sf.inst("and a.status in", statusList);
|
||||
} else {
|
||||
sf.line("and a.status = ? ", map.get("status"));
|
||||
}
|
||||
}
|
||||
if(StringUtil.isNotBlank(map.get("partner"))){
|
||||
sf.line(" and b.partner_id = ? ", map.get("partner"));
|
||||
}
|
||||
}
|
||||
|
||||
private List<String> appendColumns(List<Record> records, String column) {
|
||||
List<String> ret = new ArrayList<>();
|
||||
for (Record record : records) {
|
||||
String value = record.getStr(column);
|
||||
if (StrKit.notBlank(value)) {
|
||||
ret.addAll(Arrays.asList(value.split(",")));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public Record findByEntryIdAndStatus(String entryId, String status) {
|
||||
return Db.findFirst("select * from crm_customer_entry_change_design as d where d.entry_id=? and status=? limit 1", entryId, status);
|
||||
}
|
||||
|
||||
public Long existsNum(String entryId) {
|
||||
return Db.queryLong("select count(*) from crm_customer_entry_change_design where entry_id=?", entryId);
|
||||
}
|
||||
|
||||
public int cancel(String changeId) {
|
||||
SqlBuilder sb = new SqlBuilder()
|
||||
.line("update crm_customer_entry_change_design set status='3'")
|
||||
.line("where id=:id and status='0'");
|
||||
SQLQuery query = getSession().createSQLQuery(sb.build());
|
||||
query.setParameter("id", changeId);
|
||||
return query.executeUpdate();
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.sifang.modules.changes.dao;
|
||||
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.sifang.modules.changes.entity.CrmCustomerEntryChangeRecord;
|
||||
import com.sifang.modules.site.siteInfo.service.SiteEmployeeService;
|
||||
import com.sifang.modules.sunshine.SystemSetting.service.TraderService;
|
||||
import com.sifang.modules.sys.common.persistence.BaseDao;
|
||||
import com.sifang.modules.sys.common.persistence.Parameter;
|
||||
import com.sifang.modules.sys.dao.UserDao;
|
||||
import com.sifang.modules.sys.util.SqlBuilder;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public class CustomerEntryChangeRecordDao extends BaseDao<CrmCustomerEntryChangeRecord> {
|
||||
|
||||
@Autowired
|
||||
UserDao userDao;
|
||||
|
||||
@Autowired
|
||||
SiteEmployeeService siteEmployeeService;
|
||||
@Autowired
|
||||
private TraderService traderService;
|
||||
|
||||
public List<CrmCustomerEntryChangeRecord> fingStatusAll() {
|
||||
return find("from CrmCustomerEntryChangeRecord where changeStatus='20'");
|
||||
}
|
||||
public CrmCustomerEntryChangeRecord findByChangeNo(String changeNo) {
|
||||
return getByHql("from CrmCustomerEntryChangeRecord where changeNumber=:p1", new Parameter(changeNo));
|
||||
}
|
||||
|
||||
public Long getIfHaveTenantChange(String entryId){
|
||||
SqlBuilder builder = new SqlBuilder();
|
||||
builder.line("select count(1) from crm_customer_entry_change_record r ")
|
||||
.line("left join crm_customer_entry_tenant_change_record t on t.id = r.change_id ")
|
||||
.line(" where t.entry_id = ? and r.change_status in('15','20') ",entryId);
|
||||
return Db.queryLong(builder.build(), builder.params());
|
||||
}
|
||||
public Long getIfHaveSurveyChange(String entryId){
|
||||
SqlBuilder builder = new SqlBuilder();
|
||||
builder.line("select count(1) from crm_customer_entry_change_record r ")
|
||||
.line("left join crm_customer_entry_survey_change_record t on t.id = r.change_id ")
|
||||
.line(" where t.entry_id = ? and r.change_status in('15','20') ",entryId);
|
||||
return Db.queryLong(builder.build(), builder.params());
|
||||
}
|
||||
public Long getIfHaveDesignChange(String entryId){
|
||||
SqlBuilder builder = new SqlBuilder();
|
||||
builder.line("select count(1) from crm_customer_entry_change_record r ")
|
||||
.line("left join crm_customer_entry_change_design t on t.id = r.change_id ")
|
||||
.line(" where t.entry_id = ? and r.change_status in('15','20') ",entryId);
|
||||
return Db.queryLong(builder.build(), builder.params());
|
||||
}
|
||||
public Long getIfHaveCompleteChange(String entryId){
|
||||
SqlBuilder builder = new SqlBuilder();
|
||||
builder.line("select count(1) from crm_customer_entry_change_record r ")
|
||||
.line("left join crm_customer_entry_completion_change_record t on t.id = r.change_id ")
|
||||
.line(" where t.entry_id = ? and r.change_status in('15','20') ",entryId);
|
||||
return Db.queryLong(builder.build(), builder.params());
|
||||
}
|
||||
public Long getIfHaveMaterialChange(String entryId){
|
||||
SqlBuilder builder = new SqlBuilder();
|
||||
builder.line("select count(1) from crm_customer_entry_change_record r ")
|
||||
.line("left join crm_material_information_change_apply t on t.id = r.change_id ")
|
||||
.line(" where t.entry_id = ? and r.change_status in('15','20') ",entryId);
|
||||
return Db.queryLong(builder.build(), builder.params());
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.sifang.modules.changes.dao;
|
||||
|
||||
import com.sifang.modules.changes.entity.CustomerEntryCompletionChangeRecordDetail;
|
||||
import com.sifang.modules.sys.common.persistence.BaseDao;
|
||||
import com.sifang.modules.sys.common.persistence.Parameter;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public class CustomerEntryCompletionChangeRecordDetailDao extends BaseDao<CustomerEntryCompletionChangeRecordDetail> {
|
||||
|
||||
public List<CustomerEntryCompletionChangeRecordDetail> findByChangeRecord(String changeRecordId) {
|
||||
return find("from CustomerEntryCompletionChangeRecordDetail where changeRecordId = :p1", new Parameter(changeRecordId));
|
||||
}
|
||||
}
|
@ -0,0 +1,144 @@
|
||||
package com.sifang.modules.changes.dao;
|
||||
|
||||
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.sifang.modules.changes.entity.CustomerEntrySupplement;
|
||||
import com.sifang.modules.customer.constant.UserConstants;
|
||||
import com.sifang.modules.sunshine.SystemSetting.utils.StringUtil;
|
||||
import com.sifang.modules.sys.common.entity.User;
|
||||
import com.sifang.modules.sys.common.persistence.BaseDao;
|
||||
import com.sifang.modules.sys.util.CrmUtils;
|
||||
import com.sifang.modules.sys.util.LayuiPage;
|
||||
import com.sifang.modules.sys.util.SqlBuilder;
|
||||
import com.sifang.modules.taskdispatch.util.ItemDispatchUtil;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Repository
|
||||
public class CustomerEntrySupplementDao extends BaseDao<CustomerEntrySupplement> {
|
||||
|
||||
public Record findEntrySupplementByentryId(String entryId){
|
||||
|
||||
return Db.findFirst("select * from crm_customer_entry_supplement WHERE entry_id=? ORDER BY create_time desc LIMIT 1" ,entryId);
|
||||
}
|
||||
|
||||
public Record getChangeRecord(String id){
|
||||
StringBuilder sb=new StringBuilder();
|
||||
sb.append(" SELECT r.id,r.number,r.entry_id,r.power_station_code,r.change_count,r.change_reason,r.audit_remarks,e.tenant_name ");
|
||||
sb.append(" ,e.trader_name,e.project_company_name,e.project_name,e.id_code,e.province,e.city,e.area,e.street,e.address,CONCAT(e.province,e.city,e.area,e.address) AS customerAddress ");
|
||||
sb.append(" FROM `crm_customer_entry_supplement` r ");
|
||||
sb.append(" LEFT JOIN `crm_customer_entry` e ON e.id=r.entry_id ");
|
||||
sb.append(" WHERE r.id=? ");
|
||||
return Db.findFirst(sb.toString(),id);
|
||||
}
|
||||
|
||||
public List<Record> selectList(LayuiPage<Record> page, Map<String, String> map, User user) {
|
||||
SqlBuilder sf = new SqlBuilder();
|
||||
sf.line(" select a.id,a.number,a.power_station_code,a.`status`,a.change_count,a.creator,a.create_time,e.tenant_name,e.id_code,a.audit_time,a.create_by,m.assign_audit_user_id ");
|
||||
sf.line(" from crm_customer_entry_supplement a");
|
||||
sf.line(" inner join crm_customer_entry e on a.entry_id=e.id");
|
||||
sf.line(" left join crm_item_manage as m on m.process_instance_id=a.id");
|
||||
sf.line(" where 1=1 ");
|
||||
getOrderMap(sf, map, user);
|
||||
sf.line(" order by a.create_time desc");
|
||||
if (page != null) {
|
||||
sf.line(" limit " + page.getLimit() + " offset " + (page.getPage() - 1) * page.getLimit());
|
||||
Long count = getCount(map, user);
|
||||
page.setCount(count);
|
||||
}
|
||||
List<Record> records = Db.find(sf.build(), sf.params());
|
||||
ItemDispatchUtil.setReviewFlag(records);
|
||||
return records;
|
||||
}
|
||||
|
||||
public long getCount(Map<String, String> map,User user) {
|
||||
SqlBuilder sf = new SqlBuilder();
|
||||
sf.line(" select count(*)");
|
||||
sf.line(" from crm_customer_entry_supplement a");
|
||||
sf.line(" inner join crm_customer_entry e on a.entry_id=e.id");
|
||||
sf.line(" where 1=1 ");
|
||||
getOrderMap(sf, map, user);
|
||||
return Db.queryLong(sf.toString(), sf.params());
|
||||
}
|
||||
|
||||
public String getOrderMap(SqlBuilder sf, Map<String, String> map, User user) {
|
||||
if ("1".equals( map.get("tabType"))) {
|
||||
sf.line("and a.status in('1','2') ");
|
||||
}else{
|
||||
sf.line("and a.status in('3','4','0') ");
|
||||
}
|
||||
if(StringUtil.equalsAny(user.getUserType(), UserConstants.TYPE_TRADER, User.USER_TYPE_ADVISOR)){
|
||||
Record record= CrmUtils.getUserTrader(user.getUserType(),user.getId());
|
||||
String traderId =record.getStr("id");
|
||||
String type = record.getStr("type");
|
||||
if(UserConstants.TYPE_TRADER.equals(user.getUserType())){ //代理商
|
||||
if ("1".equals(type)){ // 1.一级代理商 2.二级代理商
|
||||
sf.line(" and e.distributor_id =?" , traderId );
|
||||
}else{ //二级代理商
|
||||
if (UserConstants.TYPE_TRADER.equals(user.getUserType())) {
|
||||
//代理商只能查看自己的
|
||||
sf.line(" and e.create_trader_id =?" , traderId );
|
||||
}
|
||||
}
|
||||
}else { //代理商人员
|
||||
String dataAuthority=record.getStr("data_authority");
|
||||
if("1".equals(type) && UserConstants.DATA_AUTHORITY_ALL.equals(dataAuthority)) {
|
||||
sf.line(" and e.distributor_id =?" , traderId );
|
||||
}else {
|
||||
sf.line(" and e.create_trader_id =?" , traderId );
|
||||
if(StringUtil.isBlank(dataAuthority) || UserConstants.DATA_AUTHORITY_ONLY.equals(dataAuthority)){
|
||||
sf.line(" and a.create_by =? ", user.getId());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtil.checkParamsValid(map.get("number"))) {
|
||||
sf.like("and a.number like ?", map.get("number"));
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("stationCode"))) {
|
||||
sf.like("and e.power_station_code like ? ", map.get("stationCode"));
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("tenantName"))) {
|
||||
sf.like("and e.tenant_name like ? ", map.get("tenantName"));
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("createTimeMin"))) {
|
||||
sf.line("and a.create_time >= ? ", map.get("createTimeMin") + " 00:00:00");
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("createTimeMax"))) {
|
||||
sf.line("and a.create_time <= ? ", map.get("createTimeMax") + " 23:59:59");
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("status"))) {
|
||||
sf.line("and a.status = ? ", map.get("status"));
|
||||
}
|
||||
if(StringUtil.isNotBlank(map.get("provinceE"))){
|
||||
sf.inst(" and e.province in ",map.get("provinceE").split(","));
|
||||
}
|
||||
if(StringUtil.isNotBlank(map.get("cityE"))){
|
||||
sf.inst(" and e.city in ",map.get("cityE").split(","));
|
||||
}
|
||||
if(StringUtil.isNotBlank(map.get("areaE"))){
|
||||
sf.inst(" and e.area in ",map.get("areaE").split(","));
|
||||
}
|
||||
if(StringUtil.isNotBlank(map.get("traderIdsE"))){
|
||||
sf.inst(" and e.create_trader_id in ",map.get("traderIdsE").split(","));
|
||||
}
|
||||
if (StringUtil.isNotBlank(map.get("projectNumberE"))) {
|
||||
sf.inst(" and e.project_id in ", map.get("projectNumberE").split(","));
|
||||
}
|
||||
return sf.toString();
|
||||
}
|
||||
|
||||
public Integer selectMaxNum(String entryId) {
|
||||
return Db.queryInt("select max(change_count) from crm_customer_entry_supplement where entry_id=? and status in('1','2','3','4')", entryId);
|
||||
}
|
||||
|
||||
public Long getIfHaveChangeRecord(String entryId){
|
||||
return Db.queryLong(" SELECT COUNT(r.id) FROM crm_customer_entry_supplement r WHERE r.entry_id=? AND r.status='2' ",entryId);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.sifang.modules.changes.dao;
|
||||
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.sifang.modules.changes.entity.CustomerEntrySupplementDetail;
|
||||
import com.sifang.modules.sunshine.SystemSetting.utils.StringUtil;
|
||||
import com.sifang.modules.sys.common.persistence.BaseDao;
|
||||
import com.sifang.modules.sys.common.persistence.Parameter;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class CustomerEntrySupplementDetailDao extends BaseDao<CustomerEntrySupplementDetail> {
|
||||
|
||||
|
||||
public CustomerEntrySupplementDetail getChangeRecordDetail(String mainId, String type){
|
||||
|
||||
return getByHql("FROM CustomerEntrySupplementDetail WHERE mainId = :p1 AND changeType=:p2 ", new Parameter(mainId,type));
|
||||
}
|
||||
|
||||
public CustomerEntrySupplementDetail getLatestChangeRecordDetail(String entryId){
|
||||
String latestMainId= Db.queryStr(" SELECT id FROM `crm_customer_entry_supplement` WHERE entry_id=? AND status='3' ORDER BY audit_time DESC LIMIT 1",entryId);
|
||||
if(StringUtil.isBlank(latestMainId)){
|
||||
return null;
|
||||
}
|
||||
return getByHql("FROM CustomerEntrySupplementDetail WHERE mainId = :p1 AND changeType='1' ", new Parameter(latestMainId));
|
||||
}
|
||||
}
|
@ -0,0 +1,221 @@
|
||||
package com.sifang.modules.changes.dao;
|
||||
|
||||
import com.jfinal.kit.StrKit;
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.sifang.modules.changes.entity.CustomerEntrySurveyChangeRecord;
|
||||
import com.sifang.modules.customer.constant.UserConstants;
|
||||
import com.sifang.modules.site.siteInfo.service.SiteEmployeeService;
|
||||
import com.sifang.modules.sunshine.SystemSetting.service.TraderService;
|
||||
import com.sifang.modules.sunshine.SystemSetting.utils.StringUtil;
|
||||
import com.sifang.modules.sys.common.entity.User;
|
||||
import com.sifang.modules.sys.common.persistence.BaseDao;
|
||||
import com.sifang.modules.sys.dao.UserDao;
|
||||
import com.sifang.modules.sys.entity.Operator;
|
||||
import com.sifang.modules.sys.util.CrmUtils;
|
||||
import com.sifang.modules.sys.util.LayuiPage;
|
||||
import com.sifang.modules.sys.util.SqlBuilder;
|
||||
import com.sifang.modules.taskdispatch.util.ItemDispatchUtil;
|
||||
import org.hibernate.Query;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Repository
|
||||
public class CustomerEntrySurveyChangeRecordDao extends BaseDao<CustomerEntrySurveyChangeRecord> {
|
||||
|
||||
@Autowired
|
||||
UserDao userDao;
|
||||
|
||||
@Autowired
|
||||
SiteEmployeeService siteEmployeeService;
|
||||
|
||||
@Autowired
|
||||
private TraderService traderService;
|
||||
|
||||
public List<Record> selectList(LayuiPage<Record> page, Map<String, String> map, String flag,Operator operator) {
|
||||
SqlBuilder sf = new SqlBuilder();
|
||||
sf.line(" select a.id,a.number,a.power_station_code,a.`status`,a.num,a.creator,a.create_time,b.tenant_name,b.id_code,a.audit_time");
|
||||
sf.line(",a.create_by,m.assign_audit_user_id,b.partner_name,r.change_status,r.change_reason ");
|
||||
sf.line(" from crm_customer_entry_survey_change_record a");
|
||||
sf.line(" inner join crm_customer_entry b on a.entry_id=b.id");
|
||||
sf.line("left join crm_item_manage as m on m.process_instance_id=a.id");
|
||||
sf.line(" left join crm_customer_entry_change_record r on r.change_id=a.id");
|
||||
sf.line(" where a.num>0");
|
||||
if("1".equals(operator.getUserType())){
|
||||
if ("1".equals(flag)) {
|
||||
sf.line(" and a.status in('1','2','3')");
|
||||
} else {
|
||||
sf.line(" and a.status ='0'");
|
||||
}
|
||||
}else{
|
||||
if ("1".equals(flag)) {
|
||||
if(StringUtil.equalsAny(operator.getUserType(), UserConstants.TYPE_ADMIN, UserConstants.TYPE_PLAT_EMP)){
|
||||
sf.line(" and a.status in('1','2')");
|
||||
}else{
|
||||
sf.line(" and a.status in('1','2','3')");
|
||||
}
|
||||
} else {
|
||||
sf.line(" and a.status ='0'");
|
||||
}
|
||||
}
|
||||
if(UserConstants.TYPE_TRADER.equals(operator.getUserType())) {
|
||||
String partnerIds = traderService.getPartnerIdByTraderId(operator.getUserId());
|
||||
if(StringUtil.isNotBlank(partnerIds)){
|
||||
sf.inst(" and b.partner_id in ",partnerIds);
|
||||
}
|
||||
}
|
||||
getOrderMap(sf, map, operator);
|
||||
sf.line(" order by a.create_time desc");
|
||||
if (page != null) {
|
||||
sf.line(" limit " + page.getLimit() + " offset " + (page.getPage() - 1) * page.getLimit());
|
||||
Long count = getCount(map, flag, operator);
|
||||
page.setCount(count);
|
||||
}
|
||||
List<Record> records = Db.find(sf.toString(), sf.params());
|
||||
ItemDispatchUtil.setReviewFlag(records);
|
||||
return records;
|
||||
}
|
||||
|
||||
public long getCount(Map<String, String> map, String flag,Operator operator) {
|
||||
SqlBuilder sf = new SqlBuilder();
|
||||
sf.line(" select count(*)");
|
||||
sf.line(" from crm_customer_entry_survey_change_record a");
|
||||
sf.line(" inner join crm_customer_entry b on a.entry_id=b.id");
|
||||
sf.line(" where a.num>0 ");
|
||||
if ("1".equals(flag)) {
|
||||
if(StringUtil.equalsAny(operator.getUserType(), UserConstants.TYPE_ADMIN, UserConstants.TYPE_PLAT_EMP)){
|
||||
sf.line(" and a.status in('1','2')");
|
||||
}else{
|
||||
sf.line(" and a.status in('1','2','3')");
|
||||
}
|
||||
} else {
|
||||
sf.line(" and a.status ='0'");
|
||||
}
|
||||
getOrderMap(sf, map, operator);
|
||||
return Db.queryLong(sf.toString(), sf.params());
|
||||
}
|
||||
|
||||
public String getOrderMap(SqlBuilder sf, Map<String, String> map, Operator operator) {
|
||||
if(StringUtil.equalsAny(operator.getUserType(), UserConstants.TYPE_TRADER, User.USER_TYPE_ADVISOR)){
|
||||
Record record= CrmUtils.getUserTrader(operator.getUserType(),operator.getUserId());
|
||||
String traderId =record.getStr("id");
|
||||
String type = record.getStr("type");
|
||||
if(UserConstants.TYPE_TRADER.equals(operator.getUserType())){ //代理商
|
||||
if ("1".equals(type)){ // 1.一级代理商 2.二级代理商
|
||||
sf.line(" and b.distributor_id =?" , traderId );
|
||||
}else{ //二级代理商
|
||||
if (UserConstants.TYPE_TRADER.equals(operator.getUserType())) {
|
||||
//代理商只能查看自己的
|
||||
sf.line(" and b.create_trader_id =?" , traderId );
|
||||
}
|
||||
}
|
||||
}else { //代理商人员
|
||||
String dataAuthority=record.getStr("data_authority");
|
||||
if("1".equals(type) && UserConstants.DATA_AUTHORITY_ALL.equals(dataAuthority)) {
|
||||
sf.line(" and b.distributor_id =?", traderId);
|
||||
}else {
|
||||
sf.line(" and b.create_trader_id =?" , traderId );
|
||||
if(StringUtil.isBlank(dataAuthority) || UserConstants.DATA_AUTHORITY_ONLY.equals(dataAuthority)){
|
||||
sf.line(" and a.create_by =? ", operator.getUserId());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
long checkRo= userDao.isDefaultPlatRole(operator.getUserId());
|
||||
if (checkRo>0) {
|
||||
List<Record> employeeRole = siteEmployeeService.findEmployeeByUserId(operator.getUserId());
|
||||
List<String> provinceList = appendColumns(employeeRole, "provices");
|
||||
List<String> cityList = appendColumns(employeeRole, "city");
|
||||
List<String> numberList = appendColumns(employeeRole, "project_number");
|
||||
List<String> traderList = appendColumns(employeeRole, "trader_id");
|
||||
if (!provinceList.isEmpty()) {
|
||||
sf.inst("and b.province in ", provinceList);
|
||||
}
|
||||
if (!cityList.isEmpty()) {
|
||||
sf.inst("and b.city in ", cityList);
|
||||
}
|
||||
if (!numberList.isEmpty()) {
|
||||
sf.inst("and b.project_id in ", numberList);
|
||||
}
|
||||
|
||||
if (!traderList.isEmpty()) {
|
||||
if (map.get("traderId") != null && !map.get("traderId").isEmpty()){
|
||||
// builder.inst(" and e.distributor_id in ('"+ map.get("traderId") + "')");
|
||||
}else {
|
||||
sf.inst(" and b.distributor_id in ",traderList);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (StringUtil.checkParamsValid(map.get("authorizedId"))) {
|
||||
sf.inst("and b.project_id IN ", Arrays.asList(map.get("authorizedId").split(",")));
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("number"))) {
|
||||
sf.like("and a.number like ?", map.get("number"));
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("stationCode"))) {
|
||||
sf.like("and a.power_station_code like ? ", map.get("stationCode"));
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("tenantName"))) {
|
||||
sf.like("and b.tenant_name like ? ", map.get("tenantName"));
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("createTimeMin"))) {
|
||||
sf.line("and a.create_time >= ? ", map.get("createTimeMin") + " 00:00:00");
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("createTimeMax"))) {
|
||||
sf.line("and a.create_time <= ? ", map.get("createTimeMax") + " 23:59:59");
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("auditTimeMin"))) {
|
||||
sf.line("and a.audit_time >= ? ", map.get("auditTimeMin") + " 00:00:00");
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("auditTimeMax"))) {
|
||||
sf.line("and a.audit_time <= ? ", map.get("auditTimeMax") + " 23:59:59");
|
||||
}
|
||||
if (StringUtil.checkParamsValid(map.get("status"))) {
|
||||
sf.line("and a.status = ? ", map.get("status"));
|
||||
}
|
||||
return sf.toString();
|
||||
}
|
||||
|
||||
private List<String> appendColumns(List<Record> records, String column) {
|
||||
List<String> ret = new ArrayList<>();
|
||||
for (Record record : records) {
|
||||
String value = record.getStr(column);
|
||||
if (StrKit.notBlank(value)) {
|
||||
ret.addAll(Arrays.asList(value.split(",")));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public Integer selectMaxNum(String entryId) {
|
||||
return Db.queryInt("select max(num) from crm_customer_entry_survey_change_record where entry_id=? and status in('1','2','3')", entryId);
|
||||
}
|
||||
|
||||
public long selectNoAudited(String entryId, String id) {
|
||||
SqlBuilder sb = new SqlBuilder();
|
||||
sb.line("select count(1) from crm_customer_entry_survey_change_record where entry_id=? and status ='0'", entryId);
|
||||
if (StringUtil.isNotBlank(id)) {
|
||||
sb.line("and id <>?", id);
|
||||
}
|
||||
return Db.queryLong(sb.build(), sb.params());
|
||||
}
|
||||
|
||||
public CustomerEntrySurveyChangeRecord selectPre(String entryId, int num) {
|
||||
Query query = getSession().createQuery(" from CustomerEntrySurveyChangeRecord where entryId=:p1 and num<:p2 and status='1' order by num desc");
|
||||
query.setParameter("p1", entryId);
|
||||
query.setParameter("p2", num);
|
||||
List<CustomerEntrySurveyChangeRecord> list = query.list();
|
||||
return list.get(0);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.sifang.modules.changes.dao;
|
||||
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.sifang.modules.changes.entity.CustomerEntrySurveyChangeRecordDetail;
|
||||
import com.sifang.modules.sys.common.persistence.BaseDao;
|
||||
import com.sifang.modules.sys.common.persistence.Parameter;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public class CustomerEntrySurveyChangeRecordDetailDao extends BaseDao<CustomerEntrySurveyChangeRecordDetail> {
|
||||
|
||||
public List<CustomerEntrySurveyChangeRecordDetail> findByChangeRecord(String changeRecordId) {
|
||||
return find("from CustomerEntrySurveyChangeRecordDetail where changeRecordId = :p1", new Parameter(changeRecordId));
|
||||
}
|
||||
|
||||
|
||||
public List<Record> findByChangeRecordId(String changeRecordId) {
|
||||
return Db.find(" SELECT d.* FROM `crm_customer_entry_survey_change_record_detail`d WHERE d.change_record_id=? ",changeRecordId);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,351 @@
|
||||
package com.sifang.modules.changes.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.util.Date;
|
||||
|
||||
@Entity
|
||||
@Table(name = "crm_customer_entry_change_design")
|
||||
public class CrmCustomerEntryChangeDesign {
|
||||
@Id
|
||||
@GeneratedValue(generator = "idGenerator")
|
||||
@GenericGenerator(name = "idGenerator", strategy = "uuid")
|
||||
private String id;
|
||||
|
||||
private String number;
|
||||
|
||||
private String entryId;
|
||||
|
||||
private String powerStationCode;
|
||||
|
||||
private Integer num;
|
||||
|
||||
private String designDrawings;
|
||||
|
||||
private String preDesignDrawings;
|
||||
|
||||
private String schemeType;
|
||||
|
||||
private String preSchemeType;
|
||||
|
||||
private String schemeTypeId;
|
||||
|
||||
private String preSchemeTypeId;
|
||||
|
||||
private String schemeTypeName;
|
||||
|
||||
private String preSchemeTypeName;
|
||||
|
||||
private String schemeId;
|
||||
|
||||
private String preSchemeId;
|
||||
|
||||
private String schemeName;
|
||||
|
||||
private String preSchemeName;
|
||||
|
||||
private String status;
|
||||
|
||||
private String reason;
|
||||
|
||||
private String creator;
|
||||
|
||||
private String createBy;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
|
||||
private String auditBy;
|
||||
|
||||
private String auditor;
|
||||
|
||||
private Date auditTime;
|
||||
|
||||
private String auditRemark;
|
||||
|
||||
private String zjzxImg;
|
||||
private String preZjzxImg;
|
||||
private String zjhsImg;
|
||||
private String preZjhsImg;
|
||||
private String zjcsImg;
|
||||
private String preZjcsImg;
|
||||
private String zjpbImg;
|
||||
private String preZjpbImg;
|
||||
|
||||
public String getZjzxImg() {
|
||||
return zjzxImg;
|
||||
}
|
||||
|
||||
public void setZjzxImg(String zjzxImg) {
|
||||
this.zjzxImg = zjzxImg;
|
||||
}
|
||||
|
||||
public String getPreZjzxImg() {
|
||||
return preZjzxImg;
|
||||
}
|
||||
|
||||
public void setPreZjzxImg(String preZjzxImg) {
|
||||
this.preZjzxImg = preZjzxImg;
|
||||
}
|
||||
|
||||
public String getZjhsImg() {
|
||||
return zjhsImg;
|
||||
}
|
||||
|
||||
public void setZjhsImg(String zjhsImg) {
|
||||
this.zjhsImg = zjhsImg;
|
||||
}
|
||||
|
||||
public String getPreZjhsImg() {
|
||||
return preZjhsImg;
|
||||
}
|
||||
|
||||
public void setPreZjhsImg(String preZjhsImg) {
|
||||
this.preZjhsImg = preZjhsImg;
|
||||
}
|
||||
|
||||
public String getZjcsImg() {
|
||||
return zjcsImg;
|
||||
}
|
||||
|
||||
public void setZjcsImg(String zjcsImg) {
|
||||
this.zjcsImg = zjcsImg;
|
||||
}
|
||||
|
||||
public String getPreZjcsImg() {
|
||||
return preZjcsImg;
|
||||
}
|
||||
|
||||
public void setPreZjcsImg(String preZjcsImg) {
|
||||
this.preZjcsImg = preZjcsImg;
|
||||
}
|
||||
|
||||
public String getZjpbImg() {
|
||||
return zjpbImg;
|
||||
}
|
||||
|
||||
public void setZjpbImg(String zjpbImg) {
|
||||
this.zjpbImg = zjpbImg;
|
||||
}
|
||||
|
||||
public String getPreZjpbImg() {
|
||||
return preZjpbImg;
|
||||
}
|
||||
|
||||
public void setPreZjpbImg(String preZjpbImg) {
|
||||
this.preZjpbImg = preZjpbImg;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber(String number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public String getEntryId() {
|
||||
return entryId;
|
||||
}
|
||||
|
||||
public void setEntryId(String entryId) {
|
||||
this.entryId = entryId;
|
||||
}
|
||||
|
||||
public String getPowerStationCode() {
|
||||
return powerStationCode;
|
||||
}
|
||||
|
||||
public void setPowerStationCode(String powerStationCode) {
|
||||
this.powerStationCode = powerStationCode;
|
||||
}
|
||||
|
||||
public Integer getNum() {
|
||||
return num;
|
||||
}
|
||||
|
||||
public void setNum(Integer num) {
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public String getDesignDrawings() {
|
||||
return designDrawings;
|
||||
}
|
||||
|
||||
public void setDesignDrawings(String designDrawings) {
|
||||
this.designDrawings = designDrawings;
|
||||
}
|
||||
|
||||
public String getPreDesignDrawings() {
|
||||
return preDesignDrawings;
|
||||
}
|
||||
|
||||
public void setPreDesignDrawings(String preDesignDrawings) {
|
||||
this.preDesignDrawings = preDesignDrawings;
|
||||
}
|
||||
|
||||
public String getSchemeType() {
|
||||
return schemeType;
|
||||
}
|
||||
|
||||
public void setSchemeType(String schemeType) {
|
||||
this.schemeType = schemeType;
|
||||
}
|
||||
|
||||
public String getPreSchemeType() {
|
||||
return preSchemeType;
|
||||
}
|
||||
|
||||
public void setPreSchemeType(String preSchemeType) {
|
||||
this.preSchemeType = preSchemeType;
|
||||
}
|
||||
|
||||
public String getSchemeTypeId() {
|
||||
return schemeTypeId;
|
||||
}
|
||||
|
||||
public void setSchemeTypeId(String schemeTypeId) {
|
||||
this.schemeTypeId = schemeTypeId;
|
||||
}
|
||||
|
||||
public String getPreSchemeTypeId() {
|
||||
return preSchemeTypeId;
|
||||
}
|
||||
|
||||
public void setPreSchemeTypeId(String preSchemeTypeId) {
|
||||
this.preSchemeTypeId = preSchemeTypeId;
|
||||
}
|
||||
|
||||
public String getSchemeTypeName() {
|
||||
return schemeTypeName;
|
||||
}
|
||||
|
||||
public void setSchemeTypeName(String schemeTypeName) {
|
||||
this.schemeTypeName = schemeTypeName;
|
||||
}
|
||||
|
||||
public String getPreSchemeTypeName() {
|
||||
return preSchemeTypeName;
|
||||
}
|
||||
|
||||
public void setPreSchemeTypeName(String preSchemeTypeName) {
|
||||
this.preSchemeTypeName = preSchemeTypeName;
|
||||
}
|
||||
|
||||
public String getSchemeId() {
|
||||
return schemeId;
|
||||
}
|
||||
|
||||
public void setSchemeId(String schemeId) {
|
||||
this.schemeId = schemeId;
|
||||
}
|
||||
|
||||
public String getPreSchemeId() {
|
||||
return preSchemeId;
|
||||
}
|
||||
|
||||
public void setPreSchemeId(String preSchemeId) {
|
||||
this.preSchemeId = preSchemeId;
|
||||
}
|
||||
|
||||
public String getSchemeName() {
|
||||
return schemeName;
|
||||
}
|
||||
|
||||
public void setSchemeName(String schemeName) {
|
||||
this.schemeName = schemeName;
|
||||
}
|
||||
|
||||
public String getPreSchemeName() {
|
||||
return preSchemeName;
|
||||
}
|
||||
|
||||
public void setPreSchemeName(String preSchemeName) {
|
||||
this.preSchemeName = preSchemeName;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
public void setReason(String reason) {
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
public String getCreator() {
|
||||
return creator;
|
||||
}
|
||||
|
||||
public void setCreator(String creator) {
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(String createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getAuditBy() {
|
||||
return auditBy;
|
||||
}
|
||||
|
||||
public void setAuditBy(String auditBy) {
|
||||
this.auditBy = auditBy;
|
||||
}
|
||||
|
||||
public String getAuditor() {
|
||||
return auditor;
|
||||
}
|
||||
|
||||
public void setAuditor(String auditor) {
|
||||
this.auditor = auditor;
|
||||
}
|
||||
|
||||
public Date getAuditTime() {
|
||||
return auditTime;
|
||||
}
|
||||
|
||||
public void setAuditTime(Date auditTime) {
|
||||
this.auditTime = auditTime;
|
||||
}
|
||||
|
||||
public String getAuditRemark() {
|
||||
return auditRemark;
|
||||
}
|
||||
|
||||
public void setAuditRemark(String auditRemark) {
|
||||
this.auditRemark = auditRemark;
|
||||
}
|
||||
}
|
@ -0,0 +1,126 @@
|
||||
package com.sifang.modules.changes.entity;
|
||||
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.util.Date;
|
||||
|
||||
@Entity
|
||||
@Table(name = "crm_customer_entry_change_design_component")
|
||||
public class CrmCustomerEntryChangeDesignComponent {
|
||||
@Id
|
||||
@GeneratedValue(generator = "idGenerator")
|
||||
@GenericGenerator(name = "idGenerator", strategy = "uuid")
|
||||
private String id;
|
||||
|
||||
private String designChangeId;
|
||||
|
||||
private String flag;
|
||||
|
||||
private String itemType;
|
||||
|
||||
private String itemId;
|
||||
|
||||
private String model;
|
||||
|
||||
private Integer num;
|
||||
|
||||
private String status;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private String createBy;
|
||||
|
||||
private String projectId;
|
||||
|
||||
public String getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setProjectId(String projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getDesignChangeId() {
|
||||
return designChangeId;
|
||||
}
|
||||
|
||||
public void setDesignChangeId(String designChangeId) {
|
||||
this.designChangeId = designChangeId;
|
||||
}
|
||||
|
||||
public String getFlag() {
|
||||
return flag;
|
||||
}
|
||||
|
||||
public void setFlag(String flag) {
|
||||
this.flag = flag;
|
||||
}
|
||||
|
||||
public String getItemType() {
|
||||
return itemType;
|
||||
}
|
||||
|
||||
public void setItemType(String itemType) {
|
||||
this.itemType = itemType;
|
||||
}
|
||||
|
||||
public String getItemId() {
|
||||
return itemId;
|
||||
}
|
||||
|
||||
public void setItemId(String itemId) {
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
public Integer getNum() {
|
||||
return num;
|
||||
}
|
||||
|
||||
public void setNum(Integer num) {
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(String createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
public String getModel() {
|
||||
return model;
|
||||
}
|
||||
|
||||
public void setModel(String model) {
|
||||
this.model = model;
|
||||
}
|
||||
}
|
@ -0,0 +1,291 @@
|
||||
package com.sifang.modules.changes.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.util.Date;
|
||||
|
||||
@Entity
|
||||
@Table(name = "crm_customer_entry_change_design_detail")
|
||||
public class CrmCustomerEntryChangeDesignDetail {
|
||||
@Id
|
||||
@GeneratedValue(generator = "idGenerator")
|
||||
@GenericGenerator(name = "idGenerator", strategy = "uuid")
|
||||
private String id;
|
||||
|
||||
private String number;
|
||||
|
||||
private String entryId;
|
||||
|
||||
private String powerStationCode;
|
||||
|
||||
private String projectId;
|
||||
|
||||
private String designDrawings;
|
||||
|
||||
private String preDesignDrawings;
|
||||
|
||||
private String schemeType;
|
||||
|
||||
private String preSchemeType;
|
||||
|
||||
private String schemeTypeId;
|
||||
|
||||
private String preSchemeTypeId;
|
||||
|
||||
private String schemeTypeName;
|
||||
|
||||
private String preSchemeTypeName;
|
||||
|
||||
private String schemeId;
|
||||
|
||||
private String preSchemeId;
|
||||
|
||||
private String schemeName;
|
||||
|
||||
private String preSchemeName;
|
||||
|
||||
private String creator;
|
||||
|
||||
private String createBy;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
|
||||
private String zjzxImg;
|
||||
private String preZjzxImg;
|
||||
private String zjhsImg;
|
||||
private String preZjhsImg;
|
||||
private String zjcsImg;
|
||||
private String preZjcsImg;
|
||||
private String zjpbImg;
|
||||
private String preZjpbImg;
|
||||
|
||||
public String getZjzxImg() {
|
||||
return zjzxImg;
|
||||
}
|
||||
|
||||
public void setZjzxImg(String zjzxImg) {
|
||||
this.zjzxImg = zjzxImg;
|
||||
}
|
||||
|
||||
public String getPreZjzxImg() {
|
||||
return preZjzxImg;
|
||||
}
|
||||
|
||||
public void setPreZjzxImg(String preZjzxImg) {
|
||||
this.preZjzxImg = preZjzxImg;
|
||||
}
|
||||
|
||||
public String getZjhsImg() {
|
||||
return zjhsImg;
|
||||
}
|
||||
|
||||
public void setZjhsImg(String zjhsImg) {
|
||||
this.zjhsImg = zjhsImg;
|
||||
}
|
||||
|
||||
public String getPreZjhsImg() {
|
||||
return preZjhsImg;
|
||||
}
|
||||
|
||||
public void setPreZjhsImg(String preZjhsImg) {
|
||||
this.preZjhsImg = preZjhsImg;
|
||||
}
|
||||
|
||||
public String getZjcsImg() {
|
||||
return zjcsImg;
|
||||
}
|
||||
|
||||
public void setZjcsImg(String zjcsImg) {
|
||||
this.zjcsImg = zjcsImg;
|
||||
}
|
||||
|
||||
public String getPreZjcsImg() {
|
||||
return preZjcsImg;
|
||||
}
|
||||
|
||||
public void setPreZjcsImg(String preZjcsImg) {
|
||||
this.preZjcsImg = preZjcsImg;
|
||||
}
|
||||
|
||||
public String getZjpbImg() {
|
||||
return zjpbImg;
|
||||
}
|
||||
|
||||
public void setZjpbImg(String zjpbImg) {
|
||||
this.zjpbImg = zjpbImg;
|
||||
}
|
||||
|
||||
public String getPreZjpbImg() {
|
||||
return preZjpbImg;
|
||||
}
|
||||
|
||||
public void setPreZjpbImg(String preZjpbImg) {
|
||||
this.preZjpbImg = preZjpbImg;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber(String number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public String getEntryId() {
|
||||
return entryId;
|
||||
}
|
||||
|
||||
public void setEntryId(String entryId) {
|
||||
this.entryId = entryId;
|
||||
}
|
||||
|
||||
public String getPowerStationCode() {
|
||||
return powerStationCode;
|
||||
}
|
||||
|
||||
public void setPowerStationCode(String powerStationCode) {
|
||||
this.powerStationCode = powerStationCode;
|
||||
}
|
||||
|
||||
public String getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setProjectId(String projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public String getDesignDrawings() {
|
||||
return designDrawings;
|
||||
}
|
||||
|
||||
public void setDesignDrawings(String designDrawings) {
|
||||
this.designDrawings = designDrawings;
|
||||
}
|
||||
|
||||
public String getPreDesignDrawings() {
|
||||
return preDesignDrawings;
|
||||
}
|
||||
|
||||
public void setPreDesignDrawings(String preDesignDrawings) {
|
||||
this.preDesignDrawings = preDesignDrawings;
|
||||
}
|
||||
|
||||
public String getSchemeType() {
|
||||
return schemeType;
|
||||
}
|
||||
|
||||
public void setSchemeType(String schemeType) {
|
||||
this.schemeType = schemeType;
|
||||
}
|
||||
|
||||
public String getPreSchemeType() {
|
||||
return preSchemeType;
|
||||
}
|
||||
|
||||
public void setPreSchemeType(String preSchemeType) {
|
||||
this.preSchemeType = preSchemeType;
|
||||
}
|
||||
|
||||
public String getSchemeTypeId() {
|
||||
return schemeTypeId;
|
||||
}
|
||||
|
||||
public void setSchemeTypeId(String schemeTypeId) {
|
||||
this.schemeTypeId = schemeTypeId;
|
||||
}
|
||||
|
||||
public String getPreSchemeTypeId() {
|
||||
return preSchemeTypeId;
|
||||
}
|
||||
|
||||
public void setPreSchemeTypeId(String preSchemeTypeId) {
|
||||
this.preSchemeTypeId = preSchemeTypeId;
|
||||
}
|
||||
|
||||
public String getSchemeTypeName() {
|
||||
return schemeTypeName;
|
||||
}
|
||||
|
||||
public void setSchemeTypeName(String schemeTypeName) {
|
||||
this.schemeTypeName = schemeTypeName;
|
||||
}
|
||||
|
||||
public String getPreSchemeTypeName() {
|
||||
return preSchemeTypeName;
|
||||
}
|
||||
|
||||
public void setPreSchemeTypeName(String preSchemeTypeName) {
|
||||
this.preSchemeTypeName = preSchemeTypeName;
|
||||
}
|
||||
|
||||
public String getSchemeId() {
|
||||
return schemeId;
|
||||
}
|
||||
|
||||
public void setSchemeId(String schemeId) {
|
||||
this.schemeId = schemeId;
|
||||
}
|
||||
|
||||
public String getPreSchemeId() {
|
||||
return preSchemeId;
|
||||
}
|
||||
|
||||
public void setPreSchemeId(String preSchemeId) {
|
||||
this.preSchemeId = preSchemeId;
|
||||
}
|
||||
|
||||
public String getSchemeName() {
|
||||
return schemeName;
|
||||
}
|
||||
|
||||
public void setSchemeName(String schemeName) {
|
||||
this.schemeName = schemeName;
|
||||
}
|
||||
|
||||
public String getPreSchemeName() {
|
||||
return preSchemeName;
|
||||
}
|
||||
|
||||
public void setPreSchemeName(String preSchemeName) {
|
||||
this.preSchemeName = preSchemeName;
|
||||
}
|
||||
|
||||
public String getCreator() {
|
||||
return creator;
|
||||
}
|
||||
|
||||
public void setCreator(String creator) {
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(String createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
}
|
@ -0,0 +1,90 @@
|
||||
package com.sifang.modules.changes.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.util.Date;
|
||||
|
||||
@Entity
|
||||
@Table(name = "crm_customer_entry_change_record")
|
||||
public class CrmCustomerEntryChangeRecord {
|
||||
@Id
|
||||
@GeneratedValue(generator = "idGenerator")
|
||||
@GenericGenerator(name = "idGenerator", strategy = "uuid")
|
||||
private String id;
|
||||
private String changeId;
|
||||
private String changeType;
|
||||
private String changeStatus;
|
||||
private String changeReason;
|
||||
private String changeNumber;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getChangeId() {
|
||||
return changeId;
|
||||
}
|
||||
|
||||
public void setChangeId(String changeId) {
|
||||
this.changeId = changeId;
|
||||
}
|
||||
|
||||
public String getChangeType() {
|
||||
return changeType;
|
||||
}
|
||||
|
||||
public void setChangeType(String changeType) {
|
||||
this.changeType = changeType;
|
||||
}
|
||||
|
||||
public String getChangeStatus() {
|
||||
return changeStatus;
|
||||
}
|
||||
|
||||
public void setChangeStatus(String changeStatus) {
|
||||
this.changeStatus = changeStatus;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
public String getChangeReason() {
|
||||
return changeReason;
|
||||
}
|
||||
|
||||
public void setChangeReason(String changeReason) {
|
||||
this.changeReason = changeReason;
|
||||
}
|
||||
|
||||
public String getChangeNumber() {
|
||||
return changeNumber;
|
||||
}
|
||||
|
||||
public void setChangeNumber(String changeNumber) {
|
||||
this.changeNumber = changeNumber;
|
||||
}
|
||||
}
|
@ -0,0 +1,165 @@
|
||||
package com.sifang.modules.changes.entity;
|
||||
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.util.Date;
|
||||
|
||||
@Entity
|
||||
@Table(name ="crm_customer_entry_tenant_change_record")
|
||||
public class CrmCustomerEntryTenantChangeRecord {
|
||||
|
||||
@Id
|
||||
private String id;
|
||||
|
||||
private String number;
|
||||
|
||||
private String entryId;
|
||||
|
||||
private String powerStationCode;
|
||||
|
||||
private String entryStatus;
|
||||
|
||||
private String createBy;
|
||||
|
||||
private String createName;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private String changeReason;
|
||||
|
||||
private String status;
|
||||
|
||||
private String auditRemarks ;
|
||||
|
||||
private String auditBy;
|
||||
|
||||
private String auditName;
|
||||
|
||||
private Date auditTime;
|
||||
|
||||
private Integer changeCount;
|
||||
|
||||
public String getEntryStatus() {
|
||||
return entryStatus;
|
||||
}
|
||||
|
||||
public void setEntryStatus(String entryStatus) {
|
||||
this.entryStatus = entryStatus;
|
||||
}
|
||||
|
||||
public Date getAuditTime() {
|
||||
return auditTime;
|
||||
}
|
||||
|
||||
public void setAuditTime(Date auditTime) {
|
||||
this.auditTime = auditTime;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber(String number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public String getEntryId() {
|
||||
return entryId;
|
||||
}
|
||||
|
||||
public void setEntryId(String entryId) {
|
||||
this.entryId = entryId;
|
||||
}
|
||||
|
||||
public String getPowerStationCode() {
|
||||
return powerStationCode;
|
||||
}
|
||||
|
||||
public void setPowerStationCode(String powerStationCode) {
|
||||
this.powerStationCode = powerStationCode;
|
||||
}
|
||||
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(String createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
public String getCreateName() {
|
||||
return createName;
|
||||
}
|
||||
|
||||
public void setCreateName(String createName) {
|
||||
this.createName = createName;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getChangeReason() {
|
||||
return changeReason;
|
||||
}
|
||||
|
||||
public void setChangeReason(String changeReason) {
|
||||
this.changeReason = changeReason;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getAuditRemarks() {
|
||||
return auditRemarks;
|
||||
}
|
||||
|
||||
public void setAuditRemarks(String auditRemarks) {
|
||||
this.auditRemarks = auditRemarks;
|
||||
}
|
||||
|
||||
public String getAuditBy() {
|
||||
return auditBy;
|
||||
}
|
||||
|
||||
public void setAuditBy(String auditBy) {
|
||||
this.auditBy = auditBy;
|
||||
}
|
||||
|
||||
public String getAuditName() {
|
||||
return auditName;
|
||||
}
|
||||
|
||||
public void setAuditName(String auditName) {
|
||||
this.auditName = auditName;
|
||||
}
|
||||
|
||||
public Integer getChangeCount() {
|
||||
return changeCount;
|
||||
}
|
||||
|
||||
public void setChangeCount(Integer changeCount) {
|
||||
this.changeCount = changeCount;
|
||||
}
|
||||
}
|
@ -0,0 +1,117 @@
|
||||
package com.sifang.modules.changes.entity;
|
||||
|
||||
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "crm_customer_entry_tenant_change_record_detail")
|
||||
public class CrmCustomerEntryTenantChangeRecordDetail {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(generator = "idGenerator")
|
||||
@GenericGenerator(name = "idGenerator", strategy = "uuid")
|
||||
private String id;
|
||||
|
||||
private String mainId;
|
||||
|
||||
private String itemName;
|
||||
|
||||
private String itemCode;
|
||||
|
||||
private String ifChange;
|
||||
|
||||
private String beforeChange;
|
||||
|
||||
private String afterChange;
|
||||
|
||||
private String ifAffectContract;
|
||||
|
||||
private Integer sort;
|
||||
|
||||
private String type;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getMainId() {
|
||||
return mainId;
|
||||
}
|
||||
|
||||
public void setMainId(String mainId) {
|
||||
this.mainId = mainId;
|
||||
}
|
||||
|
||||
public String getItemName() {
|
||||
return itemName;
|
||||
}
|
||||
|
||||
public void setItemName(String itemName) {
|
||||
this.itemName = itemName;
|
||||
}
|
||||
|
||||
public String getItemCode() {
|
||||
return itemCode;
|
||||
}
|
||||
|
||||
public void setItemCode(String itemCode) {
|
||||
this.itemCode = itemCode;
|
||||
}
|
||||
|
||||
public String getIfChange() {
|
||||
return ifChange;
|
||||
}
|
||||
|
||||
public void setIfChange(String ifChange) {
|
||||
this.ifChange = ifChange;
|
||||
}
|
||||
|
||||
public String getBeforeChange() {
|
||||
return beforeChange;
|
||||
}
|
||||
|
||||
public void setBeforeChange(String beforeChange) {
|
||||
this.beforeChange = beforeChange;
|
||||
}
|
||||
|
||||
public String getAfterChange() {
|
||||
return afterChange;
|
||||
}
|
||||
|
||||
public void setAfterChange(String afterChange) {
|
||||
this.afterChange = afterChange;
|
||||
}
|
||||
|
||||
public String getIfAffectContract() {
|
||||
return ifAffectContract;
|
||||
}
|
||||
|
||||
public void setIfAffectContract(String ifAffectContract) {
|
||||
this.ifAffectContract = ifAffectContract;
|
||||
}
|
||||
|
||||
public Integer getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setSort(Integer sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
@ -0,0 +1,153 @@
|
||||
package com.sifang.modules.changes.entity;
|
||||
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.util.Date;
|
||||
|
||||
@Entity
|
||||
@Table(name = "crm_material_information_change_apply")
|
||||
public class CrmMaterialInformationChangeApply {
|
||||
|
||||
private String id;
|
||||
private String uniqueKey;
|
||||
private String number;
|
||||
private String entryId;
|
||||
private String powerStationCode;
|
||||
private String changeReason;
|
||||
private Integer changeTime;
|
||||
private String status;
|
||||
private String createBy;
|
||||
private String creator;
|
||||
private Date createTime;
|
||||
private String auditBy;
|
||||
private String auditName;
|
||||
private Date auditTime;
|
||||
private String auditRemarks;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(generator = "idGenerator")
|
||||
@GenericGenerator(name = "idGenerator", strategy = "uuid")
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUniqueKey() {
|
||||
return uniqueKey;
|
||||
}
|
||||
|
||||
public void setUniqueKey(String uniqueKey) {
|
||||
this.uniqueKey = uniqueKey;
|
||||
}
|
||||
|
||||
public String getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber(String number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public String getEntryId() {
|
||||
return entryId;
|
||||
}
|
||||
|
||||
public void setEntryId(String entryId) {
|
||||
this.entryId = entryId;
|
||||
}
|
||||
|
||||
public String getPowerStationCode() {
|
||||
return powerStationCode;
|
||||
}
|
||||
|
||||
public void setPowerStationCode(String powerStationCode) {
|
||||
this.powerStationCode = powerStationCode;
|
||||
}
|
||||
|
||||
public String getChangeReason() {
|
||||
return changeReason;
|
||||
}
|
||||
|
||||
public void setChangeReason(String changeReason) {
|
||||
this.changeReason = changeReason;
|
||||
}
|
||||
|
||||
public Integer getChangeTime() {
|
||||
return changeTime;
|
||||
}
|
||||
|
||||
public void setChangeTime(Integer changeTime) {
|
||||
this.changeTime = changeTime;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(String createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
public String getCreator() {
|
||||
return creator;
|
||||
}
|
||||
|
||||
public void setCreator(String creator) {
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getAuditBy() {
|
||||
return auditBy;
|
||||
}
|
||||
|
||||
public void setAuditBy(String auditBy) {
|
||||
this.auditBy = auditBy;
|
||||
}
|
||||
|
||||
public String getAuditName() {
|
||||
return auditName;
|
||||
}
|
||||
|
||||
public void setAuditName(String auditName) {
|
||||
this.auditName = auditName;
|
||||
}
|
||||
|
||||
public Date getAuditTime() {
|
||||
return auditTime;
|
||||
}
|
||||
|
||||
public void setAuditTime(Date auditTime) {
|
||||
this.auditTime = auditTime;
|
||||
}
|
||||
|
||||
public String getAuditRemarks() {
|
||||
return auditRemarks;
|
||||
}
|
||||
|
||||
public void setAuditRemarks(String auditRemarks) {
|
||||
this.auditRemarks = auditRemarks;
|
||||
}
|
||||
}
|
@ -0,0 +1,169 @@
|
||||
package com.sifang.modules.changes.entity;
|
||||
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "crm_material_information_change_apply_detail")
|
||||
public class CrmMaterialInformationChangeApplyDetail {
|
||||
private String id;
|
||||
private String applyId;
|
||||
private String projectId;
|
||||
private String type;
|
||||
private String materialId;
|
||||
private String materialCode;
|
||||
private String materialName;
|
||||
private String materialSpec;
|
||||
private String materialBrand;
|
||||
private String barcode;
|
||||
private String newBarcode;
|
||||
private String sn;
|
||||
private String newSn;
|
||||
private String nbqSn;
|
||||
private String newNbqSn;
|
||||
private String yzCode;
|
||||
private String newYzCode;
|
||||
@Id
|
||||
@GeneratedValue(generator = "idGenerator")
|
||||
@GenericGenerator(name = "idGenerator", strategy = "uuid")
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getApplyId() {
|
||||
return applyId;
|
||||
}
|
||||
|
||||
public void setApplyId(String applyId) {
|
||||
this.applyId = applyId;
|
||||
}
|
||||
|
||||
public String getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setProjectId(String projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getMaterialId() {
|
||||
return materialId;
|
||||
}
|
||||
|
||||
public void setMaterialId(String materialId) {
|
||||
this.materialId = materialId;
|
||||
}
|
||||
|
||||
public String getMaterialCode() {
|
||||
return materialCode;
|
||||
}
|
||||
|
||||
public void setMaterialCode(String materialCode) {
|
||||
this.materialCode = materialCode;
|
||||
}
|
||||
|
||||
public String getMaterialName() {
|
||||
return materialName;
|
||||
}
|
||||
|
||||
public void setMaterialName(String materialName) {
|
||||
this.materialName = materialName;
|
||||
}
|
||||
|
||||
public String getMaterialSpec() {
|
||||
return materialSpec;
|
||||
}
|
||||
|
||||
public void setMaterialSpec(String materialSpec) {
|
||||
this.materialSpec = materialSpec;
|
||||
}
|
||||
|
||||
public String getMaterialBrand() {
|
||||
return materialBrand;
|
||||
}
|
||||
|
||||
public void setMaterialBrand(String materialBrand) {
|
||||
this.materialBrand = materialBrand;
|
||||
}
|
||||
|
||||
public String getBarcode() {
|
||||
return barcode;
|
||||
}
|
||||
|
||||
public void setBarcode(String barcode) {
|
||||
this.barcode = barcode;
|
||||
}
|
||||
|
||||
public String getNewBarcode() {
|
||||
return newBarcode;
|
||||
}
|
||||
|
||||
public void setNewBarcode(String newBarcode) {
|
||||
this.newBarcode = newBarcode;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public String getNewSn() {
|
||||
return newSn;
|
||||
}
|
||||
|
||||
public void setNewSn(String newSn) {
|
||||
this.newSn = newSn;
|
||||
}
|
||||
|
||||
public String getNbqSn() {
|
||||
return nbqSn;
|
||||
}
|
||||
|
||||
public void setNbqSn(String nbqSn) {
|
||||
this.nbqSn = nbqSn;
|
||||
}
|
||||
|
||||
public String getNewNbqSn() {
|
||||
return newNbqSn;
|
||||
}
|
||||
|
||||
public void setNewNbqSn(String newNbqSn) {
|
||||
this.newNbqSn = newNbqSn;
|
||||
}
|
||||
|
||||
public String getYzCode() {
|
||||
return yzCode;
|
||||
}
|
||||
|
||||
public void setYzCode(String yzCode) {
|
||||
this.yzCode = yzCode;
|
||||
}
|
||||
|
||||
public String getNewYzCode() {
|
||||
return newYzCode;
|
||||
}
|
||||
|
||||
public void setNewYzCode(String newYzCode) {
|
||||
this.newYzCode = newYzCode;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,861 @@
|
||||
package com.sifang.modules.changes.entity;
|
||||
|
||||
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author hz
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "crm_customer_entry_completion_change_record")
|
||||
public class CustomerEntryCompletionChangeRecord implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@Id
|
||||
private String id;
|
||||
private String number;
|
||||
private String entryId;
|
||||
private String powerStationCode;
|
||||
private String otherImgs1;
|
||||
private String otherImgs2;
|
||||
private String otherImgs3;
|
||||
private String otherImgs4;
|
||||
private String dzjc1;
|
||||
private String dzjc2;
|
||||
private String zjImg1;
|
||||
private String zjImg2;
|
||||
private String zjImg3;
|
||||
private String zjImg4;
|
||||
private String zjImg5;
|
||||
private String componentImg1;
|
||||
private String componentImg2;
|
||||
private String sizeMeasureImgs;
|
||||
private String fixOtherImg;
|
||||
private String totalImgs;
|
||||
private String bwInnerImg;
|
||||
private String dcImgs;
|
||||
private String nbqZbImg;
|
||||
private String dqsbAnImgOne;
|
||||
private String nbqPlateImg;
|
||||
private String zjPlateImg;
|
||||
private String openWayVoltageImgs;
|
||||
private String jdImg1;
|
||||
private String jdImg2;
|
||||
private String jdImg3;
|
||||
private String jdImg4;
|
||||
private String jdImg5;
|
||||
private String jdImg6;
|
||||
private String yxImg;
|
||||
private String gebImg;
|
||||
private String gebImg2;
|
||||
private String dbImgs;
|
||||
private String filingDocumentPhoto;
|
||||
private String zjReport;
|
||||
private String otherFiles;
|
||||
private String status;
|
||||
private int num;
|
||||
private String reason;
|
||||
private String createBy;
|
||||
private String creator;
|
||||
private Date createTime;
|
||||
private String auditor;
|
||||
private Date auditTime;
|
||||
private String auditBy;
|
||||
private String remarks;
|
||||
|
||||
private String houseOwnership;
|
||||
private String safetyWarningImg2;
|
||||
private String safetyWarningImg3;
|
||||
private String safetyWarningImg;
|
||||
private String safetyDiscloseDocImg;
|
||||
private String zjImg10;
|
||||
private String zjImg11;
|
||||
private String zjImg8;
|
||||
private String zjImg9;
|
||||
private String zjImg12;
|
||||
private String zjImg13;
|
||||
private String zjImg14;
|
||||
private String componentImg3;
|
||||
private String componentImg4;
|
||||
private String bkImg1;
|
||||
private String bkImg2;
|
||||
private String bkImg3;
|
||||
private String ykImg1;
|
||||
private String nbqZlcImg;
|
||||
private String bwJdImg;
|
||||
private String jdImg8;
|
||||
private String jdImg11;
|
||||
private String jdImg9;
|
||||
private String jdImg10;
|
||||
private String fsImg1;
|
||||
private String fsImg2;
|
||||
private String fsImg3;
|
||||
private String otherImgs5;
|
||||
private String otherImgs6;
|
||||
private String otherImgs7;
|
||||
private String otherImgs8;
|
||||
|
||||
private String supplementVideoUrl;
|
||||
|
||||
private String completeRemark;
|
||||
|
||||
private String kgConditionFiles;
|
||||
|
||||
private String filingDocumentCode;
|
||||
|
||||
private String waterMudClampImgs;
|
||||
|
||||
public String getWaterMudClampImgs() {
|
||||
return waterMudClampImgs;
|
||||
}
|
||||
|
||||
public void setWaterMudClampImgs(String waterMudClampImgs) {
|
||||
this.waterMudClampImgs = waterMudClampImgs;
|
||||
}
|
||||
|
||||
public String getFilingDocumentCode() {
|
||||
return filingDocumentCode;
|
||||
}
|
||||
|
||||
public void setFilingDocumentCode(String filingDocumentCode) {
|
||||
this.filingDocumentCode = filingDocumentCode;
|
||||
}
|
||||
|
||||
public String getKgConditionFiles() {
|
||||
return kgConditionFiles;
|
||||
}
|
||||
|
||||
public void setKgConditionFiles(String kgConditionFiles) {
|
||||
this.kgConditionFiles = kgConditionFiles;
|
||||
}
|
||||
|
||||
public String getSupplementVideoUrl() {
|
||||
return supplementVideoUrl;
|
||||
}
|
||||
|
||||
public void setSupplementVideoUrl(String supplementVideoUrl) {
|
||||
this.supplementVideoUrl = supplementVideoUrl;
|
||||
}
|
||||
|
||||
public String getCompleteRemark() {
|
||||
return completeRemark;
|
||||
}
|
||||
|
||||
public void setCompleteRemark(String completeRemark) {
|
||||
this.completeRemark = completeRemark;
|
||||
}
|
||||
|
||||
public String getBkImg2() {
|
||||
return bkImg2;
|
||||
}
|
||||
|
||||
public void setBkImg2(String bkImg2) {
|
||||
this.bkImg2 = bkImg2;
|
||||
}
|
||||
|
||||
public String getSafetyDiscloseDocImg() {
|
||||
return safetyDiscloseDocImg;
|
||||
}
|
||||
|
||||
public void setSafetyDiscloseDocImg(String safetyDiscloseDocImg) {
|
||||
this.safetyDiscloseDocImg = safetyDiscloseDocImg;
|
||||
}
|
||||
|
||||
public String getSafetyWarningImg2() {
|
||||
return safetyWarningImg2;
|
||||
}
|
||||
|
||||
public void setSafetyWarningImg2(String safetyWarningImg2) {
|
||||
this.safetyWarningImg2 = safetyWarningImg2;
|
||||
}
|
||||
|
||||
public String getSafetyWarningImg3() {
|
||||
return safetyWarningImg3;
|
||||
}
|
||||
|
||||
public void setSafetyWarningImg3(String safetyWarningImg3) {
|
||||
this.safetyWarningImg3 = safetyWarningImg3;
|
||||
}
|
||||
|
||||
public String getSafetyWarningImg() {
|
||||
return safetyWarningImg;
|
||||
}
|
||||
|
||||
public void setSafetyWarningImg(String safetyWarningImg) {
|
||||
this.safetyWarningImg = safetyWarningImg;
|
||||
}
|
||||
|
||||
public String getZjImg10() {
|
||||
return zjImg10;
|
||||
}
|
||||
|
||||
public void setZjImg10(String zjImg10) {
|
||||
this.zjImg10 = zjImg10;
|
||||
}
|
||||
|
||||
public String getZjImg11() {
|
||||
return zjImg11;
|
||||
}
|
||||
|
||||
public void setZjImg11(String zjImg11) {
|
||||
this.zjImg11 = zjImg11;
|
||||
}
|
||||
|
||||
public String getZjImg8() {
|
||||
return zjImg8;
|
||||
}
|
||||
|
||||
public void setZjImg8(String zjImg8) {
|
||||
this.zjImg8 = zjImg8;
|
||||
}
|
||||
|
||||
public String getZjImg9() {
|
||||
return zjImg9;
|
||||
}
|
||||
|
||||
public void setZjImg9(String zjImg9) {
|
||||
this.zjImg9 = zjImg9;
|
||||
}
|
||||
|
||||
public String getZjImg12() {
|
||||
return zjImg12;
|
||||
}
|
||||
|
||||
public void setZjImg12(String zjImg12) {
|
||||
this.zjImg12 = zjImg12;
|
||||
}
|
||||
|
||||
public String getZjImg13() {
|
||||
return zjImg13;
|
||||
}
|
||||
|
||||
public void setZjImg13(String zjImg13) {
|
||||
this.zjImg13 = zjImg13;
|
||||
}
|
||||
|
||||
public String getZjImg14() {
|
||||
return zjImg14;
|
||||
}
|
||||
|
||||
public void setZjImg14(String zjImg14) {
|
||||
this.zjImg14 = zjImg14;
|
||||
}
|
||||
|
||||
public String getComponentImg3() {
|
||||
return componentImg3;
|
||||
}
|
||||
|
||||
public void setComponentImg3(String componentImg3) {
|
||||
this.componentImg3 = componentImg3;
|
||||
}
|
||||
|
||||
public String getComponentImg4() {
|
||||
return componentImg4;
|
||||
}
|
||||
|
||||
public void setComponentImg4(String componentImg4) {
|
||||
this.componentImg4 = componentImg4;
|
||||
}
|
||||
|
||||
public String getBkImg1() {
|
||||
return bkImg1;
|
||||
}
|
||||
|
||||
public void setBkImg1(String bkImg1) {
|
||||
this.bkImg1 = bkImg1;
|
||||
}
|
||||
|
||||
public String getBkImg3() {
|
||||
return bkImg3;
|
||||
}
|
||||
|
||||
public void setBkImg3(String bkImg3) {
|
||||
this.bkImg3 = bkImg3;
|
||||
}
|
||||
|
||||
public String getYkImg1() {
|
||||
return ykImg1;
|
||||
}
|
||||
|
||||
public void setYkImg1(String ykImg1) {
|
||||
this.ykImg1 = ykImg1;
|
||||
}
|
||||
|
||||
public String getNbqZlcImg() {
|
||||
return nbqZlcImg;
|
||||
}
|
||||
|
||||
public void setNbqZlcImg(String nbqZlcImg) {
|
||||
this.nbqZlcImg = nbqZlcImg;
|
||||
}
|
||||
|
||||
public String getBwJdImg() {
|
||||
return bwJdImg;
|
||||
}
|
||||
|
||||
public void setBwJdImg(String bwJdImg) {
|
||||
this.bwJdImg = bwJdImg;
|
||||
}
|
||||
|
||||
public String getJdImg8() {
|
||||
return jdImg8;
|
||||
}
|
||||
|
||||
public void setJdImg8(String jdImg8) {
|
||||
this.jdImg8 = jdImg8;
|
||||
}
|
||||
|
||||
public String getJdImg11() {
|
||||
return jdImg11;
|
||||
}
|
||||
|
||||
public void setJdImg11(String jdImg11) {
|
||||
this.jdImg11 = jdImg11;
|
||||
}
|
||||
|
||||
public String getJdImg9() {
|
||||
return jdImg9;
|
||||
}
|
||||
|
||||
public void setJdImg9(String jdImg9) {
|
||||
this.jdImg9 = jdImg9;
|
||||
}
|
||||
|
||||
public String getJdImg10() {
|
||||
return jdImg10;
|
||||
}
|
||||
|
||||
public void setJdImg10(String jdImg10) {
|
||||
this.jdImg10 = jdImg10;
|
||||
}
|
||||
|
||||
public String getFsImg1() {
|
||||
return fsImg1;
|
||||
}
|
||||
|
||||
public void setFsImg1(String fsImg1) {
|
||||
this.fsImg1 = fsImg1;
|
||||
}
|
||||
|
||||
public String getFsImg2() {
|
||||
return fsImg2;
|
||||
}
|
||||
|
||||
public void setFsImg2(String fsImg2) {
|
||||
this.fsImg2 = fsImg2;
|
||||
}
|
||||
|
||||
public String getFsImg3() {
|
||||
return fsImg3;
|
||||
}
|
||||
|
||||
public void setFsImg3(String fsImg3) {
|
||||
this.fsImg3 = fsImg3;
|
||||
}
|
||||
|
||||
public String getOtherImgs5() {
|
||||
return otherImgs5;
|
||||
}
|
||||
|
||||
public void setOtherImgs5(String otherImgs5) {
|
||||
this.otherImgs5 = otherImgs5;
|
||||
}
|
||||
|
||||
public String getOtherImgs6() {
|
||||
return otherImgs6;
|
||||
}
|
||||
|
||||
public void setOtherImgs6(String otherImgs6) {
|
||||
this.otherImgs6 = otherImgs6;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber(String number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public String getEntryId() {
|
||||
return entryId;
|
||||
}
|
||||
|
||||
public void setEntryId(String entryId) {
|
||||
this.entryId = entryId;
|
||||
}
|
||||
|
||||
public String getPowerStationCode() {
|
||||
return powerStationCode;
|
||||
}
|
||||
|
||||
public void setPowerStationCode(String powerStationCode) {
|
||||
this.powerStationCode = powerStationCode;
|
||||
}
|
||||
|
||||
public String getOtherImgs1() {
|
||||
return otherImgs1;
|
||||
}
|
||||
|
||||
public void setOtherImgs1(String otherImgs1) {
|
||||
this.otherImgs1 = otherImgs1;
|
||||
}
|
||||
|
||||
public String getOtherImgs2() {
|
||||
return otherImgs2;
|
||||
}
|
||||
|
||||
public void setOtherImgs2(String otherImgs2) {
|
||||
this.otherImgs2 = otherImgs2;
|
||||
}
|
||||
|
||||
public String getOtherImgs3() {
|
||||
return otherImgs3;
|
||||
}
|
||||
|
||||
public void setOtherImgs3(String otherImgs3) {
|
||||
this.otherImgs3 = otherImgs3;
|
||||
}
|
||||
|
||||
public String getOtherImgs4() {
|
||||
return otherImgs4;
|
||||
}
|
||||
|
||||
public void setOtherImgs4(String otherImgs4) {
|
||||
this.otherImgs4 = otherImgs4;
|
||||
}
|
||||
|
||||
public String getDzjc1() {
|
||||
return dzjc1;
|
||||
}
|
||||
|
||||
public void setDzjc1(String dzjc1) {
|
||||
this.dzjc1 = dzjc1;
|
||||
}
|
||||
|
||||
public String getDzjc2() {
|
||||
return dzjc2;
|
||||
}
|
||||
|
||||
public void setDzjc2(String dzjc2) {
|
||||
this.dzjc2 = dzjc2;
|
||||
}
|
||||
|
||||
public String getZjImg1() {
|
||||
return zjImg1;
|
||||
}
|
||||
|
||||
public void setZjImg1(String zjImg1) {
|
||||
this.zjImg1 = zjImg1;
|
||||
}
|
||||
|
||||
public String getZjImg2() {
|
||||
return zjImg2;
|
||||
}
|
||||
|
||||
public void setZjImg2(String zjImg2) {
|
||||
this.zjImg2 = zjImg2;
|
||||
}
|
||||
|
||||
public String getZjImg3() {
|
||||
return zjImg3;
|
||||
}
|
||||
|
||||
public void setZjImg3(String zjImg3) {
|
||||
this.zjImg3 = zjImg3;
|
||||
}
|
||||
|
||||
public String getZjImg4() {
|
||||
return zjImg4;
|
||||
}
|
||||
|
||||
public void setZjImg4(String zjImg4) {
|
||||
this.zjImg4 = zjImg4;
|
||||
}
|
||||
|
||||
public String getZjImg5() {
|
||||
return zjImg5;
|
||||
}
|
||||
|
||||
public void setZjImg5(String zjImg5) {
|
||||
this.zjImg5 = zjImg5;
|
||||
}
|
||||
|
||||
public String getComponentImg1() {
|
||||
return componentImg1;
|
||||
}
|
||||
|
||||
public void setComponentImg1(String componentImg1) {
|
||||
this.componentImg1 = componentImg1;
|
||||
}
|
||||
|
||||
public String getComponentImg2() {
|
||||
return componentImg2;
|
||||
}
|
||||
|
||||
public void setComponentImg2(String componentImg2) {
|
||||
this.componentImg2 = componentImg2;
|
||||
}
|
||||
|
||||
public String getSizeMeasureImgs() {
|
||||
return sizeMeasureImgs;
|
||||
}
|
||||
|
||||
public void setSizeMeasureImgs(String sizeMeasureImgs) {
|
||||
this.sizeMeasureImgs = sizeMeasureImgs;
|
||||
}
|
||||
|
||||
public String getFixOtherImg() {
|
||||
return fixOtherImg;
|
||||
}
|
||||
|
||||
public void setFixOtherImg(String fixOtherImg) {
|
||||
this.fixOtherImg = fixOtherImg;
|
||||
}
|
||||
|
||||
public String getTotalImgs() {
|
||||
return totalImgs;
|
||||
}
|
||||
|
||||
public void setTotalImgs(String totalImgs) {
|
||||
this.totalImgs = totalImgs;
|
||||
}
|
||||
|
||||
public String getBwInnerImg() {
|
||||
return bwInnerImg;
|
||||
}
|
||||
|
||||
public void setBwInnerImg(String bwInnerImg) {
|
||||
this.bwInnerImg = bwInnerImg;
|
||||
}
|
||||
|
||||
public String getDcImgs() {
|
||||
return dcImgs;
|
||||
}
|
||||
|
||||
public void setDcImgs(String dcImgs) {
|
||||
this.dcImgs = dcImgs;
|
||||
}
|
||||
|
||||
public String getNbqZbImg() {
|
||||
return nbqZbImg;
|
||||
}
|
||||
|
||||
public void setNbqZbImg(String nbqZbImg) {
|
||||
this.nbqZbImg = nbqZbImg;
|
||||
}
|
||||
|
||||
public String getDqsbAnImgOne() {
|
||||
return dqsbAnImgOne;
|
||||
}
|
||||
|
||||
public void setDqsbAnImgOne(String dqsbAnImgOne) {
|
||||
this.dqsbAnImgOne = dqsbAnImgOne;
|
||||
}
|
||||
|
||||
public String getNbqPlateImg() {
|
||||
return nbqPlateImg;
|
||||
}
|
||||
|
||||
public void setNbqPlateImg(String nbqPlateImg) {
|
||||
this.nbqPlateImg = nbqPlateImg;
|
||||
}
|
||||
|
||||
public String getZjPlateImg() {
|
||||
return zjPlateImg;
|
||||
}
|
||||
|
||||
public void setZjPlateImg(String zjPlateImg) {
|
||||
this.zjPlateImg = zjPlateImg;
|
||||
}
|
||||
|
||||
public String getOpenWayVoltageImgs() {
|
||||
return openWayVoltageImgs;
|
||||
}
|
||||
|
||||
public void setOpenWayVoltageImgs(String openWayVoltageImgs) {
|
||||
this.openWayVoltageImgs = openWayVoltageImgs;
|
||||
}
|
||||
|
||||
public String getJdImg1() {
|
||||
return jdImg1;
|
||||
}
|
||||
|
||||
public void setJdImg1(String jdImg1) {
|
||||
this.jdImg1 = jdImg1;
|
||||
}
|
||||
|
||||
public String getJdImg2() {
|
||||
return jdImg2;
|
||||
}
|
||||
|
||||
public void setJdImg2(String jdImg2) {
|
||||
this.jdImg2 = jdImg2;
|
||||
}
|
||||
|
||||
public String getJdImg3() {
|
||||
return jdImg3;
|
||||
}
|
||||
|
||||
public void setJdImg3(String jdImg3) {
|
||||
this.jdImg3 = jdImg3;
|
||||
}
|
||||
|
||||
public String getJdImg4() {
|
||||
return jdImg4;
|
||||
}
|
||||
|
||||
public void setJdImg4(String jdImg4) {
|
||||
this.jdImg4 = jdImg4;
|
||||
}
|
||||
|
||||
public String getJdImg5() {
|
||||
return jdImg5;
|
||||
}
|
||||
|
||||
public void setJdImg5(String jdImg5) {
|
||||
this.jdImg5 = jdImg5;
|
||||
}
|
||||
|
||||
public String getJdImg6() {
|
||||
return jdImg6;
|
||||
}
|
||||
|
||||
public void setJdImg6(String jdImg6) {
|
||||
this.jdImg6 = jdImg6;
|
||||
}
|
||||
|
||||
public String getYxImg() {
|
||||
return yxImg;
|
||||
}
|
||||
|
||||
public void setYxImg(String yxImg) {
|
||||
this.yxImg = yxImg;
|
||||
}
|
||||
|
||||
public String getGebImg() {
|
||||
return gebImg;
|
||||
}
|
||||
|
||||
public void setGebImg(String gebImg) {
|
||||
this.gebImg = gebImg;
|
||||
}
|
||||
|
||||
public String getGebImg2() {
|
||||
return gebImg2;
|
||||
}
|
||||
|
||||
public void setGebImg2(String gebImg2) {
|
||||
this.gebImg2 = gebImg2;
|
||||
}
|
||||
|
||||
public String getDbImgs() {
|
||||
return dbImgs;
|
||||
}
|
||||
|
||||
public void setDbImgs(String dbImgs) {
|
||||
this.dbImgs = dbImgs;
|
||||
}
|
||||
|
||||
public String getFilingDocumentPhoto() {
|
||||
return filingDocumentPhoto;
|
||||
}
|
||||
|
||||
public void setFilingDocumentPhoto(String filingDocumentPhoto) {
|
||||
this.filingDocumentPhoto = filingDocumentPhoto;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public int getNum() {
|
||||
return num;
|
||||
}
|
||||
|
||||
public void setNum(int num) {
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
public void setReason(String reason) {
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(String createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
public String getCreator() {
|
||||
return creator;
|
||||
}
|
||||
|
||||
public void setCreator(String creator) {
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getAuditor() {
|
||||
return auditor;
|
||||
}
|
||||
|
||||
public void setAuditor(String auditor) {
|
||||
this.auditor = auditor;
|
||||
}
|
||||
|
||||
public Date getAuditTime() {
|
||||
return auditTime;
|
||||
}
|
||||
|
||||
public void setAuditTime(Date auditTime) {
|
||||
this.auditTime = auditTime;
|
||||
}
|
||||
|
||||
public String getAuditBy() {
|
||||
return auditBy;
|
||||
}
|
||||
|
||||
public void setAuditBy(String auditBy) {
|
||||
this.auditBy = auditBy;
|
||||
}
|
||||
|
||||
public String getRemarks() {
|
||||
return remarks;
|
||||
}
|
||||
|
||||
public void setRemarks(String remarks) {
|
||||
this.remarks = remarks;
|
||||
}
|
||||
|
||||
public String getZjReport() {
|
||||
return zjReport;
|
||||
}
|
||||
|
||||
public void setZjReport(String zjReport) {
|
||||
this.zjReport = zjReport;
|
||||
}
|
||||
|
||||
public String getOtherFiles() {
|
||||
return otherFiles;
|
||||
}
|
||||
|
||||
public void setOtherFiles(String otherFiles) {
|
||||
this.otherFiles = otherFiles;
|
||||
}
|
||||
|
||||
public String getHouseOwnership() {
|
||||
return houseOwnership;
|
||||
}
|
||||
|
||||
public void setHouseOwnership(String houseOwnership) {
|
||||
this.houseOwnership = houseOwnership;
|
||||
}
|
||||
|
||||
public String getOtherImgs7() {
|
||||
return otherImgs7;
|
||||
}
|
||||
|
||||
public void setOtherImgs7(String otherImgs7) {
|
||||
this.otherImgs7 = otherImgs7;
|
||||
}
|
||||
|
||||
public String getOtherImgs8() {
|
||||
return otherImgs8;
|
||||
}
|
||||
|
||||
public void setOtherImgs8(String otherImgs8) {
|
||||
this.otherImgs8 = otherImgs8;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CustomerEntryCompletionChangeRecord{" +
|
||||
"id='" + id + '\'' +
|
||||
", number='" + number + '\'' +
|
||||
", entryId='" + entryId + '\'' +
|
||||
", powerStationCode='" + powerStationCode + '\'' +
|
||||
", otherImgs1='" + otherImgs1 + '\'' +
|
||||
", otherImgs2='" + otherImgs2 + '\'' +
|
||||
", otherImgs3='" + otherImgs3 + '\'' +
|
||||
", otherImgs4='" + otherImgs4 + '\'' +
|
||||
", dzjc1='" + dzjc1 + '\'' +
|
||||
", dzjc2='" + dzjc2 + '\'' +
|
||||
", zjImg1='" + zjImg1 + '\'' +
|
||||
", zjImg2='" + zjImg2 + '\'' +
|
||||
", zjImg3='" + zjImg3 + '\'' +
|
||||
", zjImg4='" + zjImg4 + '\'' +
|
||||
", zjImg5='" + zjImg5 + '\'' +
|
||||
", componentImg1='" + componentImg1 + '\'' +
|
||||
", componentImg2='" + componentImg2 + '\'' +
|
||||
", sizeMeasureImgs='" + sizeMeasureImgs + '\'' +
|
||||
", fixOtherImg='" + fixOtherImg + '\'' +
|
||||
", totalImgs='" + totalImgs + '\'' +
|
||||
", bwInnerImg='" + bwInnerImg + '\'' +
|
||||
", dcImgs='" + dcImgs + '\'' +
|
||||
", nbqZbImg='" + nbqZbImg + '\'' +
|
||||
", dqsbAnImgOne='" + dqsbAnImgOne + '\'' +
|
||||
", nbqPlateImg='" + nbqPlateImg + '\'' +
|
||||
", zjPlateImg='" + zjPlateImg + '\'' +
|
||||
", openWayVoltageImgs='" + openWayVoltageImgs + '\'' +
|
||||
", jdImg1='" + jdImg1 + '\'' +
|
||||
", jdImg2='" + jdImg2 + '\'' +
|
||||
", jdImg3='" + jdImg3 + '\'' +
|
||||
", jdImg4='" + jdImg4 + '\'' +
|
||||
", jdImg5='" + jdImg5 + '\'' +
|
||||
", jdImg6='" + jdImg6 + '\'' +
|
||||
", yxImg='" + yxImg + '\'' +
|
||||
", gebImg='" + gebImg + '\'' +
|
||||
", gebImg2='" + gebImg2 + '\'' +
|
||||
", dbImgs='" + dbImgs + '\'' +
|
||||
", filingDocumentPhoto='" + filingDocumentPhoto + '\'' +
|
||||
", zjReport='" + zjReport + '\'' +
|
||||
", otherFiles='" + otherFiles + '\'' +
|
||||
", status='" + status + '\'' +
|
||||
", num=" + num +
|
||||
", reason='" + reason + '\'' +
|
||||
", createBy='" + createBy + '\'' +
|
||||
", creator='" + creator + '\'' +
|
||||
", createTime=" + createTime +
|
||||
", auditor='" + auditor + '\'' +
|
||||
", auditTime=" + auditTime +
|
||||
", auditBy='" + auditBy + '\'' +
|
||||
", remarks='" + remarks + '\'' +
|
||||
", houseOwnership='" + houseOwnership + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,779 @@
|
||||
package com.sifang.modules.changes.entity;
|
||||
|
||||
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author hz
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "crm_customer_entry_completion_change_record_detail")
|
||||
public class CustomerEntryCompletionChangeRecordDetail implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@Id
|
||||
@GeneratedValue(generator = "idGenerator")
|
||||
@GenericGenerator(name = "idGenerator", strategy = "uuid")
|
||||
private String id;
|
||||
private String number;
|
||||
private String entryId;
|
||||
private String powerStationCode;
|
||||
private String changeRecordId;
|
||||
private String projectId;
|
||||
private String otherImgs1;
|
||||
private String otherImgs2;
|
||||
private String otherImgs3;
|
||||
private String otherImgs4;
|
||||
private String dzjc1;
|
||||
private String dzjc2;
|
||||
private String zjImg1;
|
||||
private String zjImg2;
|
||||
private String zjImg3;
|
||||
private String zjImg4;
|
||||
private String zjImg5;
|
||||
private String componentImg1;
|
||||
private String componentImg2;
|
||||
private String sizeMeasureImgs;
|
||||
private String fixOtherImg;
|
||||
private String totalImgs;
|
||||
private String bwInnerImg;
|
||||
private String dcImgs;
|
||||
private String nbqZbImg;
|
||||
private String dqsbAnImgOne;
|
||||
private String nbqPlateImg;
|
||||
private String zjPlateImg;
|
||||
private String openWayVoltageImgs;
|
||||
private String jdImg1;
|
||||
private String jdImg2;
|
||||
private String jdImg3;
|
||||
private String jdImg4;
|
||||
private String jdImg5;
|
||||
private String jdImg6;
|
||||
private String yxImg;
|
||||
private String gebImg;
|
||||
private String gebImg2;
|
||||
private String dbImgs;
|
||||
private String filingDocumentPhoto;
|
||||
private String zjReport;
|
||||
private String otherFiles;
|
||||
private Date createTime;
|
||||
private String houseOwnership;
|
||||
private String safetyWarningImg2;
|
||||
private String safetyWarningImg3;
|
||||
private String safetyWarningImg;
|
||||
private String safetyDiscloseDocImg;
|
||||
private String zjImg10;
|
||||
private String zjImg11;
|
||||
private String zjImg8;
|
||||
private String zjImg9;
|
||||
private String zjImg12;
|
||||
private String zjImg13;
|
||||
private String zjImg14;
|
||||
private String componentImg3;
|
||||
private String componentImg4;
|
||||
private String bkImg1;
|
||||
private String bkImg2;
|
||||
private String bkImg3;
|
||||
private String ykImg1;
|
||||
private String nbqZlcImg;
|
||||
private String bwJdImg;
|
||||
private String jdImg8;
|
||||
private String jdImg11;
|
||||
private String jdImg9;
|
||||
private String jdImg10;
|
||||
private String fsImg1;
|
||||
private String fsImg2;
|
||||
private String fsImg3;
|
||||
private String otherImgs5;
|
||||
private String otherImgs6;
|
||||
private String otherImgs7;
|
||||
private String otherImgs8;
|
||||
|
||||
private String supplementVideoUrl;
|
||||
|
||||
private String completeRemark;
|
||||
|
||||
private String kgConditionFiles;
|
||||
|
||||
private String filingDocumentCode;
|
||||
|
||||
public String getFilingDocumentCode() {
|
||||
return filingDocumentCode;
|
||||
}
|
||||
|
||||
public void setFilingDocumentCode(String filingDocumentCode) {
|
||||
this.filingDocumentCode = filingDocumentCode;
|
||||
}
|
||||
|
||||
public String getOtherImgs7() {
|
||||
return otherImgs7;
|
||||
}
|
||||
|
||||
public void setOtherImgs7(String otherImgs7) {
|
||||
this.otherImgs7 = otherImgs7;
|
||||
}
|
||||
|
||||
public String getOtherImgs8() {
|
||||
return otherImgs8;
|
||||
}
|
||||
|
||||
public void setOtherImgs8(String otherImgs8) {
|
||||
this.otherImgs8 = otherImgs8;
|
||||
}
|
||||
|
||||
public String getKgConditionFiles() {
|
||||
return kgConditionFiles;
|
||||
}
|
||||
|
||||
public void setKgConditionFiles(String kgConditionFiles) {
|
||||
this.kgConditionFiles = kgConditionFiles;
|
||||
}
|
||||
|
||||
public String getSupplementVideoUrl() {
|
||||
return supplementVideoUrl;
|
||||
}
|
||||
|
||||
public void setSupplementVideoUrl(String supplementVideoUrl) {
|
||||
this.supplementVideoUrl = supplementVideoUrl;
|
||||
}
|
||||
|
||||
public String getCompleteRemark() {
|
||||
return completeRemark;
|
||||
}
|
||||
|
||||
public void setCompleteRemark(String completeRemark) {
|
||||
this.completeRemark = completeRemark;
|
||||
}
|
||||
|
||||
public String getBkImg2() {
|
||||
return bkImg2;
|
||||
}
|
||||
|
||||
public void setBkImg2(String bkImg2) {
|
||||
this.bkImg2 = bkImg2;
|
||||
}
|
||||
|
||||
public String getSafetyDiscloseDocImg() {
|
||||
return safetyDiscloseDocImg;
|
||||
}
|
||||
|
||||
public void setSafetyDiscloseDocImg(String safetyDiscloseDocImg) {
|
||||
this.safetyDiscloseDocImg = safetyDiscloseDocImg;
|
||||
}
|
||||
|
||||
public String getSafetyWarningImg2() {
|
||||
return safetyWarningImg2;
|
||||
}
|
||||
|
||||
public void setSafetyWarningImg2(String safetyWarningImg2) {
|
||||
this.safetyWarningImg2 = safetyWarningImg2;
|
||||
}
|
||||
|
||||
public String getSafetyWarningImg3() {
|
||||
return safetyWarningImg3;
|
||||
}
|
||||
|
||||
public void setSafetyWarningImg3(String safetyWarningImg3) {
|
||||
this.safetyWarningImg3 = safetyWarningImg3;
|
||||
}
|
||||
|
||||
public String getSafetyWarningImg() {
|
||||
return safetyWarningImg;
|
||||
}
|
||||
|
||||
public void setSafetyWarningImg(String safetyWarningImg) {
|
||||
this.safetyWarningImg = safetyWarningImg;
|
||||
}
|
||||
|
||||
public String getZjImg10() {
|
||||
return zjImg10;
|
||||
}
|
||||
|
||||
public void setZjImg10(String zjImg10) {
|
||||
this.zjImg10 = zjImg10;
|
||||
}
|
||||
|
||||
public String getZjImg11() {
|
||||
return zjImg11;
|
||||
}
|
||||
|
||||
public void setZjImg11(String zjImg11) {
|
||||
this.zjImg11 = zjImg11;
|
||||
}
|
||||
|
||||
public String getZjImg8() {
|
||||
return zjImg8;
|
||||
}
|
||||
|
||||
public void setZjImg8(String zjImg8) {
|
||||
this.zjImg8 = zjImg8;
|
||||
}
|
||||
|
||||
public String getZjImg9() {
|
||||
return zjImg9;
|
||||
}
|
||||
|
||||
public void setZjImg9(String zjImg9) {
|
||||
this.zjImg9 = zjImg9;
|
||||
}
|
||||
|
||||
public String getZjImg12() {
|
||||
return zjImg12;
|
||||
}
|
||||
|
||||
public void setZjImg12(String zjImg12) {
|
||||
this.zjImg12 = zjImg12;
|
||||
}
|
||||
|
||||
public String getZjImg13() {
|
||||
return zjImg13;
|
||||
}
|
||||
|
||||
public void setZjImg13(String zjImg13) {
|
||||
this.zjImg13 = zjImg13;
|
||||
}
|
||||
|
||||
public String getZjImg14() {
|
||||
return zjImg14;
|
||||
}
|
||||
|
||||
public void setZjImg14(String zjImg14) {
|
||||
this.zjImg14 = zjImg14;
|
||||
}
|
||||
|
||||
public String getComponentImg3() {
|
||||
return componentImg3;
|
||||
}
|
||||
|
||||
public void setComponentImg3(String componentImg3) {
|
||||
this.componentImg3 = componentImg3;
|
||||
}
|
||||
|
||||
public String getComponentImg4() {
|
||||
return componentImg4;
|
||||
}
|
||||
|
||||
public void setComponentImg4(String componentImg4) {
|
||||
this.componentImg4 = componentImg4;
|
||||
}
|
||||
|
||||
public String getBkImg1() {
|
||||
return bkImg1;
|
||||
}
|
||||
|
||||
public void setBkImg1(String bkImg1) {
|
||||
this.bkImg1 = bkImg1;
|
||||
}
|
||||
|
||||
public String getBkImg3() {
|
||||
return bkImg3;
|
||||
}
|
||||
|
||||
public void setBkImg3(String bkImg3) {
|
||||
this.bkImg3 = bkImg3;
|
||||
}
|
||||
|
||||
public String getYkImg1() {
|
||||
return ykImg1;
|
||||
}
|
||||
|
||||
public void setYkImg1(String ykImg1) {
|
||||
this.ykImg1 = ykImg1;
|
||||
}
|
||||
|
||||
public String getNbqZlcImg() {
|
||||
return nbqZlcImg;
|
||||
}
|
||||
|
||||
public void setNbqZlcImg(String nbqZlcImg) {
|
||||
this.nbqZlcImg = nbqZlcImg;
|
||||
}
|
||||
|
||||
public String getBwJdImg() {
|
||||
return bwJdImg;
|
||||
}
|
||||
|
||||
public void setBwJdImg(String bwJdImg) {
|
||||
this.bwJdImg = bwJdImg;
|
||||
}
|
||||
|
||||
public String getJdImg8() {
|
||||
return jdImg8;
|
||||
}
|
||||
|
||||
public void setJdImg8(String jdImg8) {
|
||||
this.jdImg8 = jdImg8;
|
||||
}
|
||||
|
||||
public String getJdImg11() {
|
||||
return jdImg11;
|
||||
}
|
||||
|
||||
public void setJdImg11(String jdImg11) {
|
||||
this.jdImg11 = jdImg11;
|
||||
}
|
||||
|
||||
public String getJdImg9() {
|
||||
return jdImg9;
|
||||
}
|
||||
|
||||
public void setJdImg9(String jdImg9) {
|
||||
this.jdImg9 = jdImg9;
|
||||
}
|
||||
|
||||
public String getJdImg10() {
|
||||
return jdImg10;
|
||||
}
|
||||
|
||||
public void setJdImg10(String jdImg10) {
|
||||
this.jdImg10 = jdImg10;
|
||||
}
|
||||
|
||||
public String getFsImg1() {
|
||||
return fsImg1;
|
||||
}
|
||||
|
||||
public void setFsImg1(String fsImg1) {
|
||||
this.fsImg1 = fsImg1;
|
||||
}
|
||||
|
||||
public String getFsImg2() {
|
||||
return fsImg2;
|
||||
}
|
||||
|
||||
public void setFsImg2(String fsImg2) {
|
||||
this.fsImg2 = fsImg2;
|
||||
}
|
||||
|
||||
public String getFsImg3() {
|
||||
return fsImg3;
|
||||
}
|
||||
|
||||
public void setFsImg3(String fsImg3) {
|
||||
this.fsImg3 = fsImg3;
|
||||
}
|
||||
|
||||
public String getOtherImgs5() {
|
||||
return otherImgs5;
|
||||
}
|
||||
|
||||
public void setOtherImgs5(String otherImgs5) {
|
||||
this.otherImgs5 = otherImgs5;
|
||||
}
|
||||
|
||||
public String getOtherImgs6() {
|
||||
return otherImgs6;
|
||||
}
|
||||
|
||||
public void setOtherImgs6(String otherImgs6) {
|
||||
this.otherImgs6 = otherImgs6;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber(String number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public String getEntryId() {
|
||||
return entryId;
|
||||
}
|
||||
|
||||
public void setEntryId(String entryId) {
|
||||
this.entryId = entryId;
|
||||
}
|
||||
|
||||
public String getPowerStationCode() {
|
||||
return powerStationCode;
|
||||
}
|
||||
|
||||
public void setPowerStationCode(String powerStationCode) {
|
||||
this.powerStationCode = powerStationCode;
|
||||
}
|
||||
|
||||
public String getOtherImgs1() {
|
||||
return otherImgs1;
|
||||
}
|
||||
|
||||
public void setOtherImgs1(String otherImgs1) {
|
||||
this.otherImgs1 = otherImgs1;
|
||||
}
|
||||
|
||||
public String getOtherImgs2() {
|
||||
return otherImgs2;
|
||||
}
|
||||
|
||||
public void setOtherImgs2(String otherImgs2) {
|
||||
this.otherImgs2 = otherImgs2;
|
||||
}
|
||||
|
||||
public String getOtherImgs3() {
|
||||
return otherImgs3;
|
||||
}
|
||||
|
||||
public void setOtherImgs3(String otherImgs3) {
|
||||
this.otherImgs3 = otherImgs3;
|
||||
}
|
||||
|
||||
public String getOtherImgs4() {
|
||||
return otherImgs4;
|
||||
}
|
||||
|
||||
public void setOtherImgs4(String otherImgs4) {
|
||||
this.otherImgs4 = otherImgs4;
|
||||
}
|
||||
|
||||
public String getDzjc1() {
|
||||
return dzjc1;
|
||||
}
|
||||
|
||||
public void setDzjc1(String dzjc1) {
|
||||
this.dzjc1 = dzjc1;
|
||||
}
|
||||
|
||||
public String getDzjc2() {
|
||||
return dzjc2;
|
||||
}
|
||||
|
||||
public void setDzjc2(String dzjc2) {
|
||||
this.dzjc2 = dzjc2;
|
||||
}
|
||||
|
||||
public String getZjImg1() {
|
||||
return zjImg1;
|
||||
}
|
||||
|
||||
public void setZjImg1(String zjImg1) {
|
||||
this.zjImg1 = zjImg1;
|
||||
}
|
||||
|
||||
public String getZjImg2() {
|
||||
return zjImg2;
|
||||
}
|
||||
|
||||
public void setZjImg2(String zjImg2) {
|
||||
this.zjImg2 = zjImg2;
|
||||
}
|
||||
|
||||
public String getZjImg3() {
|
||||
return zjImg3;
|
||||
}
|
||||
|
||||
public void setZjImg3(String zjImg3) {
|
||||
this.zjImg3 = zjImg3;
|
||||
}
|
||||
|
||||
public String getZjImg4() {
|
||||
return zjImg4;
|
||||
}
|
||||
|
||||
public void setZjImg4(String zjImg4) {
|
||||
this.zjImg4 = zjImg4;
|
||||
}
|
||||
|
||||
public String getZjImg5() {
|
||||
return zjImg5;
|
||||
}
|
||||
|
||||
public void setZjImg5(String zjImg5) {
|
||||
this.zjImg5 = zjImg5;
|
||||
}
|
||||
|
||||
public String getComponentImg1() {
|
||||
return componentImg1;
|
||||
}
|
||||
|
||||
public void setComponentImg1(String componentImg1) {
|
||||
this.componentImg1 = componentImg1;
|
||||
}
|
||||
|
||||
public String getComponentImg2() {
|
||||
return componentImg2;
|
||||
}
|
||||
|
||||
public void setComponentImg2(String componentImg2) {
|
||||
this.componentImg2 = componentImg2;
|
||||
}
|
||||
|
||||
public String getSizeMeasureImgs() {
|
||||
return sizeMeasureImgs;
|
||||
}
|
||||
|
||||
public void setSizeMeasureImgs(String sizeMeasureImgs) {
|
||||
this.sizeMeasureImgs = sizeMeasureImgs;
|
||||
}
|
||||
|
||||
public String getFixOtherImg() {
|
||||
return fixOtherImg;
|
||||
}
|
||||
|
||||
public void setFixOtherImg(String fixOtherImg) {
|
||||
this.fixOtherImg = fixOtherImg;
|
||||
}
|
||||
|
||||
public String getTotalImgs() {
|
||||
return totalImgs;
|
||||
}
|
||||
|
||||
public void setTotalImgs(String totalImgs) {
|
||||
this.totalImgs = totalImgs;
|
||||
}
|
||||
|
||||
public String getBwInnerImg() {
|
||||
return bwInnerImg;
|
||||
}
|
||||
|
||||
public void setBwInnerImg(String bwInnerImg) {
|
||||
this.bwInnerImg = bwInnerImg;
|
||||
}
|
||||
|
||||
public String getDcImgs() {
|
||||
return dcImgs;
|
||||
}
|
||||
|
||||
public void setDcImgs(String dcImgs) {
|
||||
this.dcImgs = dcImgs;
|
||||
}
|
||||
|
||||
public String getNbqZbImg() {
|
||||
return nbqZbImg;
|
||||
}
|
||||
|
||||
public void setNbqZbImg(String nbqZbImg) {
|
||||
this.nbqZbImg = nbqZbImg;
|
||||
}
|
||||
|
||||
public String getDqsbAnImgOne() {
|
||||
return dqsbAnImgOne;
|
||||
}
|
||||
|
||||
public void setDqsbAnImgOne(String dqsbAnImgOne) {
|
||||
this.dqsbAnImgOne = dqsbAnImgOne;
|
||||
}
|
||||
|
||||
public String getNbqPlateImg() {
|
||||
return nbqPlateImg;
|
||||
}
|
||||
|
||||
public void setNbqPlateImg(String nbqPlateImg) {
|
||||
this.nbqPlateImg = nbqPlateImg;
|
||||
}
|
||||
|
||||
public String getZjPlateImg() {
|
||||
return zjPlateImg;
|
||||
}
|
||||
|
||||
public void setZjPlateImg(String zjPlateImg) {
|
||||
this.zjPlateImg = zjPlateImg;
|
||||
}
|
||||
|
||||
public String getOpenWayVoltageImgs() {
|
||||
return openWayVoltageImgs;
|
||||
}
|
||||
|
||||
public void setOpenWayVoltageImgs(String openWayVoltageImgs) {
|
||||
this.openWayVoltageImgs = openWayVoltageImgs;
|
||||
}
|
||||
|
||||
public String getJdImg1() {
|
||||
return jdImg1;
|
||||
}
|
||||
|
||||
public void setJdImg1(String jdImg1) {
|
||||
this.jdImg1 = jdImg1;
|
||||
}
|
||||
|
||||
public String getJdImg2() {
|
||||
return jdImg2;
|
||||
}
|
||||
|
||||
public void setJdImg2(String jdImg2) {
|
||||
this.jdImg2 = jdImg2;
|
||||
}
|
||||
|
||||
public String getJdImg3() {
|
||||
return jdImg3;
|
||||
}
|
||||
|
||||
public void setJdImg3(String jdImg3) {
|
||||
this.jdImg3 = jdImg3;
|
||||
}
|
||||
|
||||
public String getJdImg4() {
|
||||
return jdImg4;
|
||||
}
|
||||
|
||||
public void setJdImg4(String jdImg4) {
|
||||
this.jdImg4 = jdImg4;
|
||||
}
|
||||
|
||||
public String getJdImg5() {
|
||||
return jdImg5;
|
||||
}
|
||||
|
||||
public void setJdImg5(String jdImg5) {
|
||||
this.jdImg5 = jdImg5;
|
||||
}
|
||||
|
||||
public String getJdImg6() {
|
||||
return jdImg6;
|
||||
}
|
||||
|
||||
public void setJdImg6(String jdImg6) {
|
||||
this.jdImg6 = jdImg6;
|
||||
}
|
||||
|
||||
public String getYxImg() {
|
||||
return yxImg;
|
||||
}
|
||||
|
||||
public void setYxImg(String yxImg) {
|
||||
this.yxImg = yxImg;
|
||||
}
|
||||
|
||||
public String getGebImg() {
|
||||
return gebImg;
|
||||
}
|
||||
|
||||
public void setGebImg(String gebImg) {
|
||||
this.gebImg = gebImg;
|
||||
}
|
||||
|
||||
public String getGebImg2() {
|
||||
return gebImg2;
|
||||
}
|
||||
|
||||
public void setGebImg2(String gebImg2) {
|
||||
this.gebImg2 = gebImg2;
|
||||
}
|
||||
|
||||
public String getDbImgs() {
|
||||
return dbImgs;
|
||||
}
|
||||
|
||||
public void setDbImgs(String dbImgs) {
|
||||
this.dbImgs = dbImgs;
|
||||
}
|
||||
|
||||
public String getFilingDocumentPhoto() {
|
||||
return filingDocumentPhoto;
|
||||
}
|
||||
|
||||
public void setFilingDocumentPhoto(String filingDocumentPhoto) {
|
||||
this.filingDocumentPhoto = filingDocumentPhoto;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getZjReport() {
|
||||
return zjReport;
|
||||
}
|
||||
|
||||
public void setZjReport(String zjReport) {
|
||||
this.zjReport = zjReport;
|
||||
}
|
||||
|
||||
public String getOtherFiles() {
|
||||
return otherFiles;
|
||||
}
|
||||
|
||||
public void setOtherFiles(String otherFiles) {
|
||||
this.otherFiles = otherFiles;
|
||||
}
|
||||
|
||||
public String getHouseOwnership() {
|
||||
return houseOwnership;
|
||||
}
|
||||
|
||||
public void setHouseOwnership(String houseOwnership) {
|
||||
this.houseOwnership = houseOwnership;
|
||||
}
|
||||
|
||||
public String getChangeRecordId() {
|
||||
return changeRecordId;
|
||||
}
|
||||
|
||||
public void setChangeRecordId(String changeRecordId) {
|
||||
this.changeRecordId = changeRecordId;
|
||||
}
|
||||
|
||||
public String getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setProjectId(String projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CustomerEntryCompletionChangeRecord{" +
|
||||
"id='" + id + '\'' +
|
||||
", number='" + number + '\'' +
|
||||
", entryId='" + entryId + '\'' +
|
||||
", powerStationCode='" + powerStationCode + '\'' +
|
||||
", otherImgs1='" + otherImgs1 + '\'' +
|
||||
", otherImgs2='" + otherImgs2 + '\'' +
|
||||
", otherImgs3='" + otherImgs3 + '\'' +
|
||||
", otherImgs4='" + otherImgs4 + '\'' +
|
||||
", dzjc1='" + dzjc1 + '\'' +
|
||||
", dzjc2='" + dzjc2 + '\'' +
|
||||
", zjImg1='" + zjImg1 + '\'' +
|
||||
", zjImg2='" + zjImg2 + '\'' +
|
||||
", zjImg3='" + zjImg3 + '\'' +
|
||||
", zjImg4='" + zjImg4 + '\'' +
|
||||
", zjImg5='" + zjImg5 + '\'' +
|
||||
", componentImg1='" + componentImg1 + '\'' +
|
||||
", componentImg2='" + componentImg2 + '\'' +
|
||||
", sizeMeasureImgs='" + sizeMeasureImgs + '\'' +
|
||||
", fixOtherImg='" + fixOtherImg + '\'' +
|
||||
", totalImgs='" + totalImgs + '\'' +
|
||||
", bwInnerImg='" + bwInnerImg + '\'' +
|
||||
", dcImgs='" + dcImgs + '\'' +
|
||||
", nbqZbImg='" + nbqZbImg + '\'' +
|
||||
", dqsbAnImgOne='" + dqsbAnImgOne + '\'' +
|
||||
", nbqPlateImg='" + nbqPlateImg + '\'' +
|
||||
", zjPlateImg='" + zjPlateImg + '\'' +
|
||||
", openWayVoltageImgs='" + openWayVoltageImgs + '\'' +
|
||||
", jdImg1='" + jdImg1 + '\'' +
|
||||
", jdImg2='" + jdImg2 + '\'' +
|
||||
", jdImg3='" + jdImg3 + '\'' +
|
||||
", jdImg4='" + jdImg4 + '\'' +
|
||||
", jdImg5='" + jdImg5 + '\'' +
|
||||
", jdImg6='" + jdImg6 + '\'' +
|
||||
", yxImg='" + yxImg + '\'' +
|
||||
", gebImg='" + gebImg + '\'' +
|
||||
", gebImg2='" + gebImg2 + '\'' +
|
||||
", dbImgs='" + dbImgs + '\'' +
|
||||
", filingDocumentPhoto='" + filingDocumentPhoto + '\'' +
|
||||
", zjReport='" + zjReport + '\'' +
|
||||
", otherFiles='" + otherFiles + '\'' +
|
||||
", houseOwnership='" + houseOwnership + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,151 @@
|
||||
package com.sifang.modules.changes.entity;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Entity
|
||||
@Table(name = "crm_customer_entry_supplement")
|
||||
public class CustomerEntrySupplement implements Serializable {
|
||||
|
||||
@Id
|
||||
private String id;
|
||||
|
||||
private String number;
|
||||
|
||||
private String entryId;
|
||||
|
||||
private String powerStationCode;
|
||||
|
||||
private Integer changeCount;
|
||||
|
||||
private String createBy;
|
||||
private String creator;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private String auditBy;
|
||||
private String auditor;
|
||||
private Date auditTime;
|
||||
|
||||
private String status;
|
||||
|
||||
private String changeReason;
|
||||
|
||||
private String auditRemarks;
|
||||
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber(String number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public String getEntryId() {
|
||||
return entryId;
|
||||
}
|
||||
|
||||
public void setEntryId(String entryId) {
|
||||
this.entryId = entryId;
|
||||
}
|
||||
|
||||
public String getPowerStationCode() {
|
||||
return powerStationCode;
|
||||
}
|
||||
|
||||
public void setPowerStationCode(String powerStationCode) {
|
||||
this.powerStationCode = powerStationCode;
|
||||
}
|
||||
|
||||
public Integer getChangeCount() {
|
||||
return changeCount;
|
||||
}
|
||||
|
||||
public void setChangeCount(Integer changeCount) {
|
||||
this.changeCount = changeCount;
|
||||
}
|
||||
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(String createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
public String getCreator() {
|
||||
return creator;
|
||||
}
|
||||
|
||||
public void setCreator(String creator) {
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getAuditBy() {
|
||||
return auditBy;
|
||||
}
|
||||
|
||||
public void setAuditBy(String auditBy) {
|
||||
this.auditBy = auditBy;
|
||||
}
|
||||
|
||||
public String getAuditor() {
|
||||
return auditor;
|
||||
}
|
||||
|
||||
public void setAuditor(String auditor) {
|
||||
this.auditor = auditor;
|
||||
}
|
||||
|
||||
public Date getAuditTime() {
|
||||
return auditTime;
|
||||
}
|
||||
|
||||
public void setAuditTime(Date auditTime) {
|
||||
this.auditTime = auditTime;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getChangeReason() {
|
||||
return changeReason;
|
||||
}
|
||||
|
||||
public void setChangeReason(String changeReason) {
|
||||
this.changeReason = changeReason;
|
||||
}
|
||||
|
||||
public String getAuditRemarks() {
|
||||
return auditRemarks;
|
||||
}
|
||||
|
||||
public void setAuditRemarks(String auditRemarks) {
|
||||
this.auditRemarks = auditRemarks;
|
||||
}
|
||||
}
|
@ -0,0 +1,473 @@
|
||||
package com.sifang.modules.changes.entity;
|
||||
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
import org.hibernate.validator.constraints.NotBlank;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Entity
|
||||
@Table(name = "crm_customer_entry_supplement_detail")
|
||||
public class CustomerEntrySupplementDetail implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@Id
|
||||
@GeneratedValue(generator = "idGenerator")
|
||||
@GenericGenerator(name = "idGenerator", strategy = "uuid")
|
||||
private String id;
|
||||
|
||||
@NotBlank(message = "电站id不能为空")
|
||||
private String entryId;
|
||||
|
||||
private String powerStationCode;
|
||||
|
||||
private String partnersContractNumber;
|
||||
|
||||
private String changeType;
|
||||
|
||||
private String mainId;
|
||||
private String residenceBooklet;
|
||||
|
||||
private String bankCard;
|
||||
|
||||
|
||||
private String bpFile;
|
||||
private String houseOwnership;
|
||||
|
||||
private String generatorNo;
|
||||
|
||||
private String provinceCode;
|
||||
|
||||
private String tssBankNum;
|
||||
|
||||
private String tssBankNumName;
|
||||
|
||||
private String bankCode;
|
||||
|
||||
private String idCardFront;
|
||||
|
||||
private String idCardBack;
|
||||
|
||||
private String address;
|
||||
|
||||
private String bpCardFront;
|
||||
|
||||
private String bpCardBack;
|
||||
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private String addressConsistent;
|
||||
|
||||
private String electricProvince;
|
||||
|
||||
private String electricCity;
|
||||
|
||||
private String electricArea;
|
||||
|
||||
private String electricAddress;
|
||||
|
||||
private String yxImg;
|
||||
|
||||
private String gebImg;
|
||||
|
||||
private String gebImg2;
|
||||
|
||||
private String otherAttachment;
|
||||
|
||||
private String dbImgs;
|
||||
|
||||
private String contract;
|
||||
|
||||
private String contractFilename;
|
||||
|
||||
private String bwtsFile;
|
||||
|
||||
private String bwtsFilename;
|
||||
|
||||
private String filingDocumentPhoto;
|
||||
|
||||
private String powerCapacityUrl;
|
||||
|
||||
private String dbxImgs;
|
||||
|
||||
private String powerPlantCode;
|
||||
|
||||
private String gridInstitution;
|
||||
|
||||
private String archivesImg;
|
||||
|
||||
private String contractVideoUrl;
|
||||
|
||||
private String provinceCodeHand;
|
||||
|
||||
private String tlzhjkImgs;
|
||||
|
||||
public String getGebImg2() {
|
||||
return gebImg2;
|
||||
}
|
||||
|
||||
public void setGebImg2(String gebImg2) {
|
||||
this.gebImg2 = gebImg2;
|
||||
}
|
||||
|
||||
public String getArchivesImg() {
|
||||
return archivesImg;
|
||||
}
|
||||
|
||||
public void setArchivesImg(String archivesImg) {
|
||||
this.archivesImg = archivesImg;
|
||||
}
|
||||
|
||||
public String getContractVideoUrl() {
|
||||
return contractVideoUrl;
|
||||
}
|
||||
|
||||
public void setContractVideoUrl(String contractVideoUrl) {
|
||||
this.contractVideoUrl = contractVideoUrl;
|
||||
}
|
||||
|
||||
public String getProvinceCodeHand() {
|
||||
return provinceCodeHand;
|
||||
}
|
||||
|
||||
public void setProvinceCodeHand(String provinceCodeHand) {
|
||||
this.provinceCodeHand = provinceCodeHand;
|
||||
}
|
||||
|
||||
public String getGridInstitution() {
|
||||
return gridInstitution;
|
||||
}
|
||||
|
||||
public void setGridInstitution(String gridInstitution) {
|
||||
this.gridInstitution = gridInstitution;
|
||||
}
|
||||
|
||||
public String getPowerPlantCode() {
|
||||
return powerPlantCode;
|
||||
}
|
||||
|
||||
public void setPowerPlantCode(String powerPlantCode) {
|
||||
this.powerPlantCode = powerPlantCode;
|
||||
}
|
||||
|
||||
public String getFilingDocumentPhoto() {
|
||||
return filingDocumentPhoto;
|
||||
}
|
||||
|
||||
public void setFilingDocumentPhoto(String filingDocumentPhoto) {
|
||||
this.filingDocumentPhoto = filingDocumentPhoto;
|
||||
}
|
||||
|
||||
public String getPowerCapacityUrl() {
|
||||
return powerCapacityUrl;
|
||||
}
|
||||
|
||||
public void setPowerCapacityUrl(String powerCapacityUrl) {
|
||||
this.powerCapacityUrl = powerCapacityUrl;
|
||||
}
|
||||
|
||||
public String getDbxImgs() {
|
||||
return dbxImgs;
|
||||
}
|
||||
|
||||
public void setDbxImgs(String dbxImgs) {
|
||||
this.dbxImgs = dbxImgs;
|
||||
}
|
||||
|
||||
public String getDbImgs() {
|
||||
return dbImgs;
|
||||
}
|
||||
|
||||
public void setDbImgs(String dbImgs) {
|
||||
this.dbImgs = dbImgs;
|
||||
}
|
||||
|
||||
public String getContract() {
|
||||
return contract;
|
||||
}
|
||||
|
||||
public void setContract(String contract) {
|
||||
this.contract = contract;
|
||||
}
|
||||
|
||||
public String getContractFilename() {
|
||||
return contractFilename;
|
||||
}
|
||||
|
||||
public void setContractFilename(String contractFilename) {
|
||||
this.contractFilename = contractFilename;
|
||||
}
|
||||
|
||||
public String getBwtsFile() {
|
||||
return bwtsFile;
|
||||
}
|
||||
|
||||
public void setBwtsFile(String bwtsFile) {
|
||||
this.bwtsFile = bwtsFile;
|
||||
}
|
||||
|
||||
public String getBwtsFilename() {
|
||||
return bwtsFilename;
|
||||
}
|
||||
|
||||
public void setBwtsFilename(String bwtsFilename) {
|
||||
this.bwtsFilename = bwtsFilename;
|
||||
}
|
||||
|
||||
public String getOtherAttachment() {
|
||||
return otherAttachment;
|
||||
}
|
||||
|
||||
public void setOtherAttachment(String otherAttachment) {
|
||||
this.otherAttachment = otherAttachment;
|
||||
}
|
||||
|
||||
@Transient
|
||||
private String reason;
|
||||
|
||||
public String getChangeType() {
|
||||
return changeType;
|
||||
}
|
||||
|
||||
public void setChangeType(String changeType) {
|
||||
this.changeType = changeType;
|
||||
}
|
||||
|
||||
public String getMainId() {
|
||||
return mainId;
|
||||
}
|
||||
|
||||
public void setMainId(String mainId) {
|
||||
this.mainId = mainId;
|
||||
}
|
||||
|
||||
public String getPartnersContractNumber() {
|
||||
return partnersContractNumber;
|
||||
}
|
||||
|
||||
public void setPartnersContractNumber(String partnersContractNumber) {
|
||||
this.partnersContractNumber = partnersContractNumber;
|
||||
}
|
||||
|
||||
|
||||
public String getPowerStationCode() {
|
||||
return powerStationCode;
|
||||
}
|
||||
|
||||
public void setPowerStationCode(String powerStationCode) {
|
||||
this.powerStationCode = powerStationCode;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getResidenceBooklet() {
|
||||
return residenceBooklet;
|
||||
}
|
||||
|
||||
public void setResidenceBooklet(String residenceBooklet) {
|
||||
this.residenceBooklet = residenceBooklet;
|
||||
}
|
||||
|
||||
public String getBankCard() {
|
||||
return bankCard;
|
||||
}
|
||||
|
||||
public void setBankCard(String bankCard) {
|
||||
this.bankCard = bankCard;
|
||||
}
|
||||
|
||||
public String getEntryId() {
|
||||
return entryId;
|
||||
}
|
||||
|
||||
public void setEntryId(String entryId) {
|
||||
this.entryId = entryId;
|
||||
}
|
||||
|
||||
public String getBpFile() {
|
||||
return bpFile;
|
||||
}
|
||||
|
||||
public void setBpFile(String bpFile) {
|
||||
this.bpFile = bpFile;
|
||||
}
|
||||
|
||||
public String getHouseOwnership() {
|
||||
return houseOwnership;
|
||||
}
|
||||
|
||||
public void setHouseOwnership(String houseOwnership) {
|
||||
this.houseOwnership = houseOwnership;
|
||||
}
|
||||
|
||||
public String getGeneratorNo() {
|
||||
return generatorNo;
|
||||
}
|
||||
|
||||
public void setGeneratorNo(String generatorNo) {
|
||||
this.generatorNo = generatorNo;
|
||||
}
|
||||
|
||||
public String getProvinceCode() {
|
||||
return provinceCode;
|
||||
}
|
||||
|
||||
public void setProvinceCode(String provinceCode) {
|
||||
this.provinceCode = provinceCode;
|
||||
}
|
||||
|
||||
public String getTssBankNum() {
|
||||
return tssBankNum;
|
||||
}
|
||||
|
||||
public void setTssBankNum(String tssBankNum) {
|
||||
this.tssBankNum = tssBankNum;
|
||||
}
|
||||
|
||||
public String getTssBankNumName() {
|
||||
return tssBankNumName;
|
||||
}
|
||||
|
||||
public void setTssBankNumName(String tssBankNumName) {
|
||||
this.tssBankNumName = tssBankNumName;
|
||||
}
|
||||
|
||||
public String getBankCode() {
|
||||
return bankCode;
|
||||
}
|
||||
|
||||
public void setBankCode(String bankCode) {
|
||||
this.bankCode = bankCode;
|
||||
}
|
||||
|
||||
public String getIdCardFront() {
|
||||
return idCardFront;
|
||||
}
|
||||
|
||||
public void setIdCardFront(String idCardFront) {
|
||||
this.idCardFront = idCardFront;
|
||||
}
|
||||
|
||||
public String getIdCardBack() {
|
||||
return idCardBack;
|
||||
}
|
||||
|
||||
public void setIdCardBack(String idCardBack) {
|
||||
this.idCardBack = idCardBack;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getBpCardFront() {
|
||||
return bpCardFront;
|
||||
}
|
||||
|
||||
public void setBpCardFront(String bpCardFront) {
|
||||
this.bpCardFront = bpCardFront;
|
||||
}
|
||||
|
||||
public String getBpCardBack() {
|
||||
return bpCardBack;
|
||||
}
|
||||
|
||||
public void setBpCardBack(String bpCardBack) {
|
||||
this.bpCardBack = bpCardBack;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getAddressConsistent() {
|
||||
return addressConsistent;
|
||||
}
|
||||
|
||||
public void setAddressConsistent(String addressConsistent) {
|
||||
this.addressConsistent = addressConsistent;
|
||||
}
|
||||
|
||||
public String getElectricProvince() {
|
||||
return electricProvince;
|
||||
}
|
||||
|
||||
public void setElectricProvince(String electricProvince) {
|
||||
this.electricProvince = electricProvince;
|
||||
}
|
||||
|
||||
public String getElectricCity() {
|
||||
return electricCity;
|
||||
}
|
||||
|
||||
public void setElectricCity(String electricCity) {
|
||||
this.electricCity = electricCity;
|
||||
}
|
||||
|
||||
public String getElectricArea() {
|
||||
return electricArea;
|
||||
}
|
||||
|
||||
public void setElectricArea(String electricArea) {
|
||||
this.electricArea = electricArea;
|
||||
}
|
||||
|
||||
public String getElectricAddress() {
|
||||
return electricAddress;
|
||||
}
|
||||
|
||||
public void setElectricAddress(String electricAddress) {
|
||||
this.electricAddress = electricAddress;
|
||||
}
|
||||
|
||||
public String getYxImg() {
|
||||
return yxImg;
|
||||
}
|
||||
|
||||
public void setYxImg(String yxImg) {
|
||||
this.yxImg = yxImg;
|
||||
}
|
||||
|
||||
public String getGebImg() {
|
||||
return gebImg;
|
||||
}
|
||||
|
||||
public void setGebImg(String gebImg) {
|
||||
this.gebImg = gebImg;
|
||||
}
|
||||
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
public void setReason(String reason) {
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
public String getTlzhjkImgs() {
|
||||
return tlzhjkImgs;
|
||||
}
|
||||
|
||||
public void setTlzhjkImgs(String tlzhjkImgs) {
|
||||
this.tlzhjkImgs = tlzhjkImgs;
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.sifang.modules.changes.service;
|
||||
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import com.sifang.modules.changes.dao.CustomerEntryChangeDesignComponentDao;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class CustomerEntryChangeDesignComponentService {
|
||||
|
||||
@Autowired
|
||||
CustomerEntryChangeDesignComponentDao componentDao;
|
||||
|
||||
public List<Record> findByDesignId(String designId) {
|
||||
return componentDao.findByDesignId(designId);
|
||||
}
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue