Commit 9dc2bb7f by kangxiaoshan

Merge branch 'manager_new' into 31762_bugfix

parents b5dce634 ca9d7978
......@@ -4,7 +4,7 @@
/.classpath
/.project
/.externalToolBuilders
/.idea/
.idea/
/node_modules/
/dist/
!/src/main/webapp/WEB-INF
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -11,8 +11,11 @@
</webroots>
</configuration>
</facet>
<facet type="Spring" name="Spring">
<configuration />
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
......@@ -79,7 +82,7 @@
<orderEntry type="module-library">
<library name="Maven: com.alibaba:jconsole:1.8.0">
<CLASSES>
<root url="jar://E:/Java/jdk1.8.0_65/lib/jconsole.jar!/" />
<root url="jar://D:/Program Files/Java/jdk1.8.0_181/lib/jconsole.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
......@@ -88,7 +91,7 @@
<orderEntry type="module-library">
<library name="Maven: com.alibaba:tools:1.8.0">
<CLASSES>
<root url="jar://E:/Java/jdk1.8.0_65/lib/tools.jar!/" />
<root url="jar://D:/Program Files/Java/jdk1.8.0_181/lib/tools.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
......
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="web" name="Web">
<configuration>
<descriptors>
<deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
</descriptors>
<webroots>
<root url="file://$MODULE_DIR$/lib" relative="WEB-INF/lib" />
<root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
</webroots>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.servlet:javax.servlet-api:3.0.1" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:4.3.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:4.3.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-web:4.3.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:4.3.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:4.3.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:4.3.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:4.3.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-jpa:1.3.2.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:1.5.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-orm:3.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:3.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.aspectj:aspectjrt:1.7.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aspects:4.3.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.8.9" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:4.3.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:1.7.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:1.1.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:4.2.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-oxm:4.2.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: net.sf.ehcache:ehcache:2.9.1" level="project" />
<orderEntry type="library" name="Maven: com.googlecode.ehcache-spring-annotations:ehcache-spring-annotations:1.1.2" level="project" />
<orderEntry type="library" name="Maven: aopalliance:aopalliance:1.0" level="project" />
<orderEntry type="library" name="Maven: net.sf.ehcache:ehcache-core:2.1.0" level="project" />
<orderEntry type="library" name="Maven: org.hibernate:hibernate-core:4.2.1.Final" level="project" />
<orderEntry type="library" name="Maven: antlr:antlr:2.7.7" level="project" />
<orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
<orderEntry type="library" name="Maven: org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:1.0.1.Final" level="project" />
<orderEntry type="library" name="Maven: org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final" level="project" />
<orderEntry type="library" name="Maven: org.hibernate:hibernate-entitymanager:4.2.1.Final" level="project" />
<orderEntry type="library" name="Maven: org.hibernate.common:hibernate-commons-annotations:4.0.1.Final" level="project" />
<orderEntry type="library" name="Maven: org.hibernate:hibernate-validator:5.0.0.Final" level="project" />
<orderEntry type="library" name="Maven: javax.validation:validation-api:1.1.0.Final" level="project" />
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.1.1.GA" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml:classmate:0.8.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.glassfish.web:javax.el:2.2.4" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: javax.el:javax.el-api:2.2.4" level="project" />
<orderEntry type="library" name="Maven: org.xerial.snappy:snappy-java:1.1.2.6" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.5" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.5" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.1.3" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.1.3" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-access:1.1.3" level="project" />
<orderEntry type="library" name="Maven: org.logback-extensions:logback-ext-spring:0.1.2" level="project" />
<orderEntry type="library" name="Maven: org.javassist:javassist:3.20.0-GA" level="project" />
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:5.1.25" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.8.5" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.8.5" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.8.5" level="project" />
<orderEntry type="library" name="Maven: javax.inject:javax.inject:1" level="project" />
<orderEntry type="library" name="Maven: redis.clients:jedis:2.8.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.3" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:druid:1.0.14" level="project" />
<orderEntry type="module-library">
<library name="Maven: com.alibaba:jconsole:1.8.0">
<CLASSES>
<root url="jar://E:/Java/jdk1.8.0_65/lib/jconsole.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Maven: com.alibaba:tools:1.8.0">
<CLASSES>
<root url="jar://E:/Java/jdk1.8.0_65/lib/tools.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="Maven: net.sf.json-lib:json-lib:jdk15:2.4" level="project" />
<orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.8.0" level="project" />
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.1" level="project" />
<orderEntry type="library" name="Maven: net.sf.ezmorph:ezmorph:1.0.6" level="project" />
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" name="Maven: org.json:json:20090211" level="project" />
<orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.2.2" level="project" />
<orderEntry type="library" name="Maven: commons-io:commons-io:2.4" level="project" />
<orderEntry type="library" name="Maven: com.belerweb:pinyin4j:2.5.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-email:1.2" level="project" />
<orderEntry type="library" name="Maven: javax.mail:mail:1.4.1" level="project" />
<orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: com.googlecode.jmockit:jmockit:1.5" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: com.googlecode.jmockit:jmockit-coverage:0.999.24" level="project" />
<orderEntry type="library" name="Maven: org.jdom:jdom:1.1.3" level="project" />
<orderEntry type="library" name="Maven: com.amazonaws:aws-java-sdk-dynamodb:1.11.52" level="project" />
<orderEntry type="library" name="Maven: com.amazonaws:aws-java-sdk-s3:1.11.52" level="project" />
<orderEntry type="library" name="Maven: com.amazonaws:aws-java-sdk-kms:1.11.52" level="project" />
<orderEntry type="library" name="Maven: com.amazonaws:aws-java-sdk-core:1.11.52" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.4" level="project" />
<orderEntry type="library" name="Maven: software.amazon.ion:ion-java:1.0.1" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.6.6" level="project" />
<orderEntry type="library" name="Maven: com.amazonaws:jmespath-java:1.0" level="project" />
<orderEntry type="library" name="Maven: org.jsoup:jsoup:1.6.3" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.jettison:jettison:1.3.7" level="project" />
<orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
<orderEntry type="library" name="Maven: commons-httpclient:commons-httpclient:3.1" level="project" />
<orderEntry type="library" name="Maven: com.sun.jersey:jersey-core:1.8" level="project" />
<orderEntry type="library" name="Maven: org.webjars.npm:isemail:2.1.0" level="project" />
<orderEntry type="library" name="Maven: commons-net:commons-net:3.6" level="project" />
<orderEntry type="library" name="Maven: dnsjava:dnsjava:2.1.8" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi:3.16" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.10" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:3.16" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:3.16" level="project" />
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:2.6.0" level="project" />
<orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.04" level="project" />
<orderEntry type="library" name="Maven: org.anarres.lzo:lzo-core:1.0.5" level="project" />
<orderEntry type="library" name="Maven: com.google.code.findbugs:annotations:2.0.3" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-all:4.0.23.Final" level="project" />
<orderEntry type="library" name="Maven: com.google.code.gson:gson:1.6" level="project" />
<orderEntry type="library" name="Maven: com.google.api-ads:ads-lib:3.9.0" level="project" />
<orderEntry type="library" name="Maven: com.google.inject:guice:4.0" level="project" />
<orderEntry type="library" name="Maven: com.google.inject.extensions:guice-assistedinject:4.0" level="project" />
<orderEntry type="library" name="Maven: com.google.inject.extensions:guice-multibindings:4.0" level="project" />
<orderEntry type="library" name="Maven: commons-configuration:commons-configuration:1.10" level="project" />
<orderEntry type="library" name="Maven: net.sf.opencsv:opencsv:1.8" level="project" />
<orderEntry type="library" name="Maven: joda-time:joda-time:2.8.2" level="project" />
<orderEntry type="library" name="Maven: com.google.api-client:google-api-client:1.22.0" level="project" />
<orderEntry type="library" name="Maven: com.google.oauth-client:google-oauth-client:1.22.0" level="project" />
<orderEntry type="library" name="Maven: com.google.api-ads:adwords-axis:3.9.0" level="project" />
<orderEntry type="library" name="Maven: com.google.api-ads:ads-lib-axis:3.9.0" level="project" />
<orderEntry type="library" name="Maven: commons-discovery:commons-discovery:0.4" level="project" />
<orderEntry type="library" name="Maven: javax.xml:jaxrpc-api:1.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.axis:axis:1.4" level="project" />
<orderEntry type="library" name="Maven: wsdl4j:wsdl4j:1.6.2" level="project" />
<orderEntry type="library" name="Maven: com.google.http-client:google-http-client-jackson2:1.22.0" level="project" />
<orderEntry type="library" name="Maven: com.google.http-client:google-http-client:1.22.0" level="project" />
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:1.3.9" level="project" />
<orderEntry type="library" name="Maven: com.beust:jcommander:1.48" level="project" />
</component>
</module>
\ No newline at end of file
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.reyun</groupId>
<artifactId>manage</artifactId>
......@@ -37,7 +38,8 @@
<!--数据源配置-->
<datasource.driver>com.mysql.jdbc.Driver</datasource.driver>
<!--//office-->
<default.datasource.url>jdbc:mysql://192.168.2.57:3306/manager?characterEncoding=utf-8</default.datasource.url>
<default.datasource.url>jdbc:mysql://192.168.2.57:3306/manager?characterEncoding=utf-8
</default.datasource.url>
<default.datasource.username>root</default.datasource.username>
<default.datasource.password>reyun123</default.datasource.password>
......@@ -93,7 +95,8 @@
<!--数据源配置-->
<datasource.driver>com.mysql.jdbc.Driver</datasource.driver>
<!--//office-->
<default.datasource.url>jdbc:mysql://10.3.20.32:3306/manager?characterEncoding=utf-8</default.datasource.url>
<default.datasource.url>jdbc:mysql://10.3.20.32:3306/manager?characterEncoding=utf-8
</default.datasource.url>
<default.datasource.username>root</default.datasource.username>
<default.datasource.password>reyun.123</default.datasource.password>
......@@ -125,7 +128,8 @@
<!-- 单位是分钟-->
<mail.valid_time>3</mail.valid_time>
<report.url>http://localhost:9010</report.url>
<!--<report.url>http://localhost:9010</report.url>-->
<report.url>http://http://10.3.20.41:11010</report.url>
<!--Redis setting-->
<redis.key.validtime>120</redis.key.validtime>
<redis.ip.requesttimes>5</redis.ip.requesttimes>
......@@ -145,7 +149,9 @@
<id>preview</id>
<properties>
<label>dev</label>
<datasource.url>jdbc:mysql://reyuntest.c42s8pkbxrdg.rds.cn-north-1.amazonaws.com.cn:3306/trackingio_test?characterEncoding=utf-8</datasource.url>
<datasource.url>
jdbc:mysql://reyuntest.c42s8pkbxrdg.rds.cn-north-1.amazonaws.com.cn:3306/trackingio_test?characterEncoding=utf-8
</datasource.url>
<datasource.username>reyuntest</datasource.username>
<datasource.password>reyuntest</datasource.password>
<datasource.driver>com.mysql.jdbc.Driver</datasource.driver>
......@@ -162,27 +168,39 @@
<!--数据源配置-->
<datasource.driver>com.mysql.jdbc.Driver</datasource.driver>
<!--//office-->
<default.datasource.url>jdbc:mysql://tkio.cma5jkozme68.rds.cn-north-1.amazonaws.com.cn:3306/manager?characterEncoding=utf-8</default.datasource.url>
<default.datasource.url>
jdbc:mysql://tkio.cma5jkozme68.rds.cn-north-1.amazonaws.com.cn:3306/manager?characterEncoding=utf-8
</default.datasource.url>
<default.datasource.username>trackingio</default.datasource.username>
<default.datasource.password>trackingio</default.datasource.password>
<office.url>jdbc:mysql://track.cma5jkozme68.rds.cn-north-1.amazonaws.com.cn:3306/office?characterEncoding=utf-8</office.url>
<office.url>
jdbc:mysql://track.cma5jkozme68.rds.cn-north-1.amazonaws.com.cn:3306/office?characterEncoding=utf-8
</office.url>
<office.username>office</office.username>
<office.password>office</office.password>
<tkio.url>jdbc:mysql://tkio.cma5jkozme68.rds.cn-north-1.amazonaws.com.cn:3306/trackingio?characterEncoding=utf-8</tkio.url>
<tkio.url>
jdbc:mysql://tkio.cma5jkozme68.rds.cn-north-1.amazonaws.com.cn:3306/trackingio?characterEncoding=utf-8
</tkio.url>
<tkio.username>trackingio</tkio.username>
<tkio.password>trackingio</tkio.password>
<track.url>jdbc:mysql://track.cma5jkozme68.rds.cn-north-1.amazonaws.com.cn:3306/track?characterEncoding=utf-8</track.url>
<track.url>
jdbc:mysql://track.cma5jkozme68.rds.cn-north-1.amazonaws.com.cn:3306/track?characterEncoding=utf-8
</track.url>
<track.username>admin</track.username>
<track.password>admin!@#456</track.password>
<dmp.url>jdbc:mysql://tkio.cma5jkozme68.rds.cn-north-1.amazonaws.com.cn:3306/manager?characterEncoding=utf-8</dmp.url>
<dmp.url>
jdbc:mysql://tkio.cma5jkozme68.rds.cn-north-1.amazonaws.com.cn:3306/manager?characterEncoding=utf-8
</dmp.url>
<dmp.username>trackingio</dmp.username>
<dmp.password>trackingio</dmp.password>
<io.url>jdbc:mysql://tkio.cma5jkozme68.rds.cn-north-1.amazonaws.com.cn:3306/userio?characterEncoding=utf-8</io.url>
<io.url>
jdbc:mysql://tkio.cma5jkozme68.rds.cn-north-1.amazonaws.com.cn:3306/userio?characterEncoding=utf-8
</io.url>
<io.username>reyun</io.username>
<io.password>Reyun123</io.password>
......@@ -201,11 +219,10 @@
<redis.ip.requesttimes>5</redis.ip.requesttimes>
<redis.ip.unknown.requesttimes>5</redis.ip.unknown.requesttimes>
<redis.surl.host>trackingio-web.nr7fi4.ng.0001.cnn1.cache.amazonaws.com.cn</redis.surl.host>
<redis.surl.host>trackingio-web.nr7fi4.0001.cnn1.cache.amazonaws.com.cn</redis.surl.host>
<redis.surl.port>6379</redis.surl.port>
<redis.event.host>trackingio-web.nr7fi4.ng.0001.cnn1.cache.amazonaws.com.cn</redis.event.host>
<redis.event.host>trackingio-web.nr7fi4.0001.cnn1.cache.amazonaws.com.cn</redis.event.host>
<redis.event.port>6379</redis.event.port>
<redis.event.database>13</redis.event.database>
<!--Redis setting//end-->
......
......@@ -50,12 +50,12 @@ public class ContractController {
@Autowired
private ContractService service;
@RequestMapping(value = "find", method = RequestMethod.GET)
@ResponseBody
public ResultModel findAll(@CurrentAccount User loginAccount, @PathVariable String platform,
@RequestParam String startDate, @RequestParam String endDate) {
return ResultModel.OK(service.findAll(loginAccount,startDate, endDate, platform));
return ResultModel.OK(service.findAllContract(loginAccount,startDate, endDate, platform));
}
@RequestMapping(value = "export", method = RequestMethod.GET,produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
......@@ -161,8 +161,9 @@ public class ContractController {
@RequestMapping(value = "find/code", method = RequestMethod.GET)
@ResponseBody
public ResultModel findCode(@CurrentAccount User loginAccount, @RequestParam String code) {
return ResultModel.OK(service.getContractCode(code));
public ResultModel findCode(@CurrentAccount User loginAccount, @RequestParam String code,@PathVariable String platform,String company) {
return ResultModel.OK(service.getContractCode(code,platform,company));
}
@RequestMapping(value = "find/pricelevel", method = RequestMethod.GET)
......@@ -264,10 +265,26 @@ public class ContractController {
@ResponseBody
public ResultModel build(@RequestBody Contract contract, HttpServletRequest request) {
// ContractSendEmailThread email = new ContractSendEmailThread(contract);
// email.start();
logger.error("tkiio---------------" + contract);
return ResultModel.OK(service.build(contract));
}
@RequestMapping(value = "trade", method = RequestMethod.POST)
@ResponseBody
public ResultModel baseCreate(@RequestBody Contract contract, @PathVariable String platform) {
return ResultModel.OK(service.getTradeData(platform));
}
@RequestMapping(value = "code/all", method = RequestMethod.POST)
@ResponseBody
public ResultModel contractCodeAll(@RequestBody Contract contract, @PathVariable String platform) {
return ResultModel.OK(service.contractCodeAll(platform));
}
}
......@@ -113,4 +113,7 @@ public class LoginController {
return ResultModel.OK(true);
}
}
......@@ -16,7 +16,7 @@ public class Contract {
private String myBodyName;
private String myBodyCode;
private String customerBody;
private String email;
private String email; //客户主账号
private String contractCode;
//是否首次签约
private String contractType;
......@@ -24,16 +24,18 @@ public class Contract {
private String endDate;
//套餐
private Long priceLevel;
private Long money;
private Double rebate;
private String priceLevelName;
private Long money; //合同金额
private Double rebate; //
private Long sale;
//产品trackingio or adi ...
private String platform;
private String status;
private String saleName;
private String priceLevelName;
private Long payMoney;
private Long invoice;
private Long invoice; // 发票金额
private String createName;
//合同类型 主套餐 or 增值套餐
private String type;
......@@ -48,6 +50,23 @@ public class Contract {
private String ds;
private Boolean virtual;
/**
* 新增字段
*/
// private Long catogrey; //行业
private Long discountFlow; // 优惠流量
private Long discountTimeLong; // 优惠时长
private Double rebateMoney; //回款金额
private String customerShort;// 客户简称
private String customerThird;// 三方客户
private int tradeType; // 行业id
private Long relationContract;// 关联合同id
private String createrName; // 录入人
@Id
@GeneratedValue
public Long getId() {
......@@ -300,6 +319,70 @@ public class Contract {
this.createName = createName;
}
public Long getDiscountFlow() {
return discountFlow;
}
public void setDiscountFlow(Long discountFlow) {
this.discountFlow = discountFlow;
}
public Long getDiscountTimeLong() {
return discountTimeLong;
}
public void setDiscountTimeLong(Long discountTimeLong) {
this.discountTimeLong = discountTimeLong;
}
public Double getRebateMoney() {
return rebateMoney;
}
public void setRebateMoney(Double rebateMoney) {
this.rebateMoney = rebateMoney;
}
public String getCustomerShort() {
return customerShort;
}
public void setCustomerShort(String customerShort) {
this.customerShort = customerShort;
}
public String getCustomerThird() {
return customerThird;
}
public void setCustomerThird(String customerThird) {
this.customerThird = customerThird;
}
public int getTradeType() {
return tradeType;
}
public void setTradeType(int tradeType) {
this.tradeType = tradeType;
}
public Long getRelationContract() {
return relationContract;
}
public void setRelationContract(Long relationContract) {
this.relationContract = relationContract;
}
public String getCreaterName() {
return createrName;
}
public void setCreaterName(String createrName) {
this.createrName = createrName;
}
@Override
public String toString() {
return "Contract{" +
......
package common.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.util.Date;
/**
* Created .
* 合同 关联信息
*/
@Entity
public class ContractRelation {
private Long id;
private Long mainContract;
private Long relationId;
private Date createTime;
@Id
@GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getMainContract() {
return mainContract;
}
public void setMainContract(Long mainContract) {
this.mainContract = mainContract;
}
public Long getRelationId() {
return relationId;
}
public void setRelationId(Long relationId) {
this.relationId = relationId;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}
package common.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@Entity
public class TradeType {
private Long id;
private Long parentId;
private String name;
private String code;
private String platform;
private int sort;
@Id
@GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getPlatform() {
return platform;
}
public void setPlatform(String platform) {
this.platform = platform;
}
public int getSort() {
return sort;
}
public void setSort(int sort) {
this.sort = sort;
}
}
package common.repository;
import common.model.ContractRelation;
import org.springframework.data.jpa.repository.JpaRepository;
/**
* 合同 关联信息
*/
public interface ContractRelationRepository extends JpaRepository<ContractRelation, Long> {
}
......@@ -8,6 +8,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigInteger;
import java.util.List;
import java.util.Map;
@Transactional
public interface ContractRepository extends JpaRepository<Contract, Long> {
......@@ -47,4 +48,13 @@ public interface ContractRepository extends JpaRepository<Contract, Long> {
@Query(value="SELECT * from contract where end_date <= ?1 and (status <> 'end' or status <> 'cancel')",nativeQuery=true)
List<Contract> findByEndDate(String endDate);
@Query(value = "select count(*) from contract where platform = ?1",nativeQuery = true)
BigInteger findcountContract(String platform);
@Query(value = "select new map( c.id as id, c.contractCode as contractCode ) from Contract c where c.platform = ?1")
Map contractCodePlatform(String platform);
@Query(value = "select * from contract where platform = ?1 and contract_code = ?2",nativeQuery = true)
Contract findByCodePlatform(String contractCode, String platform);
}
package common.repository;
import common.model.TradeType;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.transaction.annotation.Transactional;
@Transactional
public interface TradeTypeRepsitory extends JpaRepository<TradeType, Long>{
}
......@@ -48,4 +48,12 @@ public interface ContractService {
List<ContractMoney> findPayAll(String startDate, String endDate, String platform);
Contract build(Contract contract);
String getContractCode(String code, String platform, String company);
List<TradeType> getTradeData(String platform);
Map contractCodeAll(String platform);
List<Contract> findAllContract(User loginAccount, String startDate, String endDate, String platform);
}
\ No newline at end of file
......@@ -85,6 +85,14 @@ public class ContractServiceImpl implements ContractService{
@Autowired
ADIAccountService adiAccountService;
@Autowired
TradeTypeRepsitory tradeTypeRepsitory;
@Autowired
ContractRelationRepository contractRelationRepository;
@Override
public Map<String, Object> checkAccount(String email, String platfrom) {
Map<String, Object> map = new HashMap<>();
......@@ -169,6 +177,23 @@ public class ContractServiceImpl implements ContractService{
}
@Override
public String getContractCode(String code, String platform, String company) {
BigInteger countContract = contractRepository.findcountContract(platform);
String lastCode = "";
int codeInt = countContract.intValue();
if(codeInt < 9){
lastCode = "0"+(codeInt+1);
}else{
lastCode = ""+(codeInt+1);
}
return company+"-"+platform+"-"+DateUtil.getDays2(0)+"-"+lastCode;
}
@Override
public List findSetmeal(String platform) {
List list = new ArrayList();
if("adi".equals(platform)){
......@@ -239,6 +264,47 @@ public class ContractServiceImpl implements ContractService{
}
@Override
public Contract create(User loginUser, Contract resource) {
if(resource ==null){
return null;
}
Contract contractExist = contractRepository.findByCodePlatform(resource.getContractCode(),resource.getPlatform());
if(contractExist!=null){
// 合同编号已存在
return null;
}
resource.setPayMoney(0L);
resource.setInvoice(0L);
resource.setStatus(ContractStatusEnum.EXECUTING.getKey());
resource.setCreateTime(new Date());
if(null != loginUser) {
resource.setCreateAccount(loginUser.getId());
resource.setCreaterName(loginUser.getName());
}
resource = contractRepository.save(resource);
if(resource.getRelationContract()>0){
//保存关联合同信息
ContractRelation relation = new ContractRelation();
relation.setCreateTime(new Date());
relation.setMainContract(resource.getId());
relation.setRelationId(resource.getRelationContract());
contractRelationRepository.save(relation);
}
if(true){
return resource;
}
// 老的逻辑
String contractCode = getContractCode(resource.getMyBodyCode());
if(!contractCode.equals(resource.getContractCode())){
......@@ -288,6 +354,7 @@ public class ContractServiceImpl implements ContractService{
if(null != loginUser) {
resource.setCreateAccount(loginUser.getId());
resource.setCreaterName(loginUser.getName());
}
resource.setCreateTime(new Date());
......@@ -489,6 +556,28 @@ public class ContractServiceImpl implements ContractService{
}
@Override
public List<Contract> findAllContract(User loginAccount, String startDate, String endDate, String platform) {
List<Contract> contractList ;
if(!loginAccount.getRole().equals(RoleEnum.MANAGER.getKey())){
//非 管理员
List<User> userList = userService.findAllSons(loginAccount.getId());
List<Long> idList = new ArrayList<>();
idList.add(loginAccount.getId());
for(User u : userList){
idList.add(u.getId());
}
contractList = contractRepository.findByDsAndRoile(startDate, endDate, platform, idList);
}else{
contractList = contractRepository.findByDs(startDate, endDate, platform);
}
return contractList;
}
@Override
public Contract findOne(String code) {
List<Contract> result = new ArrayList<>();
......@@ -710,7 +799,19 @@ public class ContractServiceImpl implements ContractService{
return result;
}
@Override
public List<TradeType> getTradeData(String platform) {
return tradeTypeRepsitory.findAll();
}
@Override
public Map contractCodeAll(String platform) {
return contractRepository.contractCodePlatform(platform);
}
public Map<Long, String> getPackageMap(){
List<PackageType> typeList = packageTypeRepository.findAll();
......
......@@ -353,5 +353,10 @@ public class UserServiceImpl implements UserService {
return result;
}
public static void main(String[] args) {
System.out.println(CipherUtil.generatePassword("111111"));
}
}
package track.service.impl;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import tkio.model.AccountRestrict4Web;
import track.model.Account;
import track.model.App;
import track.repository.MeasureRepository;
import track.repository.TrackAppRepository;
import track.service.TrackAccountFlowRestrictService;
import util.Constant;
import util.DateUtil;
import util.HttpClientUtil;
import util.ValidateUtil;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.ArrayList;
import java.util.List;
/**
* Created by song on 2017/10/19.
......
......@@ -16,29 +16,30 @@
<description>Spring公共配置</description>
<aop:aspectj-autoproxy proxy-target-class="true"/>
<context:component-scan base-package="tkio" />
<context:component-scan base-package="track" />
<context:component-scan base-package="userio" />
<context:component-scan base-package="common" />
<context:component-scan base-package="office" />
<context:component-scan base-package="dmp" />
<context:component-scan base-package="security" />
<context:component-scan base-package="adi" />
<context:component-scan base-package="tkio"/>
<context:component-scan base-package="track"/>
<context:component-scan base-package="userio"/>
<context:component-scan base-package="common"/>
<context:component-scan base-package="office"/>
<context:component-scan base-package="dmp"/>
<context:component-scan base-package="security"/>
<context:component-scan base-package="adi"/>
<context:property-placeholder location="classpath:persistence.properties,classpath:redis.properties"/>
<!--Redis配置-->
<bean id="poolConfig" class="redis.clients.jedis.JedisPoolConfig">
<property name="maxIdle" value="300" />
<property name="maxTotal" value="600" />
<property name="maxIdle" value="300"/>
<property name="maxTotal" value="600"/>
<property name="maxWaitMillis" value="1000"></property>
<property name="testOnBorrow" value="true" />
<property name="testOnBorrow" value="true"/>
</bean>
<bean id="connectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory" p:hostName="${redis.Surl.host}" p:port="${redis.Surl.port}" p:poolConfig-ref="poolConfig"/>
<bean id="connectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"
p:hostName="${redis.Surl.host}" p:port="${redis.Surl.port}" p:poolConfig-ref="poolConfig"/>
<bean id="redisTemplate" class="org.springframework.data.redis.core.StringRedisTemplate">
<property name="connectionFactory" ref="connectionFactory" />
<property name="connectionFactory" ref="connectionFactory"/>
</bean>
<!--//Redis配置 -->
......@@ -93,7 +94,7 @@
<property name="dataSource" ref="dataSource"/>
<property name="packagesToScan" value="common.model">
</property>
<property name="persistenceUnitName" value="defaultUnit" />
<property name="persistenceUnitName" value="defaultUnit"/>
<property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapter"/>
<property name="jpaProperties">
......@@ -111,7 +112,7 @@
<bean id="officeEntityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="officeDataSource"/>
<property name="packagesToScan" value="office.model"></property>
<property name="persistenceUnitName" value="officeUnit" />
<property name="persistenceUnitName" value="officeUnit"/>
<property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapter"/>
<property name="jpaProperties">
......@@ -125,11 +126,11 @@
<prop key="hibernate.connection.useUnicode">true</prop>
</props>
</property>
</bean>
</bean>
<bean id="tkioEntityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="tkioDataSource"/>
<property name="packagesToScan" value="tkio.model"></property>
<property name="persistenceUnitName" value="tkioUnit" />
<property name="persistenceUnitName" value="tkioUnit"/>
<property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapter"/>
<property name="jpaProperties">
......@@ -147,7 +148,7 @@
<bean id="trackEntityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="trackDataSource"/>
<property name="packagesToScan" value="track.model"></property>
<property name="persistenceUnitName" value="tkrackUnit" />
<property name="persistenceUnitName" value="tkrackUnit"/>
<property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapter"/>
<property name="jpaProperties">
......@@ -165,7 +166,7 @@
<bean id="dmpEntityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dmpDataSource"/>
<property name="packagesToScan" value="dmp.model"></property>
<property name="persistenceUnitName" value="dmpUnit" />
<property name="persistenceUnitName" value="dmpUnit"/>
<property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapter"/>
<property name="jpaProperties">
......@@ -183,7 +184,7 @@
<bean id="ioEntityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="ioDataSource"/>
<property name="packagesToScan" value="userio.model"></property>
<property name="persistenceUnitName" value="ioUnit" />
<property name="persistenceUnitName" value="ioUnit"/>
<property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapter"/>
<property name="jpaProperties">
......@@ -337,5 +338,5 @@
<property name="maxUploadSize" value="2000000"/>
</bean>
<bean id="appUtils" class="common.context.AppUtils" lazy-init="false" />
<bean id="appUtils" class="common.context.AppUtils" lazy-init="false"/>
</beans>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment