Commit 104f1118ad40edee91b63a134c1b2de13ca58cff

Authored by 游瑞烽
0 parents

初始化

Showing 44 changed files with 3749 additions and 0 deletions
.git.zip 0 → 100644
No preview for this file type
.gitignore 0 → 100644
  1 +++ a/.gitignore
  1 +.classpath
  2 +.project
  3 +.springBeans
  4 +.settings/*
  5 +/target/*
  6 +node_modules/
  7 +test_junitReport/
  8 +test_coverage/
  9 +.idea
  10 +.DS_Store
  11 +*.iml
  12 +tmp
  13 +
  14 +# git忽略空文件夹,按照惯例,空文件夹下放置.gitkeep文件避免文件夹被忽略不上传。
  15 +!.gitkeep
  16 +/target/
README.md 0 → 100644
  1 +++ a/README.md
  1 +人员表更新金蝶数据
0 \ No newline at end of file 2 \ No newline at end of file
calc_mileage.sql 0 → 100644
  1 +++ a/calc_mileage.sql
  1 +/*
  2 +Navicat MySQL Data Transfer
  3 +
  4 +Source Server : bsth
  5 +Source Server Version : 50612
  6 +Source Host : localhost:3306
  7 +Source Database : control
  8 +
  9 +Target Server Type : MYSQL
  10 +Target Server Version : 50612
  11 +File Encoding : 65001
  12 +
  13 +Date: 2017-08-22 10:51:38
  14 +*/
  15 +
  16 +SET FOREIGN_KEY_CHECKS=0;
  17 +
  18 +-- ----------------------------
  19 +-- Table structure for calc_mileage
  20 +-- ----------------------------
  21 +DROP TABLE IF EXISTS `calc_mileage`;
  22 +CREATE TABLE `calc_mileage` (
  23 + `id` bigint(20) NOT NULL AUTO_INCREMENT,
  24 + `company_id` int(11) DEFAULT NULL,
  25 + `sub_company_id` int(11) DEFAULT NULL,
  26 + `company_name` varchar(255) DEFAULT NULL,
  27 + `sub_company_name` varchar(255) DEFAULT NULL,
  28 + `line_code` varchar(255) DEFAULT NULL,
  29 + `line_name` varchar(255) DEFAULT NULL,
  30 + `zyygl` double DEFAULT NULL,
  31 + `sjyygl` double DEFAULT NULL,
  32 + `sjksgl` double DEFAULT NULL,
  33 + `sddfgl` double DEFAULT NULL,
  34 + `zddfgl` double DEFAULT NULL,
  35 + `wqwxhgl` double DEFAULT NULL,
  36 + `bfwxhgl` double DEFAULT NULL,
  37 + `pygl` double DEFAULT NULL,
  38 + `ljgl` double DEFAULT NULL,
  39 + `zrwgl` double DEFAULT NULL,
  40 + `other` varchar(255) DEFAULT NULL,
  41 + `rq` datetime DEFAULT NULL,
  42 + `remarks` varchar(255) DEFAULT NULL,
  43 + `create_date` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP,
  44 + PRIMARY KEY (`id`)
  45 +) ENGINE=InnoDB AUTO_INCREMENT=3232 DEFAULT CHARSET=utf8;
  46 +
  47 +DROP TABLE IF EXISTS `calc_schedule`;
  48 +CREATE TABLE `calc_schedule` (
  49 + `id` bigint(20) NOT NULL AUTO_INCREMENT,
  50 + `company_id` int(11) DEFAULT NULL,
  51 + `sub_company_id` int(11) DEFAULT NULL,
  52 + `company_name` varchar(255) DEFAULT NULL,
  53 + `sub_company_name` varchar(255) DEFAULT NULL,
  54 + `line_code` varchar(255) DEFAULT NULL,
  55 + `line_name` varchar(255) DEFAULT NULL,
  56 + `zyybc` int(255) DEFAULT NULL,
  57 + `sjyybc` int(255) DEFAULT NULL,
  58 + `sjksbc` int(255) DEFAULT NULL,
  59 + `sddfbc` int(255) DEFAULT NULL,
  60 + `zddfbc` int(255) DEFAULT NULL,
  61 + `wqwxhbc` int(255) DEFAULT NULL,
  62 + `bfwxhbc` int(255) DEFAULT NULL,
  63 + `pybc` int(255) DEFAULT NULL,
  64 + `ljbc` int(255) DEFAULT NULL,
  65 + `zrwbc` int(255) DEFAULT NULL,
  66 + `other` varchar(255) DEFAULT NULL,
  67 + `rq` varchar(255) DEFAULT NULL,
  68 + `remarks` varchar(255) DEFAULT NULL,
  69 + `create_date` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  70 + PRIMARY KEY (`id`)
  71 +) ENGINE=InnoDB AUTO_INCREMENT=3232 DEFAULT CHARSET=utf8;
pom.xml 0 → 100644
  1 +++ a/pom.xml
  1 +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  3 +
  4 + <modelVersion>4.0.0</modelVersion>
  5 + <groupId>com.bsth</groupId>
  6 + <artifactId>personnel_update</artifactId>
  7 + <version>0.0.1-SNAPSHOT</version>
  8 + <packaging>jar</packaging>
  9 +
  10 + <parent>
  11 + <groupId>org.springframework.boot</groupId>
  12 + <artifactId>spring-boot-starter-parent</artifactId>
  13 + <version>1.5.2.RELEASE</version>
  14 + </parent>
  15 +
  16 + <dependencies>
  17 + <dependency>
  18 + <groupId>dom4j</groupId>
  19 + <artifactId>dom4j</artifactId>
  20 + <version>1.6.1</version>
  21 + </dependency>
  22 + <dependency>
  23 + <groupId>org.apache.camel</groupId>
  24 + <artifactId>camel-core</artifactId>
  25 + <version>1.3.0</version>
  26 + </dependency>
  27 +
  28 + <dependency>
  29 + <groupId>org.springframework.boot</groupId>
  30 + <artifactId>spring-boot-starter-web</artifactId>
  31 + </dependency>
  32 +
  33 + <dependency>
  34 + <groupId>org.springframework.boot</groupId>
  35 + <artifactId>spring-boot-starter-tomcat</artifactId>
  36 + <scope>provided</scope>
  37 + </dependency>
  38 +
  39 + <dependency>
  40 + <groupId>org.springframework.boot</groupId>
  41 + <artifactId>spring-boot-starter-data-jpa</artifactId>
  42 + </dependency>
  43 + <dependency>
  44 + <groupId>org.springframework.boot</groupId>
  45 + <artifactId>spring-boot-starter-aop</artifactId>
  46 + </dependency>
  47 +
  48 + <dependency>
  49 + <groupId>org.springframework.boot</groupId>
  50 + <artifactId>spring-boot-starter-data-redis</artifactId>
  51 + </dependency>
  52 +
  53 + <!--<dependency>
  54 + <groupId>org.mybatis.spring.boot</groupId>
  55 + <artifactId>mybatis-spring-boot-starter</artifactId>
  56 + <version>1.3.0</version>
  57 + </dependency>-->
  58 +
  59 + <dependency>
  60 + <groupId>org.springframework</groupId>
  61 + <artifactId>spring-context-support</artifactId>
  62 + </dependency>
  63 + <dependency>
  64 + <groupId>mysql</groupId>
  65 + <artifactId>mysql-connector-java</artifactId>
  66 + </dependency>
  67 +
  68 + <dependency>
  69 + <groupId>joda-time</groupId>
  70 + <artifactId>joda-time</artifactId>
  71 + </dependency>
  72 + <dependency>
  73 + <groupId>com.alibaba</groupId>
  74 + <artifactId>fastjson</artifactId>
  75 + <version>1.2.4</version>
  76 + </dependency>
  77 +
  78 + <dependency>
  79 + <groupId>org.apache.httpcomponents</groupId>
  80 + <artifactId>httpclient</artifactId>
  81 + </dependency>
  82 +
  83 + <dependency>
  84 + <groupId>commons-dbcp</groupId>
  85 + <artifactId>commons-dbcp</artifactId>
  86 + </dependency>
  87 + <dependency>
  88 + <groupId>commons-lang</groupId>
  89 + <artifactId>commons-lang</artifactId>
  90 + <version>2.6</version>
  91 + </dependency>
  92 + <dependency>
  93 + <groupId>org.apache.commons</groupId>
  94 + <artifactId>commons-lang3</artifactId>
  95 + <version>3.4</version>
  96 + </dependency>
  97 + <dependency>
  98 + <groupId>commons-fileupload</groupId>
  99 + <artifactId>commons-fileupload</artifactId>
  100 + <version>1.2.2</version>
  101 + </dependency>
  102 + <dependency>
  103 + <groupId>commons-io</groupId>
  104 + <artifactId>commons-io</artifactId>
  105 + <version>2.4</version>
  106 + </dependency>
  107 + <dependency>
  108 + <groupId>org.codehaus.janino</groupId>
  109 + <artifactId>janino</artifactId>
  110 + </dependency>
  111 +
  112 + <dependency>
  113 + <groupId>org.apache.poi</groupId>
  114 + <artifactId>poi</artifactId>
  115 + <version>3.13</version>
  116 + </dependency>
  117 +
  118 + <dependency>
  119 + <groupId>com.google.guava</groupId>
  120 + <artifactId>guava</artifactId>
  121 + <version>19.0</version>
  122 + </dependency>
  123 +
  124 + <dependency>
  125 + <groupId>c3p0</groupId>
  126 + <artifactId>c3p0</artifactId>
  127 + <version>0.9.1.2</version>
  128 + </dependency>
  129 +
  130 + <dependency>
  131 + <groupId>com.fasterxml.jackson.jaxrs</groupId>
  132 + <artifactId>jackson-jaxrs-json-provider</artifactId>
  133 + <version>2.8.7</version>
  134 + </dependency>
  135 +
  136 + <dependency>
  137 + <groupId>org.eclipse.jetty</groupId>
  138 + <artifactId>jetty-util</artifactId>
  139 + <version>8.1.15.v20140411</version>
  140 + </dependency>
  141 + </dependencies>
  142 +
  143 + <build>
  144 + <plugins>
  145 + <plugin>
  146 + <artifactId>maven-compiler-plugin</artifactId>
  147 + <version>2.3.2</version><!--$NO-MVN-MAN-VER$ -->
  148 + <configuration>
  149 + <source>1.7</source>
  150 + <target>1.7</target>
  151 + </configuration>
  152 + </plugin>
  153 + <plugin>
  154 + <artifactId>maven-war-plugin</artifactId>
  155 + <version>2.2</version><!--$NO-MVN-MAN-VER$ -->
  156 + <configuration>
  157 + <failOnMissingWebXml>false</failOnMissingWebXml>
  158 + </configuration>
  159 + </plugin>
  160 + <plugin>
  161 + <groupId>org.springframework.boot</groupId>
  162 + <artifactId>spring-boot-maven-plugin</artifactId>
  163 + </plugin>
  164 + </plugins>
  165 + <resources>
  166 + <resource>
  167 + <directory>src/main/resources</directory>
  168 + <filtering>false</filtering>
  169 + </resource>
  170 + </resources>
  171 + </build>
  172 + <repositories>
  173 + <repository>
  174 + <id>spring-snapshots</id>
  175 + <url>http://repo.spring.io/snapshot</url>
  176 + <snapshots>
  177 + <enabled>true</enabled>
  178 + </snapshots>
  179 + </repository>
  180 + <repository>
  181 + <id>spring-milestones</id>
  182 + <url>http://repo.spring.io/milestone</url>
  183 + </repository>
  184 + </repositories>
  185 + <pluginRepositories>
  186 + <pluginRepository>
  187 + <id>spring-snapshots</id>
  188 + <url>http://repo.spring.io/snapshot</url>
  189 + </pluginRepository>
  190 + <pluginRepository>
  191 + <id>spring-milestones</id>
  192 + <url>http://repo.spring.io/milestone</url>
  193 + </pluginRepository>
  194 + </pluginRepositories>
  195 +
  196 + <properties>
  197 + <start-class>com.bsth.Application</start-class>
  198 + </properties>
  199 +</project>
src/main/java/com/bsth/Application.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/Application.java
  1 +package com.bsth;
  2 +
  3 +import org.springframework.boot.SpringApplication;
  4 +import org.springframework.boot.autoconfigure.SpringBootApplication;
  5 +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
  6 +import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
  7 +import org.springframework.boot.web.support.SpringBootServletInitializer;
  8 +
  9 +@SpringBootApplication
  10 +//@SpringBootApplication(exclude={DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class})
  11 +public class Application extends SpringBootServletInitializer {
  12 +
  13 + public static void main(String[] args) throws Exception {
  14 + SpringApplication.run(Application.class, args);
  15 + }
  16 +
  17 +}
0 \ No newline at end of file 18 \ No newline at end of file
src/main/java/com/bsth/StartCommand.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/StartCommand.java
  1 +package com.bsth;
  2 +
  3 +
  4 +import com.bsth.thread.PersonnelUpdateThrad;
  5 +import com.bsth.util.DateUtils;
  6 +
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.boot.CommandLineRunner;
  9 +import org.springframework.stereotype.Component;
  10 +import org.slf4j.Logger;
  11 +import org.slf4j.LoggerFactory;
  12 +
  13 +import java.util.concurrent.Executors;
  14 +import java.util.concurrent.ScheduledExecutorService;
  15 +import java.util.concurrent.TimeUnit;
  16 +
  17 +
  18 +/**
  19 + * 随应用启动运行
  20 + *
  21 + */
  22 +@Component
  23 +public class StartCommand implements CommandLineRunner{
  24 +
  25 + public static ScheduledExecutorService mainServices = Executors.newScheduledThreadPool(2);
  26 +
  27 + Logger log = LoggerFactory.getLogger(this.getClass());
  28 +
  29 + private static long timeDiff;
  30 +
  31 + @Autowired
  32 + PersonnelUpdateThrad personnelUpdateThrad;
  33 +
  34 + static {
  35 + // 中午12:00
  36 + timeDiff = (DateUtils.getTimestamp() + 1000 * 60 * 60 * 24) - System.currentTimeMillis();
  37 +// if (timeDiff < 0)
  38 +// timeDiff += (1000 * 60 * 60 * 24);
  39 + }
  40 +
  41 + @Override
  42 + public void run(String... arg0){
  43 +
  44 + try {
  45 + log.info("在:"+timeDiff / 1000 / 60 + "分钟后开始同步数据");
  46 + mainServices.scheduleAtFixedRate(personnelUpdateThrad, timeDiff / 1000, 60 * 60 * 24, TimeUnit.SECONDS);//timeDiff / 1000
  47 +// mainServices.scheduleAtFixedRate(personnelUpdateThrad, 1, 60*60, TimeUnit.SECONDS);//timeDiff / 1000
  48 + } catch (Exception e) {
  49 + e.printStackTrace();
  50 + }
  51 + }
  52 +}
src/main/java/com/bsth/common/ResponseCode.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/common/ResponseCode.java
  1 +package com.bsth.common;
  2 +
  3 +/**
  4 + *
  5 + * @ClassName: ResponseCode
  6 + * @Description: TODO(响应状态码)
  7 + * @author PanZhao
  8 + * @date 2016年3月18日 下午11:12:08
  9 + *
  10 + */
  11 +public enum ResponseCode {
  12 +
  13 + SUCCESS("操作成功", 200),
  14 + NO_PERMISSION("无资源访问权限", 403),
  15 + NO_AUTHENTICATION("客户端未授权", 407),
  16 + ERROR("服务器异常", 500);
  17 +
  18 + private String text;
  19 + private int code;
  20 +
  21 + ResponseCode(String text, int code) {
  22 + this.text = text;
  23 + this.code = code;
  24 + }
  25 +
  26 + @Override
  27 + public String toString() {
  28 + return this.code + "";
  29 + }
  30 +
  31 + public String getText() {
  32 + return this.text;
  33 + }
  34 +}
src/main/java/com/bsth/entity/Business.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/entity/Business.java
  1 +package com.bsth.entity;
  2 +
  3 +import javax.persistence.Column;
  4 +import javax.persistence.Entity;
  5 +import javax.persistence.GeneratedValue;
  6 +import javax.persistence.GenerationType;
  7 +import javax.persistence.Id;
  8 +import javax.persistence.Table;
  9 +import java.util.Date;
  10 +
  11 +/**
  12 + *
  13 + * @ClassName : Business(公司实体类)
  14 + *
  15 + * @Author : bsth@lq
  16 + *
  17 + * @Description : TODO(公司信息)
  18 + *
  19 + * @Data : 2016-04-27
  20 + *
  21 + * @Version 公交调度系统BS版 0.1
  22 + *
  23 + */
  24 +
  25 +@Entity
  26 +@Table(name = "bsth_c_business")
  27 +public class Business {
  28 +
  29 + // ID
  30 + @Id
  31 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  32 + private Integer id;
  33 +
  34 + // 企业<公司>名称
  35 + private String businessName;
  36 +
  37 + // 企业<公司>代码
  38 + private String businessCode;
  39 +
  40 + // 所属企业<公司>代码
  41 + private String upCode;
  42 +
  43 + // 描述
  44 + private String descriptions;
  45 +
  46 + // 创建日期
  47 + @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  48 + private Date createDate;
  49 +
  50 + // 修改日期
  51 + @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  52 + private Date updateDate;
  53 + public Date getCreateDate() {
  54 + return createDate;
  55 + }
  56 +
  57 + public void setCreateDate(Date createDate) {
  58 + this.createDate = createDate;
  59 + }
  60 +
  61 + public Date getUpdateDate() {
  62 + return updateDate;
  63 + }
  64 +
  65 + public void setUpdateDate(Date updateDate) {
  66 + this.updateDate = updateDate;
  67 + }
  68 +
  69 + public Integer getId() {
  70 + return id;
  71 + }
  72 +
  73 + public void setId(Integer id) {
  74 + this.id = id;
  75 + }
  76 +
  77 + public String getBusinessName() {
  78 + return businessName;
  79 + }
  80 +
  81 + public void setBusinessName(String businessName) {
  82 + this.businessName = businessName;
  83 + }
  84 +
  85 + public String getBusinessCode() {
  86 + return businessCode;
  87 + }
  88 +
  89 + public void setBusinessCode(String businessCode) {
  90 + this.businessCode = businessCode;
  91 + }
  92 +
  93 + public String getUpCode() {
  94 + return upCode;
  95 + }
  96 +
  97 + public void setUpCode(String upCode) {
  98 + this.upCode = upCode;
  99 + }
  100 +
  101 + public String getDescriptions() {
  102 + return descriptions;
  103 + }
  104 +
  105 + public void setDescriptions(String descriptions) {
  106 + this.descriptions = descriptions;
  107 + }
  108 +}
src/main/java/com/bsth/entity/Dictionary.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/entity/Dictionary.java
  1 +package com.bsth.entity;
  2 +
  3 +import javax.persistence.Column;
  4 +import javax.persistence.Entity;
  5 +import javax.persistence.GeneratedValue;
  6 +import javax.persistence.GenerationType;
  7 +import javax.persistence.Id;
  8 +import javax.persistence.Table;
  9 +import java.util.Date;
  10 +
  11 +@Entity
  12 +@Table(name = "bsth_c_sys_dictionary")
  13 +public class Dictionary {
  14 +
  15 + @Id
  16 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  17 + private Integer id;
  18 +
  19 + private String dCode;
  20 +
  21 + private String dName;
  22 +
  23 + private String descriptions;
  24 +
  25 + private String dGroup;
  26 +
  27 + /**
  28 + * 固化的字典不能修改
  29 + */
  30 + private boolean fixed;
  31 +
  32 + @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  33 + private Date updateDate;
  34 +
  35 +
  36 + public Integer getId() {
  37 + return id;
  38 + }
  39 +
  40 + public void setId(Integer id) {
  41 + this.id = id;
  42 + }
  43 +
  44 + public boolean isFixed() {
  45 + return fixed;
  46 + }
  47 +
  48 + public void setFixed(boolean fixed) {
  49 + this.fixed = fixed;
  50 + }
  51 +
  52 + public String getdCode() {
  53 + return dCode;
  54 + }
  55 +
  56 + public void setdCode(String dCode) {
  57 + this.dCode = dCode;
  58 + }
  59 +
  60 + public String getdName() {
  61 + return dName;
  62 + }
  63 +
  64 + public void setdName(String dName) {
  65 + this.dName = dName;
  66 + }
  67 +
  68 + public String getDescriptions() {
  69 + return descriptions;
  70 + }
  71 +
  72 + public void setDescriptions(String descriptions) {
  73 + this.descriptions = descriptions;
  74 + }
  75 +
  76 + public String getdGroup() {
  77 + return dGroup;
  78 + }
  79 +
  80 + public void setdGroup(String dGroup) {
  81 + this.dGroup = dGroup;
  82 + }
  83 +
  84 + public Date getUpdateDate() {
  85 + return updateDate;
  86 + }
  87 +
  88 + public void setUpdateDate(Date updateDate) {
  89 + this.updateDate = updateDate;
  90 + }
  91 +}
src/main/java/com/bsth/entity/Personnel.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/entity/Personnel.java
  1 +package com.bsth.entity;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  4 +import org.hibernate.annotations.Formula;
  5 +
  6 +import javax.persistence.Column;
  7 +import javax.persistence.Entity;
  8 +import javax.persistence.GeneratedValue;
  9 +import javax.persistence.Id;
  10 +import javax.persistence.Table;
  11 +import java.util.Date;
  12 +
  13 +/**
  14 + *
  15 + * @ClassName : Personnel(人员实体类)
  16 + *
  17 + * @Author : bsth@lq
  18 + *
  19 + * @Description : TODO(人员)
  20 + *
  21 + * @Version 公交调度系统BS版 0.1
  22 + *
  23 + */
  24 +
  25 +@Entity
  26 +@Table(name = "bsth_c_personnel")//_copy
  27 +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
  28 +public class Personnel {
  29 +
  30 + /** 主键Id */
  31 + @Id
  32 + @GeneratedValue
  33 + private Integer id;
  34 +
  35 + /** 所属公司 */
  36 + @Column(nullable = false)
  37 + private String company;
  38 + /** 公司编码 */
  39 + @Column(nullable = false)
  40 + private String companyCode;
  41 + /** 所属分公司 */
  42 + private String brancheCompany;
  43 + /** 分公司编码 */
  44 + private String brancheCompanyCode;
  45 + /** 组合公司分公司编码 */
  46 +// @Formula(" concat(company_code, '_', branche_company_code) ")
  47 +// private String cgsbm;
  48 +
  49 + /** 工号(员工编号带公司编码前缀) */
  50 + @Column(nullable = false)
  51 + private String jobCode;
  52 + /** 姓名 */
  53 + @Column(nullable = false)
  54 + private String personnelName;
  55 +
  56 + /** 运营服务证书号 */
  57 + private String papersCode;
  58 + /** 一卡通工作卡号 */
  59 + private String icCardCode;
  60 + /** 性别(字典类型sexType) */
  61 + private String personnelType;
  62 + /** 所属岗位/工种(字典类型gzType) */
  63 + private String posts;
  64 +
  65 + /** 工号 */
  66 + @Column(nullable = false)
  67 + private String jobCodeori;
  68 +
  69 + /** 金蝶工号 */
  70 +// @Column(nullable = false)
  71 + private String jdCodeori;
  72 +
  73 + /** 身份证 */
  74 + private String card;
  75 +
  76 + @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  77 + private Date updateDate;
  78 +
  79 + /** 备注 */
  80 + private String remark;
  81 +
  82 + /**
  83 + * 0为正常,1为停用
  84 + */
  85 + private Integer destroy;
  86 +
  87 + public Personnel() {}
  88 +
  89 + public Personnel(Object id, Object companyCode, Object gh) {
  90 + if (id != null) {
  91 + this.id = Integer.valueOf(id.toString());
  92 + }
  93 + if (companyCode != null) {
  94 + this.companyCode = companyCode.toString();
  95 + }
  96 + if (gh != null) {
  97 + this.jobCode = gh.toString();
  98 + }
  99 + }
  100 +
  101 + public String getCard() {
  102 + return card;
  103 + }
  104 +
  105 + public void setCard(String card) {
  106 + this.card = card;
  107 + }
  108 +
  109 + /** 人员编码(TODO:在原系统里没有,这里暂时留着) */
  110 + private String personnelCode;
  111 + /** 照片地址(TODO:在原系统里没有,这里暂时留着) */
  112 + private String personnelImg;
  113 + /** 线路编号(TODO:在原系统里没有,这里暂时留着) */
  114 + private String lineCode;
  115 + /** 联系电话(TODO:在原系统里没有,这里暂时留着) */
  116 + private String telphone;
  117 + /** 描述(TODO:在原系统里没有,这里暂时留着) */
  118 + private String descriptions;
  119 +
  120 + public Integer getId() {
  121 + return id;
  122 + }
  123 +
  124 + public void setId(Integer id) {
  125 + this.id = id;
  126 + }
  127 +
  128 + public String getCompany() {
  129 + return company;
  130 + }
  131 +
  132 + public void setCompany(String company) {
  133 + this.company = company;
  134 + }
  135 +
  136 + public String getCompanyCode() {
  137 + return companyCode;
  138 + }
  139 +
  140 + public void setCompanyCode(String companyCode) {
  141 + this.companyCode = companyCode;
  142 + }
  143 +
  144 + public String getBrancheCompany() {
  145 + return brancheCompany;
  146 + }
  147 +
  148 + public void setBrancheCompany(String brancheCompany) {
  149 + this.brancheCompany = brancheCompany;
  150 + }
  151 +
  152 + public String getBrancheCompanyCode() {
  153 + return brancheCompanyCode;
  154 + }
  155 +
  156 + public void setBrancheCompanyCode(String brancheCompanyCode) {
  157 + this.brancheCompanyCode = brancheCompanyCode;
  158 + }
  159 +
  160 + public String getJobCode() {
  161 + return jobCode;
  162 + }
  163 +
  164 + public void setJobCode(String jobCode) {
  165 + this.jobCode = jobCode;
  166 + }
  167 +
  168 + public String getPersonnelName() {
  169 + return personnelName;
  170 + }
  171 +
  172 + public void setPersonnelName(String personnelName) {
  173 + this.personnelName = personnelName;
  174 + }
  175 +
  176 + public String getPapersCode() {
  177 + return papersCode;
  178 + }
  179 +
  180 + public void setPapersCode(String papersCode) {
  181 + this.papersCode = papersCode;
  182 + }
  183 +
  184 + public String getIcCardCode() {
  185 + return icCardCode;
  186 + }
  187 +
  188 + public void setIcCardCode(String icCardCode) {
  189 + this.icCardCode = icCardCode;
  190 + }
  191 +
  192 + public String getPersonnelType() {
  193 + return personnelType;
  194 + }
  195 +
  196 + public void setPersonnelType(String personnelType) {
  197 + this.personnelType = personnelType;
  198 + }
  199 +
  200 + public String getPosts() {
  201 + return posts;
  202 + }
  203 +
  204 + public void setPosts(String posts) {
  205 + this.posts = posts;
  206 + }
  207 +
  208 + public String getPersonnelCode() {
  209 + return personnelCode;
  210 + }
  211 +
  212 + public void setPersonnelCode(String personnelCode) {
  213 + this.personnelCode = personnelCode;
  214 + }
  215 +
  216 + public String getPersonnelImg() {
  217 + return personnelImg;
  218 + }
  219 +
  220 + public void setPersonnelImg(String personnelImg) {
  221 + this.personnelImg = personnelImg;
  222 + }
  223 +
  224 + public String getLineCode() {
  225 + return lineCode;
  226 + }
  227 +
  228 + public void setLineCode(String lineCode) {
  229 + this.lineCode = lineCode;
  230 + }
  231 +
  232 + public String getTelphone() {
  233 + return telphone;
  234 + }
  235 +
  236 + public void setTelphone(String telphone) {
  237 + this.telphone = telphone;
  238 + }
  239 +
  240 + public String getDescriptions() {
  241 + return descriptions;
  242 + }
  243 +
  244 + public void setDescriptions(String descriptions) {
  245 + this.descriptions = descriptions;
  246 + }
  247 +
  248 +// public String getCgsbm() {
  249 +// return cgsbm;
  250 +// }
  251 +//
  252 +// public void setCgsbm(String cgsbm) {
  253 +// this.cgsbm = cgsbm;
  254 +// }
  255 +
  256 + public String getJobCodeori() {
  257 + return jobCodeori;
  258 + }
  259 +
  260 + public void setJobCodeori(String jobCodeori) {
  261 + this.jobCodeori = jobCodeori;
  262 + }
  263 +
  264 + public String getJdCodeori() {
  265 + return jdCodeori;
  266 + }
  267 +
  268 + public void setJdCodeori(String jdCodeori) {
  269 + this.jdCodeori = jdCodeori;
  270 + }
  271 +
  272 + public String getRemark() {
  273 + return remark;
  274 + }
  275 +
  276 + public void setRemark(String remark) {
  277 + this.remark = remark;
  278 + }
  279 +
  280 + public Date getUpdateDate() {
  281 + return updateDate;
  282 + }
  283 +
  284 + public void setUpdateDate(Date updateDate) {
  285 + this.updateDate = updateDate;
  286 + }
  287 +
  288 + public Integer getDestroy() {
  289 + return destroy;
  290 + }
  291 +
  292 + public void setDestroy(Integer destroy) {
  293 + this.destroy = destroy;
  294 + }
  295 +}
src/main/java/com/bsth/entity/PersonnelCopy.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/entity/PersonnelCopy.java
  1 +package com.bsth.entity;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  4 +import org.hibernate.annotations.Formula;
  5 +
  6 +import javax.persistence.Column;
  7 +import javax.persistence.Entity;
  8 +import javax.persistence.GeneratedValue;
  9 +import javax.persistence.Id;
  10 +import javax.persistence.Table;
  11 +import java.util.Date;
  12 +
  13 +/**
  14 + *
  15 + * @ClassName : PersonnelCopy(人员实体类备份)
  16 + *
  17 + * @Author : bsth@lq
  18 + *
  19 + * @Description : TODO(人员)
  20 + *
  21 + * @Version 公交调度系统BS版 0.1
  22 + *
  23 + */
  24 +
  25 +//@Entity
  26 +//@Table(name = "bsth_c_personnel_copy")
  27 +//@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
  28 +public class PersonnelCopy {
  29 +
  30 + /** 主键Id */
  31 + @Id
  32 + @GeneratedValue
  33 + private Integer id;
  34 +
  35 + /** 所属公司 */
  36 +// @Column(nullable = false)
  37 + private String company;
  38 + /** 公司编码 */
  39 +// @Column(nullable = false)
  40 + private String companyCode;
  41 + /** 所属分公司 */
  42 + private String brancheCompany;
  43 + /** 分公司编码 */
  44 + private String brancheCompanyCode;
  45 + /** 组合公司分公司编码 */
  46 + @Formula(" concat(company_code, '_', branche_company_code) ")
  47 + private String cgsbm;
  48 +
  49 + /** 工号(员工编号带公司编码前缀) */
  50 +// @Column(nullable = false)
  51 + private String jobCode;
  52 + /** 姓名 */
  53 +// @Column(nullable = false)
  54 + private String personnelName;
  55 +
  56 + /** 运营服务证书号 */
  57 + private String papersCode;
  58 + /** 一卡通工作卡号 */
  59 + private String icCardCode;
  60 + /** 性别(字典类型sexType) */
  61 + private String personnelType;
  62 + /** 所属岗位/工种(字典类型gzType) */
  63 + private String posts;
  64 +
  65 + /** 工号 */
  66 +// @Column(nullable = false)
  67 + private String jobCodeori;
  68 + /** 身份证 */
  69 + private String card;
  70 +
  71 + @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  72 + private Date updateDate;
  73 +
  74 + /** 备注 */
  75 + private String remark;
  76 +
  77 + public PersonnelCopy() {}
  78 +
  79 + public PersonnelCopy(Object id, Object companyCode, Object gh) {
  80 + if (id != null) {
  81 + this.id = Integer.valueOf(id.toString());
  82 + }
  83 + if (companyCode != null) {
  84 + this.companyCode = companyCode.toString();
  85 + }
  86 + if (gh != null) {
  87 + this.jobCode = gh.toString();
  88 + }
  89 + }
  90 +
  91 + public String getCard() {
  92 + return card;
  93 + }
  94 +
  95 + public void setCard(String card) {
  96 + this.card = card;
  97 + }
  98 +
  99 + /** 人员编码(TODO:在原系统里没有,这里暂时留着) */
  100 + private String personnelCode;
  101 + /** 照片地址(TODO:在原系统里没有,这里暂时留着) */
  102 + private String personnelImg;
  103 + /** 线路编号(TODO:在原系统里没有,这里暂时留着) */
  104 + private String lineCode;
  105 + /** 联系电话(TODO:在原系统里没有,这里暂时留着) */
  106 + private String telphone;
  107 + /** 描述(TODO:在原系统里没有,这里暂时留着) */
  108 + private String descriptions;
  109 +
  110 + public Integer getId() {
  111 + return id;
  112 + }
  113 +
  114 + public void setId(Integer id) {
  115 + this.id = id;
  116 + }
  117 +
  118 + public String getCompany() {
  119 + return company;
  120 + }
  121 +
  122 + public void setCompany(String company) {
  123 + this.company = company;
  124 + }
  125 +
  126 + public String getCompanyCode() {
  127 + return companyCode;
  128 + }
  129 +
  130 + public void setCompanyCode(String companyCode) {
  131 + this.companyCode = companyCode;
  132 + }
  133 +
  134 + public String getBrancheCompany() {
  135 + return brancheCompany;
  136 + }
  137 +
  138 + public void setBrancheCompany(String brancheCompany) {
  139 + this.brancheCompany = brancheCompany;
  140 + }
  141 +
  142 + public String getBrancheCompanyCode() {
  143 + return brancheCompanyCode;
  144 + }
  145 +
  146 + public void setBrancheCompanyCode(String brancheCompanyCode) {
  147 + this.brancheCompanyCode = brancheCompanyCode;
  148 + }
  149 +
  150 + public String getJobCode() {
  151 + return jobCode;
  152 + }
  153 +
  154 + public void setJobCode(String jobCode) {
  155 + this.jobCode = jobCode;
  156 + }
  157 +
  158 + public String getPersonnelName() {
  159 + return personnelName;
  160 + }
  161 +
  162 + public void setPersonnelName(String personnelName) {
  163 + this.personnelName = personnelName;
  164 + }
  165 +
  166 + public String getPapersCode() {
  167 + return papersCode;
  168 + }
  169 +
  170 + public void setPapersCode(String papersCode) {
  171 + this.papersCode = papersCode;
  172 + }
  173 +
  174 + public String getIcCardCode() {
  175 + return icCardCode;
  176 + }
  177 +
  178 + public void setIcCardCode(String icCardCode) {
  179 + this.icCardCode = icCardCode;
  180 + }
  181 +
  182 + public String getPersonnelType() {
  183 + return personnelType;
  184 + }
  185 +
  186 + public void setPersonnelType(String personnelType) {
  187 + this.personnelType = personnelType;
  188 + }
  189 +
  190 + public String getPosts() {
  191 + return posts;
  192 + }
  193 +
  194 + public void setPosts(String posts) {
  195 + this.posts = posts;
  196 + }
  197 +
  198 + public String getPersonnelCode() {
  199 + return personnelCode;
  200 + }
  201 +
  202 + public void setPersonnelCode(String personnelCode) {
  203 + this.personnelCode = personnelCode;
  204 + }
  205 +
  206 + public String getPersonnelImg() {
  207 + return personnelImg;
  208 + }
  209 +
  210 + public void setPersonnelImg(String personnelImg) {
  211 + this.personnelImg = personnelImg;
  212 + }
  213 +
  214 + public String getLineCode() {
  215 + return lineCode;
  216 + }
  217 +
  218 + public void setLineCode(String lineCode) {
  219 + this.lineCode = lineCode;
  220 + }
  221 +
  222 + public String getTelphone() {
  223 + return telphone;
  224 + }
  225 +
  226 + public void setTelphone(String telphone) {
  227 + this.telphone = telphone;
  228 + }
  229 +
  230 + public String getDescriptions() {
  231 + return descriptions;
  232 + }
  233 +
  234 + public void setDescriptions(String descriptions) {
  235 + this.descriptions = descriptions;
  236 + }
  237 +
  238 + public String getCgsbm() {
  239 + return cgsbm;
  240 + }
  241 +
  242 + public void setCgsbm(String cgsbm) {
  243 + this.cgsbm = cgsbm;
  244 + }
  245 +
  246 + public String getJobCodeori() {
  247 + return jobCodeori;
  248 + }
  249 +
  250 + public void setJobCodeori(String jobCodeori) {
  251 + this.jobCodeori = jobCodeori;
  252 + }
  253 +
  254 + public String getRemark() {
  255 + return remark;
  256 + }
  257 +
  258 + public void setRemark(String remark) {
  259 + this.remark = remark;
  260 + }
  261 +
  262 + public Date getUpdateDate() {
  263 + return updateDate;
  264 + }
  265 +
  266 + public void setUpdateDate(Date updateDate) {
  267 + this.updateDate = updateDate;
  268 + }
  269 +}
src/main/java/com/bsth/handler/personnelUpdateHandler.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/handler/personnelUpdateHandler.java
  1 +package com.bsth.handler;
  2 +
  3 +import com.alibaba.fastjson.JSONArray;
  4 +import com.alibaba.fastjson.JSONObject;
  5 +import com.bsth.entity.Personnel;
  6 +import com.bsth.repository.PersonnelRepository;
  7 +import com.bsth.service.PersonnelService;
  8 +import com.bsth.util.DBUtils_Personnel;
  9 +import com.bsth.util.XmlToJson;
  10 +import com.bsth.wsdl.PJDataSerivce;
  11 +import com.bsth.wsdl.PJDataSerivceSoap;
  12 +import org.hibernate.collection.internal.PersistentBag;
  13 +import org.joda.time.DateTime;
  14 +import org.slf4j.Logger;
  15 +import org.slf4j.LoggerFactory;
  16 +import org.springframework.beans.factory.annotation.Autowired;
  17 +import org.springframework.jdbc.core.BeanPropertyRowMapper;
  18 +import org.springframework.jdbc.core.JdbcTemplate;
  19 +import org.springframework.stereotype.Component;
  20 +
  21 +import javax.xml.namespace.QName;
  22 +import java.net.URL;
  23 +import java.sql.Connection;
  24 +import java.sql.PreparedStatement;
  25 +import java.sql.ResultSet;
  26 +import java.sql.SQLException;
  27 +import java.util.ArrayList;
  28 +import java.util.HashMap;
  29 +import java.util.Iterator;
  30 +import java.util.List;
  31 +import java.util.Map;
  32 +
  33 +
  34 +@Component
  35 +public class personnelUpdateHandler {
  36 +
  37 + @Autowired
  38 + PersonnelService personnelService;
  39 +
  40 + @Autowired
  41 + PersonnelRepository repository;
  42 +
  43 + @Autowired
  44 + JdbcTemplate jdbcTemplate;
  45 +
  46 + Logger logger = LoggerFactory.getLogger(this.getClass());
  47 +
  48 + private static final QName SERVICE_NAME = new QName("http://www.pd-transport.com/", "PJDataSerivce");
  49 +
  50 + public void sync() {
  51 +
  52 + URL wsdlURL = PJDataSerivce.WSDL_LOCATION;
  53 +
  54 + PJDataSerivce ss = new PJDataSerivce(wsdlURL, SERVICE_NAME);
  55 + PJDataSerivceSoap port = ss.getPJDataSerivceSoap12();
  56 +
  57 +
  58 +
  59 +
  60 + try {
  61 + Connection conn ;
  62 + PreparedStatement ps;
  63 + ResultSet rs = null ;
  64 + DateTime dt = DateTime.now();
  65 + String rq = dt.toString("yyyy-MM-dd");
  66 + logger.info("同步人员数据: " + rq);
  67 + System.out.println("Invoking getEmployee...");
  68 + String _getEmployee_idCard = "";
  69 + /*String unintCode_sn = "KD01.0110";
  70 + String _getEmployee_sn = port.getEmployee(unintCode_sn, _getEmployee_idCard);
  71 + String unintCode_jg = "KD01.0111";
  72 + String _getEmployee_jg = port.getEmployee(unintCode_jg, _getEmployee_idCard);
  73 + String unintCode_yg = "KD01.0113";
  74 + String _getEmployee_yg = port.getEmployee(unintCode_yg, _getEmployee_idCard);
  75 + String unintCode_nh = "KD01.0112";
  76 + String _getEmployee_nh = port.getEmployee(unintCode_nh, _getEmployee_idCard);*/
  77 +
  78 + logger.info("金蝶数据同步到:bsth_c_personnel 表,开始");
  79 +
  80 + // 把所有人员设为停用状态,然后在用金蝶人员数据匹配,匹配上的设为在职
  81 + conn = DBUtils_Personnel.getConnection();
  82 + // 服务器
  83 + ps = conn.prepareStatement("UPDATE control.bsth_c_personnel SET destroy = 1");
  84 + // 本地
  85 +// ps = conn.prepareStatement("UPDATE pd_control.bsth_c_personnel SET destroy = 1");
  86 + ps.executeUpdate();
  87 +
  88 + // 取出所有调度人员,转存map
  89 + Map<String, Personnel> personnelMap= new HashMap<>();
  90 + Iterator<Personnel> perIterator=repository.findAll().iterator();
  91 +// List<Personnel> personnelList = new ArrayList<>();
  92 + while(perIterator.hasNext()){
  93 + Personnel per=perIterator.next();
  94 + personnelMap.put(per.getJobCode(),per);
  95 + // 工号补全6位
  96 +// String JobCodeori = per.getJobCodeori();
  97 +// while (JobCodeori.length() < 6){
  98 +// JobCodeori = "0"+JobCodeori;
  99 +// }
  100 +// per.setJobCodeori(JobCodeori);
  101 +// per.setJobCode(per.getCompanyCode()+"-"+JobCodeori);
  102 +// personnelList.add(per);
  103 + }
  104 + // 工号补全6位
  105 +// repository.save(personnelList);
  106 +
  107 + for(int i=0;i<4;i++){
  108 + String unintCode = "KD01.011"+i;
  109 + String _getEmployee__return = port.getEmployee(unintCode, _getEmployee_idCard);
  110 + String _getRetiredInfor_unintCode = null;
  111 + System.out.println("Invoking getRetiredInfor...");
  112 + String _getRetiredInfor_beginDate = "1900-01-01";
  113 + String _getRetiredInfor_endDate = rq;
  114 + JSONArray retiredInfor = new JSONArray();
  115 + if(_getRetiredInfor_unintCode != null){
  116 + String _getRetiredInfor__return = port.getRetiredInfor(unintCode, _getRetiredInfor_beginDate, _getRetiredInfor_endDate);
  117 + JSONObject jsonRetiredInfor= XmlToJson.xml2Json(_getRetiredInfor__return);
  118 + retiredInfor = JSONArray.parseArray(jsonRetiredInfor.get("Retire").toString());
  119 + }
  120 +
  121 + personnelService.matchPersonnel(retiredInfor,_getEmployee__return,i,personnelMap);
  122 + }
  123 +
  124 + logger.info("金蝶数据同步到:bsth_c_personnel 表,完成");
  125 +
  126 + logger.info("把bsth_c_personnel备份到:personnel库的bsth_c_personnel"+rq+" 表");
  127 + String sql="CREATE TABLE `bsth_c_personnel"+rq+"` (" +
  128 + " `id` int(11) NOT NULL ," +//AUTO_INCREMENT
  129 + " `branche_company` varchar(255) DEFAULT NULL," +
  130 + " `branche_company_code` varchar(255) DEFAULT NULL," +
  131 + " `company` varchar(255) DEFAULT NULL," +
  132 + " `company_code` varchar(255) NOT NULL," +
  133 + " `create_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP," +
  134 + " `descriptions` varchar(255) DEFAULT NULL," +
  135 + " `ic_card_code` varchar(255) DEFAULT NULL," +
  136 + " `job_code` varchar(255) NOT NULL," +
  137 + " `line_code` varchar(255) DEFAULT NULL," +
  138 + " `papers_code` varchar(255) DEFAULT NULL," +
  139 + " `personnel_code` varchar(255) DEFAULT NULL," +
  140 + " `personnel_img` varchar(255) DEFAULT NULL," +
  141 + " `personnel_name` varchar(255) NOT NULL," +
  142 + " `personnel_type` varchar(255) DEFAULT NULL," +
  143 + " `posts` varchar(255) DEFAULT NULL," +
  144 + " `telphone` varchar(255) DEFAULT NULL," +
  145 + " `update_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP," +
  146 + " `create_by` int(11) DEFAULT NULL," +
  147 + " `update_by` int(11) DEFAULT NULL," +
  148 + " `card` varchar(255) DEFAULT NULL," +
  149 + " `ic_rfid` varchar(255) DEFAULT NULL," +
  150 + " `id_rfid` varchar(255) DEFAULT NULL," +
  151 + " `tag_rfid` varchar(255) DEFAULT NULL," +
  152 + " `remark` varchar(255) DEFAULT NULL," +
  153 + " `job_codeori` varchar(255) NOT NULL," +
  154 + " `destroy` int(11)," +
  155 + " `jd_codeori` varchar(255)," +
  156 + "PRIMARY KEY (`id`)"+
  157 + ") ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8";
  158 +
  159 + int returnRs;
  160 + try {
  161 + logger.info("创建personnel库的bsth_c_personnel"+rq+" 表");
  162 +// conn = DBUtils_Personnel.getConnection();
  163 + ps = conn.prepareStatement("DROP TABLE IF EXISTS `bsth_c_personnel"+rq+"`");
  164 + ps.executeUpdate();
  165 + ps = conn.prepareStatement(sql);
  166 + returnRs = ps.executeUpdate();
  167 + if(returnRs == 0){
  168 + logger.info("备份数据到personnel库的bsth_c_personnel"+rq+" 表,开始");
  169 + // 服务器
  170 + sql = "INSERT into `bsth_c_personnel"+rq+"` (SELECT * FROM control.bsth_c_personnel)";
  171 + // 本地
  172 +// sql = "INSERT into `bsth_c_personnel"+rq+"` (SELECT * FROM pd_control.bsth_c_personnel)";
  173 + ps = conn.prepareStatement(sql);
  174 + returnRs = ps.executeUpdate();
  175 +
  176 + logger.info("备份数据到personnel库的bsth_c_personnel"+rq+" 表,完成");
  177 + }
  178 + } catch (SQLException e) {
  179 + // TODO Auto-generated catch block
  180 + e.printStackTrace();
  181 + }finally {
  182 + DBUtils_Personnel.close(rs, ps, conn);
  183 + }
  184 +
  185 +
  186 +// logger.info("把bsth_c_personnel_copy数据同步到:bsth_c_personnel 表,开始");
  187 +// List<Personnel> retuenList = jdbcTemplate.query("select * from bsth_c_personnel_copy",new BeanPropertyRowMapper(Personnel.class));
  188 +// repository.save(retuenList);
  189 +// logger.info("bsth_c_personnel_copy数据同步到:bsth_c_personnel 表,完成");
  190 +// jdbcTemplate.execute()
  191 +// // 备份数据
  192 +// jdbcTemplate.update("INSERT into `bsth_c_personnel"+rq+"` (SELECT * FROM pd_control.bsth_c_personnel)");
  193 +// jdbcTemplate.update("insert into bsth_c_personnel_copy select * from bsth_c_personnel");
  194 +// String _getEmployee__return = _getEmployee_sn + _getEmployee_jg + _getEmployee_yg + _getEmployee_nh;
  195 +// JSONObject jsonInfor = XmlToJson.xml2Json(_getEmployee__return);
  196 +// System.out.println("getEmployee.result=" + _getEmployee__return);
  197 +
  198 + logger.info("同步完成: " + rq);
  199 + } catch (Exception e) {
  200 + logger.error("", e);
  201 + }
  202 + }
  203 +}
src/main/java/com/bsth/repository/PersonnelCopyRepository.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/repository/PersonnelCopyRepository.java
  1 +package com.bsth.repository;
  2 +
  3 +import com.bsth.entity.PersonnelCopy;
  4 +import org.springframework.data.repository.PagingAndSortingRepository;
  5 +import org.springframework.stereotype.Repository;
  6 +
  7 +@Repository
  8 +public interface PersonnelCopyRepository extends PagingAndSortingRepository<PersonnelCopy, Long> {
  9 +
  10 +// @Query(value="select s from Personnel s where s.id in(select e.jsy.id from EmployeeConfigInfo e where e.xl.id = ?1) ")
  11 +// List<Personnel> findJsysByLineId(Integer lineId);
  12 +//
  13 +// @Query(value="select s from Personnel s where s.id in(select e.spy.id from EmployeeConfigInfo e where e.xl.id = ?1) ")
  14 +// List<Personnel> findSpysByLineId(Integer lineId);
  15 +
  16 +// @Query(value="select s from Personnel s ")
  17 +// List<Personnel> findAll();
  18 +
  19 +}
src/main/java/com/bsth/repository/PersonnelRepository.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/repository/PersonnelRepository.java
  1 +package com.bsth.repository;
  2 +
  3 +import com.bsth.entity.Personnel;
  4 +import org.springframework.data.jpa.repository.Query;
  5 +import org.springframework.data.repository.PagingAndSortingRepository;
  6 +import org.springframework.stereotype.Repository;
  7 +
  8 +import java.util.List;
  9 +
  10 +@Repository
  11 +public interface PersonnelRepository extends PagingAndSortingRepository<Personnel, Long> {
  12 +
  13 +// @Query(value="select s from Personnel s where s.id in(select e.jsy.id from EmployeeConfigInfo e where e.xl.id = ?1) ")
  14 +// List<Personnel> findJsysByLineId(Integer lineId);
  15 +//
  16 +// @Query(value="select s from Personnel s where s.id in(select e.spy.id from EmployeeConfigInfo e where e.xl.id = ?1) ")
  17 +// List<Personnel> findSpysByLineId(Integer lineId);
  18 +
  19 +// @Query(value="select s from Personnel s ")
  20 +// List<Personnel> findAll();
  21 +
  22 +}
src/main/java/com/bsth/service/PersonnelService.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/service/PersonnelService.java
  1 +package com.bsth.service;
  2 +
  3 +import com.alibaba.fastjson.JSONArray;
  4 +import com.bsth.entity.Personnel;
  5 +import com.bsth.entity.PersonnelCopy;
  6 +
  7 +import java.util.List;
  8 +import java.util.Map;
  9 +
  10 +public interface PersonnelService {
  11 + List<PersonnelCopy> matchPersonnel(JSONArray retiredInfor,String jobCode, int i,Map<String, Personnel> personnelMap);
  12 +}
src/main/java/com/bsth/service/impl/PersonnelServiceImpl.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/service/impl/PersonnelServiceImpl.java
  1 +package com.bsth.service.impl;
  2 +
  3 +import com.alibaba.fastjson.JSONArray;
  4 +import com.alibaba.fastjson.JSONObject;
  5 +import com.bsth.entity.Business;
  6 +import com.bsth.entity.Personnel;
  7 +import com.bsth.entity.PersonnelCopy;
  8 +import com.bsth.repository.PersonnelRepository;
  9 +import com.bsth.service.PersonnelService;
  10 +import com.bsth.util.XmlToJson;
  11 +import org.slf4j.Logger;
  12 +import org.slf4j.LoggerFactory;
  13 +import org.springframework.beans.factory.annotation.Autowired;
  14 +import org.springframework.data.annotation.Transient;
  15 +import org.springframework.jdbc.core.BeanPropertyRowMapper;
  16 +import org.springframework.jdbc.core.JdbcTemplate;
  17 +import org.springframework.stereotype.Service;
  18 +
  19 +import java.util.ArrayList;
  20 +import java.util.Date;
  21 +import java.util.HashMap;
  22 +import java.util.Iterator;
  23 +import java.util.List;
  24 +import java.util.Map;
  25 +
  26 +/**
  27 + * Created by xu on 16/6/15.
  28 + */
  29 +@Service
  30 +public class PersonnelServiceImpl implements PersonnelService {
  31 + // TODO 以后过滤退休人员
  32 + @Autowired
  33 + PersonnelRepository repository;
  34 +
  35 + @Autowired
  36 + JdbcTemplate jdbcTemplate;
  37 +
  38 + Logger logger = LoggerFactory.getLogger(this.getClass());
  39 +
  40 + @Transient
  41 + @Override
  42 + public List<PersonnelCopy> matchPersonnel(JSONArray retiredInfor,String _getEmployee__return,int index,Map<String, Personnel> personnelMap) {
  43 +
  44 + Map<String,String> gzDictionaryMap = new HashMap<>();
  45 + gzDictionaryMap.put("路线驾驶员","1");
  46 + gzDictionaryMap.put("团客车驾驶员","1");
  47 + gzDictionaryMap.put("后方驾驶员","1");
  48 + gzDictionaryMap.put("实习驾驶员","1");
  49 + gzDictionaryMap.put("调度员","2");
  50 + gzDictionaryMap.put("售票员","3");
  51 + gzDictionaryMap.put("公共汽电车售票员","3");
  52 + gzDictionaryMap.put("管理员","3");
  53 + gzDictionaryMap.put("站员","4");
  54 + gzDictionaryMap.put("安检员","6");
  55 + gzDictionaryMap.put("机务","7");
  56 + gzDictionaryMap.put("机务员/质检员","7");
  57 + gzDictionaryMap.put("引导员","8");
  58 + gzDictionaryMap.put("乘务员","9");
  59 + gzDictionaryMap.put("线长(正职)","10");
  60 + gzDictionaryMap.put("线长(副职)","10");
  61 + gzDictionaryMap.put("见习管理人员","11");
  62 + gzDictionaryMap.put("公司部门管理人员","11");
  63 + gzDictionaryMap.put("机务员/警消人员","12");
  64 + gzDictionaryMap.put("线长(副职)","13");
  65 + gzDictionaryMap.put("见习管理人员","11");
  66 + gzDictionaryMap.put("公司部门管理人员","11");
  67 + gzDictionaryMap.put("机务员/警消人员","12");
  68 + gzDictionaryMap.put("票务人员","13");
  69 + gzDictionaryMap.put("其他服务人员","14");
  70 +
  71 + String sql="select * from bsth_c_business ";
  72 + List<Business> businessList=jdbcTemplate.query(sql, new BeanPropertyRowMapper(Business.class));
  73 + Map<String,Map<String,Business>> businessMap = new HashMap<>();
  74 + for (Business bu:businessList) {
  75 +
  76 + Map<String,Business> buMap = new HashMap<>();
  77 + if (businessMap.get(bu.getUpCode()) != null)
  78 + buMap = businessMap.get(bu.getUpCode());
  79 +
  80 + /*if(bu.getUpCode().equals("55"))
  81 + buMap.put(bu.getBusinessName().substring(2),bu);
  82 + else*/
  83 + buMap.put(bu.getBusinessName(),bu);
  84 +
  85 + businessMap.put(bu.getUpCode(),buMap);
  86 + }
  87 +
  88 + List<Personnel> newPersonnel = new ArrayList<>();
  89 +
  90 +// Map<String, Object> retiredInforMap = new HashMap<>();
  91 + try{
  92 +// if(retiredInfor.size() > 0){
  93 +// for(int i=0;i<retiredInfor.size()-1; i++){
  94 +// JSONObject pjson = retiredInfor.getJSONObject(i);
  95 +// String codeArr[] = pjson.getString("Code").split("-");
  96 +// String code = "",
  97 +// companyCode="";
  98 +//
  99 +// if(codeArr.length > 1){
  100 +// if (index == 0) {
  101 +// // 上南
  102 +// code = 55+"-"+codeArr[1];
  103 +// companyCode = "55";
  104 +// } else if (index == 1) {
  105 +// // 金高
  106 +// code = 22+"-"+codeArr[1];
  107 +// companyCode = "22";
  108 +// } else if (index == 2) {
  109 +// // 南汇
  110 +// code = 26+"-"+codeArr[1];
  111 +// companyCode = "26";
  112 +// } else if(index == 3){
  113 +// // 杨高
  114 +// code = "05"+"-"+codeArr[1];
  115 +// companyCode = "05";
  116 +// }
  117 +//// retiredInforMap.put(code,pjson);
  118 +// }
  119 +// }
  120 +// }
  121 +
  122 + // 金蝶人员数据转为json,然后遍历匹配
  123 + JSONObject jsonInfor = XmlToJson.xml2Json(_getEmployee__return);
  124 + System.out.println("getEmployee.result=" + _getEmployee__return);
  125 +
  126 +
  127 + JSONArray jsonArr = JSONArray.parseArray(jsonInfor.get("Emp").toString());
  128 + for(int i=0;i<jsonArr.size()-1; i++){
  129 + JSONObject pjson = jsonArr.getJSONObject(i);
  130 + String codeArr[] = pjson.getString("Code").split("-");
  131 + String JobCodeori = codeArr[1];
  132 + while (JobCodeori.length() < 6){
  133 + JobCodeori = "0"+JobCodeori;
  134 + }
  135 +
  136 +
  137 +// Personnel p = new Personnel();
  138 +// p.setJdCodeori(pjson.getString("Code"));
  139 +// p.setJobCodeori(JobCodeori);
  140 +// p.setPersonnelName(pjson.getString("EmployeeName"));
  141 +// p.setCompany(pjson.getString("CompanyName"));
  142 +//
  143 +// newPersonnel.add(p);
  144 +
  145 + String code = "",
  146 + companyCode="",
  147 + company="";
  148 + Business business = new Business();
  149 + String companyName = pjson.getString("CompanyName");
  150 +
  151 + // 人员数据匹配公司
  152 + if (index == 0) {
  153 + // 上南
  154 + code = 55+"-"+JobCodeori;
  155 + companyCode = "55";
  156 + company = "上南公司";
  157 + if (companyName.indexOf("一分") > -1) {
  158 + business = businessMap.get(companyCode).get("上南一分公司");
  159 + } else if (companyName.indexOf("二分") > -1) {
  160 + business = businessMap.get(companyCode).get("上南二分公司");
  161 + } else if (companyName.indexOf("三分") > -1) {
  162 + business = businessMap.get(companyCode).get("上南三分公司");
  163 + } else if (companyName.indexOf("六分") > -1) {
  164 + business = businessMap.get(companyCode).get("上南六分公司");
  165 + } else if (companyName.indexOf("山南") > -1) {
  166 + business = businessMap.get(companyCode).get("山南培训部");
  167 + } else {
  168 + business = businessMap.get(companyCode).get("其它分公司");
  169 + }
  170 + } else if (index == 1) {
  171 + // 金高
  172 + code = 22+"-"+JobCodeori;
  173 + companyCode = "22";
  174 + company = "金高公司";
  175 + if (companyName.indexOf("一分") > -1) {
  176 + business = businessMap.get(companyCode).get("一分公司");
  177 + } else if (companyName.indexOf("二分") > -1) {
  178 + business = businessMap.get(companyCode).get("二分公司");
  179 + } else if (companyName.indexOf("三分") > -1) {
  180 + business = businessMap.get(companyCode).get("三分公司");
  181 + } else if (companyName.indexOf("四分") > -1) {
  182 + business = businessMap.get(companyCode).get("四分公司");
  183 + } else {
  184 + business = businessMap.get(companyCode).get("其它分公司");
  185 + }
  186 + } else if (index == 2) {
  187 + // 南汇
  188 + code = 26+"-"+JobCodeori;
  189 + companyCode = "26";
  190 + company = "南汇公司";
  191 + if (companyName.indexOf("一分") > -1) {
  192 + business = businessMap.get(companyCode).get("南汇一分");
  193 + } else if (companyName.indexOf("二分") > -1) {
  194 + business = businessMap.get(companyCode).get("南汇二分");
  195 + } else if (companyName.indexOf("三分") > -1) {
  196 + business = businessMap.get(companyCode).get("南汇三分");
  197 + } else if (companyName.indexOf("维修") > -1) {
  198 + business = businessMap.get(companyCode).get("南汇维修公司");
  199 + } else if (companyName.indexOf("南汇公司") > -1) {
  200 + business = businessMap.get(companyCode).get("南汇公司");
  201 + } else if (companyName.indexOf("航头") > -1) {
  202 + business = businessMap.get(companyCode).get("航头枢纽站");
  203 + } else {
  204 + business = businessMap.get(companyCode).get("其它分公司");
  205 + }
  206 + } else if(index == 3){
  207 + code = "05"+"-"+JobCodeori;
  208 + companyCode = "05";
  209 + company = "杨高公司";
  210 + if (companyName.indexOf("川沙") > -1) {
  211 + business = businessMap.get(companyCode).get("川沙分公司");
  212 + } else if (companyName.indexOf("金桥") > -1) {
  213 + business = businessMap.get(companyCode).get("金桥分公司");
  214 + } else if (companyName.indexOf("杨高") > -1) {
  215 + business = businessMap.get(companyCode).get("杨高分公司");
  216 + } else if (companyName.indexOf("周浦") > -1) {
  217 + business = businessMap.get(companyCode).get("周浦分公司");
  218 + } else if (companyName.indexOf("芦潮港") > -1) {
  219 + business = businessMap.get(companyCode).get("芦潮港分公司");
  220 + } else {
  221 + business = businessMap.get(companyCode).get("其它分公司");
  222 + }
  223 + }
  224 +
  225 +//
  226 +// if(pjson.getString("Code").equals("03-S07265") ||pjson.getString("Code").equals("03-S07273") ||pjson.getString("Code").equals("03-S07264")
  227 +// ||pjson.getString("Code").equals("03-S07269") ||pjson.getString("Code").equals("03-S07274") ||pjson.getString("Code").equals("03-S07275")
  228 +// ||pjson.getString("Code").equals("03-S07267") ||pjson.getString("Code").equals("03-S07268") ||pjson.getString("Code").equals("05-006008")
  229 +// ||pjson.getString("Code").equals("02-017122")){
  230 +// System.out.print(pjson);
  231 +// }
  232 +// if(pjson.getString("EmployeeName").equals("吴燕辉") || pjson.getString("EmployeeName").equals("顾振军")|| pjson.getString("EmployeeName").equals("宋荣甲")){
  233 +// System.out.print(pjson);
  234 +// }
  235 +
  236 + /*if(codeArr[0].equals("02")){
  237 + code = "05"+"-"+JobCodeori;
  238 + companyCode = "05";
  239 + company = "杨高公司";
  240 + } else if(codeArr[0].equals("03")){
  241 + code = 55+"-"+JobCodeori;
  242 + companyCode = "55";
  243 + company = "上南公司";
  244 + } else if(codeArr[0].equals("04")){
  245 + code = 22+"-"+JobCodeori;
  246 + companyCode = "22";
  247 + company = "金高公司";
  248 + } else if(codeArr[0].equals("05")){
  249 + code = 26+"-"+JobCodeori;
  250 + companyCode = "26";
  251 + company = "南汇公司";
  252 + }*/
  253 +
  254 + Personnel p = personnelMap.get(code);
  255 +// Object isRetiredInfor = retiredInforMap.get(code);
  256 + // p不为空这表示调度数据和金蝶数据能匹配、则更新数据,不能匹配这新增数据
  257 + if(p != null ){
  258 +// p.setCard(pjson.getString("IDCardID"));// 第一次需要添加身份证,后面则不需要了
  259 + if(pjson.getString("IDCardID").equals(p.getCard())){
  260 + p.setBrancheCompanyCode(business.getBusinessCode());
  261 + p.setBrancheCompany(business.getBusinessName());
  262 + p.setPersonnelName(pjson.getString("EmployeeName"));
  263 + p.setDescriptions(pjson.getString("UnitFullName"));
  264 + p.setJdCodeori(pjson.getString("Code")); // 金蝶工号
  265 + p.setUpdateDate(new Date());
  266 + // 设置人员为在职状态
  267 + p.setDestroy(0);
  268 + newPersonnel.add(p);
  269 + }
  270 + } else {
  271 + p = new Personnel();
  272 + p.setJobCode(code);
  273 + p.setJobCodeori(JobCodeori);
  274 + p.setCard(pjson.getString("IDCardID"));
  275 +// String companyName = pjson.getString("CompanyName");
  276 +// // 搜索分公司
  277 +// Business business = businessMap.get(companyCode).get(companyName);
  278 +// if(business != null){
  279 +// } else {
  280 +// p.setBrancheCompanyCode("");
  281 +// p.setBrancheCompany("");
  282 +// }
  283 +
  284 + p.setBrancheCompanyCode(business.getBusinessCode());
  285 + p.setBrancheCompany(business.getBusinessName());
  286 + p.setCompanyCode(companyCode);
  287 + p.setCompany(company);
  288 + p.setJdCodeori(pjson.getString("Code")); // 金蝶工号
  289 + p.setPersonnelName(pjson.getString("EmployeeName"));
  290 + p.setPersonnelType(pjson.getString("SexType").indexOf("男") > -1 ?"1":"2");
  291 + p.setPosts(gzDictionaryMap.get(pjson.getString("PositName")) == null?"14":gzDictionaryMap.get(pjson.getString("PositName")));
  292 + p.setDescriptions(pjson.getString("UnitFullName"));
  293 + p.setTelphone(pjson.getString("Telphone"));
  294 + p.setUpdateDate(new Date());
  295 + p.setRemark("新增");
  296 + // 设置人员为在职状态
  297 + p.setDestroy(0);
  298 +// if(isRetiredInfor != null && isRetiredInfor != ""){
  299 +// p.setRemark("退休");
  300 +// }
  301 + newPersonnel.add(p);
  302 + }
  303 + }
  304 + // 批量保存
  305 + repository.save(newPersonnel);
  306 +
  307 + } catch (Exception e) {
  308 + logger.error("", e);
  309 + }
  310 + return null;
  311 + }
  312 +
  313 + /*public Map<String, Personnel> loadPersonnel(){
  314 + Map<String, Personnel> personnelMap= new HashMap<>();
  315 + Iterator<Personnel> perIterator=repository.findAll().iterator();
  316 + Personnel per;
  317 + while(perIterator.hasNext()){
  318 + per=perIterator.next();
  319 + personnelMap.put(per.getJobCode(),per);
  320 + }
  321 + return personnelMap;
  322 +
  323 + }*/
  324 +}
src/main/java/com/bsth/thread/PersonnelUpdateThrad.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/thread/PersonnelUpdateThrad.java
  1 +package com.bsth.thread;
  2 +
  3 +import com.bsth.handler.personnelUpdateHandler;
  4 +import org.slf4j.Logger;
  5 +import org.slf4j.LoggerFactory;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.stereotype.Component;
  8 +
  9 +/**
  10 + * @ClassName: PersonnelUpdateThrad.java
  11 + * @Description: TODO(用金蝶数据更新人员数据)
  12 + * @author: YouRuiFeng
  13 + * @date: 2019-06-26
  14 + *
  15 + */
  16 +@Component
  17 +public class PersonnelUpdateThrad extends Thread {
  18 + @Autowired
  19 + personnelUpdateHandler personnelUpdateHandler;
  20 +
  21 + Logger logger = LoggerFactory.getLogger(this.getClass());
  22 +
  23 + @Override
  24 + public void run() {
  25 + try {
  26 + personnelUpdateHandler.sync();
  27 + } catch (Exception e) {
  28 + logger.error("", e);
  29 + }
  30 + }
  31 +}
src/main/java/com/bsth/util/Arith.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/util/Arith.java
  1 +package com.bsth.util;
  2 +
  3 +import java.math.BigDecimal;
  4 +
  5 +/**
  6 + * 进行BigDecimal对象的加减乘除,四舍五入等运算的工具类
  7 + * @author ameyume
  8 + *
  9 + */
  10 +public class Arith {
  11 +
  12 + /**
  13 + * 由于Java的简单类型不能够精确的对浮点数进行运算,这个工具类提供精
  14 + * 确的浮点数运算,包括加减乘除和四舍五入。
  15 + */
  16 + //默认除法运算精度
  17 + private static final int DEF_DIV_SCALE = 10;
  18 +
  19 + //这个类不能实例化
  20 + private Arith(){
  21 + }
  22 +
  23 + /**
  24 + * 提供精确的加法运算。
  25 + * @param v1 被加数
  26 + * @param v2 加数
  27 + * @return 两个参数的和
  28 + */
  29 + public static double add(Object v1,Object v2){
  30 + BigDecimal b1 = new BigDecimal(String.valueOf(v1));
  31 + BigDecimal b2 = new BigDecimal(String.valueOf(v2));
  32 + return b1.add(b2).doubleValue();
  33 + }
  34 +
  35 + /**
  36 + * 提供精确的减法运算。
  37 + * @param v1 被减数
  38 + * @param v2 减数
  39 + * @return 两个参数的差
  40 + */
  41 + public static double sub(Object v1,Object v2){
  42 + BigDecimal b1 = new BigDecimal(String.valueOf(v1));
  43 + BigDecimal b2 = new BigDecimal(String.valueOf(v2));
  44 + return b1.subtract(b2).doubleValue();
  45 + }
  46 +
  47 + /**
  48 + * 提供精确的乘法运算。
  49 + * @param v1 被乘数
  50 + * @param v2 乘数
  51 + * @return 两个参数的积
  52 + */
  53 + public static double mul(Object v1,Object v2){
  54 + BigDecimal b1 = new BigDecimal(String.valueOf(v1));
  55 + BigDecimal b2 = new BigDecimal(String.valueOf(v2));
  56 + return b1.multiply(b2).doubleValue();
  57 + }
  58 +
  59 + /**
  60 + * 提供(相对)精确的除法运算,当发生除不尽的情况时,精确到
  61 + * 小数点以后10位,以后的数字四舍五入。
  62 + * @param v1 被除数
  63 + * @param v2 除数
  64 + * @return 两个参数的商
  65 + */
  66 + public static double div(Object v1,Object v2){
  67 + return div(v1,v2,DEF_DIV_SCALE);
  68 + }
  69 +
  70 + /**
  71 + * 提供(相对)精确的除法运算。当发生除不尽的情况时,由scale参数指
  72 + * 定精度,以后的数字四舍五入。
  73 + * @param v1 被除数
  74 + * @param v2 除数
  75 + * @param scale 表示表示需要精确到小数点以后几位。
  76 + * @return 两个参数的商
  77 + */
  78 + public static double div(Object v1,Object v2,int scale){
  79 + if(scale<0){
  80 + throw new IllegalArgumentException(
  81 + "The scale must be a positive integer or zero");
  82 + }
  83 + BigDecimal b1 = new BigDecimal(String.valueOf(v1));
  84 + BigDecimal b2 = new BigDecimal(String.valueOf(v2));
  85 + return b1.divide(b2,scale,BigDecimal.ROUND_HALF_UP).doubleValue();
  86 + }
  87 +
  88 + /**
  89 + * 提供精确的小数位四舍五入处理。
  90 + * @param v 需要四舍五入的数字
  91 + * @param scale 小数点后保留几位
  92 + * @return 四舍五入后的结果
  93 + */
  94 + public static double round(Object v,int scale){
  95 + if(scale<0){
  96 + throw new IllegalArgumentException(
  97 + "The scale must be a positive integer or zero");
  98 + }
  99 + BigDecimal b = new BigDecimal(String.valueOf(v));
  100 + BigDecimal one = new BigDecimal("1");
  101 + return b.divide(one,scale,BigDecimal.ROUND_HALF_UP).doubleValue();
  102 + }
  103 +
  104 + /**
  105 + * 提供精确的类型转换(Float)
  106 + * @param v 需要被转换的数字
  107 + * @return 返回转换结果
  108 + */
  109 + public static float convertsToFloat(double v){
  110 + BigDecimal b = new BigDecimal(v);
  111 + return b.floatValue();
  112 + }
  113 +
  114 + /**
  115 + * 提供精确的类型转换(Int)不进行四舍五入
  116 + * @param v 需要被转换的数字
  117 + * @return 返回转换结果
  118 + */
  119 + public static int convertsToInt(double v){
  120 + BigDecimal b = new BigDecimal(v);
  121 + return b.intValue();
  122 + }
  123 +
  124 + /**
  125 + * 提供精确的类型转换(Long)
  126 + * @param v 需要被转换的数字
  127 + * @return 返回转换结果
  128 + */
  129 + public static long convertsToLong(double v){
  130 + BigDecimal b = new BigDecimal(v);
  131 + return b.longValue();
  132 + }
  133 +
  134 + /**
  135 + * 返回两个数中大的一个值
  136 + * @param v1 需要被对比的第一个数
  137 + * @param v2 需要被对比的第二个数
  138 + * @return 返回两个数中大的一个值
  139 + */
  140 + public static double returnMax(double v1,double v2){
  141 + BigDecimal b1 = new BigDecimal(v1);
  142 + BigDecimal b2 = new BigDecimal(v2);
  143 + return b1.max(b2).doubleValue();
  144 + }
  145 +
  146 + /**
  147 + * 返回两个数中小的一个值
  148 + * @param v1 需要被对比的第一个数
  149 + * @param v2 需要被对比的第二个数
  150 + * @return 返回两个数中小的一个值
  151 + */
  152 + public static double returnMin(double v1,double v2){
  153 + BigDecimal b1 = new BigDecimal(v1);
  154 + BigDecimal b2 = new BigDecimal(v2);
  155 + return b1.min(b2).doubleValue();
  156 + }
  157 +
  158 + /**
  159 + * 精确对比两个数字
  160 + * @param v1 需要被对比的第一个数
  161 + * @param v2 需要被对比的第二个数
  162 + * @return 如果两个数一样则返回0,如果第一个数比第二个数大则返回1,反之返回-1
  163 + */
  164 + public static int compareTo(double v1,double v2){
  165 + BigDecimal b1 = new BigDecimal(v1);
  166 + BigDecimal b2 = new BigDecimal(v2);
  167 + return b1.compareTo(b2);
  168 + }
  169 +
  170 +}
0 \ No newline at end of file 171 \ No newline at end of file
src/main/java/com/bsth/util/ConfigUtil.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/util/ConfigUtil.java
  1 +package com.bsth.util;
  2 +
  3 +public class ConfigUtil {
  4 +
  5 + static Tools tools;
  6 +
  7 + static{
  8 + tools = new Tools("application.properties");
  9 + String active = tools.getValue("spring.profiles.active");
  10 + tools = new Tools("application-"+active+".properties");
  11 + }
  12 +
  13 + public static String get(String key){
  14 + return tools.getValue(key);
  15 + }
  16 +}
src/main/java/com/bsth/util/ConvertUtil.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/util/ConvertUtil.java
  1 +package com.bsth.util;
  2 +
  3 +import com.google.common.collect.ArrayListMultimap;
  4 +import org.joda.time.format.DateTimeFormat;
  5 +import org.joda.time.format.DateTimeFormatter;
  6 +import org.slf4j.Logger;
  7 +import org.slf4j.LoggerFactory;
  8 +
  9 +import java.lang.reflect.Field;
  10 +import java.util.*;
  11 +
  12 +/**
  13 + * 数据转换
  14 + * Created by panzhao on 2017/3/13.
  15 + */
  16 +public class ConvertUtil<T> {
  17 +
  18 + Logger logger = LoggerFactory.getLogger(this.getClass());
  19 + private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyyMMdd");
  20 +
  21 + /**
  22 + * 根据指定字段 将 list 分组
  23 + *
  24 + * @param list
  25 + * @param separator 字段使用分隔符连接 组成key
  26 + * @param fields
  27 + * @return
  28 + */
  29 + public ArrayListMultimap<String, T> groupMultiList(List<T> list, String separator, Field... fields) {
  30 + ArrayListMultimap<String, T> multimap = ArrayListMultimap.create();
  31 +
  32 + String key;
  33 + //Object field;
  34 + try {
  35 + for (T t : list) {
  36 +
  37 + key = "";
  38 + for (Field f : fields) {
  39 + f.setAccessible(true);
  40 + //日期类型格式化为 YYYY-MM-DD
  41 + if (f.getType().equals(Date.class))
  42 + key += (separator + fmtyyyyMMdd.print(((Date) f.get(t)).getTime()));
  43 + else
  44 + key += (separator + f.get(t).toString());
  45 + }
  46 + key = key.substring(1);
  47 +
  48 + multimap.put(key, t);
  49 + }
  50 + } catch (Exception e) {
  51 + logger.error("", e);
  52 + }
  53 +
  54 + return multimap;
  55 + }
  56 +
  57 + /**
  58 + * 根据指定字段 将 list 分组
  59 + *
  60 + * @param list
  61 + * @param separator 字段使用分隔符连接 组成key
  62 + * @param fields
  63 + * @return
  64 + */
  65 + public Map<String, T> groupList(List<T> list, String separator, Field... fields) {
  66 + Map<String, T> map = new HashMap<>();
  67 +
  68 + String key;
  69 + //Object field;
  70 + try {
  71 + for (T t : list) {
  72 +
  73 + key = "";
  74 + for (Field f : fields) {
  75 + f.setAccessible(true);
  76 + //日期类型格式化为 YYYY-MM-DD
  77 + if (f.getType().equals(Date.class))
  78 + key += (separator + fmtyyyyMMdd.print(((Date) f.get(t)).getTime()));
  79 + else
  80 + key += (separator + f.get(t).toString());
  81 + }
  82 + key = key.substring(1);
  83 +
  84 + map.put(key, t);
  85 + }
  86 + } catch (Exception e) {
  87 + logger.error("", e);
  88 + }
  89 +
  90 + return map;
  91 + }
  92 +
  93 + /**
  94 + * 计算并集
  95 + *
  96 + * @param all
  97 + * @param sub
  98 + * @return
  99 + */
  100 + public List<String> calcUnion(Collection<String> all, Collection<String> sub) {
  101 + List<String> rs = new ArrayList<>();
  102 +
  103 + for (String str : all) {
  104 + if (sub.contains(str))
  105 + rs.add(str);
  106 + }
  107 + return rs;
  108 + }
  109 +
  110 + /**
  111 + * 计算补集
  112 + *
  113 + * @param all
  114 + * @param sub
  115 + * @return
  116 + */
  117 + public List<String> calcComplement(Collection<String> all, Collection<String> sub) {
  118 + List<String> rs = new ArrayList<>();
  119 +
  120 + for (String str : all) {
  121 + if (!sub.contains(str))
  122 + rs.add(str);
  123 + }
  124 + return rs;
  125 + }
  126 +}
src/main/java/com/bsth/util/DBUtils_Personnel.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/util/DBUtils_Personnel.java
  1 +package com.bsth.util;
  2 +
  3 +import com.mchange.v2.c3p0.DataSources;
  4 +import org.apache.log4j.Logger;
  5 +
  6 +import javax.sql.DataSource;
  7 +import java.io.FileNotFoundException;
  8 +import java.io.IOException;
  9 +import java.sql.Connection;
  10 +import java.sql.ResultSet;
  11 +import java.sql.SQLException;
  12 +import java.sql.Statement;
  13 +import java.util.HashMap;
  14 +import java.util.Map;
  15 +import java.util.Properties;
  16 +
  17 +/**
  18 + * 数据备份personnel库连接池
  19 + * @author PanZhao
  20 + *
  21 + */
  22 +//@Component
  23 +public class DBUtils_Personnel {
  24 +
  25 + private static String url = null;
  26 +
  27 + private static String username = null;
  28 +
  29 + private static String pwd = null;
  30 +
  31 + private static DataSource ds_pooled;
  32 +
  33 + static Logger logger = Logger.getLogger(DBUtils_Personnel.class);
  34 +
  35 + static {
  36 + Properties env = new Properties();
  37 +
  38 + try {
  39 + env.load(DBUtils_Personnel.class.getClassLoader().getResourceAsStream("personnel-jdbc.properties"));
  40 + // 1. 加载驱动类
  41 + Class.forName(env.getProperty("ms.mysql.driver"));
  42 +
  43 + url = env.getProperty("ms.mysql.url");
  44 + username = env.getProperty("ms.mysql.username");
  45 + pwd = env.getProperty("ms.mysql.password");
  46 +
  47 + // 设置连接数据库的配置信息
  48 + DataSource ds_unpooled = DataSources.unpooledDataSource(url,
  49 + username, pwd);
  50 +
  51 + Map<String, Object> pool_conf = new HashMap<String, Object>();
  52 + // 设置最大连接数
  53 + pool_conf.put("maxPoolSize", 10);
  54 +
  55 + pool_conf.put("testConnectionOnCheckout", false);
  56 + //异步检测连接的有效性
  57 + pool_conf.put("testConnectionOnCheckin", true);
  58 + //30秒检测一次
  59 + pool_conf.put("idleConnectionTestPeriod", 30);
  60 + ds_pooled = DataSources.pooledDataSource(ds_unpooled, pool_conf);
  61 + } catch (FileNotFoundException e) {
  62 + logger.error(e.toString());
  63 + e.printStackTrace();
  64 + } catch (IOException e) {
  65 + logger.error(e.toString());
  66 + e.printStackTrace();
  67 + } catch (ClassNotFoundException e) {
  68 + logger.error(e.toString());
  69 + e.printStackTrace();
  70 + } catch (SQLException e) {
  71 + logger.error(e.toString());
  72 + e.printStackTrace();
  73 + }
  74 + }
  75 +
  76 + /**
  77 + * 获取连接对象
  78 + */
  79 + public static Connection getConnection() throws SQLException {
  80 + return ds_pooled.getConnection();
  81 + }
  82 +
  83 + /**
  84 + * 释放连接池资源
  85 + */
  86 + public static void clearup() {
  87 + if (ds_pooled != null) {
  88 + try {
  89 + DataSources.destroy(ds_pooled);
  90 + } catch (SQLException e) {
  91 + logger.error(e.toString());
  92 + e.printStackTrace();
  93 + }
  94 + }
  95 + }
  96 +
  97 + /**
  98 + * 资源关闭
  99 + *
  100 + * @param rs
  101 + * @param stmt
  102 + * @param conn
  103 + */
  104 + public static void close(ResultSet rs, Statement stmt, Connection conn) {
  105 + if (rs != null) {
  106 + try {
  107 + rs.close();
  108 + } catch (SQLException e) {
  109 + logger.error(e.toString());
  110 + e.printStackTrace();
  111 + }
  112 + }
  113 +
  114 + if (stmt != null) {
  115 + try {
  116 + stmt.close();
  117 + } catch (SQLException e) {
  118 + logger.error(e.toString());
  119 + e.printStackTrace();
  120 + }
  121 + }
  122 +
  123 + if (conn != null) {
  124 + try {
  125 + conn.close();
  126 + } catch (SQLException e) {
  127 + logger.error(e.toString());
  128 + e.printStackTrace();
  129 + }
  130 + }
  131 + }
  132 +
  133 + public static DataSource getDataSource(){
  134 + return ds_pooled;
  135 + }
  136 +}
src/main/java/com/bsth/util/DateUtils.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/util/DateUtils.java
  1 +package com.bsth.util;
  2 +
  3 +import java.text.ParseException;
  4 +import java.text.SimpleDateFormat;
  5 +import java.util.Calendar;
  6 +import java.util.Date;
  7 +
  8 +public class DateUtils {
  9 +
  10 + // 获得当天0点时间
  11 + public static int getTimesmorning() {
  12 + Calendar cal = Calendar.getInstance();
  13 + cal.set(Calendar.HOUR_OF_DAY, 0);
  14 + cal.set(Calendar.SECOND, 0);
  15 + cal.set(Calendar.MINUTE, 0);
  16 + cal.set(Calendar.MILLISECOND, 0);
  17 + return (int) (cal.getTimeInMillis() / 1000);
  18 + }
  19 +
  20 + // 获得当天0点毫秒时间戳
  21 + public static long getTimestamp() {
  22 + Calendar cal = Calendar.getInstance();
  23 + cal.set(Calendar.HOUR_OF_DAY, 0);
  24 + cal.set(Calendar.SECOND, 0);
  25 + cal.set(Calendar.MINUTE, 0);
  26 + cal.set(Calendar.MILLISECOND, 0);
  27 + return cal.getTimeInMillis();
  28 + }
  29 +
  30 + public static Long getTimesmorning(Calendar cal) {
  31 + cal.set(Calendar.HOUR_OF_DAY, 0);
  32 + cal.set(Calendar.SECOND, 0);
  33 + cal.set(Calendar.MINUTE, 0);
  34 + cal.set(Calendar.MILLISECOND, 0);
  35 + return cal.getTimeInMillis() / 1000;
  36 + }
  37 +
  38 + // 获得当天24点时间
  39 + public static int getTimesnight() {
  40 + Calendar cal = Calendar.getInstance();
  41 + cal.set(Calendar.HOUR_OF_DAY, 24);
  42 + cal.set(Calendar.SECOND, 0);
  43 + cal.set(Calendar.MINUTE, 0);
  44 + cal.set(Calendar.MILLISECOND, 0);
  45 + return (int) (cal.getTimeInMillis() / 1000);
  46 + }
  47 +
  48 + // 获得当天24点时间 毫秒
  49 + public static Long getTimesnight2() {
  50 + Calendar cal = Calendar.getInstance();
  51 + cal.set(Calendar.HOUR_OF_DAY, 24);
  52 + cal.set(Calendar.SECOND, 0);
  53 + cal.set(Calendar.MINUTE, 0);
  54 + cal.set(Calendar.MILLISECOND, 0);
  55 + return cal.getTimeInMillis();
  56 + }
  57 +
  58 + public static Long getTimesnight(Calendar cal) {
  59 + cal.set(Calendar.HOUR_OF_DAY, 24);
  60 + cal.set(Calendar.SECOND, 0);
  61 + cal.set(Calendar.MINUTE, 0);
  62 + cal.set(Calendar.MILLISECOND, 0);
  63 + return cal.getTimeInMillis();
  64 + }
  65 +
  66 + // 获得本周一0点时间
  67 + public static int getTimesWeekmorning() {
  68 + Calendar cal = Calendar.getInstance();
  69 + cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONDAY), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
  70 + cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
  71 + return (int) (cal.getTimeInMillis() / 1000);
  72 + }
  73 +
  74 + // 获得本周日24点时间
  75 + public static int getTimesWeeknight() {
  76 + Calendar cal = Calendar.getInstance();
  77 + cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONDAY), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
  78 + cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
  79 + return (int) ((cal.getTime().getTime() + (7 * 24 * 60 * 60 * 1000)) / 1000);
  80 + }
  81 +
  82 + // 获得本月第一天0点时间
  83 + public static int getTimesMonthmorning() {
  84 + Calendar cal = Calendar.getInstance();
  85 + cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONDAY), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
  86 + cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
  87 + return (int) (cal.getTimeInMillis() / 1000);
  88 + }
  89 +
  90 + // 获得本月最后一天24点时间
  91 + public static int getTimesMonthnight() {
  92 + Calendar cal = Calendar.getInstance();
  93 + cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONDAY), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
  94 + cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
  95 + cal.set(Calendar.HOUR_OF_DAY, 24);
  96 + return (int) (cal.getTimeInMillis() / 1000);
  97 + }
  98 +
  99 + private static SimpleDateFormat sdfyyyyMMddHHmm = new SimpleDateFormat("yyyy-MM-ddHH:mm")
  100 + ,sdfyyyyMMdd = new SimpleDateFormat("yyyy-MM-dd")
  101 + ,sdfHHmm = new SimpleDateFormat("HH:mm");
  102 + public static long getTimesByHHmm(String str) throws ParseException{
  103 + Date d = sdfyyyyMMddHHmm.parse(sdfyyyyMMdd.format(new Date()) + str);
  104 + return d.getTime();
  105 + }
  106 +
  107 + public static String plusDay(String old, int day){
  108 + Calendar cal = null;
  109 + try {
  110 + Date date = sdfyyyyMMdd.parse(old);
  111 + cal = Calendar.getInstance();
  112 + cal.setTime(date);
  113 + cal.add(Calendar.DATE, day);
  114 + } catch (ParseException e) {
  115 + e.printStackTrace();
  116 + }
  117 + return sdfyyyyMMdd.format(cal.getTime());
  118 + }
  119 +
  120 + public static String subtractDay(String old, int day){
  121 + Calendar cal = null;
  122 + try {
  123 + Date date = sdfyyyyMMdd.parse(old);
  124 + cal = Calendar.getInstance();
  125 + cal.setTime(date);
  126 + cal.set(Calendar.DATE, cal.get(Calendar.DATE) - day);
  127 + } catch (ParseException e) {
  128 + e.printStackTrace();
  129 + }
  130 + return sdfyyyyMMdd.format(cal.getTime());
  131 + }
  132 +
  133 + public static int calcHHmmDiff(String fcsj, String zdsj) throws ParseException {
  134 + return (int) (sdfHHmm.parse(zdsj).getTime() - sdfHHmm.parse(fcsj).getTime());
  135 + }
  136 +}
src/main/java/com/bsth/util/Tools.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/util/Tools.java
  1 +package com.bsth.util;
  2 +
  3 +import java.io.IOException;
  4 +import java.util.Properties;
  5 +
  6 +public class Tools {
  7 + private static Properties p = new Properties();
  8 + private static String f;
  9 + public Tools(String file){
  10 + f = file;
  11 + try {
  12 + p.load(Tools.class.getClassLoader().getResourceAsStream(f));
  13 + } catch (IOException e) {
  14 + e.printStackTrace();
  15 + }
  16 + }
  17 +
  18 + /**
  19 + * 根据key得到value的值
  20 + */
  21 + public String getValue(String key)
  22 + {
  23 + return p.getProperty(key);
  24 + }
  25 +}
src/main/java/com/bsth/util/XmlToJson.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/util/XmlToJson.java
  1 +package com.bsth.util;
  2 +
  3 +import com.alibaba.fastjson.JSONArray;
  4 +import com.alibaba.fastjson.JSONObject;
  5 +import org.dom4j.*;
  6 +
  7 +import java.io.File;
  8 +import java.io.FileInputStream;
  9 +import java.nio.ByteBuffer;
  10 +import java.nio.channels.FileChannel;
  11 +import java.util.List;
  12 +
  13 +public class XmlToJson {
  14 + public static void main(String[] args) throws Exception {
  15 +// String xmlStr= readFile("D:/ADA/et/Issue_20130506_back.xml");
  16 +// Document doc= DocumentHelper.parseText(xmlStr);
  17 +// JSONObject json=new JSONObject();
  18 +// dom4j2Json(doc.getRootElement(),json);
  19 +// System.out.println("xml2Json:"+json.toJSONString());
  20 + String a = "[{'s':'sd','b':'sd'},{'s':'11','b':'22'}]";
  21 +
  22 + System.out.println(a.toString());
  23 + String b = "{lhjcData={tabledata=[[{zdmc=组织机构代码, zd=TYSBM, zdmcdata=630301035}, {zdmc=对象名称, zd=DXMC, zdmcdata=测试公司1}, {zdmc=备忘录ID, zd=BWLID, zdmcdata=e4e4e4b15c3346ff015c336517a80043}, {zdmc=备忘录名称, zd=BWLMC, zdmcdata=对失信被执行人实施联合惩戒的合作备忘录}, {zdmc=行为事项, zd=XWSX, zdmcdata=最高人民法院公布的失信被执行人}, {zdmc=奖惩类型编码, zd=JCLX, zdmcdata=20}, {zdmc=奖惩类型名称, zd=JCLXMC, zdmcdata=惩戒}, {zdmc=判决法院, zd=PJFY, zdmcdata=上海市宝山区人民法院}, {zdmc=文书号, zd=WSH, zdmcdata=(2016)沪0113民初02817号}, {zdmc=立案日期, zd=LARQ, zdmcdata=2017/08/11}]], tablename=奖惩对象信息}, enterpriseData={resultGLL=null, resultDJL=[{tabledata=[[{zdmc=法定代表人, zdmcdata=TIMOTHY BRIAN CONSIDINE, zd=principalname}, {zdmc=工商注册号, zdmcdata=310000400595922, zd=regno}, {zdmc=法人类型, zdmcdata=公司, zd=organtype}, {zdmc=成立日期, zdmcdata=2009-03-30, zd=approvedate}, {zdmc=经营范围, zdmcdata=家具、金属制品、木工制品、亚克力制品的批发、进出口,并提供相关配套服务。 【依法须经批准的项目,经相关部门批准后方可开展经营活动】, zd=tradescope}, {zdmc=组织机构代码, zdmcdata=685514951, zd=organcode}, {zdmc=注册地址, zdmcdata=上海市静安区南京西路920号南泰大厦16A楼11室, zd=address}, {zdmc=法人名称, zdmcdata=测试公司1, zd=organname}, {zdmc=注册资金(万), zdmcdata=14, zd=regcapital}, {zdmc=币种, zdmcdata=美元, zd=currencytype}, {zdmc=登记状态, zdmcdata=确立, zd=organstatus}, {zdmc=信息类别, zdmcdata=登记类, zd=XXLB}, {zdmc=来源部门, zdmcdata=市工商局, zd=XXSSDW}]], tablename=企业登记信息}, {tabledata=[[{zdmc=个人独资企业出资方式, zdmcdata=, zd=invest_type_id}, {zdmc=证照类型, zdmcdata=, zd=cert_type}, {zdmc=合伙人国别(地区)(外资), zdmcdata=英国, zd=nationality_id}, {zdmc=投资人名称, zdmcdata=CARDINAL PROJECT MANAGEMENT LIMITED, zd=investor_name}, {zdmc=证照编号, zdmcdata=, zd=cert_number}, {zdmc=投资人类型, zdmcdata=外国(地区)企业, zd=investor_type_gb}, {zdmc=合伙人住所(外资), zdmcdata=, zd=address}, {zdmc=合伙人承担责任方式(外资), zdmcdata=, zd=respond_way}, {zdmc=信息类别, zdmcdata=登记类, zd=XXLB}, {zdmc=来源部门, zdmcdata=市工商行政管理局, zd=XXSSDW}]], tablename=出资信息}, {tabledata=[[{zdmc=姓名, zdmcdata=TIMOTHY BRIAN CONSIDINE, zd=person_name}, {zdmc=职务, zdmcdata=执行董事, zd=hdsh_gb}, {zdmc=信息类别, zdmcdata=登记类, zd=XXLB}, {zdmc=来源部门, zdmcdata=市工商行政管理局, zd=XXSSDW}], [{zdmc=姓名, zdmcdata=陈漪, zd=person_name}, {zdmc=职务, zdmcdata=总经理, zd=hdsh_gb}, {zdmc=信息类别, zdmcdata=登记类, zd=XXLB}, {zdmc=来源部门, zdmcdata=市工商行政管理局, zd=XXSSDW}], [{zdmc=姓名, zdmcdata=MARK SIMPSON, zd=person_name}, {zdmc=职务, zdmcdata=监事, zd=hdsh_gb}, {zdmc=信息类别, zdmcdata=登记类, zd=XXLB}, {zdmc=来源部门, zdmcdata=市工商行政管理局, zd=XXSSDW}]], tablename=主要成员信息}, {tabledata=[[{zdmc=变更前内容, zdmcdata=0.0000万美元, zd=before_content}, {zdmc=变更后内容, zdmcdata=2.8000万美元, zd=after_content}, {zdmc=变更日期, zdmcdata=20090702, zd=change_date}, {zdmc=变更事项, zdmcdata=实收资本变更, zd=reg_item_gb}, {zdmc=信息类别, zdmcdata=登记类, zd=XXLB}, {zdmc=来源部门, zdmcdata=市工商行政管理局, zd=XXSSDW}], [{zdmc=变更前内容, zdmcdata=2.8000万美元, zd=before_content}, {zdmc=变更后内容, zdmcdata=7.0000万美元, zd=after_content}, {zdmc=变更日期, zdmcdata=20091111, zd=change_date}, {zdmc=变更事项, zdmcdata=实收资本变更, zd=reg_item_gb}, {zdmc=信息类别, zdmcdata=登记类, zd=XXLB}, {zdmc=来源部门, zdmcdata=市工商行政管理局, zd=XXSSDW}], [{zdmc=变更前内容, zdmcdata=CARDINAL PROJECT MANAGEMENT LIMITED 2009-09-24 货币4.2000万美元;CARDINAL PROJECT MANAGEMENT LIMITED 2009-06-15 货币2.8000万美元, zd=before_content}, {zdmc=变更后内容, zdmcdata=CARDINAL PROJECT MANAGEMENT LIMITED 2009-09-24 货币4.2000万美元;CARDINAL PROJECT MANAGEMENT LIMITED 2009-06-15 货币2.8000万美元;CARDINAL PROJECT MANAGEMENT LIMITED 2010-05-31 货币0.4500万美元;CARDINAL PROJECT MANAGEMENT LIMITED 2011-02-09 货币6.5500万美元, zd=after_content}, {zdmc=变更日期, zdmcdata=20110523, zd=change_date}, {zdmc=变更事项, zdmcdata=实收资本变更, zd=reg_item_gb}, {zdmc=信息类别, zdmcdata=登记类, zd=XXLB}, {zdmc=来源部门, zdmcdata=市工商行政管理局, zd=XXSSDW}], [{zdmc=变更前内容, zdmcdata=无, zd=before_content}, {zdmc=变更后内容, zdmcdata=陈漪, zd=after_content}, {zdmc=变更日期, zdmcdata=20171206, zd=change_date}, {zdmc=变更事项, zdmcdata=经理备案, zd=reg_item_gb}, {zdmc=信息类别, zdmcdata=登记类, zd=XXLB}, {zdmc=来源部门, zdmcdata=市工商行政管理局, zd=XXSSDW}], [{zdmc=变更前内容, zdmcdata=MICHAEL ANDREW BARNARD, zd=before_content}, {zdmc=变更后内容, zdmcdata=MARK SIMPSON, zd=after_content}, {zdmc=变更日期, zdmcdata=20171206, zd=change_date}, {zdmc=变更事项, zdmcdata=监事备案, zd=reg_item_gb}, {zdmc=信息类别, zdmcdata=登记类, zd=XXLB}, {zdmc=来源部门, zdmcdata=市工商行政管理局, zd=XXSSDW}], [{zdmc=变更前内容, zdmcdata=家具、货柜架、收银台、电器设备的批发、进出口,并提供相关设计咨询和配套服务(不涉及国营贸易管理商品,涉及配额、许可证管理商品的,按国家有关规定办理申请)。 【依法须经批准的项目,经相关部门批准后方可开展经营活动】, zd=before_content}, {zdmc=变更后内容, zdmcdata=家具、金属制品、木工制品、亚克力制品的批发、进出口,并提供相关配套服务。 【依法须经批准的项目,经相关部门批准后方可开展经营活动】, zd=after_content}, {zdmc=变更日期, zdmcdata=20171206, zd=change_date}, {zdmc=变更事项, zdmcdata=经营范围变更, zd=reg_item_gb}, {zdmc=信息类别, zdmcdata=登记类, zd=XXLB}, {zdmc=来源部门, zdmcdata=市工商行政管理局, zd=XXSSDW}], [{zdmc=变更前内容, zdmcdata=PAUL DAVID BENJAMIN CONSIDINE, zd=before_content}, {zdmc=变更后内容, zdmcdata=TIMOTHY BRIAN CONSIDINE, zd=after_content}, {zdmc=变更日期, zdmcdata=20171206, zd=change_date}, {zdmc=变更事项, zdmcdata=法定代表人变更, zd=reg_item_gb}, {zdmc=信息类别, zdmcdata=登记类, zd=XXLB}, {zdmc=来源部门, zdmcdata=市工商行政管理局, zd=XXSSDW}], [{zdmc=变更前内容, zdmcdata=MICHAEL PATRICK THOMPSON;BRIAN ROSS GORMAN;TIMOTHY BRIAN CONSIDINE;GRAHAM PHILIP DAVIES, zd=before_content}, {zdmc=变更后内容, zdmcdata=无, zd=after_content}, {zdmc=变更日期, zdmcdata=20171206, zd=change_date}, {zdmc=变更事项, zdmcdata=董事备案, zd=reg_item_gb}, {zdmc=信息类别, zdmcdata=登记类, zd=XXLB}, {zdmc=来源部门, zdmcdata=市工商行政管理局, zd=XXSSDW}], [{zdmc=变更前内容, zdmcdata=无, zd=before_content}, {zdmc=变更后内容, zdmcdata=2017-09-18章程备案, zd=after_content}, {zdmc=变更日期, zdmcdata=20171206, zd=change_date}, {zdmc=变更事项, zdmcdata=章程备案, zd=reg_item_gb}, {zdmc=信息类别, zdmcdata=登记类, zd=XXLB}, {zdmc=来源部门, zdmcdata=市工商行政管理局, zd=XXSSDW}]], tablename=变更信息}, {tabledata=[[{zdmc=备案日期, zdmcdata=2010/5/24, zd=A4}, {zdmc=企业备案号, zdmcdata=3100633346, zd=A3}, {zdmc=法定代表人, zdmcdata=Paul David considine, zd=A5}, {zdmc=信息类别, zdmcdata=登记类, zd=XXLB}, {zdmc=来源部门, zdmcdata=上海海关, zd=XXSSDW}]], tablename=自理报检单位备案}], resultZZL=null, resultWYL=null, resultGYL=null, resultZXL=null, resultJDL=[{tabledata=[[{zdmc=信用等级, zdmcdata=A, zd=A8}, {zdmc=信息类别, zdmcdata=监管类, zd=XXLB}, {zdmc=来源部门, zdmcdata=上海海关, zd=XXSSDW}]], tablename=信用ABCD级}, {tabledata=[[{zdmc=年检结果, zdmcdata=年检结果正常, zd=annlresult}, {zdmc=年检年度, zdmcdata=2009, zd=annlyear}, {zdmc=信息类别, zdmcdata=监管类, zd=XXLB}, {zdmc=来源部门, zdmcdata=市工商局, zd=XXSSDW}], [{zdmc=年检结果, zdmcdata=年检结果正常, zd=annlresult}, {zdmc=年检年度, zdmcdata=2010, zd=annlyear}, {zdmc=信息类别, zdmcdata=监管类, zd=XXLB}, {zdmc=来源部门, zdmcdata=市工商局, zd=XXSSDW}], [{zdmc=年检结果, zdmcdata=年检结果正常, zd=annlresult}, {zdmc=年检年度, zdmcdata=2011, zd=annlyear}, {zdmc=信息类别, zdmcdata=监管类, zd=XXLB}, {zdmc=来源部门, zdmcdata=市工商局, zd=XXSSDW}], [{zdmc=年检结果, zdmcdata=年检结果正常, zd=annlresult}, {zdmc=年检年度, zdmcdata=2012, zd=annlyear}, {zdmc=信息类别, zdmcdata=监管类, zd=XXLB}, {zdmc=来源部门, zdmcdata=市工商局, zd=XXSSDW}]], tablename=年检信息}], resultPJL=null}}\";\n";
  24 +
  25 + JSONArray jsonArr = JSONArray.parseArray(a);
  26 + System.out.println(jsonArr);
  27 + }
  28 +
  29 + public static String readFile(String path) throws Exception {
  30 + File file=new File(path);
  31 + FileInputStream fis = new FileInputStream(file);
  32 + FileChannel fc = fis.getChannel();
  33 + ByteBuffer bb = ByteBuffer.allocate(new Long(file.length()).intValue());
  34 + //fc向buffer中读入数据
  35 + fc.read(bb);
  36 + bb.flip();
  37 + String str=new String(bb.array(),"UTF8");
  38 + fc.close();
  39 + fis.close();
  40 + return str;
  41 +
  42 + }
  43 + /**
  44 + * xml转json
  45 + * @param xmlStr
  46 + * @return
  47 + * @throws DocumentException
  48 + */
  49 + public static JSONObject xml2Json(String xmlStr) throws DocumentException{
  50 + Document doc= DocumentHelper.parseText(xmlStr);
  51 + JSONObject json=new JSONObject();
  52 + dom4j2Json(doc.getRootElement(), json);
  53 + return json;
  54 + }
  55 +
  56 + /**
  57 + * xml转json
  58 + * @param element
  59 + * @param json
  60 + */
  61 + public static void dom4j2Json(Element element,JSONObject json){
  62 + //如果是属性
  63 + for(Object o:element.attributes()){
  64 + Attribute attr=(Attribute)o;
  65 + if(!isEmpty(attr.getValue())){
  66 + json.put("@"+attr.getName(), attr.getValue());
  67 + }
  68 + }
  69 + List<Element> chdEl=element.elements();
  70 + if(chdEl.isEmpty()&&!isEmpty(element.getText())){//如果没有子元素,只有一个值
  71 + json.put(element.getName(), element.getText());
  72 + }
  73 +
  74 + for(Element e:chdEl){//有子元素
  75 + if(!e.elements().isEmpty()){//子元素也有子元素
  76 + JSONObject chdjson=new JSONObject();
  77 + dom4j2Json(e,chdjson);
  78 + Object o=json.get(e.getName());
  79 + if(o!=null){
  80 + JSONArray jsona=null;
  81 + if(o instanceof JSONObject){//如果此元素已存在,则转为jsonArray
  82 + JSONObject jsono=(JSONObject)o;
  83 + json.remove(e.getName());
  84 + jsona=new JSONArray();
  85 + jsona.add(jsono);
  86 + jsona.add(chdjson);
  87 + }
  88 + if(o instanceof JSONArray){
  89 + jsona=(JSONArray)o;
  90 + jsona.add(chdjson);
  91 + }
  92 + json.put(e.getName(), jsona);
  93 + }else{
  94 + if(!chdjson.isEmpty()){
  95 + json.put(e.getName(), chdjson);
  96 + }
  97 + }
  98 +
  99 +
  100 + }else{//子元素没有子元素
  101 + for(Object o:element.attributes()){
  102 + Attribute attr=(Attribute)o;
  103 + if(!isEmpty(attr.getValue())){
  104 + json.put("@"+attr.getName(), attr.getValue());
  105 + }
  106 + }
  107 + if(!e.getText().isEmpty()){
  108 + json.put(e.getName(), e.getText());
  109 + }
  110 + }
  111 + }
  112 + }
  113 +
  114 + public static boolean isEmpty(String str) {
  115 +
  116 + if (str == null || str.trim().isEmpty() || "null".equals(str)) {
  117 + return true;
  118 + }
  119 + return false;
  120 + }
  121 +}
src/main/java/com/bsth/wsdl/GetEmployee.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/wsdl/GetEmployee.java
  1 +
  2 +package com.bsth.wsdl;
  3 +
  4 +import javax.xml.bind.annotation.XmlAccessType;
  5 +import javax.xml.bind.annotation.XmlAccessorType;
  6 +import javax.xml.bind.annotation.XmlElement;
  7 +import javax.xml.bind.annotation.XmlRootElement;
  8 +import javax.xml.bind.annotation.XmlType;
  9 +
  10 +
  11 +/**
  12 + * <p>anonymous complex type�� Java �ࡣ
  13 + *
  14 + * <p>����ģʽƬ��ָ�������ڴ����е�Ԥ�����ݡ�
  15 + *
  16 + * <pre>
  17 + * &lt;complexType&gt;
  18 + * &lt;complexContent&gt;
  19 + * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
  20 + * &lt;sequence&gt;
  21 + * &lt;element name="UnintCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
  22 + * &lt;element name="IDCard" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
  23 + * &lt;/sequence&gt;
  24 + * &lt;/restriction&gt;
  25 + * &lt;/complexContent&gt;
  26 + * &lt;/complexType&gt;
  27 + * </pre>
  28 + *
  29 + *
  30 + */
  31 +@XmlAccessorType(XmlAccessType.FIELD)
  32 +@XmlType(name = "", propOrder = {
  33 + "unintCode",
  34 + "idCard"
  35 +})
  36 +@XmlRootElement(name = "GetEmployee")
  37 +public class GetEmployee {
  38 +
  39 + @XmlElement(name = "UnintCode")
  40 + protected String unintCode;
  41 + @XmlElement(name = "IDCard")
  42 + protected String idCard;
  43 +
  44 + /**
  45 + * ��ȡunintCode���Ե�ֵ��
  46 + *
  47 + * @return
  48 + * possible object is
  49 + * {@link String }
  50 + *
  51 + */
  52 + public String getUnintCode() {
  53 + return unintCode;
  54 + }
  55 +
  56 + /**
  57 + * ����unintCode���Ե�ֵ��
  58 + *
  59 + * @param value
  60 + * allowed object is
  61 + * {@link String }
  62 + *
  63 + */
  64 + public void setUnintCode(String value) {
  65 + this.unintCode = value;
  66 + }
  67 +
  68 + /**
  69 + * ��ȡidCard���Ե�ֵ��
  70 + *
  71 + * @return
  72 + * possible object is
  73 + * {@link String }
  74 + *
  75 + */
  76 + public String getIDCard() {
  77 + return idCard;
  78 + }
  79 +
  80 + /**
  81 + * ����idCard���Ե�ֵ��
  82 + *
  83 + * @param value
  84 + * allowed object is
  85 + * {@link String }
  86 + *
  87 + */
  88 + public void setIDCard(String value) {
  89 + this.idCard = value;
  90 + }
  91 +
  92 +}
src/main/java/com/bsth/wsdl/GetEmployeeResponse.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/wsdl/GetEmployeeResponse.java
  1 +
  2 +package com.bsth.wsdl;
  3 +
  4 +import javax.xml.bind.annotation.XmlAccessType;
  5 +import javax.xml.bind.annotation.XmlAccessorType;
  6 +import javax.xml.bind.annotation.XmlElement;
  7 +import javax.xml.bind.annotation.XmlRootElement;
  8 +import javax.xml.bind.annotation.XmlType;
  9 +
  10 +
  11 +/**
  12 + * <p>anonymous complex type�� Java �ࡣ
  13 + *
  14 + * <p>����ģʽƬ��ָ�������ڴ����е�Ԥ�����ݡ�
  15 + *
  16 + * <pre>
  17 + * &lt;complexType&gt;
  18 + * &lt;complexContent&gt;
  19 + * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
  20 + * &lt;sequence&gt;
  21 + * &lt;element name="GetEmployeeResult" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
  22 + * &lt;/sequence&gt;
  23 + * &lt;/restriction&gt;
  24 + * &lt;/complexContent&gt;
  25 + * &lt;/complexType&gt;
  26 + * </pre>
  27 + *
  28 + *
  29 + */
  30 +@XmlAccessorType(XmlAccessType.FIELD)
  31 +@XmlType(name = "", propOrder = {
  32 + "getEmployeeResult"
  33 +})
  34 +@XmlRootElement(name = "GetEmployeeResponse")
  35 +public class GetEmployeeResponse {
  36 +
  37 + @XmlElement(name = "GetEmployeeResult")
  38 + protected String getEmployeeResult;
  39 +
  40 + /**
  41 + * ��ȡgetEmployeeResult���Ե�ֵ��
  42 + *
  43 + * @return
  44 + * possible object is
  45 + * {@link String }
  46 + *
  47 + */
  48 + public String getGetEmployeeResult() {
  49 + return getEmployeeResult;
  50 + }
  51 +
  52 + /**
  53 + * ����getEmployeeResult���Ե�ֵ��
  54 + *
  55 + * @param value
  56 + * allowed object is
  57 + * {@link String }
  58 + *
  59 + */
  60 + public void setGetEmployeeResult(String value) {
  61 + this.getEmployeeResult = value;
  62 + }
  63 +
  64 +}
src/main/java/com/bsth/wsdl/GetPAItem.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/wsdl/GetPAItem.java
  1 +
  2 +package com.bsth.wsdl;
  3 +
  4 +import javax.xml.bind.annotation.XmlAccessType;
  5 +import javax.xml.bind.annotation.XmlAccessorType;
  6 +import javax.xml.bind.annotation.XmlElement;
  7 +import javax.xml.bind.annotation.XmlRootElement;
  8 +import javax.xml.bind.annotation.XmlType;
  9 +
  10 +
  11 +/**
  12 + * <p>anonymous complex type�� Java �ࡣ
  13 + *
  14 + * <p>����ģʽƬ��ָ�������ڴ����е�Ԥ�����ݡ�
  15 + *
  16 + * <pre>
  17 + * &lt;complexType&gt;
  18 + * &lt;complexContent&gt;
  19 + * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
  20 + * &lt;sequence&gt;
  21 + * &lt;element name="Year" type="{http://www.w3.org/2001/XMLSchema}int"/&gt;
  22 + * &lt;element name="Period" type="{http://www.w3.org/2001/XMLSchema}int"/&gt;
  23 + * &lt;/sequence&gt;
  24 + * &lt;/restriction&gt;
  25 + * &lt;/complexContent&gt;
  26 + * &lt;/complexType&gt;
  27 + * </pre>
  28 + *
  29 + *
  30 + */
  31 +@XmlAccessorType(XmlAccessType.FIELD)
  32 +@XmlType(name = "", propOrder = {
  33 + "year",
  34 + "period"
  35 +})
  36 +@XmlRootElement(name = "GetPAItem")
  37 +public class GetPAItem {
  38 +
  39 + @XmlElement(name = "Year")
  40 + protected int year;
  41 + @XmlElement(name = "Period")
  42 + protected int period;
  43 +
  44 + /**
  45 + * ��ȡyear���Ե�ֵ��
  46 + *
  47 + */
  48 + public int getYear() {
  49 + return year;
  50 + }
  51 +
  52 + /**
  53 + * ����year���Ե�ֵ��
  54 + *
  55 + */
  56 + public void setYear(int value) {
  57 + this.year = value;
  58 + }
  59 +
  60 + /**
  61 + * ��ȡperiod���Ե�ֵ��
  62 + *
  63 + */
  64 + public int getPeriod() {
  65 + return period;
  66 + }
  67 +
  68 + /**
  69 + * ����period���Ե�ֵ��
  70 + *
  71 + */
  72 + public void setPeriod(int value) {
  73 + this.period = value;
  74 + }
  75 +
  76 +}
src/main/java/com/bsth/wsdl/GetPAItemResponse.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/wsdl/GetPAItemResponse.java
  1 +
  2 +package com.bsth.wsdl;
  3 +
  4 +import javax.xml.bind.annotation.XmlAccessType;
  5 +import javax.xml.bind.annotation.XmlAccessorType;
  6 +import javax.xml.bind.annotation.XmlElement;
  7 +import javax.xml.bind.annotation.XmlRootElement;
  8 +import javax.xml.bind.annotation.XmlType;
  9 +
  10 +
  11 +/**
  12 + * <p>anonymous complex type�� Java �ࡣ
  13 + *
  14 + * <p>����ģʽƬ��ָ�������ڴ����е�Ԥ�����ݡ�
  15 + *
  16 + * <pre>
  17 + * &lt;complexType&gt;
  18 + * &lt;complexContent&gt;
  19 + * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
  20 + * &lt;sequence&gt;
  21 + * &lt;element name="GetPAItemResult" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
  22 + * &lt;/sequence&gt;
  23 + * &lt;/restriction&gt;
  24 + * &lt;/complexContent&gt;
  25 + * &lt;/complexType&gt;
  26 + * </pre>
  27 + *
  28 + *
  29 + */
  30 +@XmlAccessorType(XmlAccessType.FIELD)
  31 +@XmlType(name = "", propOrder = {
  32 + "getPAItemResult"
  33 +})
  34 +@XmlRootElement(name = "GetPAItemResponse")
  35 +public class GetPAItemResponse {
  36 +
  37 + @XmlElement(name = "GetPAItemResult")
  38 + protected String getPAItemResult;
  39 +
  40 + /**
  41 + * ��ȡgetPAItemResult���Ե�ֵ��
  42 + *
  43 + * @return
  44 + * possible object is
  45 + * {@link String }
  46 + *
  47 + */
  48 + public String getGetPAItemResult() {
  49 + return getPAItemResult;
  50 + }
  51 +
  52 + /**
  53 + * ����getPAItemResult���Ե�ֵ��
  54 + *
  55 + * @param value
  56 + * allowed object is
  57 + * {@link String }
  58 + *
  59 + */
  60 + public void setGetPAItemResult(String value) {
  61 + this.getPAItemResult = value;
  62 + }
  63 +
  64 +}
src/main/java/com/bsth/wsdl/GetRetiredInfor.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/wsdl/GetRetiredInfor.java
  1 +
  2 +package com.bsth.wsdl;
  3 +
  4 +import javax.xml.bind.annotation.XmlAccessType;
  5 +import javax.xml.bind.annotation.XmlAccessorType;
  6 +import javax.xml.bind.annotation.XmlElement;
  7 +import javax.xml.bind.annotation.XmlRootElement;
  8 +import javax.xml.bind.annotation.XmlType;
  9 +
  10 +
  11 +/**
  12 + * <p>anonymous complex type�� Java �ࡣ
  13 + *
  14 + * <p>����ģʽƬ��ָ�������ڴ����е�Ԥ�����ݡ�
  15 + *
  16 + * <pre>
  17 + * &lt;complexType&gt;
  18 + * &lt;complexContent&gt;
  19 + * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
  20 + * &lt;sequence&gt;
  21 + * &lt;element name="UnintCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
  22 + * &lt;element name="begin_date" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
  23 + * &lt;element name="end_date" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
  24 + * &lt;/sequence&gt;
  25 + * &lt;/restriction&gt;
  26 + * &lt;/complexContent&gt;
  27 + * &lt;/complexType&gt;
  28 + * </pre>
  29 + *
  30 + *
  31 + */
  32 +@XmlAccessorType(XmlAccessType.FIELD)
  33 +@XmlType(name = "", propOrder = {
  34 + "unintCode",
  35 + "beginDate",
  36 + "endDate"
  37 +})
  38 +@XmlRootElement(name = "GetRetiredInfor")
  39 +public class GetRetiredInfor {
  40 +
  41 + @XmlElement(name = "UnintCode")
  42 + protected String unintCode;
  43 + @XmlElement(name = "begin_date")
  44 + protected String beginDate;
  45 + @XmlElement(name = "end_date")
  46 + protected String endDate;
  47 +
  48 + /**
  49 + * ��ȡunintCode���Ե�ֵ��
  50 + *
  51 + * @return
  52 + * possible object is
  53 + * {@link String }
  54 + *
  55 + */
  56 + public String getUnintCode() {
  57 + return unintCode;
  58 + }
  59 +
  60 + /**
  61 + * ����unintCode���Ե�ֵ��
  62 + *
  63 + * @param value
  64 + * allowed object is
  65 + * {@link String }
  66 + *
  67 + */
  68 + public void setUnintCode(String value) {
  69 + this.unintCode = value;
  70 + }
  71 +
  72 + /**
  73 + * ��ȡbeginDate���Ե�ֵ��
  74 + *
  75 + * @return
  76 + * possible object is
  77 + * {@link String }
  78 + *
  79 + */
  80 + public String getBeginDate() {
  81 + return beginDate;
  82 + }
  83 +
  84 + /**
  85 + * ����beginDate���Ե�ֵ��
  86 + *
  87 + * @param value
  88 + * allowed object is
  89 + * {@link String }
  90 + *
  91 + */
  92 + public void setBeginDate(String value) {
  93 + this.beginDate = value;
  94 + }
  95 +
  96 + /**
  97 + * ��ȡendDate���Ե�ֵ��
  98 + *
  99 + * @return
  100 + * possible object is
  101 + * {@link String }
  102 + *
  103 + */
  104 + public String getEndDate() {
  105 + return endDate;
  106 + }
  107 +
  108 + /**
  109 + * ����endDate���Ե�ֵ��
  110 + *
  111 + * @param value
  112 + * allowed object is
  113 + * {@link String }
  114 + *
  115 + */
  116 + public void setEndDate(String value) {
  117 + this.endDate = value;
  118 + }
  119 +
  120 +}
src/main/java/com/bsth/wsdl/GetRetiredInforResponse.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/wsdl/GetRetiredInforResponse.java
  1 +
  2 +package com.bsth.wsdl;
  3 +
  4 +import javax.xml.bind.annotation.XmlAccessType;
  5 +import javax.xml.bind.annotation.XmlAccessorType;
  6 +import javax.xml.bind.annotation.XmlElement;
  7 +import javax.xml.bind.annotation.XmlRootElement;
  8 +import javax.xml.bind.annotation.XmlType;
  9 +
  10 +
  11 +/**
  12 + * <p>anonymous complex type�� Java �ࡣ
  13 + *
  14 + * <p>����ģʽƬ��ָ�������ڴ����е�Ԥ�����ݡ�
  15 + *
  16 + * <pre>
  17 + * &lt;complexType&gt;
  18 + * &lt;complexContent&gt;
  19 + * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
  20 + * &lt;sequence&gt;
  21 + * &lt;element name="GetRetiredInforResult" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
  22 + * &lt;/sequence&gt;
  23 + * &lt;/restriction&gt;
  24 + * &lt;/complexContent&gt;
  25 + * &lt;/complexType&gt;
  26 + * </pre>
  27 + *
  28 + *
  29 + */
  30 +@XmlAccessorType(XmlAccessType.FIELD)
  31 +@XmlType(name = "", propOrder = {
  32 + "getRetiredInforResult"
  33 +})
  34 +@XmlRootElement(name = "GetRetiredInforResponse")
  35 +public class GetRetiredInforResponse {
  36 +
  37 + @XmlElement(name = "GetRetiredInforResult")
  38 + protected String getRetiredInforResult;
  39 +
  40 + /**
  41 + * ��ȡgetRetiredInforResult���Ե�ֵ��
  42 + *
  43 + * @return
  44 + * possible object is
  45 + * {@link String }
  46 + *
  47 + */
  48 + public String getGetRetiredInforResult() {
  49 + return getRetiredInforResult;
  50 + }
  51 +
  52 + /**
  53 + * ����getRetiredInforResult���Ե�ֵ��
  54 + *
  55 + * @param value
  56 + * allowed object is
  57 + * {@link String }
  58 + *
  59 + */
  60 + public void setGetRetiredInforResult(String value) {
  61 + this.getRetiredInforResult = value;
  62 + }
  63 +
  64 +}
src/main/java/com/bsth/wsdl/MyHeader.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/wsdl/MyHeader.java
  1 +
  2 +package com.bsth.wsdl;
  3 +
  4 +import java.util.HashMap;
  5 +import java.util.Map;
  6 +import javax.xml.bind.annotation.XmlAccessType;
  7 +import javax.xml.bind.annotation.XmlAccessorType;
  8 +import javax.xml.bind.annotation.XmlAnyAttribute;
  9 +import javax.xml.bind.annotation.XmlElement;
  10 +import javax.xml.bind.annotation.XmlType;
  11 +import javax.xml.namespace.QName;
  12 +
  13 +
  14 +/**
  15 + * <p>MyHeader complex type�� Java �ࡣ
  16 + *
  17 + * <p>����ģʽƬ��ָ�������ڴ����е�Ԥ�����ݡ�
  18 + *
  19 + * <pre>
  20 + * &lt;complexType name="MyHeader"&gt;
  21 + * &lt;complexContent&gt;
  22 + * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
  23 + * &lt;sequence&gt;
  24 + * &lt;element name="UserPermissionAcct" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
  25 + * &lt;element name="UserPermissionPwd" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
  26 + * &lt;/sequence&gt;
  27 + * &lt;anyAttribute/&gt;
  28 + * &lt;/restriction&gt;
  29 + * &lt;/complexContent&gt;
  30 + * &lt;/complexType&gt;
  31 + * </pre>
  32 + *
  33 + *
  34 + */
  35 +@XmlAccessorType(XmlAccessType.FIELD)
  36 +@XmlType(name = "MyHeader", propOrder = {
  37 + "userPermissionAcct",
  38 + "userPermissionPwd"
  39 +})
  40 +public class MyHeader {
  41 +
  42 + @XmlElement(name = "UserPermissionAcct")
  43 + protected String userPermissionAcct;
  44 + @XmlElement(name = "UserPermissionPwd")
  45 + protected String userPermissionPwd;
  46 + @XmlAnyAttribute
  47 + private Map<QName, String> otherAttributes = new HashMap<QName, String>();
  48 +
  49 + /**
  50 + * ��ȡuserPermissionAcct���Ե�ֵ��
  51 + *
  52 + * @return
  53 + * possible object is
  54 + * {@link String }
  55 + *
  56 + */
  57 + public String getUserPermissionAcct() {
  58 + return userPermissionAcct;
  59 + }
  60 +
  61 + /**
  62 + * ����userPermissionAcct���Ե�ֵ��
  63 + *
  64 + * @param value
  65 + * allowed object is
  66 + * {@link String }
  67 + *
  68 + */
  69 + public void setUserPermissionAcct(String value) {
  70 + this.userPermissionAcct = value;
  71 + }
  72 +
  73 + /**
  74 + * ��ȡuserPermissionPwd���Ե�ֵ��
  75 + *
  76 + * @return
  77 + * possible object is
  78 + * {@link String }
  79 + *
  80 + */
  81 + public String getUserPermissionPwd() {
  82 + return userPermissionPwd;
  83 + }
  84 +
  85 + /**
  86 + * ����userPermissionPwd���Ե�ֵ��
  87 + *
  88 + * @param value
  89 + * allowed object is
  90 + * {@link String }
  91 + *
  92 + */
  93 + public void setUserPermissionPwd(String value) {
  94 + this.userPermissionPwd = value;
  95 + }
  96 +
  97 + /**
  98 + * Gets a map that contains attributes that aren't bound to any typed property on this class.
  99 + *
  100 + * <p>
  101 + * the map is keyed by the name of the attribute and
  102 + * the value is the string value of the attribute.
  103 + *
  104 + * the map returned by this method is live, and you can add new attribute
  105 + * by updating the map directly. Because of this design, there's no setter.
  106 + *
  107 + *
  108 + * @return
  109 + * always non-null
  110 + */
  111 + public Map<QName, String> getOtherAttributes() {
  112 + return otherAttributes;
  113 + }
  114 +
  115 +}
src/main/java/com/bsth/wsdl/ObjectFactory.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/wsdl/ObjectFactory.java
  1 +
  2 +package com.bsth.wsdl;
  3 +
  4 +import javax.xml.bind.JAXBElement;
  5 +import javax.xml.bind.annotation.XmlElementDecl;
  6 +import javax.xml.bind.annotation.XmlRegistry;
  7 +import javax.xml.namespace.QName;
  8 +
  9 +
  10 +/**
  11 + * This object contains factory methods for each
  12 + * Java content interface and Java element interface
  13 + * generated in the com.pd_transport package.
  14 + * <p>An ObjectFactory allows you to programatically
  15 + * construct new instances of the Java representation
  16 + * for XML content. The Java representation of XML
  17 + * content can consist of schema derived interfaces
  18 + * and classes representing the binding of schema
  19 + * type definitions, element declarations and model
  20 + * groups. Factory methods for each of these are
  21 + * provided in this class.
  22 + *
  23 + */
  24 +@XmlRegistry
  25 +public class ObjectFactory {
  26 +
  27 + private final static QName _MyHeader_QNAME = new QName("http://www.pd-transport.com/", "MyHeader");
  28 +
  29 + /**
  30 + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.pd_transport
  31 + *
  32 + */
  33 + public ObjectFactory() {
  34 + }
  35 +
  36 + /**
  37 + * Create an instance of {@link GetEmployee }
  38 + *
  39 + */
  40 + public GetEmployee createGetEmployee() {
  41 + return new GetEmployee();
  42 + }
  43 +
  44 + /**
  45 + * Create an instance of {@link GetEmployeeResponse }
  46 + *
  47 + */
  48 + public GetEmployeeResponse createGetEmployeeResponse() {
  49 + return new GetEmployeeResponse();
  50 + }
  51 +
  52 + /**
  53 + * Create an instance of {@link MyHeader }
  54 + *
  55 + */
  56 + public MyHeader createMyHeader() {
  57 + return new MyHeader();
  58 + }
  59 +
  60 + /**
  61 + * Create an instance of {@link GetPAItem }
  62 + *
  63 + */
  64 + public GetPAItem createGetPAItem() {
  65 + return new GetPAItem();
  66 + }
  67 +
  68 + /**
  69 + * Create an instance of {@link GetPAItemResponse }
  70 + *
  71 + */
  72 + public GetPAItemResponse createGetPAItemResponse() {
  73 + return new GetPAItemResponse();
  74 + }
  75 +
  76 + /**
  77 + * Create an instance of {@link GetRetiredInfor }
  78 + *
  79 + */
  80 + public GetRetiredInfor createGetRetiredInfor() {
  81 + return new GetRetiredInfor();
  82 + }
  83 +
  84 + /**
  85 + * Create an instance of {@link GetRetiredInforResponse }
  86 + *
  87 + */
  88 + public GetRetiredInforResponse createGetRetiredInforResponse() {
  89 + return new GetRetiredInforResponse();
  90 + }
  91 +
  92 + /**
  93 + * Create an instance of {@link JAXBElement }{@code <}{@link MyHeader }{@code >}
  94 + *
  95 + * @param value
  96 + * Java instance representing xml element's value.
  97 + * @return
  98 + * the new instance of {@link JAXBElement }{@code <}{@link MyHeader }{@code >}
  99 + */
  100 + @XmlElementDecl(namespace = "http://www.pd-transport.com/", name = "MyHeader")
  101 + public JAXBElement<MyHeader> createMyHeader(MyHeader value) {
  102 + return new JAXBElement<MyHeader>(_MyHeader_QNAME, MyHeader.class, null, value);
  103 + }
  104 +
  105 +}
src/main/java/com/bsth/wsdl/PJDataSerivce.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/wsdl/PJDataSerivce.java
  1 +package com.bsth.wsdl;
  2 +
  3 +import javax.xml.namespace.QName;
  4 +import javax.xml.ws.Service;
  5 +import javax.xml.ws.WebEndpoint;
  6 +import javax.xml.ws.WebServiceClient;
  7 +import javax.xml.ws.WebServiceFeature;
  8 +import java.net.MalformedURLException;
  9 +import java.net.URL;
  10 +
  11 +/**
  12 + * This class was generated by Apache CXF 3.3.2
  13 + * 2019-06-25T10:55:23.807+08:00
  14 + * Generated source version: 3.3.2
  15 + *
  16 + */
  17 +@WebServiceClient(name = "PJDataSerivce",
  18 + wsdlLocation = "http://116.236.238.218:31/PJDataInterface/PJDataService.asmx?wsdl",
  19 + targetNamespace = "http://www.pd-transport.com/")
  20 +public class PJDataSerivce extends Service {
  21 +
  22 + public final static URL WSDL_LOCATION;
  23 +
  24 + public final static QName SERVICE = new QName("http://www.pd-transport.com/", "PJDataSerivce");
  25 + public final static QName PJDataSerivceSoap12 = new QName("http://www.pd-transport.com/", "PJDataSerivceSoap12");
  26 + public final static QName PJDataSerivceSoap = new QName("http://www.pd-transport.com/", "PJDataSerivceSoap");
  27 + static {
  28 + URL url = null;
  29 + try {
  30 + url = new URL("http://116.236.238.218:31/PJDataInterface/PJDataService.asmx?wsdl");
  31 + } catch (MalformedURLException e) {
  32 + java.util.logging.Logger.getLogger(PJDataSerivce.class.getName())
  33 + .log(java.util.logging.Level.INFO,
  34 + "Can not initialize the default wsdl from {0}", "http://116.236.238.218:31/PJDataInterface/PJDataService.asmx?wsdl");
  35 + }
  36 + WSDL_LOCATION = url;
  37 + }
  38 +
  39 + public PJDataSerivce(URL wsdlLocation) {
  40 + super(wsdlLocation, SERVICE);
  41 + }
  42 +
  43 + public PJDataSerivce(URL wsdlLocation, QName serviceName) {
  44 + super(wsdlLocation, serviceName);
  45 + }
  46 +
  47 + public PJDataSerivce() {
  48 + super(WSDL_LOCATION, SERVICE);
  49 + }
  50 +
  51 + public PJDataSerivce(WebServiceFeature ... features) {
  52 + super(WSDL_LOCATION, SERVICE, features);
  53 + }
  54 +
  55 + public PJDataSerivce(URL wsdlLocation, WebServiceFeature ... features) {
  56 + super(wsdlLocation, SERVICE, features);
  57 + }
  58 +
  59 + public PJDataSerivce(URL wsdlLocation, QName serviceName, WebServiceFeature ... features) {
  60 + super(wsdlLocation, serviceName, features);
  61 + }
  62 +
  63 +
  64 +
  65 +
  66 + /**
  67 + *
  68 + * @return
  69 + * returns PJDataSerivceSoap
  70 + */
  71 + @WebEndpoint(name = "PJDataSerivceSoap12")
  72 + public PJDataSerivceSoap getPJDataSerivceSoap12() {
  73 + return super.getPort(PJDataSerivceSoap12, PJDataSerivceSoap.class);
  74 + }
  75 +
  76 + /**
  77 + *
  78 + * @param features
  79 + * A list of {@link WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
  80 + * @return
  81 + * returns PJDataSerivceSoap
  82 + */
  83 + @WebEndpoint(name = "PJDataSerivceSoap12")
  84 + public PJDataSerivceSoap getPJDataSerivceSoap12(WebServiceFeature... features) {
  85 + return super.getPort(PJDataSerivceSoap12, PJDataSerivceSoap.class, features);
  86 + }
  87 +
  88 +
  89 + /**
  90 + *
  91 + * @return
  92 + * returns PJDataSerivceSoap
  93 + */
  94 + @WebEndpoint(name = "PJDataSerivceSoap")
  95 + public PJDataSerivceSoap getPJDataSerivceSoap() {
  96 + return super.getPort(PJDataSerivceSoap, PJDataSerivceSoap.class);
  97 + }
  98 +
  99 + /**
  100 + *
  101 + * @param features
  102 + * A list of {@link WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
  103 + * @return
  104 + * returns PJDataSerivceSoap
  105 + */
  106 + @WebEndpoint(name = "PJDataSerivceSoap")
  107 + public PJDataSerivceSoap getPJDataSerivceSoap(WebServiceFeature... features) {
  108 + return super.getPort(PJDataSerivceSoap, PJDataSerivceSoap.class, features);
  109 + }
  110 +
  111 +}
src/main/java/com/bsth/wsdl/PJDataSerivceSoap.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/wsdl/PJDataSerivceSoap.java
  1 +package com.bsth.wsdl;
  2 +
  3 +import javax.jws.WebMethod;
  4 +import javax.jws.WebParam;
  5 +import javax.jws.WebResult;
  6 +import javax.jws.WebService;
  7 +import javax.xml.bind.annotation.XmlSeeAlso;
  8 +import javax.xml.ws.RequestWrapper;
  9 +import javax.xml.ws.ResponseWrapper;
  10 +
  11 +/**
  12 + * This class was generated by Apache CXF 3.3.2
  13 + * 2019-06-25T10:55:23.796+08:00
  14 + * Generated source version: 3.3.2
  15 + *
  16 + */
  17 +@WebService(targetNamespace = "http://www.pd-transport.com/", name = "PJDataSerivceSoap")
  18 +@XmlSeeAlso({ObjectFactory.class})
  19 +public interface PJDataSerivceSoap {
  20 +
  21 + /**
  22 + * 离退人员信息接口
  23 + */
  24 + @WebMethod(operationName = "GetRetiredInfor", action = "http://www.pd-transport.com/GetRetiredInfor")
  25 + @RequestWrapper(localName = "GetRetiredInfor", targetNamespace = "http://www.pd-transport.com/", className = "com.pd_transport.GetRetiredInfor")
  26 + @ResponseWrapper(localName = "GetRetiredInforResponse", targetNamespace = "http://www.pd-transport.com/", className = "com.pd_transport.GetRetiredInforResponse")
  27 + @WebResult(name = "GetRetiredInforResult", targetNamespace = "http://www.pd-transport.com/")
  28 + public String getRetiredInfor(
  29 +
  30 + @WebParam(name = "UnintCode", targetNamespace = "http://www.pd-transport.com/")
  31 + String unintCode,
  32 + @WebParam(name = "begin_date", targetNamespace = "http://www.pd-transport.com/")
  33 + String beginDate,
  34 + @WebParam(name = "end_date", targetNamespace = "http://www.pd-transport.com/")
  35 + String endDate
  36 + );
  37 +
  38 + /**
  39 + * 薪资信息数据接口
  40 + */
  41 + @WebMethod(operationName = "GetPAItem", action = "http://www.pd-transport.com/GetPAItem")
  42 + @RequestWrapper(localName = "GetPAItem", targetNamespace = "http://www.pd-transport.com/", className = "com.pd_transport.GetPAItem")
  43 + @ResponseWrapper(localName = "GetPAItemResponse", targetNamespace = "http://www.pd-transport.com/", className = "com.pd_transport.GetPAItemResponse")
  44 + @WebResult(name = "GetPAItemResult", targetNamespace = "http://www.pd-transport.com/")
  45 + public String getPAItem(
  46 +
  47 + @WebParam(name = "Year", targetNamespace = "http://www.pd-transport.com/")
  48 + int year,
  49 + @WebParam(name = "Period", targetNamespace = "http://www.pd-transport.com/")
  50 + int period
  51 + );
  52 +
  53 + /**
  54 + * 在职人员信息接口
  55 + */
  56 + @WebMethod(operationName = "GetEmployee", action = "http://www.pd-transport.com/GetEmployee")
  57 + @RequestWrapper(localName = "GetEmployee", targetNamespace = "http://www.pd-transport.com/", className = "com.pd_transport.GetEmployee")
  58 + @ResponseWrapper(localName = "GetEmployeeResponse", targetNamespace = "http://www.pd-transport.com/", className = "com.pd_transport.GetEmployeeResponse")
  59 + @WebResult(name = "GetEmployeeResult", targetNamespace = "http://www.pd-transport.com/")
  60 + public String getEmployee(
  61 +
  62 + @WebParam(name = "UnintCode", targetNamespace = "http://www.pd-transport.com/")
  63 + String unintCode,
  64 + @WebParam(name = "IDCard", targetNamespace = "http://www.pd-transport.com/")
  65 + String idCard
  66 + );
  67 +}
src/main/java/com/bsth/wsdl/PJDataSerivceSoap_PJDataSerivceSoap12_Client.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/wsdl/PJDataSerivceSoap_PJDataSerivceSoap12_Client.java
  1 +
  2 +package com.bsth.wsdl;
  3 +
  4 +/**
  5 + * Please modify this class to meet your needs
  6 + * This class is not complete
  7 + */
  8 +
  9 +import com.alibaba.fastjson.JSONArray;
  10 +import com.alibaba.fastjson.JSONObject;
  11 +import com.bsth.util.XmlToJson;
  12 +import org.springframework.beans.factory.annotation.Autowired;
  13 +import org.springframework.jdbc.core.JdbcTemplate;
  14 +
  15 +import javax.xml.namespace.QName;
  16 +import java.io.File;
  17 +import java.net.MalformedURLException;
  18 +import java.net.URL;
  19 +/**
  20 + * This class was generated by Apache CXF 3.3.2
  21 + * 2019-06-25T10:55:23.727+08:00
  22 + * Generated source version: 3.3.2
  23 + *
  24 + */
  25 +public final class PJDataSerivceSoap_PJDataSerivceSoap12_Client {
  26 +
  27 + @Autowired
  28 + JdbcTemplate jdbcTemplate;
  29 +
  30 + private static final QName SERVICE_NAME = new QName("http://www.pd-transport.com/", "PJDataSerivce");
  31 +
  32 + private PJDataSerivceSoap_PJDataSerivceSoap12_Client() {
  33 + }
  34 +
  35 + public static void main(String args[]) throws Exception {
  36 + URL wsdlURL = PJDataSerivce.WSDL_LOCATION;
  37 + if (args.length > 0 && args[0] != null && !"".equals(args[0])) {
  38 + File wsdlFile = new File(args[0]);
  39 + try {
  40 + if (wsdlFile.exists()) {
  41 + wsdlURL = wsdlFile.toURI().toURL();
  42 + } else {
  43 + wsdlURL = new URL(args[0]);
  44 + }
  45 + } catch (MalformedURLException e) {
  46 + e.printStackTrace();
  47 + }
  48 + }
  49 +
  50 + PJDataSerivce ss = new PJDataSerivce(wsdlURL, SERVICE_NAME);
  51 + PJDataSerivceSoap port = ss.getPJDataSerivceSoap12();
  52 +
  53 + {
  54 + System.out.println("Invoking getRetiredInfor...");
  55 + String _getRetiredInfor_unintCode = "KD01.0110";
  56 + String _getRetiredInfor_beginDate = "1900-01-01";
  57 + String _getRetiredInfor_endDate = "2019-06-25";
  58 + String _getRetiredInfor__return = port.getRetiredInfor(_getRetiredInfor_unintCode, _getRetiredInfor_beginDate, _getRetiredInfor_endDate);
  59 +
  60 + JSONObject jsonInfor = XmlToJson.xml2Json(_getRetiredInfor__return);
  61 + System.out.println("getRetiredInfor.result=" + _getRetiredInfor__return);
  62 + JSONArray jsonArr = JSONArray.parseArray(jsonInfor.get("Retire").toString());
  63 + for(int i=0;i<jsonArr.size()-1; i++){
  64 + JSONObject pjson = jsonArr.getJSONObject(i);
  65 + String codeArr[] = pjson.getString("Code").split("-");
  66 +// if(pjson.getString("EmployeeName").equals("潘英") || pjson.getString("EmployeeName").equals("陆志兴")|| pjson.getString("EmployeeName").equals("沈志钢")){
  67 +// System.out.print(pjson);
  68 +// }
  69 +// if(codeArr.length > 1){
  70 +// if(codeArr[1].equals("016007") || codeArr[1].equals("006005") || codeArr[1].equals("005634") || codeArr[1].equals("007969")){
  71 +// System.out.print(pjson);
  72 +// }
  73 +// } else {
  74 +// System.out.print(codeArr);
  75 +// }
  76 + }
  77 +
  78 + }
  79 +// {
  80 +// System.out.println("Invoking getPAItem...");
  81 +// int _getPAItem_year = 0;
  82 +// int _getPAItem_period = 0;
  83 +// String _getPAItem__return = port.getPAItem(_getPAItem_year, _getPAItem_period);
  84 +// System.out.println("getPAItem.result=" + _getPAItem__return);
  85 +//
  86 +//
  87 +// }
  88 +
  89 + {
  90 + System.out.println("Invoking getEmployee...");
  91 + String _getEmployee_unintCode = "KD01.0112";
  92 + String _getEmployee_idCard = "";
  93 + String _getEmployee__return = port.getEmployee(_getEmployee_unintCode, _getEmployee_idCard);
  94 + JSONObject jsonInfor = XmlToJson.xml2Json(_getEmployee__return);
  95 + JSONArray jsonArr = JSONArray.parseArray(jsonInfor.get("Emp").toString());
  96 + jsonArr.getJSONObject(0).get("Code");
  97 +// jsonArr = JSONArray.fromObject(jsonInfor.get("Emp").toString());
  98 + System.out.println("getEmployee.result=" + _getEmployee__return);
  99 + for(int i=0;i<jsonArr.size()-1; i++){
  100 + JSONObject pjson = jsonArr.getJSONObject(i);
  101 + String codeArr[] = pjson.getString("Code").split("-");
  102 + if(codeArr[1].equals("016007") || codeArr[1].equals("006005") || codeArr[1].equals("005634") || codeArr[1].equals("007969")){
  103 + System.out.print(pjson);
  104 + }
  105 + }
  106 +
  107 + }
  108 +
  109 + System.exit(0);
  110 + }
  111 +
  112 +}
src/main/java/com/bsth/wsdl/PJDataSerivceSoap_PJDataSerivceSoap_Client.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/wsdl/PJDataSerivceSoap_PJDataSerivceSoap_Client.java
  1 +
  2 +package com.bsth.wsdl;
  3 +
  4 +/**
  5 + * Please modify this class to meet your needs
  6 + * This class is not complete
  7 + */
  8 +
  9 +import javax.xml.namespace.QName;
  10 +import java.io.File;
  11 +import java.net.MalformedURLException;
  12 +import java.net.URL;
  13 +
  14 +/**
  15 + * This class was generated by Apache CXF 3.3.2
  16 + * 2019-06-25T10:55:23.780+08:00
  17 + * Generated source version: 3.3.2
  18 + *
  19 + */
  20 +public final class PJDataSerivceSoap_PJDataSerivceSoap_Client {
  21 +
  22 + private static final QName SERVICE_NAME = new QName("http://www.pd-transport.com/", "PJDataSerivce");
  23 +
  24 + private PJDataSerivceSoap_PJDataSerivceSoap_Client() {
  25 + }
  26 +
  27 + public static void main(String args[]) throws Exception {
  28 + URL wsdlURL = PJDataSerivce.WSDL_LOCATION;
  29 + if (args.length > 0 && args[0] != null && !"".equals(args[0])) {
  30 + File wsdlFile = new File(args[0]);
  31 + try {
  32 + if (wsdlFile.exists()) {
  33 + wsdlURL = wsdlFile.toURI().toURL();
  34 + } else {
  35 + wsdlURL = new URL(args[0]);
  36 + }
  37 + } catch (MalformedURLException e) {
  38 + e.printStackTrace();
  39 + }
  40 + }
  41 +
  42 + PJDataSerivce ss = new PJDataSerivce(wsdlURL, SERVICE_NAME);
  43 + PJDataSerivceSoap port = ss.getPJDataSerivceSoap();
  44 +
  45 + {
  46 + System.out.println("Invoking getRetiredInfor...");
  47 + String _getRetiredInfor_unintCode = "";
  48 + String _getRetiredInfor_beginDate = "";
  49 + String _getRetiredInfor_endDate = "";
  50 + String _getRetiredInfor__return = port.getRetiredInfor(_getRetiredInfor_unintCode, _getRetiredInfor_beginDate, _getRetiredInfor_endDate);
  51 + System.out.println("getRetiredInfor.result=" + _getRetiredInfor__return);
  52 +
  53 +
  54 + }
  55 + {
  56 + System.out.println("Invoking getPAItem...");
  57 + int _getPAItem_year = 0;
  58 + int _getPAItem_period = 0;
  59 + String _getPAItem__return = port.getPAItem(_getPAItem_year, _getPAItem_period);
  60 + System.out.println("getPAItem.result=" + _getPAItem__return);
  61 +
  62 +
  63 + }
  64 + {
  65 + System.out.println("Invoking getEmployee...");
  66 + String _getEmployee_unintCode = "";
  67 + String _getEmployee_idCard = "";
  68 + String _getEmployee__return = port.getEmployee(_getEmployee_unintCode, _getEmployee_idCard);
  69 + System.out.println("getEmployee.result=" + _getEmployee__return);
  70 +
  71 +
  72 + }
  73 +
  74 + System.exit(0);
  75 + }
  76 +
  77 +}
src/main/java/com/bsth/wsdl/package-info.java 0 → 100644
  1 +++ a/src/main/java/com/bsth/wsdl/package-info.java
  1 +@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.pd-transport.com/", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
  2 +package com.bsth.wsdl;
src/main/resources/application-dev.properties 0 → 100644
  1 +++ a/src/main/resources/application-dev.properties
  1 +server.port=8776
  2 +management.port= 9001
  3 +management.address= 127.0.0.1
  4 +
  5 +spring.jpa.hibernate.ddl-auto= update
  6 +spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy
  7 +#DATABASE
  8 +spring.jpa.database= MYSQL
  9 +spring.jpa.show-sql= true
  10 +spring.datasource.driver-class-name= com.mysql.jdbc.Driver
  11 +spring.datasource.url= jdbc:mysql://localhost:3306/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
  12 +spring.datasource.username= root
  13 +spring.datasource.password=
  14 +#DATASOURCE
  15 +spring.datasource.max-active=100
  16 +spring.datasource.max-idle=8
  17 +spring.datasource.min-idle=8
  18 +spring.datasource.initial-size=5
  19 +
  20 +spring.datasource.test-on-borrow=true
  21 +spring.datasource.test-on-connect=true
  22 +spring.datasource.test-on-return=true
  23 +spring.datasource.test-while-idle=true
  24 +spring.datasource.validation-query=select 1
  25 +
  26 +## calculator result database
  27 +#calculator.datasource.driver= com.mysql.jdbc.Driver
  28 +#calculator.datasource.url= jdbc:mysql://127.0.0.1/calculator?useUnicode=true&characterEncoding=utf-8&useSSL=false
  29 +#calculator.datasource.username= root
  30 +#calculator.datasource.password= panzhao
src/main/resources/application-prod.properties 0 → 100644
  1 +++ a/src/main/resources/application-prod.properties
  1 +server.port=8776
  2 +management.port= 9001
  3 +management.address= 127.0.0.1
  4 +
  5 +spring.jpa.hibernate.ddl-auto= none
  6 +spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy
  7 +#DATABASE
  8 +spring.jpa.database= MYSQL
  9 +spring.jpa.show-sql= true
  10 +spring.datasource.driver-class-name= com.mysql.jdbc.Driver
  11 +spring.datasource.url= jdbc:mysql://10.10.150.24:3306/control?useUnicode=true&characterEncoding=utf-8&useSSL=false
  12 +spring.datasource.username= root
  13 +spring.datasource.password= root2jsp
  14 +#DATASOURCE
  15 +spring.datasource.max-active=100
  16 +spring.datasource.max-idle=8
  17 +spring.datasource.min-idle=8
  18 +spring.datasource.initial-size=5
  19 +
  20 +spring.datasource.test-on-borrow=true
  21 +spring.datasource.test-on-connect=true
  22 +spring.datasource.test-on-return=true
  23 +spring.datasource.test-while-idle=true
  24 +spring.datasource.validation-query=select 1
  25 +
  26 +## calculator result database
  27 +#calculator.datasource.driver= com.mysql.jdbc.Driver
  28 +#calculator.datasource.url= jdbc:mysql://127.0.0.1/calculator?useUnicode=true&characterEncoding=utf-8&useSSL=false
  29 +#calculator.datasource.username= root
  30 +#calculator.datasource.password= panzhao
src/main/resources/application.properties 0 → 100644
  1 +++ a/src/main/resources/application.properties
  1 +spring.profiles: dev,prod
  2 +spring.profiles.active: prod
  3 +
  4 +spring.view.suffix=.html
  5 +server.session-timeout=-1
  6 +security.basic.enabled=false
  7 +
  8 +# \u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F\u9650\u5236\u914D\u7F6E
  9 +# File size limit
  10 +multipart.maxFileSize = -1
  11 +# Total request size for a multipart/form-data
  12 +multipart.maxRequestSize = -1
  13 +
  14 +server.compression.enabled=true
  15 +server.compression.mime-types=application/json,application/xml,text/html,text/xml,text/plain,text/javascript,text/css,application/javascript
  16 +
  17 +#redis »º´æ¶àÉÙÌìµÄÊý¾Ý
  18 +cache.days=60
  19 +
  20 +
  21 +mybatis.mapper-locations=classpath:mapper/*.xml
src/main/resources/banner.txt 0 → 100644
  1 +++ a/src/main/resources/banner.txt
  1 + ____ _____ _______ _ _
  2 + | _ \ / ____| |__ __| | | | |
  3 + | |_) | | (___ | | | |__| |
  4 + | _ < \___ \ | | | __ |
  5 + | |_) | ____) | | | | | | |
  6 + |____/ |_____/ |_| |_| |_|
  7 +
  8 +Running Spring Boot ${spring-boot.version}
0 \ No newline at end of file 9 \ No newline at end of file
src/main/resources/logback.xml 0 → 100644
  1 +++ a/src/main/resources/logback.xml
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!-- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/2002/xmlspec/dtd/2.10/xmlspec.dtd"> -->
  3 +<configuration>
  4 +
  5 + <!-- <property resource="application.properties" /> -->
  6 + <property name="LOG_BASE" value="E:/personnel_update_log" />
  7 + <!-- 控制台输出 -->
  8 + <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
  9 +
  10 + <layout class="ch.qos.logback.classic.PatternLayout">
  11 + <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 -->
  12 + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%file:%line] %-5level-%msg%n
  13 + </pattern>
  14 + </layout>
  15 + </appender>
  16 +
  17 + <!-- 主日志文件 -->
  18 + <appender name="FILE"
  19 + class="ch.qos.logback.core.rolling.RollingFileAppender">
  20 + <file>${LOG_BASE}/calc_log.log</file>
  21 + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  22 + <fileNamePattern>${LOG_BASE}/personnel_update_log-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
  23 + <timeBasedFileNamingAndTriggeringPolicy
  24 + class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  25 + <maxFileSize>100MB</maxFileSize>
  26 + </timeBasedFileNamingAndTriggeringPolicy>
  27 + </rollingPolicy>
  28 + <encoder>
  29 + <pattern>%msg%n</pattern>
  30 + </encoder>
  31 +
  32 + <layout class="ch.qos.logback.classic.PatternLayout">
  33 + <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 -->
  34 + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%file:%line] %-5level-%msg%n
  35 + </pattern>
  36 + </layout>
  37 + </appender>
  38 +
  39 +
  40 + <!-- 日志输出级别 -->
  41 + <root level="info">
  42 + <appender-ref ref="STDOUT" />
  43 + <appender-ref ref="FILE" />
  44 + </root>
  45 +</configuration>
0 \ No newline at end of file 46 \ No newline at end of file
src/main/resources/personnel-jdbc.properties 0 → 100644
  1 +++ a/src/main/resources/personnel-jdbc.properties
  1 +#ms.mysql.driver= com.mysql.jdbc.Driver
  2 +#ms.mysql.url= jdbc:mysql://127.0.0.1:3306/personnel?useUnicode=true&characterEncoding=utf-8&useSSL=false
  3 +#ms.mysql.username= root
  4 +#ms.mysql.password=
  5 +
  6 +ms.mysql.driver= com.mysql.jdbc.Driver
  7 +ms.mysql.url= jdbc:mysql://10.10.150.24:3306/personnel?useUnicode=true&characterEncoding=utf-8
  8 +ms.mysql.username= root
  9 +ms.mysql.password= root2jsp