首次提交
0 parents
Showing
35 changed files
with
3514 additions
and
0 deletions
.gitignore
0 → 100644
pom.xml
0 → 100644
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <project xmlns="http://maven.apache.org/POM/4.0.0" | ||
3 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
4 | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
5 | <modelVersion>4.0.0</modelVersion> | ||
6 | |||
7 | <groupId>com.pashanhoo</groupId> | ||
8 | <artifactId>hzbdcsyn</artifactId> | ||
9 | <version>1.0-SNAPSHOT</version> | ||
10 | |||
11 | <dependencies> | ||
12 | <!-- --> | ||
13 | <dependency> | ||
14 | <groupId>com.fasterxml.jackson.core</groupId> | ||
15 | <artifactId>jackson-databind</artifactId> | ||
16 | <version>${fasterxml.jackson.version}</version> | ||
17 | </dependency> | ||
18 | |||
19 | <dependency> | ||
20 | <groupId>com.fasterxml.jackson.core</groupId> | ||
21 | <artifactId>jackson-core</artifactId> | ||
22 | <version>${fasterxml.jackson.version}</version> | ||
23 | </dependency> | ||
24 | <dependency> | ||
25 | <groupId>org.springframework.boot</groupId> | ||
26 | <artifactId>spring-boot</artifactId> | ||
27 | <version>${org.spring.boot.version}</version> | ||
28 | </dependency> | ||
29 | <dependency> | ||
30 | <groupId>org.freemarker</groupId> | ||
31 | <artifactId>freemarker</artifactId> | ||
32 | <version>2.3.29</version> | ||
33 | </dependency> | ||
34 | <dependency> | ||
35 | <groupId>junit</groupId> | ||
36 | <artifactId>junit</artifactId> | ||
37 | <version>4.12</version> | ||
38 | </dependency> | ||
39 | <dependency> | ||
40 | <groupId>org.slf4j</groupId> | ||
41 | <artifactId>slf4j-api</artifactId> | ||
42 | <version>1.7.29</version> | ||
43 | </dependency> | ||
44 | |||
45 | <dependency> | ||
46 | <groupId>com.baomidou</groupId> | ||
47 | <artifactId>mybatis-plus-boot-starter</artifactId> | ||
48 | <version>3.1.2</version> | ||
49 | </dependency> | ||
50 | <dependency> | ||
51 | <groupId>com.baomidou</groupId> | ||
52 | <artifactId>mybatis-plus-generator</artifactId> | ||
53 | <version>3.3.2</version> | ||
54 | </dependency> | ||
55 | |||
56 | <dependency> | ||
57 | <groupId>org.springframework</groupId> | ||
58 | <artifactId>spring-web</artifactId> | ||
59 | <version>${org.springframework.version}</version> | ||
60 | </dependency> | ||
61 | <dependency> | ||
62 | <groupId>org.springframework.boot</groupId> | ||
63 | <artifactId>spring-boot-starter-web</artifactId> | ||
64 | <version>${org.spring.boot.version}</version> | ||
65 | </dependency> | ||
66 | <dependency> | ||
67 | <groupId>org.apache.commons</groupId> | ||
68 | <artifactId>commons-lang3</artifactId> | ||
69 | <version>3.3.2</version> | ||
70 | </dependency> | ||
71 | |||
72 | <!--<dependency>--> | ||
73 | <!-- <groupId>org.springframework.session</groupId>--> | ||
74 | <!-- <artifactId>spring-session-data-redis</artifactId>--> | ||
75 | <!-- <version>${org.spring.session.version}</version>--> | ||
76 | <!--</dependency>--> | ||
77 | <!--<!– 引入Redis依赖 –>--> | ||
78 | <!--<dependency>--> | ||
79 | <!-- <groupId>org.springframework.boot</groupId>--> | ||
80 | <!-- <artifactId>spring-boot-starter-data-redis</artifactId>--> | ||
81 | <!-- <version>${org.spring.boot.version}</version>--> | ||
82 | <!--</dependency>--> | ||
83 | <!--<dependency>--> | ||
84 | <!-- <groupId>redis.clients</groupId>--> | ||
85 | <!-- <artifactId>jedis</artifactId>--> | ||
86 | <!-- <version>2.9.3</version>--> | ||
87 | <!--</dependency>--> | ||
88 | <!--<dependency>--> | ||
89 | <!-- <groupId>org.springframework.session</groupId>--> | ||
90 | <!-- <artifactId>spring-session</artifactId>--> | ||
91 | <!-- <version>1.0.2.RELEASE</version>--> | ||
92 | <!--</dependency>--> | ||
93 | <dependency> | ||
94 | <groupId>io.lettuce</groupId> | ||
95 | <artifactId>lettuce-core</artifactId> | ||
96 | <version>5.2.0.RELEASE</version> | ||
97 | </dependency> | ||
98 | <dependency> | ||
99 | <groupId>org.springframework.boot</groupId> | ||
100 | <artifactId>spring-boot-starter-test</artifactId> | ||
101 | <version>2.1.12.RELEASE</version> | ||
102 | </dependency> | ||
103 | |||
104 | <!-- Swagger API文档 --> | ||
105 | <dependency> | ||
106 | <groupId>io.springfox</groupId> | ||
107 | <artifactId>springfox-swagger2</artifactId> | ||
108 | <version>${springfox.swagger2.version}</version> | ||
109 | </dependency> | ||
110 | <dependency> | ||
111 | <groupId>io.springfox</groupId> | ||
112 | <artifactId>springfox-swagger-ui</artifactId> | ||
113 | <version>${springfox.swagger2.version}</version> | ||
114 | <exclusions> | ||
115 | <exclusion> | ||
116 | <groupId>io.swagger</groupId> | ||
117 | <artifactId>swagger-models</artifactId> | ||
118 | </exclusion> | ||
119 | </exclusions> | ||
120 | </dependency> | ||
121 | <dependency> | ||
122 | <groupId>io.swagger</groupId> | ||
123 | <artifactId>swagger-models</artifactId> | ||
124 | <version>1.5.21</version> | ||
125 | </dependency> | ||
126 | |||
127 | <dependency> | ||
128 | <groupId>com.spring4all</groupId> | ||
129 | <artifactId>swagger-spring-boot-starter</artifactId> | ||
130 | <version>1.9.1.RELEASE</version> | ||
131 | </dependency> | ||
132 | |||
133 | <dependency> | ||
134 | <groupId>org.projectlombok</groupId> | ||
135 | <artifactId>lombok</artifactId> | ||
136 | <optional>true</optional> | ||
137 | <version>1.16.20</version> | ||
138 | </dependency> | ||
139 | |||
140 | <dependency> | ||
141 | <groupId>io.swagger</groupId> | ||
142 | <artifactId>swagger-annotations</artifactId> | ||
143 | <version>1.5.13</version> | ||
144 | <scope>compile</scope> | ||
145 | </dependency> | ||
146 | |||
147 | <dependency> | ||
148 | <groupId>com.google.guava</groupId> | ||
149 | <artifactId>guava</artifactId> | ||
150 | <version>20.0</version> | ||
151 | <scope>compile</scope> | ||
152 | </dependency> | ||
153 | <dependency> | ||
154 | <groupId>commons-collections</groupId> | ||
155 | <artifactId>commons-collections</artifactId> | ||
156 | <version>3.2.2</version> | ||
157 | </dependency> | ||
158 | <dependency> | ||
159 | <groupId>commons-codec</groupId> | ||
160 | <artifactId>commons-codec</artifactId> | ||
161 | <version>1.10</version> | ||
162 | </dependency> | ||
163 | <dependency> | ||
164 | <groupId>commons-beanutils</groupId> | ||
165 | <artifactId>commons-beanutils</artifactId> | ||
166 | <version>1.9.3</version> | ||
167 | </dependency> | ||
168 | <dependency> | ||
169 | <groupId>javax.validation</groupId> | ||
170 | <artifactId>validation-api</artifactId> | ||
171 | <version>2.0.1.Final</version> | ||
172 | </dependency> | ||
173 | <dependency> | ||
174 | <groupId>org.hibernate</groupId> | ||
175 | <artifactId>hibernate-validator</artifactId> | ||
176 | <version>5.2.4.Final</version> | ||
177 | </dependency> | ||
178 | |||
179 | <dependency> | ||
180 | <groupId>com.github.pagehelper</groupId> | ||
181 | <artifactId>pagehelper-spring-boot-starter</artifactId> | ||
182 | <version>1.2.5</version> | ||
183 | </dependency> | ||
184 | <dependency> | ||
185 | <groupId>org.springframework.boot</groupId> | ||
186 | <artifactId>spring-boot-starter-aop</artifactId> | ||
187 | <version>${org.spring.boot.version}</version> | ||
188 | </dependency> | ||
189 | <dependency> | ||
190 | <groupId>org.aspectj</groupId> | ||
191 | <artifactId>aspectjweaver</artifactId> | ||
192 | <version>1.9.4</version> | ||
193 | </dependency> | ||
194 | <dependency> | ||
195 | <groupId>com.alibaba</groupId> | ||
196 | <artifactId>fastjson</artifactId> | ||
197 | <version>1.2.60</version> | ||
198 | </dependency> | ||
199 | <dependency> | ||
200 | <groupId>org.springframework.data</groupId> | ||
201 | <artifactId>spring-data-redis</artifactId> | ||
202 | <version>2.1.10.RELEASE</version> | ||
203 | <scope>compile</scope> | ||
204 | </dependency> | ||
205 | <dependency> | ||
206 | <groupId>org.apache.commons</groupId> | ||
207 | <artifactId>commons-lang3</artifactId> | ||
208 | <version>3.3.2</version> | ||
209 | </dependency> | ||
210 | <dependency> | ||
211 | <groupId>com.baomidou</groupId> | ||
212 | <artifactId>mybatis-plus-annotation</artifactId> | ||
213 | <version>3.3.2</version> | ||
214 | <scope>compile</scope> | ||
215 | </dependency> | ||
216 | <dependency> | ||
217 | <groupId>com.baomidou</groupId> | ||
218 | <artifactId>mybatis-plus-core</artifactId> | ||
219 | <version>3.3.2</version> | ||
220 | <scope>compile</scope> | ||
221 | </dependency> | ||
222 | <dependency> | ||
223 | <groupId>org.mapstruct</groupId> | ||
224 | <artifactId>mapstruct-jdk8</artifactId> | ||
225 | <version>${mapstruct.version}</version> | ||
226 | </dependency> | ||
227 | <dependency> | ||
228 | <groupId>org.mapstruct</groupId> | ||
229 | <artifactId>mapstruct-processor</artifactId> | ||
230 | <version>${mapstruct.version}</version> | ||
231 | </dependency> | ||
232 | <!-- <dependency> | ||
233 | <groupId>polaris</groupId> | ||
234 | <artifactId>polaris-fileattachment</artifactId> | ||
235 | <version>1.0</version> | ||
236 | <scope>compile</scope> | ||
237 | </dependency>--> | ||
238 | <dependency> | ||
239 | <groupId>io.minio</groupId> | ||
240 | <artifactId>minio</artifactId> | ||
241 | <version>8.3.4</version> | ||
242 | </dependency> | ||
243 | |||
244 | <dependency> | ||
245 | <groupId>com.google.zxing</groupId> | ||
246 | <artifactId>core</artifactId> | ||
247 | <version>3.4.1</version> | ||
248 | </dependency> | ||
249 | |||
250 | <dependency> | ||
251 | <groupId>com.oracle</groupId> | ||
252 | <artifactId>ojdbc6</artifactId> | ||
253 | <version>${oracle.version}</version> | ||
254 | </dependency> | ||
255 | |||
256 | <dependency> | ||
257 | <groupId>cn.hutool</groupId> | ||
258 | <artifactId>hutool-all</artifactId> | ||
259 | <version>5.7.16</version> | ||
260 | </dependency> | ||
261 | |||
262 | <dependency> | ||
263 | <groupId>com.github.jsqlparser</groupId> | ||
264 | <artifactId>jsqlparser</artifactId> | ||
265 | <version>1.4</version> | ||
266 | </dependency> | ||
267 | |||
268 | <dependency> | ||
269 | <groupId>com.baomidou</groupId> | ||
270 | <artifactId>dynamic-datasource-spring-boot-starter</artifactId> | ||
271 | <version>3.5.0</version> | ||
272 | </dependency> | ||
273 | |||
274 | <dependency> | ||
275 | <groupId>net.sourceforge.tess4j</groupId> | ||
276 | <artifactId>tess4j</artifactId> | ||
277 | <version>4.5.3</version> | ||
278 | </dependency> | ||
279 | <dependency> | ||
280 | <groupId>net.glxn.qrgen</groupId> | ||
281 | <artifactId>javase</artifactId> | ||
282 | <version>2.0</version> | ||
283 | </dependency> | ||
284 | <dependency> | ||
285 | <groupId>org.ofdrw</groupId> | ||
286 | <artifactId>ofdrw-full</artifactId> | ||
287 | <version>1.8.6</version> | ||
288 | </dependency> | ||
289 | |||
290 | </dependencies> | ||
291 | |||
292 | <build> | ||
293 | <plugins> | ||
294 | <plugin> | ||
295 | <groupId>org.springframework.boot</groupId> | ||
296 | <artifactId>spring-boot-maven-plugin</artifactId> | ||
297 | <version>2.2.8.RELEASE</version> | ||
298 | <executions> | ||
299 | <execution> | ||
300 | <goals> | ||
301 | <goal>repackage</goal> | ||
302 | </goals> | ||
303 | </execution> | ||
304 | </executions> | ||
305 | </plugin> | ||
306 | <plugin> | ||
307 | <groupId>org.apache.maven.plugins</groupId> | ||
308 | <artifactId>maven-surefire-plugin</artifactId> | ||
309 | <version>2.22.2</version> | ||
310 | <configuration> | ||
311 | <skip>true</skip> | ||
312 | </configuration> | ||
313 | </plugin> | ||
314 | <plugin> | ||
315 | <groupId>org.apache.maven.plugins</groupId> | ||
316 | <artifactId>maven-compiler-plugin</artifactId> | ||
317 | <configuration> | ||
318 | <source>8</source> | ||
319 | <target>8</target> | ||
320 | </configuration> | ||
321 | </plugin> | ||
322 | </plugins> | ||
323 | |||
324 | <resources> | ||
325 | <resource> | ||
326 | <directory>src/main/resources</directory> | ||
327 | <excludes> | ||
328 | <!--使用通配符,当然可以定义多个exclude标签进行排除--> | ||
329 | <exclude>application*.yml</exclude> | ||
330 | </excludes> | ||
331 | </resource> | ||
332 | |||
333 | <!--根据激活条件引入打包所需的配置和文件--> | ||
334 | <resource> | ||
335 | <directory>src/main/resources</directory> | ||
336 | <!--引入所需环境的配置文件--> | ||
337 | <filtering>true</filtering> | ||
338 | <includes> | ||
339 | <include>application.yaml</include> | ||
340 | <!--根据maven选择环境导入配置文件--> | ||
341 | <include>application-${profile.active}.yaml</include> | ||
342 | </includes> | ||
343 | </resource> | ||
344 | </resources> | ||
345 | </build> | ||
346 | |||
347 | <profiles> | ||
348 | <profile> | ||
349 | <!--不同环境的唯一id--> | ||
350 | <id>dev</id> | ||
351 | <activation> | ||
352 | <activeByDefault>true</activeByDefault> | ||
353 | </activation> | ||
354 | <properties> | ||
355 | <profile.active>dev</profile.active> | ||
356 | </properties> | ||
357 | </profile> | ||
358 | |||
359 | <!--生产环境--> | ||
360 | <profile> | ||
361 | <id>prod</id> | ||
362 | <properties> | ||
363 | <profile.active>prod</profile.active> | ||
364 | </properties> | ||
365 | </profile> | ||
366 | </profiles> | ||
367 | |||
368 | <properties> | ||
369 | <oracle.version>11.2.0.4</oracle.version> | ||
370 | <geotools.version>24-SNAPSHOT</geotools.version> | ||
371 | <org.springframework.version>5.1.8.RELEASE</org.springframework.version> | ||
372 | <org.spring.boot.version>2.1.8.RELEASE</org.spring.boot.version> | ||
373 | <org.spring.amqp>2.2.2.RELEASE</org.spring.amqp> | ||
374 | <org.spring.security.version>5.1.6.RELEASE</org.spring.security.version> | ||
375 | <!--<org.spring.session.version>2.1.4.RELEASE</org.spring.session.version>--> | ||
376 | <fasterxml.jackson.version>2.10.0</fasterxml.jackson.version> | ||
377 | <maven-deploy-plugin_version>2.8.2</maven-deploy-plugin_version> | ||
378 | <mybatis-plus.version>3.1.2</mybatis-plus.version> | ||
379 | <springfox.spring.web.version>2.9.2</springfox.spring.web.version> | ||
380 | <springfox.swagger2.version>2.9.2</springfox.swagger2.version> | ||
381 | <mapstruct.version>1.3.0.Final</mapstruct.version> | ||
382 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
383 | </properties> | ||
384 | |||
385 | </project> |
src/main/java/com/pashanhoo/Application.java
0 → 100644
1 | package com.pashanhoo; | ||
2 | |||
3 | import org.mybatis.spring.annotation.MapperScan; | ||
4 | import org.springframework.boot.SpringApplication; | ||
5 | import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
6 | import org.springframework.transaction.annotation.EnableTransactionManagement; | ||
7 | |||
8 | @SpringBootApplication(scanBasePackages={"com.pashanhoo"}) | ||
9 | @EnableTransactionManagement | ||
10 | @MapperScan(basePackages = {"com.pashanhoo.**.mapper"}) | ||
11 | public class Application { | ||
12 | public static void main(String[] args) { | ||
13 | SpringApplication app = new SpringApplication(Application.class); | ||
14 | app.run(args); | ||
15 | } | ||
16 | } |
1 | package com.pashanhoo; | ||
2 | |||
3 | import io.swagger.annotations.Api; | ||
4 | import org.springframework.context.annotation.Bean; | ||
5 | import org.springframework.context.annotation.Configuration; | ||
6 | import springfox.documentation.builders.ApiInfoBuilder; | ||
7 | import springfox.documentation.builders.PathSelectors; | ||
8 | import springfox.documentation.builders.RequestHandlerSelectors; | ||
9 | import springfox.documentation.service.ApiInfo; | ||
10 | import springfox.documentation.spi.DocumentationType; | ||
11 | import springfox.documentation.spring.web.plugins.Docket; | ||
12 | import springfox.documentation.swagger2.annotations.EnableSwagger2; | ||
13 | |||
14 | /** | ||
15 | * swagger配置类 | ||
16 | */ | ||
17 | @Configuration | ||
18 | @EnableSwagger2 | ||
19 | public class SwaggerConfig { | ||
20 | @Bean | ||
21 | public Docket createRestApi() { | ||
22 | return new Docket(DocumentationType.SWAGGER_2) | ||
23 | .apiInfo(apiInfo()) | ||
24 | .select() | ||
25 | // 为当前包路径 | ||
26 | .apis(RequestHandlerSelectors.basePackage("com.pashanhoo")) | ||
27 | .apis(RequestHandlerSelectors.withClassAnnotation(Api.class)) | ||
28 | .paths(PathSelectors.any()) | ||
29 | .build(); | ||
30 | } | ||
31 | |||
32 | // 构建 api文档的详细信息函数,注意这里的注解引用的是哪个 | ||
33 | private ApiInfo apiInfo() { | ||
34 | return new ApiInfoBuilder() | ||
35 | // 页面标题 | ||
36 | .title("接口文档") | ||
37 | // 版本号 | ||
38 | .version("1.0") | ||
39 | // 描述 | ||
40 | .description("API 描述") | ||
41 | .build(); | ||
42 | } | ||
43 | |||
44 | } |
1 | package com.pashanhoo.common; | ||
2 | |||
3 | public interface CommonConstant { | ||
4 | |||
5 | /** | ||
6 | * 新增校验报错状态 | ||
7 | */ | ||
8 | Integer CHECK_ERROR_2002=2002; | ||
9 | /** | ||
10 | * {@code 500 Server Error} (HTTP/1.0 - RFC 1945) | ||
11 | */ | ||
12 | Integer SC_INTERNAL_SERVER_ERROR_500 = 500; | ||
13 | /** | ||
14 | * {@code 200 OK} (HTTP/1.0 - RFC 1945) | ||
15 | */ | ||
16 | Integer SC_OK_200 = 200; | ||
17 | |||
18 | /** | ||
19 | * {@code 200 OK} (HTTP/1.0 - RFC 1945) | ||
20 | */ | ||
21 | Integer SC_INFO_206 = 206; | ||
22 | |||
23 | /** | ||
24 | * {@code 200 OK} (HTTP/1.0 - RFC 1945) | ||
25 | */ | ||
26 | Integer SC_INFO_210 = 210; | ||
27 | |||
28 | /** | ||
29 | * 字典信息缓存 | ||
30 | */ | ||
31 | String SYS_DICT_NAME = "sys:dict:name:"; | ||
32 | |||
33 | /** | ||
34 | * 字典信息缓存 | ||
35 | */ | ||
36 | String SYS_DICT_ID = "sys:dict:id:"; | ||
37 | |||
38 | /** | ||
39 | * 字典信息单条 | ||
40 | */ | ||
41 | String SYS_DICT_ALL = "sys:dict:all:"; | ||
42 | |||
43 | /** | ||
44 | * 字典信息缓存 | ||
45 | */ | ||
46 | String SYS_DICT_CODE = "sys:dict:code:"; | ||
47 | |||
48 | /** | ||
49 | * 菜单列表 | ||
50 | */ | ||
51 | String MENU_TREE = "sys:menu:"; | ||
52 | |||
53 | |||
54 | } |
1 | package com.pashanhoo.common; | ||
2 | |||
3 | import com.alibaba.fastjson.JSONObject; | ||
4 | import org.slf4j.Logger; | ||
5 | import org.slf4j.LoggerFactory; | ||
6 | import org.springframework.beans.factory.annotation.Value; | ||
7 | import org.springframework.stereotype.Component; | ||
8 | |||
9 | import java.io.*; | ||
10 | import java.net.HttpURLConnection; | ||
11 | import java.net.URL; | ||
12 | import java.text.SimpleDateFormat; | ||
13 | import java.util.Date; | ||
14 | import java.util.HashMap; | ||
15 | import java.util.Map; | ||
16 | @Component | ||
17 | public class EciHttpUtil { | ||
18 | |||
19 | private static Logger logger = LoggerFactory.getLogger(EciHttpUtil.class); | ||
20 | @Value("${app.AppToken}") | ||
21 | private String appToken; | ||
22 | @Value("${app.AppSecret}") | ||
23 | private String appSecret; | ||
24 | |||
25 | @Value("${app.hostUrl}") | ||
26 | private String hostUrl; | ||
27 | |||
28 | |||
29 | |||
30 | |||
31 | public Map doPostForNew(String url, String params) { | ||
32 | logger.info("http request url:" + url); | ||
33 | logger.info("http request url:" + params); | ||
34 | PrintWriter out = null; | ||
35 | BufferedReader in = null; | ||
36 | Map jsonObject = new HashMap(); | ||
37 | try{ | ||
38 | URL url1=new URL(url); | ||
39 | HttpURLConnection conn= (HttpURLConnection) url1.openConnection(); | ||
40 | conn.setRequestMethod("POST"); | ||
41 | conn.setRequestProperty("accept","*/*"); | ||
42 | conn.setRequestProperty("connection","Keep-Alive"); | ||
43 | conn.setDoInput(true); | ||
44 | conn.setDoOutput(true); | ||
45 | conn.setRequestProperty("Content-Type", "application/json;charset=utf-8"); | ||
46 | //x-qys-signature生成方式:Md5(AppToken + AppSecret + timestamp),获取32位小写值 | ||
47 | long times=System.currentTimeMillis(); | ||
48 | String unSignature = appToken + appSecret + times; | ||
49 | String signature = MD5Util.getMD5(unSignature); | ||
50 | conn.setRequestProperty("x-qys-accesstoken", appToken); | ||
51 | conn.setRequestProperty("x-qys-signature", signature); | ||
52 | conn.setRequestProperty("x-qys-timestamp", String.valueOf(times)); | ||
53 | |||
54 | logger.info("x-qys-accesstoken==="+appToken); | ||
55 | logger.info("x-qys-signature==="+signature); | ||
56 | logger.info("x-qys-timestamp==="+System.currentTimeMillis()); | ||
57 | |||
58 | |||
59 | out=new PrintWriter(new OutputStreamWriter(conn.getOutputStream(),"utf-8")); | ||
60 | out.print(params); | ||
61 | out.flush(); | ||
62 | in = new BufferedReader(new InputStreamReader(conn.getInputStream(),"UTF-8")); | ||
63 | String result=""; | ||
64 | String line; | ||
65 | while ((line = in.readLine()) != null) { | ||
66 | result += line; | ||
67 | } | ||
68 | jsonObject = JSONObject.parseObject(result, Map.class); | ||
69 | }catch (Exception ex){ | ||
70 | logger.info("发送 POST 请求出现异常!" + ex); | ||
71 | ex.printStackTrace(); | ||
72 | }finally { | ||
73 | try { | ||
74 | if (out != null) { | ||
75 | out.close(); | ||
76 | } | ||
77 | if (in != null) { | ||
78 | in.close(); | ||
79 | } | ||
80 | } catch (IOException ex) { | ||
81 | ex.printStackTrace(); | ||
82 | } | ||
83 | } | ||
84 | return jsonObject; | ||
85 | } | ||
86 | |||
87 | public Map doGetForNew(String url) { | ||
88 | logger.info("http request url:" + url); | ||
89 | BufferedReader in = null; | ||
90 | String result = ""; | ||
91 | Map jsonObject = new HashMap(); | ||
92 | try{ | ||
93 | URL url1=new URL(url); | ||
94 | HttpURLConnection conn= (HttpURLConnection) url1.openConnection(); | ||
95 | conn.setRequestMethod("GET"); | ||
96 | conn.setRequestProperty("accept","*/*"); | ||
97 | conn.setRequestProperty("connection","Keep-Alive"); | ||
98 | conn.setRequestProperty("Charset", "utf-8"); | ||
99 | conn.setDoInput(true); | ||
100 | conn.setDoOutput(false); | ||
101 | //x-qys-signature生成方式:Md5(AppToken + AppSecret + timestamp),获取32位小写值 | ||
102 | long times=System.currentTimeMillis(); | ||
103 | String unSignature = appToken +appSecret + times; | ||
104 | String signature = MD5Util.getMD5(unSignature); | ||
105 | conn.setRequestProperty("x-qys-accesstoken", appToken); | ||
106 | conn.setRequestProperty("x-qys-signature", signature); | ||
107 | conn.setRequestProperty("x-qys-timestamp", String.valueOf(times)); | ||
108 | |||
109 | logger.info("x-qys-accesstoken==="+appToken); | ||
110 | logger.info("x-qys-signature==="+signature); | ||
111 | logger.info("x-qys-timestamp==="+System.currentTimeMillis()); | ||
112 | |||
113 | conn.connect(); | ||
114 | in = new BufferedReader(new InputStreamReader(conn.getInputStream(),"UTF-8")); | ||
115 | String line; | ||
116 | while ((line = in.readLine()) != null) { | ||
117 | result += line; | ||
118 | } | ||
119 | jsonObject = JSONObject.parseObject(result, Map.class); | ||
120 | }catch (Exception ex){ | ||
121 | logger.info("发送 POST 请求出现异常!" + ex); | ||
122 | ex.printStackTrace(); | ||
123 | }finally { | ||
124 | try { | ||
125 | if (in != null) { | ||
126 | in.close(); | ||
127 | } | ||
128 | } catch (IOException ex) { | ||
129 | ex.printStackTrace(); | ||
130 | } | ||
131 | } | ||
132 | return jsonObject; | ||
133 | } | ||
134 | |||
135 | |||
136 | |||
137 | /** | ||
138 | * 文件下载 | ||
139 | * | ||
140 | * @param documentId 合同文档ID | ||
141 | * @return | ||
142 | */ | ||
143 | public String download(String documentId,String bh) { | ||
144 | String url = hostUrl + "/document/download" + "?documentId=" + documentId; | ||
145 | InputStream in = null; | ||
146 | String absolutePath = ""; | ||
147 | OutputStream out = null; | ||
148 | try{ | ||
149 | URL url1=new URL(url); | ||
150 | HttpURLConnection conn= (HttpURLConnection) url1.openConnection(); | ||
151 | conn.setRequestMethod("GET"); | ||
152 | conn.setRequestProperty("accept","*/*"); | ||
153 | conn.setRequestProperty("connection","Keep-Alive"); | ||
154 | conn.setRequestProperty("Charset", "utf-8"); | ||
155 | conn.setDoInput(true); | ||
156 | conn.setDoOutput(true); | ||
157 | long times=System.currentTimeMillis(); | ||
158 | //x-qys-signature生成方式:Md5(AppToken + AppSecret + timestamp),获取32位小写值 | ||
159 | String unSignature = appToken + appSecret + times; | ||
160 | String signature = MD5Util.getMD5(unSignature); | ||
161 | conn.setRequestProperty("x-qys-accesstoken", appToken); | ||
162 | conn.setRequestProperty("x-qys-signature", signature); | ||
163 | conn.setRequestProperty("x-qys-timestamp", String.valueOf(times)); | ||
164 | |||
165 | logger.info("x-qys-accesstoken==="+appToken); | ||
166 | logger.info("x-qys-signature==="+signature); | ||
167 | logger.info("x-qys-timestamp==="+System.currentTimeMillis()); | ||
168 | |||
169 | conn.connect(); | ||
170 | in =conn.getInputStream(); | ||
171 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy"); | ||
172 | String dateDir = simpleDateFormat.format(new Date()); | ||
173 | File savePath = new File("D:\\ECI\\" + dateDir+bh); | ||
174 | if (!savePath.exists()) { | ||
175 | savePath.mkdirs(); | ||
176 | } | ||
177 | File filePath = new File(savePath + "\\" + documentId+".ofd"); | ||
178 | if (!filePath.exists()){ | ||
179 | filePath.createNewFile(); | ||
180 | } | ||
181 | out = new FileOutputStream(filePath); | ||
182 | byte[] buffer = new byte[4096]; | ||
183 | int readLength = 0; | ||
184 | |||
185 | while ((readLength = in.read(buffer)) != -1) { | ||
186 | out.write(buffer, 0, readLength); | ||
187 | } | ||
188 | absolutePath = filePath.getAbsolutePath(); | ||
189 | out.flush(); | ||
190 | }catch (Exception ex){ | ||
191 | logger.info("发送 POST 请求出现异常!" + ex); | ||
192 | ex.printStackTrace(); | ||
193 | }finally { | ||
194 | try { | ||
195 | if (in != null) { | ||
196 | in.close(); | ||
197 | } | ||
198 | if(out != null) { | ||
199 | out.close(); | ||
200 | } | ||
201 | } catch (IOException ex) { | ||
202 | ex.printStackTrace(); | ||
203 | } | ||
204 | } | ||
205 | return absolutePath; | ||
206 | } | ||
207 | |||
208 | |||
209 | |||
210 | |||
211 | |||
212 | |||
213 | |||
214 | } |
1 | package com.pashanhoo.common; | ||
2 | |||
3 | import java.security.MessageDigest; | ||
4 | |||
5 | public class MD5Util { | ||
6 | |||
7 | public static String getMD5(String unEncryption) { | ||
8 | char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; | ||
9 | |||
10 | try { | ||
11 | byte[] btInput = unEncryption.getBytes(); | ||
12 | // 获得MD5摘要算法的 MessageDigest 对象 | ||
13 | MessageDigest mdInst = MessageDigest.getInstance("MD5"); | ||
14 | // 使用指定的字节更新摘要 | ||
15 | mdInst.update(btInput); | ||
16 | // 获得密文 | ||
17 | byte[] md = mdInst.digest(); | ||
18 | // 把密文转换成十六进制的字符串形式 | ||
19 | char[] str = new char[md.length * 2]; | ||
20 | int k = 0; | ||
21 | for (byte byte0 : md) { | ||
22 | str[k++] = hexDigits[byte0 >>> 4 & 0xf]; | ||
23 | str[k++] = hexDigits[byte0 & 0xf]; | ||
24 | } | ||
25 | return new String(str).toLowerCase(); | ||
26 | } catch (Exception e) { | ||
27 | e.printStackTrace(); | ||
28 | return null; | ||
29 | } | ||
30 | } | ||
31 | } |
1 | package com.pashanhoo.common; | ||
2 | |||
3 | import com.baomidou.mybatisplus.core.toolkit.StringUtils; | ||
4 | import io.swagger.annotations.ApiModelProperty; | ||
5 | import lombok.Data; | ||
6 | |||
7 | @Data | ||
8 | public class PageInfo { | ||
9 | @ApiModelProperty(name = "currentPage",value = "页码") | ||
10 | private Integer currentPage = 1; | ||
11 | |||
12 | @ApiModelProperty(name = "pageSize",value = "每页个数") | ||
13 | private Integer pageSize = 10; | ||
14 | |||
15 | @ApiModelProperty(name = "sortField",value = "排序字段" ) | ||
16 | private String sortField; | ||
17 | |||
18 | @ApiModelProperty(name = "sortOrder",value = "升序(asc)或降序(desc)") | ||
19 | private String sortOrder; | ||
20 | |||
21 | public void defaultFillPageProp(String sortField, String sortOrder) { | ||
22 | if(StringUtils.isBlank(this.sortField)) { | ||
23 | this.sortField = sortField; | ||
24 | this.sortOrder = sortOrder; | ||
25 | } | ||
26 | } | ||
27 | } |
1 | package com.pashanhoo.common; | ||
2 | |||
3 | import com.baomidou.mybatisplus.core.toolkit.StringUtils; | ||
4 | import org.apache.commons.codec.binary.Base64; | ||
5 | |||
6 | import java.io.*; | ||
7 | |||
8 | public class PdfUtil { | ||
9 | |||
10 | |||
11 | /** | ||
12 | * 获取文件base64 | ||
13 | * | ||
14 | */ | ||
15 | public static String fileToBase64(InputStream in) { | ||
16 | String base64String=""; | ||
17 | try { | ||
18 | byte[] bytes = toByteArray(in); | ||
19 | in.read(bytes); | ||
20 | base64String = Base64.encodeBase64String(bytes); | ||
21 | |||
22 | } catch (FileNotFoundException e) { | ||
23 | e.printStackTrace(); | ||
24 | } catch (IOException e) { | ||
25 | e.printStackTrace(); | ||
26 | } finally { | ||
27 | if (null != in) { | ||
28 | try { | ||
29 | in.close(); | ||
30 | } catch (IOException e) { | ||
31 | e.printStackTrace(); | ||
32 | } | ||
33 | } | ||
34 | return base64String; | ||
35 | } | ||
36 | } | ||
37 | |||
38 | public static byte[] toByteArray(InputStream input) throws IOException { | ||
39 | ByteArrayOutputStream output = new ByteArrayOutputStream(); | ||
40 | byte[] buffer = new byte[1024*4]; | ||
41 | int n = 0; | ||
42 | while (-1 != (n = input.read(buffer))) { | ||
43 | output.write(buffer, 0, n); | ||
44 | } | ||
45 | return output.toByteArray(); | ||
46 | } | ||
47 | } |
1 | package com.pashanhoo.common; | ||
2 | |||
3 | |||
4 | |||
5 | |||
6 | import net.glxn.qrgen.core.image.ImageType; | ||
7 | import net.glxn.qrgen.javase.QRCode; | ||
8 | |||
9 | import java.io.ByteArrayOutputStream; | ||
10 | import java.io.File; | ||
11 | import java.io.FileOutputStream; | ||
12 | import java.io.OutputStream; | ||
13 | |||
14 | public class QRCodeUtil { | ||
15 | |||
16 | |||
17 | public static void imgUrl(String url,String fileName) { | ||
18 | try{ | ||
19 | ByteArrayOutputStream out= QRCode.from(url).to(ImageType.PNG).stream(); | ||
20 | byte[] data = out.toByteArray(); | ||
21 | OutputStream oute = new FileOutputStream(new File("E:\\ewm\\"+fileName)); | ||
22 | oute.write(data); | ||
23 | oute.flush(); | ||
24 | oute.close(); | ||
25 | }catch(Exception ex){ | ||
26 | ex.printStackTrace(); | ||
27 | } | ||
28 | |||
29 | } | ||
30 | |||
31 | |||
32 | |||
33 | |||
34 | } |
1 | package com.pashanhoo.common; | ||
2 | |||
3 | import com.pashanhoo.qys.service.EciService; | ||
4 | import org.springframework.beans.factory.annotation.Autowired; | ||
5 | import org.springframework.context.annotation.Configuration; | ||
6 | import org.springframework.scheduling.annotation.EnableScheduling; | ||
7 | import org.springframework.scheduling.annotation.Scheduled; | ||
8 | |||
9 | @Configuration | ||
10 | @EnableScheduling | ||
11 | public class QysTask { | ||
12 | @Autowired | ||
13 | private EciService eciService; | ||
14 | |||
15 | @Scheduled(cron="0 0/5 * * * ?") | ||
16 | public void accessCreateContract() { | ||
17 | System.out.println("===========创建合同定时任务进来了========="); | ||
18 | eciService.accessCreateContract(); | ||
19 | System.out.println("===========创建合同定时任务走了========="); | ||
20 | } | ||
21 | |||
22 | } |
1 | package com.pashanhoo.common; | ||
2 | |||
3 | import com.fasterxml.jackson.annotation.JsonInclude; | ||
4 | import io.swagger.annotations.ApiModel; | ||
5 | import io.swagger.annotations.ApiModelProperty; | ||
6 | |||
7 | import java.io.Serializable; | ||
8 | |||
9 | @ApiModel(value = "接口返回对象", description = "接口返回对象") | ||
10 | @JsonInclude | ||
11 | public class Result<T> implements Serializable { | ||
12 | |||
13 | private static final long serialVersionUID = 1L; | ||
14 | |||
15 | /** | ||
16 | * 成功标志 | ||
17 | */ | ||
18 | @ApiModelProperty(value = "成功标志") | ||
19 | private boolean success = true; | ||
20 | |||
21 | /** | ||
22 | * 返回处理消息 | ||
23 | */ | ||
24 | @ApiModelProperty(value = "返回处理消息") | ||
25 | private String message = "操作成功!"; | ||
26 | |||
27 | /** | ||
28 | * 返回代码 | ||
29 | */ | ||
30 | @ApiModelProperty(value = "返回代码") | ||
31 | private Integer code = 0; | ||
32 | |||
33 | /** | ||
34 | * 返回数据对象 data | ||
35 | */ | ||
36 | @ApiModelProperty(value = "返回数据对象") | ||
37 | private T result; | ||
38 | |||
39 | /** | ||
40 | * 时间戳 | ||
41 | */ | ||
42 | @ApiModelProperty(value = "时间戳") | ||
43 | private long timestamp = System.currentTimeMillis(); | ||
44 | |||
45 | public Result() { | ||
46 | |||
47 | } | ||
48 | |||
49 | public Result<T> success(String message) { | ||
50 | this.message = message; | ||
51 | this.code = CommonConstant.SC_OK_200; | ||
52 | this.success = true; | ||
53 | return this; | ||
54 | } | ||
55 | |||
56 | |||
57 | public static Result<Object> ok() { | ||
58 | Result<Object> r = new Result<Object>(); | ||
59 | r.setSuccess(true); | ||
60 | r.setCode(CommonConstant.SC_OK_200); | ||
61 | r.setMessage("成功"); | ||
62 | return r; | ||
63 | } | ||
64 | |||
65 | public static Result<Object> ok(String msg) { | ||
66 | Result<Object> r = new Result<Object>(); | ||
67 | r.setSuccess(true); | ||
68 | r.setCode(CommonConstant.SC_OK_200); | ||
69 | r.setMessage(msg); | ||
70 | return r; | ||
71 | } | ||
72 | |||
73 | public static <T> Result<T> ok(T data) { | ||
74 | Result<T> r = new Result<T>(); | ||
75 | r.setSuccess(true); | ||
76 | r.setCode(CommonConstant.SC_OK_200); | ||
77 | r.setResult(data); | ||
78 | return r; | ||
79 | } | ||
80 | |||
81 | public static Result<String> content(String data) { | ||
82 | Result<String> r = new Result<String>(); | ||
83 | r.setSuccess(true); | ||
84 | r.setCode(CommonConstant.SC_OK_200); | ||
85 | r.setResult(data); | ||
86 | return r; | ||
87 | } | ||
88 | public static Result<Object> info(Object data) { | ||
89 | Result<Object> r = new Result<Object>(); | ||
90 | r.setSuccess(false); | ||
91 | r.setCode(CommonConstant.SC_INFO_206); | ||
92 | r.setResult(data); | ||
93 | return r; | ||
94 | } | ||
95 | |||
96 | public static Result<Object> exception(String data) { | ||
97 | Result<Object> r = new Result<Object>(); | ||
98 | r.setSuccess(false); | ||
99 | r.setCode(CommonConstant.SC_INFO_210); | ||
100 | r.setMessage(data); | ||
101 | return r; | ||
102 | } | ||
103 | |||
104 | public static <T> Result<T> ok(T data, String msg) { | ||
105 | Result<T> r = new Result<T>(); | ||
106 | r.setSuccess(true); | ||
107 | r.setMessage(msg); | ||
108 | r.setCode(CommonConstant.SC_OK_200); | ||
109 | r.setResult(data); | ||
110 | return r; | ||
111 | } | ||
112 | |||
113 | public static Result<String> error(String msg) { | ||
114 | return error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, msg); | ||
115 | } | ||
116 | public static Result<String> checkError(String msg) { | ||
117 | return error(CommonConstant.CHECK_ERROR_2002, msg); | ||
118 | } | ||
119 | |||
120 | public static Result<String> error(int code, String msg) { | ||
121 | Result<String> r = new Result<String>(); | ||
122 | r.setCode(code); | ||
123 | r.setMessage(msg); | ||
124 | r.setSuccess(false); | ||
125 | return r; | ||
126 | } | ||
127 | |||
128 | public static <T> Result<T> error(String message, T data) { | ||
129 | Result<T> r = new Result<T>(); | ||
130 | r.setMessage(message); | ||
131 | r.setResult(data); | ||
132 | r.setCode(CommonConstant.SC_INTERNAL_SERVER_ERROR_500); | ||
133 | r.setSuccess(false); | ||
134 | return r; | ||
135 | } | ||
136 | |||
137 | public Result<T> error500(String message) { | ||
138 | this.message = message; | ||
139 | this.code = CommonConstant.SC_INTERNAL_SERVER_ERROR_500; | ||
140 | this.success = false; | ||
141 | return this; | ||
142 | } | ||
143 | |||
144 | // /** | ||
145 | // * 无权限访问返回结果 | ||
146 | // */ | ||
147 | // public static Result<String> noauth(String msg) { | ||
148 | // return error(CommonConstant.SC_JEECG_NO_AUTHZ, msg); | ||
149 | // } | ||
150 | |||
151 | public static long getSerialVersionUID() { | ||
152 | return serialVersionUID; | ||
153 | } | ||
154 | |||
155 | public boolean getSuccess() { | ||
156 | return success; | ||
157 | } | ||
158 | |||
159 | public void setSuccess(boolean success) { | ||
160 | this.success = success; | ||
161 | } | ||
162 | |||
163 | public String getMessage() { | ||
164 | return message; | ||
165 | } | ||
166 | |||
167 | public void setMessage(String message) { | ||
168 | this.message = message; | ||
169 | } | ||
170 | |||
171 | public Integer getCode() { | ||
172 | return code; | ||
173 | } | ||
174 | |||
175 | public void setCode(Integer code) { | ||
176 | this.code = code; | ||
177 | } | ||
178 | |||
179 | public T getResult() { | ||
180 | return result; | ||
181 | } | ||
182 | |||
183 | public void setResult(T result) { | ||
184 | this.result = result; | ||
185 | } | ||
186 | |||
187 | public long getTimestamp() { | ||
188 | return timestamp; | ||
189 | } | ||
190 | |||
191 | public void setTimestamp(long timestamp) { | ||
192 | this.timestamp = timestamp; | ||
193 | } | ||
194 | |||
195 | } |
1 | package com.pashanhoo.common; | ||
2 | |||
3 | |||
4 | import com.pashanhoo.zhj.service.ZhjDatasSynService; | ||
5 | import org.springframework.beans.factory.annotation.Autowired; | ||
6 | import org.springframework.context.annotation.Configuration; | ||
7 | import org.springframework.scheduling.annotation.EnableScheduling; | ||
8 | |||
9 | @Configuration | ||
10 | @EnableScheduling | ||
11 | |||
12 | public class ZhjTask { | ||
13 | |||
14 | @Autowired | ||
15 | private ZhjDatasSynService zhjDatasSynService; | ||
16 | //@Scheduled(cron="0 0 21 * * ? ") | ||
17 | public void execute() { | ||
18 | System.out.println("===========每天晚上九点定时任务进来了========="); | ||
19 | zhjDatasSynService.send_bdcYwInfo(); | ||
20 | System.out.println("===========每天晚上九点定时任务走了========="); | ||
21 | } | ||
22 | |||
23 | } |
1 | package com.pashanhoo.config; | ||
2 | |||
3 | import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; | ||
4 | import org.springframework.context.annotation.Bean; | ||
5 | import org.springframework.context.annotation.Configuration; | ||
6 | |||
7 | @Configuration | ||
8 | public class MybatisPlusConfig { | ||
9 | /** | ||
10 | * 分页插件 | ||
11 | */ | ||
12 | @Bean | ||
13 | public PaginationInterceptor paginationInterceptor() { | ||
14 | return new PaginationInterceptor(); | ||
15 | } | ||
16 | |||
17 | } |
1 | package com.pashanhoo.qys.controller; | ||
2 | |||
3 | import com.pashanhoo.common.Result; | ||
4 | import com.pashanhoo.qys.service.EciService; | ||
5 | import io.swagger.annotations.Api; | ||
6 | import io.swagger.annotations.ApiOperation; | ||
7 | import io.swagger.annotations.ApiParam; | ||
8 | import org.springframework.beans.factory.annotation.Autowired; | ||
9 | import org.springframework.web.bind.annotation.*; | ||
10 | |||
11 | @RestController | ||
12 | @RequestMapping("/eci/") | ||
13 | @Api(tags = "电子证照相关接口") | ||
14 | public class EciController { | ||
15 | @Autowired | ||
16 | private EciService eciService; | ||
17 | |||
18 | @PostMapping("accessCreateContract") | ||
19 | @ApiOperation("创建合同接口") | ||
20 | public Result accessCreateContract(@ApiParam("不动产权基本信息id")@RequestParam String zsbs,@ApiParam("证件号码")@RequestParam String qlrzjh,@ApiParam("证书编号")@RequestParam String bh) { | ||
21 | eciService.createContractForHandle(zsbs,qlrzjh,bh); | ||
22 | return Result.ok(); | ||
23 | } | ||
24 | @GetMapping("accessDetails") | ||
25 | @ApiOperation("合同详情接口") | ||
26 | public Result accessDetails(@ApiParam("电子证照表主键ID")@RequestParam String biz_id) { | ||
27 | eciService.accessDetailsForHandle(biz_id); | ||
28 | return Result.ok(); | ||
29 | } | ||
30 | @GetMapping("accessDownload") | ||
31 | @ApiOperation("下载合同文档接口") | ||
32 | public Result accessDownload(@ApiParam("电子证照表主键ID")@RequestParam String biz_id) { | ||
33 | eciService.accessDownloadForHandle(biz_id); | ||
34 | return Result.ok(); | ||
35 | } | ||
36 | @GetMapping("convert") | ||
37 | @ApiOperation("ofd转换服务接口") | ||
38 | public Result convert(@ApiParam("电子证照表主键ID")@RequestParam String biz_id) { | ||
39 | eciService.convertElecForHandle(biz_id); | ||
40 | return Result.ok(); | ||
41 | } | ||
42 | |||
43 | } |
1 | package com.pashanhoo.qys.entity; | ||
2 | |||
3 | import lombok.Data; | ||
4 | import lombok.EqualsAndHashCode; | ||
5 | |||
6 | import java.io.Serializable; | ||
7 | |||
8 | @Data | ||
9 | @EqualsAndHashCode(callSuper = false) | ||
10 | public class ActionRequest implements Serializable { | ||
11 | private static final long serialVersionUID = 1L; | ||
12 | |||
13 | /** | ||
14 | * 是 | ||
15 | * 签署动作类型:CORPORATE(企业签章),PERSONAL(个人签字),LP(法定代表人签字),AUDIT(审批) | ||
16 | */ | ||
17 | private String type; | ||
18 | |||
19 | /** | ||
20 | * 是 | ||
21 | * 签署动作名称 | ||
22 | */ | ||
23 | private String name; | ||
24 | |||
25 | /** | ||
26 | * 是 | ||
27 | * 签署动作名称 | ||
28 | */ | ||
29 | private String autoSign; | ||
30 | |||
31 | /** | ||
32 | * 是 | ||
33 | * 签署顺序(从1开始);如果想按顺序签署,则分别设置签署动作的serialNo为1,2,3;如果想无序签署,则设置签署动作的serialNo为1,1,1;设置签署动作顺序为1,2,2时,表示第一个先签署,后两个同时签署。 | ||
34 | */ | ||
35 | private Integer serialNo; | ||
36 | |||
37 | |||
38 | } |
1 | package com.pashanhoo.qys.entity; | ||
2 | |||
3 | import lombok.Data; | ||
4 | import lombok.EqualsAndHashCode; | ||
5 | import org.springframework.web.multipart.MultipartFile; | ||
6 | |||
7 | import java.io.Serializable; | ||
8 | import java.util.List; | ||
9 | |||
10 | |||
11 | /** | ||
12 | * 创建合同请求实体 | ||
13 | */ | ||
14 | @Data | ||
15 | @EqualsAndHashCode(callSuper = false) | ||
16 | public class CreateContractRequest implements Serializable { | ||
17 | private static final long serialVersionUID = 1L; | ||
18 | /** | ||
19 | * 是 | ||
20 | * 合同名称 | ||
21 | */ | ||
22 | private String subject; | ||
23 | |||
24 | /** | ||
25 | * 否 | ||
26 | * 合同编号,对接方系统中的业务编号 | ||
27 | */ | ||
28 | private String sn; | ||
29 | |||
30 | |||
31 | |||
32 | /** | ||
33 | * 否 | ||
34 | * 用印流程ID | ||
35 | */ | ||
36 | private String categoryId; | ||
37 | |||
38 | |||
39 | |||
40 | /** | ||
41 | * 否 | ||
42 | * 是否发起合同,默认true。(true:立即发起;false:保存为草稿) | ||
43 | */ | ||
44 | private boolean send; | ||
45 | |||
46 | |||
47 | |||
48 | |||
49 | /** | ||
50 | * 否 | ||
51 | * 合同创建人姓名 | ||
52 | */ | ||
53 | private String creatorName; | ||
54 | |||
55 | /** | ||
56 | * 否 | ||
57 | * 合同创建人手机号码 | ||
58 | */ | ||
59 | private String creatorContact; | ||
60 | |||
61 | |||
62 | |||
63 | /** | ||
64 | * 否 | ||
65 | * 发起方名称 | ||
66 | */ | ||
67 | private String tenantName; | ||
68 | |||
69 | /** | ||
70 | * 受理申请pdf文件 | ||
71 | */ | ||
72 | private MultipartFile file; | ||
73 | |||
74 | /** | ||
75 | * title | ||
76 | */ | ||
77 | private String title; | ||
78 | |||
79 | /** | ||
80 | * title | ||
81 | */ | ||
82 | private String fileType; | ||
83 | |||
84 | |||
85 | /** | ||
86 | * 否 | ||
87 | * 签署方,为空时在合同签署完成后需要调用接口“封存合同”主动结束合同 | ||
88 | */ | ||
89 | private List<SignatoryRequest> signatories; | ||
90 | |||
91 | /** | ||
92 | * 否 | ||
93 | * 模板参数 | ||
94 | */ | ||
95 | private List<DocumentParam> documentParams; | ||
96 | |||
97 | |||
98 | |||
99 | |||
100 | |||
101 | } |
1 | package com.pashanhoo.qys.entity; | ||
2 | |||
3 | import lombok.Data; | ||
4 | import lombok.EqualsAndHashCode; | ||
5 | |||
6 | import java.io.Serializable; | ||
7 | @Data | ||
8 | @EqualsAndHashCode(callSuper = false) | ||
9 | public class DocumentParam implements Serializable { | ||
10 | private static final long serialVersionUID = 1L; | ||
11 | |||
12 | /** | ||
13 | * 是 | ||
14 | * 模板参数名称 | ||
15 | */ | ||
16 | private String name; | ||
17 | |||
18 | /** | ||
19 | * 是 | ||
20 | * 模板参数值 | ||
21 | */ | ||
22 | private String value; | ||
23 | |||
24 | } |
1 | package com.pashanhoo.qys.entity; | ||
2 | |||
3 | import com.baomidou.mybatisplus.annotation.IdType; | ||
4 | import com.baomidou.mybatisplus.annotation.TableField; | ||
5 | import com.baomidou.mybatisplus.annotation.TableId; | ||
6 | import com.baomidou.mybatisplus.annotation.TableName; | ||
7 | import lombok.Data; | ||
8 | import lombok.EqualsAndHashCode; | ||
9 | |||
10 | import java.util.Date; | ||
11 | /** | ||
12 | * 电子证照表实体 | ||
13 | */ | ||
14 | @Data | ||
15 | @EqualsAndHashCode(callSuper = false) | ||
16 | @TableName("ELEC_LICENSE_INFO") | ||
17 | public class ElecLicenseInfoDo { | ||
18 | /** | ||
19 | * 合同标识,主键,自己生成 | ||
20 | */ | ||
21 | /** | ||
22 | * 主键 | ||
23 | */ | ||
24 | @TableId(value = "BIZ_ID", type = IdType.UUID) | ||
25 | private String bizId; | ||
26 | |||
27 | /** | ||
28 | * 合同ID | ||
29 | */ | ||
30 | @TableField("CONTRACT_ID") | ||
31 | private Long contractId; | ||
32 | |||
33 | /** | ||
34 | * 模板参数 | ||
35 | */ | ||
36 | @TableField("DOCUMENT_PARAM") | ||
37 | private String documentParam; | ||
38 | |||
39 | /** | ||
40 | * 合同文档ID | ||
41 | */ | ||
42 | @TableField("DOCUMENT_ID") | ||
43 | private String documentId; | ||
44 | |||
45 | /** | ||
46 | * 合同类型.1:不动产登记证明.2:不动产权证书.3:不动产查询证明 | ||
47 | */ | ||
48 | @TableField("HTLX") | ||
49 | private String htlx; | ||
50 | |||
51 | /** | ||
52 | * 业务号 | ||
53 | */ | ||
54 | @TableField("YWH") | ||
55 | private String ywh; | ||
56 | |||
57 | /** | ||
58 | * 证书标识 | ||
59 | */ | ||
60 | @TableField("ZSBS") | ||
61 | private String zsbs; | ||
62 | |||
63 | /** | ||
64 | * 提交参数 | ||
65 | */ | ||
66 | @TableField("TJCS") | ||
67 | private String tjcs; | ||
68 | |||
69 | /** | ||
70 | * 返回结果 | ||
71 | */ | ||
72 | @TableField("FHJG") | ||
73 | private String fhjg; | ||
74 | |||
75 | /** | ||
76 | * 推送状态 | ||
77 | */ | ||
78 | @TableField("TSZT") | ||
79 | private String tszt; | ||
80 | |||
81 | /** | ||
82 | * 合同状态(DRAFT:草稿,FILLING:拟定中,SIGNING:签署中,COMPLETE:已完成,REJECTED:已退回,RECALLED:已撤回,EXPIRED:已过期,TERMINATING:作废中,TERMINATED:已作废,DELETE:已删除,FINISHED:强制完成) | ||
83 | */ | ||
84 | @TableField("HTZT") | ||
85 | private String htzt; | ||
86 | |||
87 | /** | ||
88 | * 推送时间 | ||
89 | */ | ||
90 | @TableField("TSSJ") | ||
91 | private Date tssj; | ||
92 | |||
93 | /** | ||
94 | * 是否下载 1是2否 | ||
95 | */ | ||
96 | @TableField("SFXZ") | ||
97 | private String sfxz; | ||
98 | |||
99 | /** | ||
100 | * ofd文件地址 | ||
101 | */ | ||
102 | @TableField("OFD_WJDZ") | ||
103 | private String ofdWjdz; | ||
104 | |||
105 | /** | ||
106 | * 是否转换1是2否 | ||
107 | */ | ||
108 | @TableField("SFZH") | ||
109 | private String sfzh; | ||
110 | |||
111 | /** | ||
112 | * jpg文件地址 | ||
113 | */ | ||
114 | @TableField("JPG_WJDZ") | ||
115 | private String jpgWjdz; | ||
116 | |||
117 | /** | ||
118 | * jpg文件地址 | ||
119 | */ | ||
120 | @TableField("SIGN_URL") | ||
121 | private String signUrl; | ||
122 | /** | ||
123 | * 备注 | ||
124 | */ | ||
125 | @TableField("BZ") | ||
126 | private String bz; | ||
127 | /** | ||
128 | * 二维码图片 | ||
129 | */ | ||
130 | @TableField("EWMIMAGE") | ||
131 | private byte[] ewmimage; | ||
132 | /** | ||
133 | * 0:临时状态,1:现势,2:历史状态 | ||
134 | */ | ||
135 | @TableField("DZZZ_STATE") | ||
136 | private String dzzz_state; | ||
137 | /** | ||
138 | * 0:正常,1:创建合同接口报错,2:合同详情接口报错,3:下载ofd接口报错,4:ofd转换接口报错 | ||
139 | */ | ||
140 | @TableField("ERR_STATE") | ||
141 | private String err_state; | ||
142 | /** | ||
143 | * 证书编号 | ||
144 | */ | ||
145 | @TableField("ZSBH") | ||
146 | private String zsbh; | ||
147 | /** | ||
148 | * 权利人名称 | ||
149 | */ | ||
150 | @TableField("QLRMC") | ||
151 | private String qlrmc; | ||
152 | /** | ||
153 | * 证件号 | ||
154 | */ | ||
155 | @TableField("ZJH") | ||
156 | private String zjh; | ||
157 | |||
158 | |||
159 | } |
1 | package com.pashanhoo.qys.entity; | ||
2 | |||
3 | import lombok.Data; | ||
4 | import lombok.EqualsAndHashCode; | ||
5 | |||
6 | import java.io.Serializable; | ||
7 | import java.util.List; | ||
8 | |||
9 | @Data | ||
10 | @EqualsAndHashCode(callSuper = false) | ||
11 | public class SignatoryRequest implements Serializable { | ||
12 | private static final long serialVersionUID = 1L; | ||
13 | |||
14 | /** | ||
15 | * 是 | ||
16 | * 签约主体类型:COMPANY(外部企业),PERSONAL(个人) | ||
17 | */ | ||
18 | private String tenantType; | ||
19 | |||
20 | /** | ||
21 | * 是 | ||
22 | * 签约主体名称 | ||
23 | */ | ||
24 | private String tenantName; | ||
25 | |||
26 | |||
27 | /** | ||
28 | * 是 | ||
29 | * 签署顺序(从1开始);如果想按顺序签署,则分别设置签署方的serialNo为1,2,3;如果想无序签署,则设置签署方的serialNo为1,1,1;设置签署方顺序为1,2,2时,表示第一个先签署,后两个同时签署。 | ||
30 | */ | ||
31 | private Integer serialNo; | ||
32 | |||
33 | /** | ||
34 | * 是 | ||
35 | * 签约主体名称 | ||
36 | */ | ||
37 | private String contact; | ||
38 | |||
39 | |||
40 | /** | ||
41 | * 否 | ||
42 | * 签署动作,用印流程非预设且签署方为发起方时,使用用户传入的签署动作,其余情况使用用印流程的配置 | ||
43 | */ | ||
44 | private List<ActionRequest> actions; | ||
45 | } |
1 | package com.pashanhoo.qys.mapper; | ||
2 | |||
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
4 | import com.pashanhoo.qys.entity.ElecLicenseInfoDo; | ||
5 | import org.apache.ibatis.annotations.Param; | ||
6 | |||
7 | import java.util.List; | ||
8 | |||
9 | public interface ElecLicenseInfoMapper extends BaseMapper<ElecLicenseInfoDo> { | ||
10 | |||
11 | List<ElecLicenseInfoDo> getEciInfoByZsbs(String zsbs); | ||
12 | |||
13 | |||
14 | List<ElecLicenseInfoDo> getDocumentIdIsNull(String ywh); | ||
15 | /** | ||
16 | * 获取合同文档ID已经入库并且还未下载集合 | ||
17 | * | ||
18 | * @return | ||
19 | */ | ||
20 | List<ElecLicenseInfoDo> getWaitForDownload(String ywh); | ||
21 | /** | ||
22 | * 获取已经下载还未转换的集合 | ||
23 | * | ||
24 | * @return | ||
25 | */ | ||
26 | List<ElecLicenseInfoDo> getWaitForConvert(String ywh); | ||
27 | /** | ||
28 | * 根据业务号和不动产单元号查询义务人名称 | ||
29 | */ | ||
30 | List<String> getYwrMcByCOnditon(@Param("ywh")String ywh, @Param("bdcdyh")String bdcdyh); | ||
31 | |||
32 | |||
33 | void updateEciInfo(@Param("bizId")String bizId); | ||
34 | |||
35 | |||
36 | ElecLicenseInfoDo getElecLicenseInfo(ElecLicenseInfoDo elecLicenseInfoDo); | ||
37 | |||
38 | |||
39 | |||
40 | |||
41 | } |
1 | package com.pashanhoo.qys.service; | ||
2 | |||
3 | import com.baomidou.mybatisplus.extension.service.IService; | ||
4 | import com.pashanhoo.common.Result; | ||
5 | import com.pashanhoo.qys.entity.ElecLicenseInfoDo; | ||
6 | |||
7 | |||
8 | |||
9 | |||
10 | public interface EciService extends IService<ElecLicenseInfoDo> { | ||
11 | |||
12 | /** | ||
13 | * 定时任务执行接口 | ||
14 | */ | ||
15 | void accessCreateContract(); | ||
16 | |||
17 | /** | ||
18 | * 手动执行创建合同 | ||
19 | */ | ||
20 | Result createContractForHandle(String zsbs,String qlrzjh,String bh); | ||
21 | |||
22 | /** | ||
23 | * 手动执行获取详情 | ||
24 | */ | ||
25 | Result accessDetailsForHandle(String biz_id); | ||
26 | /** | ||
27 | * 手动执行下载合同 | ||
28 | */ | ||
29 | Result accessDownloadForHandle(String biz_id); | ||
30 | /** | ||
31 | * 手动执行ofd转换 | ||
32 | */ | ||
33 | Result convertElecForHandle(String biz_id); | ||
34 | |||
35 | |||
36 | } |
1 | package com.pashanhoo.qys.service.impl; | ||
2 | |||
3 | import com.alibaba.fastjson.JSON; | ||
4 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
5 | import com.pashanhoo.common.EciHttpUtil; | ||
6 | import com.pashanhoo.common.Result; | ||
7 | import com.pashanhoo.qys.entity.ElecLicenseInfoDo; | ||
8 | import com.pashanhoo.qys.mapper.ElecLicenseInfoMapper; | ||
9 | import com.pashanhoo.qys.service.EciService; | ||
10 | import com.pashanhoo.zhj.mapper.RegBusBdcqzsdjxxMapper; | ||
11 | import net.glxn.qrgen.core.image.ImageType; | ||
12 | import net.glxn.qrgen.javase.QRCode; | ||
13 | import org.apache.commons.codec.binary.Base64; | ||
14 | import org.apache.commons.lang3.StringUtils; | ||
15 | import org.ofdrw.converter.ImageMaker; | ||
16 | import org.ofdrw.reader.OFDReader; | ||
17 | import org.slf4j.Logger; | ||
18 | import org.slf4j.LoggerFactory; | ||
19 | import org.springframework.beans.factory.annotation.Autowired; | ||
20 | import org.springframework.beans.factory.annotation.Value; | ||
21 | import org.springframework.stereotype.Service; | ||
22 | |||
23 | import javax.imageio.ImageIO; | ||
24 | import java.awt.image.BufferedImage; | ||
25 | import java.io.ByteArrayOutputStream; | ||
26 | import java.io.File; | ||
27 | import java.io.IOException; | ||
28 | import java.net.URLEncoder; | ||
29 | import java.nio.file.Path; | ||
30 | import java.nio.file.Paths; | ||
31 | import java.text.SimpleDateFormat; | ||
32 | import java.util.*; | ||
33 | |||
34 | |||
35 | @Service | ||
36 | public class EciServiceImpl extends ServiceImpl<ElecLicenseInfoMapper, ElecLicenseInfoDo> implements EciService { | ||
37 | |||
38 | private static Logger logger = LoggerFactory.getLogger(EciServiceImpl.class); | ||
39 | @Value("${app.hostUrl}") | ||
40 | private String hostUrl; | ||
41 | |||
42 | @Value("${app.bdcdjzmlc}") | ||
43 | private String bdcdjzmlc; | ||
44 | |||
45 | @Value("${app.bdcqzslc}") | ||
46 | private String bdcqzslc; | ||
47 | |||
48 | @Autowired | ||
49 | private RegBusBdcqzsdjxxMapper regBusBdcqzsdjxxMapper; | ||
50 | @Autowired | ||
51 | private ElecLicenseInfoMapper elecLicenseInfoMapper; | ||
52 | @Autowired | ||
53 | private EciHttpUtil eciHttpUtil; | ||
54 | |||
55 | |||
56 | |||
57 | @Override | ||
58 | public void accessCreateContract() { | ||
59 | try{ | ||
60 | List<Map> list=assemblyInfo(); | ||
61 | if(list!=null && list.size()>0){ | ||
62 | for (int i = 0; i < list.size(); i++) { | ||
63 | //=========创建合同t============== | ||
64 | ElecLicenseInfoDo elecLicenseInfo=createContract(list.get(i)); | ||
65 | if(null==elecLicenseInfo || !"0".equals(elecLicenseInfo.getErr_state())){ | ||
66 | continue; | ||
67 | } | ||
68 | //=========合同详情============== | ||
69 | ElecLicenseInfoDo details=accessDetails(elecLicenseInfo); | ||
70 | if(null==details || !"0".equals(details.getErr_state())){ | ||
71 | continue; | ||
72 | } | ||
73 | //=========证照下载============== | ||
74 | ElecLicenseInfoDo download=accessDownload(details); | ||
75 | if(null==download || !"0".equals(download.getErr_state())){ | ||
76 | continue; | ||
77 | } | ||
78 | //=========ofd转换============== | ||
79 | ElecLicenseInfoDo ofdzh=convertElec(download); | ||
80 | if(null==ofdzh || !"0".equals(ofdzh.getErr_state())){ | ||
81 | continue; | ||
82 | } | ||
83 | //修改电子证书标识 | ||
84 | elecLicenseInfoMapper.updateEciInfo(ofdzh.getBizId()); | ||
85 | } | ||
86 | } | ||
87 | }catch (Exception ex){ | ||
88 | ex.printStackTrace(); | ||
89 | } | ||
90 | } | ||
91 | |||
92 | @Override | ||
93 | public Result createContractForHandle(String zsbs, String qlrzjh, String bh) { | ||
94 | List<Map> list=createInfoByHandle(zsbs,qlrzjh,bh); | ||
95 | if(list!=null && list.size()>0){ | ||
96 | for (int i = 0; i < list.size(); i++) { | ||
97 | createContract(list.get(i)); | ||
98 | } | ||
99 | } | ||
100 | return Result.ok(); | ||
101 | } | ||
102 | |||
103 | @Override | ||
104 | public Result accessDetailsForHandle(String biz_id) { | ||
105 | ElecLicenseInfoDo elecLicenseInfoDo=this.getById(biz_id); | ||
106 | if(elecLicenseInfoDo!=null){ | ||
107 | accessDetails(elecLicenseInfoDo); | ||
108 | } | ||
109 | return Result.ok(); | ||
110 | } | ||
111 | |||
112 | @Override | ||
113 | public Result accessDownloadForHandle(String biz_id) { | ||
114 | ElecLicenseInfoDo elecLicenseInfoDo=this.getById(biz_id); | ||
115 | if(elecLicenseInfoDo!=null){ | ||
116 | accessDownload(elecLicenseInfoDo); | ||
117 | } | ||
118 | return Result.ok(); | ||
119 | } | ||
120 | |||
121 | @Override | ||
122 | public Result convertElecForHandle(String biz_id) { | ||
123 | ElecLicenseInfoDo elecLicenseInfoDo=this.getById(biz_id); | ||
124 | if(elecLicenseInfoDo!=null){ | ||
125 | convertElec(elecLicenseInfoDo); | ||
126 | elecLicenseInfoMapper.updateEciInfo(biz_id); | ||
127 | } | ||
128 | return Result.ok(); | ||
129 | } | ||
130 | |||
131 | /** | ||
132 | *插入电子证照表记录 | ||
133 | * @param tjcs | ||
134 | * @param documentParam | ||
135 | * @param backjson | ||
136 | * @param jbxxmap | ||
137 | */ | ||
138 | public ElecLicenseInfoDo insertEciInfo(String tjcs,String documentParam, Map backjson,Map jbxxmap){ | ||
139 | ElecLicenseInfoDo elecLicenseInfoDo=new ElecLicenseInfoDo(); | ||
140 | elecLicenseInfoDo.setTjcs(tjcs); | ||
141 | elecLicenseInfoDo.setDocumentParam(documentParam); | ||
142 | elecLicenseInfoDo.setZsbh((String) jbxxmap.get("BH")); | ||
143 | elecLicenseInfoDo.setQlrmc((String) jbxxmap.get("QLRMC")); | ||
144 | elecLicenseInfoDo.setZjh((String) jbxxmap.get("ZJH")); | ||
145 | if(backjson.isEmpty()){ | ||
146 | elecLicenseInfoDo.setErr_state("1"); | ||
147 | }else{ | ||
148 | if ((Integer)backjson.get("code")==0) { | ||
149 | Long contractId = Long.valueOf((String) backjson.get("contractId")); | ||
150 | //合同ID入库 | ||
151 | elecLicenseInfoDo.setContractId(contractId); | ||
152 | elecLicenseInfoDo.setErr_state("0"); | ||
153 | regBusBdcqzsdjxxMapper.updateBdcqzsjbxxInfo((String) jbxxmap.get("ID")); | ||
154 | }else{ | ||
155 | elecLicenseInfoDo.setErr_state("1"); | ||
156 | } | ||
157 | } | ||
158 | elecLicenseInfoDo.setYwh((String) jbxxmap.get("YWH")); | ||
159 | if(((String)jbxxmap.get("BDCQZH")).contains("证明")){ | ||
160 | elecLicenseInfoDo.setHtlx("1"); | ||
161 | }else{ | ||
162 | elecLicenseInfoDo.setHtlx("2"); | ||
163 | } | ||
164 | elecLicenseInfoDo.setZsbs((String) jbxxmap.get("ID")); | ||
165 | elecLicenseInfoDo.setEwmimage(getImage((String) jbxxmap.get("ID"),(String) jbxxmap.get("QLRMC"),(String) jbxxmap.get("ZJH"))); | ||
166 | //返回结果入库 | ||
167 | elecLicenseInfoDo.setFhjg(JSON.toJSONString(backjson)); | ||
168 | //未下载 | ||
169 | elecLicenseInfoDo.setSfxz("2"); | ||
170 | //未转换 | ||
171 | elecLicenseInfoDo.setSfzh("2"); | ||
172 | this.save(elecLicenseInfoDo); | ||
173 | return elecLicenseInfoDo; | ||
174 | } | ||
175 | /** | ||
176 | *修改电子证照表记录 | ||
177 | * @param tjcs | ||
178 | * @param documentParam | ||
179 | * @param backjson | ||
180 | * @param | ||
181 | */ | ||
182 | public ElecLicenseInfoDo updateEciInfo(String tjcs,String documentParam, Map backjson,ElecLicenseInfoDo elecLicenseInfoDo){ | ||
183 | elecLicenseInfoDo.setTjcs(tjcs); | ||
184 | elecLicenseInfoDo.setDocumentParam(documentParam); | ||
185 | if(backjson.isEmpty()){ | ||
186 | elecLicenseInfoDo.setErr_state("1"); | ||
187 | }else{ | ||
188 | if ((Integer)backjson.get("code")==0) { | ||
189 | Long contractId = Long.valueOf((String) backjson.get("contractId")); | ||
190 | //合同ID入库 | ||
191 | elecLicenseInfoDo.setContractId(contractId); | ||
192 | elecLicenseInfoDo.setErr_state("0"); | ||
193 | regBusBdcqzsdjxxMapper.updateBdcqzsjbxxInfo(elecLicenseInfoDo.getZsbs()); | ||
194 | }else{ | ||
195 | elecLicenseInfoDo.setErr_state("1"); | ||
196 | } | ||
197 | } | ||
198 | //返回结果入库 | ||
199 | elecLicenseInfoDo.setFhjg(JSON.toJSONString(backjson)); | ||
200 | //未下载 | ||
201 | elecLicenseInfoDo.setSfxz("2"); | ||
202 | //未转换 | ||
203 | elecLicenseInfoDo.setSfzh("2"); | ||
204 | this.updateById(elecLicenseInfoDo); | ||
205 | return elecLicenseInfoDo; | ||
206 | } | ||
207 | /** | ||
208 | * 生成文件流 | ||
209 | * @param jbxxId | ||
210 | * @return | ||
211 | */ | ||
212 | public byte[] getImage(String jbxxId,String qlr,String zjh){ | ||
213 | byte[] data=null; | ||
214 | try{ | ||
215 | String imageurl="https://www.hzbdcdj.com/api?scene="+jbxxId+"&qlr="+ URLEncoder.encode(qlr,"UTF-8")+"&zjh="+zjh; | ||
216 | logger.info("55555555============"+imageurl); | ||
217 | ByteArrayOutputStream out= QRCode.from(imageurl).to(ImageType.PNG).stream(); | ||
218 | data = out.toByteArray(); | ||
219 | }catch (Exception ex){ | ||
220 | ex.printStackTrace(); | ||
221 | } | ||
222 | return data; | ||
223 | } | ||
224 | |||
225 | /** | ||
226 | * 根据基本信息id生成二维码图片加密字符串 | ||
227 | * @param jbxxId | ||
228 | * @return | ||
229 | */ | ||
230 | public String getBase64ewm(String jbxxId,String qlr,String zjh){ | ||
231 | byte[] data=getImage(jbxxId,qlr,zjh); | ||
232 | String base64ewm =Base64.encodeBase64String(data); | ||
233 | return base64ewm; | ||
234 | } | ||
235 | |||
236 | |||
237 | /** | ||
238 | * 创建合同 | ||
239 | * @param map | ||
240 | */ | ||
241 | public ElecLicenseInfoDo createContract(Map map){ | ||
242 | String url=hostUrl + "/contract/createbycategory"; | ||
243 | ElecLicenseInfoDo elecLicenseInfo=null; | ||
244 | try{ | ||
245 | String ywh = (String) map.get("YWH"); | ||
246 | Map jsonMap = new HashMap(); | ||
247 | jsonMap.put("sn", ywh); | ||
248 | jsonMap.put("send", "true"); | ||
249 | jsonMap.put("creatorName", ""); | ||
250 | jsonMap.put("creatorContact", ""); | ||
251 | jsonMap.put("tenantName", "汉中市不动产登记交易服务中心"); | ||
252 | String zsbh= (String) map.get("BH");//去掉汉字的证书编号,数字组合 | ||
253 | |||
254 | |||
255 | Map<String, String> documentMap = new HashMap<String, String>(); | ||
256 | String bdcqzh = (String) map.get("BDCQZH"); | ||
257 | if (bdcqzh.contains("证明")) { | ||
258 | jsonMap.put("subject", "不动产登记证明"); | ||
259 | jsonMap.put("categoryId", bdcdjzmlc); | ||
260 | List<String> ywrmcList=elecLicenseInfoMapper.getYwrMcByCOnditon(ywh,(String) map.get("BDCDYH")); | ||
261 | documentMap.put("bdczmh", zsbh); | ||
262 | documentMap.put("zmqlhsx",getzmsx((String) map.get("DJLX"),(String) map.get("BDCDYH"))); | ||
263 | documentMap.put("ywr", StringUtils.join(ywrmcList.toArray(), ",")); | ||
264 | documentMap.put("qt", map.get("QT")==null ? "无": (String) map.get("QT")); | ||
265 | } else { | ||
266 | jsonMap.put("subject", "不动产登记证书"); | ||
267 | jsonMap.put("categoryId", bdcqzslc); | ||
268 | |||
269 | documentMap.put("bdcqzh",zsbh); | ||
270 | documentMap.put("gyqk", map.get("GYQK")==null ? "": (String) map.get("GYQK")); | ||
271 | documentMap.put("qllx", map.get("QLLX")==null ? "": (String) map.get("QLLX")); | ||
272 | documentMap.put("qlxz", map.get("QLXZ")==null ? "": (String) map.get("QLXZ")); | ||
273 | documentMap.put("yt", map.get("YT")==null ? "": (String) map.get("YT")); | ||
274 | documentMap.put("mj", map.get("MJ")==null ? "": (String) map.get("MJ")); | ||
275 | documentMap.put("syqx", map.get("SYQX")==null ? "": (String) map.get("SYQX")); | ||
276 | documentMap.put("qlqtzk", map.get("QLQTZK")==null ? "": (String) map.get("QLQTZK")); | ||
277 | } | ||
278 | |||
279 | List list2 = new ArrayList(); | ||
280 | Map map2 = new HashMap(); | ||
281 | map2.put("type", "CORPORATE"); | ||
282 | map2.put("name", "汉中市不动产登记交易服务中心"); | ||
283 | map2.put("serialNo", "1"); | ||
284 | list2.add(map2); | ||
285 | |||
286 | List list1 = new ArrayList(); | ||
287 | Map map1 = new HashMap(); | ||
288 | map1.put("tenantType", "CORPORATE"); | ||
289 | map1.put("tenantName", "汉中市不动产登记交易服务中心"); | ||
290 | map1.put("serialNo", "1"); | ||
291 | map1.put("actions", list2); | ||
292 | list1.add(map1); | ||
293 | |||
294 | jsonMap.put("signatories", list1); | ||
295 | |||
296 | documentMap.put("djsj", map.get("Y")==null ? "":(String) map.get("Y")); | ||
297 | documentMap.put("y", map.get("Y")==null ? "":(String) map.get("Y")); | ||
298 | documentMap.put("m", map.get("M")==null ? "":(String) map.get("M")); | ||
299 | documentMap.put("d", map.get("D")==null ? "":(String) map.get("D")); | ||
300 | documentMap.put("qlr", map.get("QLRMC")==null ? "":(String) map.get("QLRMC")); | ||
301 | documentMap.put("zl", map.get("ZL")==null ? "":(String) map.get("ZL")); | ||
302 | documentMap.put("bdcdyh", map.get("BDCDYH")==null ? "":(String) map.get("BDCDYH")); | ||
303 | documentMap.put("fj", "业务号:"+ywh); | ||
304 | documentMap.put("qx", "汉台区"); | ||
305 | |||
306 | String base64ewm =getBase64ewm((String) map.get("ID"),(String) map.get("QLRMC"),(String) map.get("ZJH")); | ||
307 | |||
308 | Map ewmMap = new HashMap(); | ||
309 | ewmMap.put("fileName", map.get("ID")+".png"); | ||
310 | ewmMap.put("value", "data:image/png;base64,"+base64ewm); | ||
311 | documentMap.put("ewm", JSON.toJSONString(ewmMap)); | ||
312 | |||
313 | List<Map> arryList = new ArrayList<Map>(); | ||
314 | for (Map.Entry<String, String> entry : documentMap.entrySet()) { | ||
315 | convert(arryList, entry.getKey(), entry.getValue()); | ||
316 | } | ||
317 | |||
318 | jsonMap.put("documentParams", arryList); | ||
319 | String inparam=JSON.toJSONString(jsonMap); | ||
320 | |||
321 | Map jsonObject =eciHttpUtil.doPostForNew(url, inparam); | ||
322 | elecLicenseInfo =new ElecLicenseInfoDo(); | ||
323 | elecLicenseInfo.setYwh((String) map.get("YWH")); | ||
324 | elecLicenseInfo.setZsbs((String) map.get("ID")); | ||
325 | elecLicenseInfo.setZsbh(zsbh); | ||
326 | elecLicenseInfo.setZjh((String) map.get("ZJH")); | ||
327 | elecLicenseInfo =elecLicenseInfoMapper.getElecLicenseInfo(elecLicenseInfo); | ||
328 | if(elecLicenseInfo==null){ | ||
329 | //电子证照表记录 | ||
330 | elecLicenseInfo=insertEciInfo(inparam,JSON.toJSONString(documentMap),jsonObject,map); | ||
331 | }else{ | ||
332 | elecLicenseInfo=updateEciInfo(inparam,JSON.toJSONString(documentMap),jsonObject,elecLicenseInfo); | ||
333 | } | ||
334 | }catch (Exception ex){ | ||
335 | ex.printStackTrace(); | ||
336 | } | ||
337 | return elecLicenseInfo; | ||
338 | } | ||
339 | |||
340 | |||
341 | public void convert(List arryList,String name,String value){ | ||
342 | Map map=new HashMap(); | ||
343 | map.put("name",name); | ||
344 | map.put("value",value); | ||
345 | arryList.add(map); | ||
346 | } | ||
347 | |||
348 | public ElecLicenseInfoDo accessDetails(ElecLicenseInfoDo waitForDetail) { | ||
349 | ElecLicenseInfoDo elecLicenseInfoDo=null; | ||
350 | try { | ||
351 | Long contractId = waitForDetail.getContractId(); | ||
352 | String url = hostUrl+ "/contract/detail?contractId=" + contractId; | ||
353 | logger.info("请求合同详情接口url:" + url); | ||
354 | |||
355 | Map jsonObject = eciHttpUtil.doGetForNew(url); | ||
356 | |||
357 | if(jsonObject.isEmpty()){ | ||
358 | waitForDetail.setErr_state("2"); | ||
359 | }else{ | ||
360 | Integer code = (Integer) jsonObject.get("code"); | ||
361 | logger.info("合同详情接口请求结果:" + jsonObject); | ||
362 | if (code==0) { | ||
363 | Map obj1= (Map) jsonObject.get("contract"); | ||
364 | List list= (List) obj1.get("documents"); | ||
365 | Map map= (Map) list.get(0); | ||
366 | waitForDetail.setErr_state("0"); | ||
367 | waitForDetail.setDocumentId((String) map.get("id")); | ||
368 | }else{ | ||
369 | waitForDetail.setErr_state("2"); | ||
370 | } | ||
371 | } | ||
372 | //文档ID入库 | ||
373 | this.updateById(waitForDetail); | ||
374 | |||
375 | elecLicenseInfoDo=waitForDetail; | ||
376 | |||
377 | } catch (Exception e) { | ||
378 | e.printStackTrace(); | ||
379 | } | ||
380 | return elecLicenseInfoDo; | ||
381 | } | ||
382 | /** | ||
383 | * 下载合同方法 | ||
384 | * @return | ||
385 | */ | ||
386 | public ElecLicenseInfoDo accessDownload(ElecLicenseInfoDo waitForDownload) { | ||
387 | ElecLicenseInfoDo downloadInfo=null; | ||
388 | try{ | ||
389 | String documentId = waitForDownload.getDocumentId(); | ||
390 | String bh=waitForDownload.getZsbh(); | ||
391 | String ofdPath = eciHttpUtil.download(documentId,bh); | ||
392 | if (StringUtils.isNotBlank(ofdPath)) { | ||
393 | //入库ofd文件地址 | ||
394 | waitForDownload.setSfxz("1"); | ||
395 | waitForDownload.setOfdWjdz(ofdPath); | ||
396 | waitForDownload.setErr_state("0"); | ||
397 | }else{ | ||
398 | waitForDownload.setErr_state("3"); | ||
399 | } | ||
400 | this.updateById(waitForDownload); | ||
401 | downloadInfo=waitForDownload; | ||
402 | }catch (Exception ex){ | ||
403 | ex.printStackTrace(); | ||
404 | } | ||
405 | return downloadInfo; | ||
406 | } | ||
407 | |||
408 | public ElecLicenseInfoDo convertElec(ElecLicenseInfoDo waitForConvert) { | ||
409 | //转换后文件输出路径 | ||
410 | ElecLicenseInfoDo convert=null; | ||
411 | try { | ||
412 | String ofdPath = waitForConvert.getOfdWjdz(); | ||
413 | String id=waitForConvert.getDocumentId(); | ||
414 | String bh=waitForConvert.getZsbh(); | ||
415 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy"); | ||
416 | String dateDir = simpleDateFormat.format(new Date()); | ||
417 | String url=ofdToImg(ofdPath,"D:\\ECI\\"+ dateDir+bh+"\\",id); | ||
418 | if(StringUtils.isNotBlank(url)){ | ||
419 | waitForConvert.setSfzh("1"); | ||
420 | waitForConvert.setJpgWjdz(url); | ||
421 | waitForConvert.setErr_state("0"); | ||
422 | }else{ | ||
423 | waitForConvert.setErr_state("4"); | ||
424 | } | ||
425 | this.updateById(waitForConvert); | ||
426 | convert=waitForConvert; | ||
427 | |||
428 | } catch (Exception e) { | ||
429 | e.printStackTrace(); | ||
430 | } | ||
431 | return convert; | ||
432 | } | ||
433 | |||
434 | /** | ||
435 | * 将ofd转换为图片 | ||
436 | * @param | ||
437 | * @param imgPath 目标文件路径 | ||
438 | */ | ||
439 | public String ofdToImg(String ofdPath, String imgPath,String id) { | ||
440 | File savePath = new File(imgPath); | ||
441 | if (!savePath.exists()) { | ||
442 | savePath.mkdirs(); | ||
443 | } | ||
444 | // 1. 文件输入路径 | ||
445 | Path src = Paths.get(ofdPath); | ||
446 | // 2. 加载指定目录字体(非必须) | ||
447 | // FontLoader.getInstance().scanFontDir(new File("src/test/resources/fonts")); | ||
448 | // 3. 创建转换转换对象,设置 每毫米像素数量(Pixels per millimeter) | ||
449 | try(OFDReader reader = new OFDReader(src);) { | ||
450 | ImageMaker imageMaker = new ImageMaker(reader, 15); | ||
451 | for (int i = 0; i < imageMaker.pageSize(); i++) { | ||
452 | // 4. 指定页码转换图片 | ||
453 | BufferedImage image = imageMaker.makePage(i); | ||
454 | Path dist = Paths.get( imgPath+ id + ".jpg"); | ||
455 | // 5. 存储为指定格式图片 | ||
456 | ImageIO.write(image, "JPG", dist.toFile()); | ||
457 | return imgPath + id + ".jpg"; | ||
458 | } | ||
459 | } catch (IOException e) { | ||
460 | e.printStackTrace(); | ||
461 | } | ||
462 | return ""; | ||
463 | } | ||
464 | |||
465 | /** | ||
466 | *根据缮证类型决定生成对应的权利相关信息 | ||
467 | */ | ||
468 | public List<Map> assemblyInfo(){ | ||
469 | List<Map> oldlist=regBusBdcqzsdjxxMapper.getBdcqzsjbxxInfo(); | ||
470 | List<Map> list=new ArrayList<Map>(); | ||
471 | if(oldlist!=null && oldlist.size()>0){ | ||
472 | for (int i = 0; i < oldlist.size(); i++) { | ||
473 | Map map=oldlist.get(i); | ||
474 | String bh= (String)map.get("BH"); | ||
475 | String zsbh[]=bh.split(","); | ||
476 | if(zsbh!=null && zsbh.length>0){ | ||
477 | String qlqtzk=(String)map.get("QLQTZK"); | ||
478 | Map qrlInfoMap=regBusBdcqzsdjxxMapper.getQlrInfoByYwh((String) map.get("YWH")); | ||
479 | String allQlrmc=(String)qrlInfoMap.get("QLRMC"); | ||
480 | String allZjh=(String)qrlInfoMap.get("ZJH"); | ||
481 | if(StringUtils.isNotBlank(allQlrmc)){ | ||
482 | for (int k = 0; k < zsbh.length; k++) { | ||
483 | String qlr[]=allQlrmc.split(","); | ||
484 | String zjh[]=allZjh.split(","); | ||
485 | Map hashMap=new HashMap(map); | ||
486 | hashMap.put("QLRMC",qlr[k]); | ||
487 | hashMap.put("BH",zsbh[k]); | ||
488 | hashMap.put("ZJH",zjh[k]); | ||
489 | List list1= Arrays.asList(qlr); | ||
490 | List arrList = new ArrayList(list1); | ||
491 | arrList.remove(qlr[k]); | ||
492 | String gyr=StringUtils.join(arrList.toArray(),","); | ||
493 | if(StringUtils.isNotBlank(qlqtzk)){ | ||
494 | qlqtzk=qlqtzk.substring(0, qlqtzk.length() - 1); | ||
495 | hashMap.put("QLQTZK",qlqtzk+hashMap.get("GYQK")+";共有人:"+gyr); | ||
496 | } | ||
497 | list.add(hashMap); | ||
498 | } | ||
499 | } | ||
500 | } | ||
501 | } | ||
502 | } | ||
503 | return list; | ||
504 | } | ||
505 | |||
506 | /** | ||
507 | * 手动版创建合同组件信息 | ||
508 | * @return | ||
509 | */ | ||
510 | public List<Map> createInfoByHandle(String zsbs,String qlrzjh,String bh){ | ||
511 | List<Map> list=new ArrayList<Map>(); | ||
512 | Map map=regBusBdcqzsdjxxMapper.getBdcqzsJbxxById(zsbs); | ||
513 | if(map!=null){ | ||
514 | Map qrlInfoMap=regBusBdcqzsdjxxMapper.getQlrInfoByYwh((String) map.get("YWH")); | ||
515 | String allQlrmc=(String)qrlInfoMap.get("QLRMC"); | ||
516 | if(StringUtils.isNotBlank(allQlrmc)){ | ||
517 | String allZjh=(String)qrlInfoMap.get("ZJH"); | ||
518 | if(StringUtils.isNotBlank(allZjh)){ | ||
519 | String zjh[]=allZjh.split(","); | ||
520 | String qlqtzk=(String)map.get("QLQTZK"); | ||
521 | for (int k = 0; k < zjh.length; k++) { | ||
522 | if(StringUtils.equals(qlrzjh,zjh[k])){ | ||
523 | String qlr[]=allQlrmc.split(","); | ||
524 | Map hashMap=new HashMap(map); | ||
525 | hashMap.put("QLRMC",qlr[k]); | ||
526 | hashMap.put("BH",bh); | ||
527 | hashMap.put("ZJH",qlrzjh); | ||
528 | List list1= Arrays.asList(qlr); | ||
529 | List arrList = new ArrayList(list1); | ||
530 | arrList.remove(qlr[k]); | ||
531 | String gyr=StringUtils.join(arrList.toArray(),","); | ||
532 | if(StringUtils.isNotBlank(qlqtzk)){ | ||
533 | qlqtzk=qlqtzk.substring(0, qlqtzk.length() - 1); | ||
534 | hashMap.put("QLQTZK",qlqtzk+hashMap.get("GYQK")+";共有人:"+gyr); | ||
535 | } | ||
536 | list.add(hashMap); | ||
537 | } | ||
538 | } | ||
539 | } | ||
540 | } | ||
541 | } | ||
542 | return list; | ||
543 | } | ||
544 | |||
545 | |||
546 | |||
547 | public String getzmsx(String djxl,String bdcdyh){ | ||
548 | //证明权利或事项 | ||
549 | if(djxl.equals("214") || djxl.equals("215") | ||
550 | || djxl.equals("213") || djxl.equals("209") | ||
551 | || djxl.equals("315") || djxl.equals("605") | ||
552 | || djxl.equals("430") || djxl.equals("316") | ||
553 | || djxl.equals("606") || djxl.equals("431") | ||
554 | || djxl.equals("427") || djxl.equals("428") | ||
555 | || djxl.equals("317") || djxl.equals("318") | ||
556 | || djxl.equals("608") || djxl.equals("433") | ||
557 | || djxl.equals("422") || djxl.equals("217")){ | ||
558 | if(djxl.equals("213") || djxl.equals("316") | ||
559 | || djxl.equals("606") || djxl.equals("431") | ||
560 | || djxl.equals("427") || djxl.equals("428")){ | ||
561 | return "在建工程抵押权"; | ||
562 | }else { | ||
563 | return "抵押权"; | ||
564 | } | ||
565 | }else { | ||
566 | //预抵押变更事项可以修改期房和现房的预抵押所以应取上一笔的预抵押信息,获取上一笔抵押登记小类 | ||
567 | if (djxl.equals("818") || djxl.equals("607") | ||
568 | || djxl.equals("432")){ | ||
569 | Map rightsInfo= regBusBdcqzsdjxxMapper.getRightsInfo(bdcdyh); | ||
570 | if(rightsInfo!=null){ | ||
571 | return regBusBdcqzsdjxxMapper.getInfoByValue((String) rightsInfo.get("REMARKS"),"reg_bus_djxl"); | ||
572 | } | ||
573 | }else { | ||
574 | if(djxl.equals("609") || djxl.equals("812") || djxl.equals("809") || djxl.equals("810") || djxl.equals("811")){ | ||
575 | return regBusBdcqzsdjxxMapper.getInfoByValue("803","reg_bus_djxl"); | ||
576 | }else{ | ||
577 | return regBusBdcqzsdjxxMapper.getInfoByValue(djxl,"reg_bus_djxl"); | ||
578 | } | ||
579 | } | ||
580 | } | ||
581 | return ""; | ||
582 | } | ||
583 | |||
584 | |||
585 | } |
1 | package com.pashanhoo.zhj.controller; | ||
2 | |||
3 | import com.pashanhoo.common.Result; | ||
4 | import com.pashanhoo.zhj.service.ZhjDatasSynService; | ||
5 | import io.swagger.annotations.Api; | ||
6 | import io.swagger.annotations.ApiOperation; | ||
7 | import io.swagger.annotations.ApiParam; | ||
8 | import org.springframework.beans.factory.annotation.Autowired; | ||
9 | import org.springframework.web.bind.annotation.PostMapping; | ||
10 | import org.springframework.web.bind.annotation.RequestMapping; | ||
11 | import org.springframework.web.bind.annotation.RequestParam; | ||
12 | import org.springframework.web.bind.annotation.RestController; | ||
13 | |||
14 | @RestController | ||
15 | @RequestMapping("/zhj/") | ||
16 | @Api(tags = "智慧局信息同步相关接口") | ||
17 | public class SynZhjInfoController { | ||
18 | |||
19 | @Autowired | ||
20 | private ZhjDatasSynService zhjDatasSynService; | ||
21 | |||
22 | @PostMapping("ZhjDatasSynInfo") | ||
23 | @ApiOperation("定时智慧局数据同步接口") | ||
24 | public Result ZhjDatasSynInfo() { | ||
25 | zhjDatasSynService.send_bdcYwInfo(); | ||
26 | return Result.ok(); | ||
27 | } | ||
28 | @PostMapping("synZdInfoByywh") | ||
29 | @ApiOperation("手动执行智慧局数据同步接口") | ||
30 | public Result synZdInfoByywh(@ApiParam("业务号")@RequestParam String ywh) { | ||
31 | zhjDatasSynService.synZdInfoByywh(ywh); | ||
32 | return Result.ok(); | ||
33 | } | ||
34 | @PostMapping("synHInfoByYwh") | ||
35 | @ApiOperation("手动执行智慧局数据同步接口") | ||
36 | public Result synHInfoByYwh(@ApiParam("业务号")@RequestParam String ywh) { | ||
37 | zhjDatasSynService.synHInfoByYwh(ywh); | ||
38 | return Result.ok(); | ||
39 | } | ||
40 | @PostMapping("synQSZTInfoByYwh") | ||
41 | @ApiOperation("手动执行智慧局数据同步接口") | ||
42 | public Result synQSZTInfoByYwh(@ApiParam("业务号")@RequestParam String ywh) { | ||
43 | zhjDatasSynService.synQSZTInfoByYwh(ywh); | ||
44 | return Result.ok(); | ||
45 | } | ||
46 | |||
47 | } |
1 | package com.pashanhoo.zhj.entity; | ||
2 | |||
3 | import com.baomidou.mybatisplus.annotation.IdType; | ||
4 | import com.baomidou.mybatisplus.annotation.TableField; | ||
5 | import com.baomidou.mybatisplus.annotation.TableId; | ||
6 | import com.baomidou.mybatisplus.annotation.TableName; | ||
7 | import lombok.Data; | ||
8 | import lombok.EqualsAndHashCode; | ||
9 | |||
10 | import java.io.Serializable; | ||
11 | import java.util.Date; | ||
12 | |||
13 | @Data | ||
14 | @EqualsAndHashCode(callSuper = false) | ||
15 | @TableName("REG_BUS_BDCQZSDJXX") | ||
16 | public class RegBusBdcqzsdjxxDo implements Serializable { | ||
17 | private static final long serialVersionUID = 1L; | ||
18 | /** | ||
19 | * 主键 | ||
20 | */ | ||
21 | @TableId(value = "ID", type = IdType.UUID) | ||
22 | private String id; | ||
23 | /** | ||
24 | * 业务号 | ||
25 | */ | ||
26 | @TableField("YWH") | ||
27 | private String ywh; | ||
28 | /** | ||
29 | * 不动产权证号 | ||
30 | */ | ||
31 | @TableField("BDCQZH") | ||
32 | private String bdcqzh; | ||
33 | /** | ||
34 | * 不动产权证编号 | ||
35 | */ | ||
36 | @TableField("BDCQZBH") | ||
37 | private String bdcqzbh; | ||
38 | /** | ||
39 | * 印刷序列号 | ||
40 | */ | ||
41 | @TableField("YSXLH") | ||
42 | private String ysxlh; | ||
43 | /** | ||
44 | * 登簿时间 | ||
45 | */ | ||
46 | @TableField("DBSJ") | ||
47 | private String dbsj; | ||
48 | /** | ||
49 | * 权利人名称 | ||
50 | */ | ||
51 | @TableField("QLRMC") | ||
52 | private String qlrmc; | ||
53 | /** | ||
54 | * 共有情况 | ||
55 | */ | ||
56 | @TableField("GYQK") | ||
57 | private String gyqk; | ||
58 | /** | ||
59 | * 坐落 | ||
60 | */ | ||
61 | @TableField("ZL") | ||
62 | private String zl; | ||
63 | /** | ||
64 | * 宗地代码 | ||
65 | */ | ||
66 | @TableField("ZDDM") | ||
67 | private String zddm; | ||
68 | /** | ||
69 | * 不动产单元号 | ||
70 | */ | ||
71 | @TableField("BDCDYH") | ||
72 | private String bdcdyh; | ||
73 | /** | ||
74 | * 权利类型 | ||
75 | */ | ||
76 | @TableField("QLLX") | ||
77 | private String qllx; | ||
78 | /** | ||
79 | * 权利性质 | ||
80 | */ | ||
81 | @TableField("QLXZ") | ||
82 | private String qlxz; | ||
83 | /** | ||
84 | * 用途 | ||
85 | */ | ||
86 | @TableField("YT") | ||
87 | private String yt; | ||
88 | /** | ||
89 | * 面积 | ||
90 | */ | ||
91 | @TableField("MJ") | ||
92 | private String mj; | ||
93 | /** | ||
94 | * 使用期限 | ||
95 | */ | ||
96 | @TableField("SYQX") | ||
97 | private String syqx; | ||
98 | /** | ||
99 | * 权利其他状况 | ||
100 | */ | ||
101 | @TableField("QLQTZK") | ||
102 | private String qlqtzk; | ||
103 | /** | ||
104 | * 附记 | ||
105 | */ | ||
106 | @TableField("FJ") | ||
107 | private String fj; | ||
108 | /** | ||
109 | * 抵押登记信息 | ||
110 | */ | ||
111 | @TableField("DYDJXX") | ||
112 | private String dydjxx; | ||
113 | /** | ||
114 | * 解除抵押登记信息 | ||
115 | */ | ||
116 | @TableField("JCDYDJXX") | ||
117 | private String jcdydjxx; | ||
118 | /** | ||
119 | * 查封情况 | ||
120 | */ | ||
121 | @TableField("CFQK") | ||
122 | private String cfqk; | ||
123 | /** | ||
124 | * 解除查封 | ||
125 | */ | ||
126 | @TableField("JCCF") | ||
127 | private String jccf; | ||
128 | /** | ||
129 | * 图号 | ||
130 | */ | ||
131 | @TableField("TH") | ||
132 | private String th; | ||
133 | /** | ||
134 | * 批文号 | ||
135 | */ | ||
136 | @TableField("PWH") | ||
137 | private String pwh; | ||
138 | /** | ||
139 | * 划拨价款 | ||
140 | */ | ||
141 | @TableField("HBJK") | ||
142 | private String hbjk; | ||
143 | /** | ||
144 | * 划拨合同号 | ||
145 | */ | ||
146 | @TableField("HBHTH") | ||
147 | private String hbhth; | ||
148 | /** | ||
149 | * 发证时间 | ||
150 | */ | ||
151 | @TableField("FZSJ") | ||
152 | private String fzsj; | ||
153 | /** | ||
154 | * 终止时间 | ||
155 | */ | ||
156 | @TableField("ZZSJ") | ||
157 | private String zzsj; | ||
158 | /** | ||
159 | * 登记类型 | ||
160 | */ | ||
161 | @TableField("DJLX") | ||
162 | private String djlx; | ||
163 | /** | ||
164 | * 当前土地或者房屋登记状态 | ||
165 | */ | ||
166 | @TableField("STATUS") | ||
167 | private String status; | ||
168 | /** | ||
169 | * 是否注销 分割合并后原数据注销 | ||
170 | */ | ||
171 | @TableField("ISLOGOUT") | ||
172 | private String islogout; | ||
173 | /** | ||
174 | * 0:正常办理,1:分割合并变更更正附带确权产生数据 | ||
175 | */ | ||
176 | @TableField("ISFDSJ") | ||
177 | private Integer isfdsj; | ||
178 | /** | ||
179 | * 是否历史数据手工录入 | ||
180 | */ | ||
181 | @TableField("ISHISTORY") | ||
182 | private String ishistory; | ||
183 | /** | ||
184 | * 是否打印出证 | ||
185 | */ | ||
186 | @TableField("ISPRINT") | ||
187 | private String isprint; | ||
188 | /** | ||
189 | * 确权类型 | ||
190 | */ | ||
191 | @TableField("RIGHTS") | ||
192 | private String rights; | ||
193 | /** | ||
194 | * 创建者 | ||
195 | */ | ||
196 | @TableField("CREATE_BY") | ||
197 | private String create_by; | ||
198 | /** | ||
199 | * 创建日期 | ||
200 | */ | ||
201 | @TableField("CREATE_DATE") | ||
202 | private Date create_date; | ||
203 | /** | ||
204 | * 更新者 | ||
205 | */ | ||
206 | @TableField("UPDATE_BY") | ||
207 | private String update_by; | ||
208 | /** | ||
209 | * 更新日期 | ||
210 | */ | ||
211 | @TableField("UPDATE_DATE") | ||
212 | private Date update_date; | ||
213 | /** | ||
214 | * 备注 | ||
215 | */ | ||
216 | @TableField("REMARKS") | ||
217 | protected String remarks; | ||
218 | /** | ||
219 | * 删除标记(0:正常;1:删除;2:审核) | ||
220 | */ | ||
221 | @TableField("DEL_FLAG") | ||
222 | protected String del_flag; | ||
223 | /** | ||
224 | * 上手id(原业务id) | ||
225 | */ | ||
226 | @TableField("OLDID") | ||
227 | private String oldid; | ||
228 | |||
229 | |||
230 | |||
231 | |||
232 | |||
233 | |||
234 | } |
1 | package com.pashanhoo.zhj.entity; | ||
2 | |||
3 | import com.baomidou.mybatisplus.annotation.IdType; | ||
4 | import com.baomidou.mybatisplus.annotation.TableField; | ||
5 | import com.baomidou.mybatisplus.annotation.TableId; | ||
6 | import com.baomidou.mybatisplus.annotation.TableName; | ||
7 | import lombok.Data; | ||
8 | import lombok.EqualsAndHashCode; | ||
9 | |||
10 | import java.io.Serializable; | ||
11 | import java.util.Date; | ||
12 | |||
13 | @Data | ||
14 | @EqualsAndHashCode(callSuper = false) | ||
15 | @TableName("SYN_ZHJINFO") | ||
16 | public class SynZhjInfoDo implements Serializable { | ||
17 | |||
18 | private static final long serialVersionUID = 1L; | ||
19 | /** | ||
20 | * 主键 | ||
21 | */ | ||
22 | @TableId(value = "ID", type = IdType.UUID) | ||
23 | private String id; | ||
24 | /** | ||
25 | * 业务号 | ||
26 | */ | ||
27 | @TableField("YWH") | ||
28 | private String ywh; | ||
29 | /** | ||
30 | * 宗地表同步状态0:未同步 1:已同步 | ||
31 | */ | ||
32 | @TableField("ZD_STATE") | ||
33 | private String zd_state; | ||
34 | /** | ||
35 | * 户表同步状态0:未同步 1:已同步 | ||
36 | */ | ||
37 | @TableField("H_STATE") | ||
38 | private String h_state; | ||
39 | /** | ||
40 | * 户权属表同步状态0:未同步 1:已同步 | ||
41 | */ | ||
42 | @TableField("HQS_STATE") | ||
43 | private String hqs_state; | ||
44 | /** | ||
45 | * 创建者 | ||
46 | */ | ||
47 | @TableField("CREATE_BY") | ||
48 | private String create_by; | ||
49 | /** | ||
50 | * 创建日期 | ||
51 | */ | ||
52 | @TableField("CREATE_DATE") | ||
53 | private Date create_date; | ||
54 | /** | ||
55 | * 更新者 | ||
56 | */ | ||
57 | @TableField("UPDATE_BY") | ||
58 | private String update_by; | ||
59 | /** | ||
60 | * 更新日期 | ||
61 | */ | ||
62 | @TableField("UPDATE_DATE") | ||
63 | private Date update_date; | ||
64 | /** | ||
65 | * 删除标记(0:正常;1:删除;2:审核) | ||
66 | */ | ||
67 | @TableField("DEL_FLAG") | ||
68 | protected String del_flag; | ||
69 | |||
70 | |||
71 | } |
1 | package com.pashanhoo.zhj.mapper; | ||
2 | |||
3 | |||
4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
5 | import com.pashanhoo.zhj.entity.RegBusBdcqzsdjxxDo; | ||
6 | import com.pashanhoo.zhj.entity.SynZhjInfoDo; | ||
7 | import org.apache.ibatis.annotations.Param; | ||
8 | |||
9 | import java.util.List; | ||
10 | import java.util.Map; | ||
11 | |||
12 | public interface RegBusBdcqzsdjxxMapper extends BaseMapper<RegBusBdcqzsdjxxDo> { | ||
13 | |||
14 | /** | ||
15 | * 批量业务号查询登记信息表数据 | ||
16 | * @param selectAllListInfo | ||
17 | * @return | ||
18 | */ | ||
19 | List<RegBusBdcqzsdjxxDo> getZsdjInfoList(List<SynZhjInfoDo> selectAllListInfo); | ||
20 | /** | ||
21 | * 业务号查询登记信息表数据 | ||
22 | * @param ywh | ||
23 | * @return | ||
24 | */ | ||
25 | List<RegBusBdcqzsdjxxDo> getZsdjInfoListByYwh(String ywh); | ||
26 | /** | ||
27 | * 根据宗地代码查询宗地信息 | ||
28 | * @param regBusBdcqzsdjxxDo | ||
29 | * @return | ||
30 | */ | ||
31 | public List<Map> getZdInfoByZddm(RegBusBdcqzsdjxxDo regBusBdcqzsdjxxDo); | ||
32 | /** | ||
33 | * 根据宗地代码查询户信息 | ||
34 | * @param regBusBdcqzsdjxxDo | ||
35 | * @return | ||
36 | */ | ||
37 | public List<Map> getHQSInfoByZddm(RegBusBdcqzsdjxxDo regBusBdcqzsdjxxDo); | ||
38 | |||
39 | /** | ||
40 | * 根据宗地代码查询户权属状态信息 | ||
41 | * @param regBusBdcqzsdjxxDo | ||
42 | * @return | ||
43 | */ | ||
44 | public List<Map> getQSZTInfoByZddm(RegBusBdcqzsdjxxDo regBusBdcqzsdjxxDo); | ||
45 | |||
46 | /** | ||
47 | * 查询所有需要创建电子证照并且已经登簿的业务信息 | ||
48 | * @return | ||
49 | */ | ||
50 | public List<Map> getBdcqzsjbxxInfo(); | ||
51 | |||
52 | /** | ||
53 | * 查询所有需要创建电子证照并且已经登簿的业务信息 | ||
54 | * @return | ||
55 | */ | ||
56 | public List<Map> getBdcqzsjbxxInfoByYwh(String ywh); | ||
57 | |||
58 | public List<Map> getUserInfo(); | ||
59 | |||
60 | public void updateBdcqzsjbxxInfo(String id); | ||
61 | |||
62 | public Map getQlrInfoByYwh(String ywh); | ||
63 | |||
64 | public String getQlrInfoByYwhAndqlr(@Param("ywh") String ywh, @Param("qlrmc") String qlrmc); | ||
65 | |||
66 | public Map getBdcqzsJbxxById(String id); | ||
67 | |||
68 | public String getInfoByValue(@Param("value") String value, @Param("type") String type); | ||
69 | |||
70 | Map getRightsInfo(@Param("bdcdyh")String bdcdyh); | ||
71 | |||
72 | Map getDyqqInfo(@Param("ywh")String ywh,@Param("bdcdyh")String bdcdyh); | ||
73 | |||
74 | String getHtbhInfo(@Param("ywh")String ywh); | ||
75 | |||
76 | |||
77 | Map getBdcjbxxInfo(@Param("bdcdyh")String bdcdyh); | ||
78 | |||
79 | Map getJbxxInfoByYwhAndBdcdyh(@Param("ywh")String ywh,@Param("bdcdyh")String bdcdyh); | ||
80 | |||
81 | Map getJbxxById(@Param("id")String id); | ||
82 | |||
83 | Map getZdjbxxByZddm(@Param("zddm")String zddm); | ||
84 | |||
85 | Map getZrzInfo(@Param("bdcdyh")String bdcdyh); | ||
86 | |||
87 | Map getHInfo(@Param("bdcdyh")String bdcdyh); | ||
88 | |||
89 | |||
90 | |||
91 | } |
1 | package com.pashanhoo.zhj.mapper; | ||
2 | |||
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
4 | import com.pashanhoo.zhj.entity.SynZhjInfoDo; | ||
5 | |||
6 | |||
7 | |||
8 | import java.util.List; | ||
9 | |||
10 | public interface SynZhjInfoMapper extends BaseMapper<SynZhjInfoDo> { | ||
11 | |||
12 | List<SynZhjInfoDo> selectAllInfo(); | ||
13 | |||
14 | void updatezdzt(String ywh); | ||
15 | |||
16 | void updateHzt(String ywh); | ||
17 | |||
18 | void updateHqszt(String ywh); | ||
19 | |||
20 | } |
1 | package com.pashanhoo.zhj.service; | ||
2 | |||
3 | import com.baomidou.mybatisplus.extension.service.IService; | ||
4 | import com.pashanhoo.zhj.entity.RegBusBdcqzsdjxxDo; | ||
5 | |||
6 | |||
7 | |||
8 | public interface ZhjDatasSynService extends IService<RegBusBdcqzsdjxxDo> { | ||
9 | |||
10 | public void send_bdcYwInfo(); | ||
11 | |||
12 | public void synZdInfoByywh(String ywh); | ||
13 | |||
14 | public void synHInfoByYwh(String ywh); | ||
15 | |||
16 | public void synQSZTInfoByYwh(String ywh); | ||
17 | |||
18 | |||
19 | |||
20 | } |
1 | package com.pashanhoo.zhj.service.impl; | ||
2 | |||
3 | import com.alibaba.fastjson.JSONObject; | ||
4 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
5 | import com.pashanhoo.zhj.entity.RegBusBdcqzsdjxxDo; | ||
6 | import com.pashanhoo.zhj.entity.SynZhjInfoDo; | ||
7 | import com.pashanhoo.zhj.mapper.RegBusBdcqzsdjxxMapper; | ||
8 | import com.pashanhoo.zhj.mapper.SynZhjInfoMapper; | ||
9 | import com.pashanhoo.zhj.service.ZhjDatasSynService; | ||
10 | import org.slf4j.Logger; | ||
11 | import org.slf4j.LoggerFactory; | ||
12 | import org.springframework.beans.factory.annotation.Autowired; | ||
13 | import org.springframework.stereotype.Service; | ||
14 | |||
15 | import java.io.*; | ||
16 | import java.net.HttpURLConnection; | ||
17 | import java.net.URL; | ||
18 | import java.net.URLEncoder; | ||
19 | import java.util.HashMap; | ||
20 | import java.util.List; | ||
21 | import java.util.Map; | ||
22 | |||
23 | /** | ||
24 | * <p> | ||
25 | * 案卷基本信息 服务实现类 | ||
26 | * </p> | ||
27 | * | ||
28 | * @author | ||
29 | * @since 2021-11-05 | ||
30 | */ | ||
31 | @Service | ||
32 | public class ZhjDatasSynServiceImpl extends ServiceImpl<RegBusBdcqzsdjxxMapper, RegBusBdcqzsdjxxDo> implements ZhjDatasSynService { | ||
33 | |||
34 | private static Logger logger = LoggerFactory.getLogger(ZhjDatasSynServiceImpl.class); | ||
35 | @Autowired | ||
36 | private SynZhjInfoMapper synZhjInfoMapper; | ||
37 | @Autowired | ||
38 | private RegBusBdcqzsdjxxMapper regBusBdcqzsdjxxMapper; | ||
39 | //智慧局内网ip | ||
40 | private String zhjurl="http://172.16.56.10:7050"; | ||
41 | //认证令牌 | ||
42 | private String appkey="3cd832c411238faa1df46d532a21bfcd"; | ||
43 | private String appSecret="ee7612083f63c2ce0d016c2aefd0a8d2"; | ||
44 | |||
45 | public void send_bdcYwInfo() { | ||
46 | List<SynZhjInfoDo> selectAllListInfo=synZhjInfoMapper.selectAllInfo(); | ||
47 | if(selectAllListInfo!=null && selectAllListInfo.size()>0){ | ||
48 | final List<RegBusBdcqzsdjxxDo> zsdjInfoList=regBusBdcqzsdjxxMapper.getZsdjInfoList(selectAllListInfo); | ||
49 | if(zsdjInfoList!=null && zsdjInfoList.size()>0){ | ||
50 | String url=zhjurl+"/dclp/hzapi/token?appKey="+appkey+"&appSecret="+appSecret; | ||
51 | Map map1=doGetForNew(url); | ||
52 | if(map1!=null && (Integer)map1.get("code")==200){ | ||
53 | final Map map2= (Map) map1.get("data"); | ||
54 | final String token= (String) map2.get("token"); | ||
55 | //组装宗地基本信息 | ||
56 | new Thread(new Runnable() { | ||
57 | @Override | ||
58 | public void run() { | ||
59 | System.out.println("===============当前线程是:"+Thread.currentThread().getName()); | ||
60 | synZdInfo(zsdjInfoList,token); | ||
61 | } | ||
62 | }).start(); | ||
63 | |||
64 | //组装户信息 | ||
65 | new Thread(new Runnable() { | ||
66 | @Override | ||
67 | public void run() { | ||
68 | System.out.println("===============当前线程是:"+Thread.currentThread().getName()); | ||
69 | synHInfo(zsdjInfoList,token); | ||
70 | } | ||
71 | }).start(); | ||
72 | |||
73 | //组装权属状态 | ||
74 | new Thread(new Runnable() { | ||
75 | @Override | ||
76 | public void run() { | ||
77 | System.out.println("===============当前线程是:"+Thread.currentThread().getName()); | ||
78 | synQSZTInfo(zsdjInfoList,token); | ||
79 | } | ||
80 | }).start(); | ||
81 | } | ||
82 | } | ||
83 | } | ||
84 | } | ||
85 | |||
86 | /** | ||
87 | *根据业务通过swagger接口手动推送宗地基本信息 | ||
88 | * @param ywh | ||
89 | * @param | ||
90 | */ | ||
91 | public void synZdInfoByywh(String ywh){ | ||
92 | List<RegBusBdcqzsdjxxDo> zsdjInfoList =regBusBdcqzsdjxxMapper.getZsdjInfoListByYwh(ywh); | ||
93 | if(zsdjInfoList!=null && zsdjInfoList.size()>0){ | ||
94 | String url=zhjurl+"/dclp/hzapi/token?appKey="+appkey+"&appSecret="+appSecret; | ||
95 | Map map1=doGetForNew(url); | ||
96 | if(map1!=null && (Integer)map1.get("code")==200){ | ||
97 | Map map2= (Map) map1.get("data"); | ||
98 | String token= (String) map2.get("token"); | ||
99 | synZdInfo(zsdjInfoList,token); | ||
100 | } | ||
101 | } | ||
102 | } | ||
103 | |||
104 | /** | ||
105 | * 给智慧局推送宗地基本信息 | ||
106 | * @param zsdjInfoList | ||
107 | * @param token | ||
108 | */ | ||
109 | public void synZdInfo(List<RegBusBdcqzsdjxxDo> zsdjInfoList,String token) { | ||
110 | try{ | ||
111 | if(zsdjInfoList!=null && zsdjInfoList.size()>0){ | ||
112 | for (int i = 0; i < zsdjInfoList.size(); i++) { | ||
113 | RegBusBdcqzsdjxxDo busBdcqzsdjxxDo= zsdjInfoList.get(i); | ||
114 | List<Map> zdjglist = regBusBdcqzsdjxxMapper.getZdInfoByZddm(busBdcqzsdjxxDo); | ||
115 | if(zdjglist!=null && zdjglist.size()>0){ | ||
116 | for (int j = 0; j < zdjglist.size(); j++) { | ||
117 | Map map=zdjglist.get(j); | ||
118 | StringBuilder params = new StringBuilder(); | ||
119 | params.append("?").append("DJQDM=").append(map.get("DJQDM")).append("&") | ||
120 | .append("DJQMC=").append(URLEncoder.encode((String) map.get("DJQMC"),"UTF-8")).append("&") | ||
121 | .append("DJZQDM=").append(map.get("DJZQDM")).append("&") | ||
122 | .append("DJZQMC=").append(URLEncoder.encode((String) map.get("DJZQMC"),"UTF-8")).append("&") | ||
123 | .append("BDCDYH=").append(map.get("BDCDYH")).append("&") | ||
124 | .append("ZL=").append(URLEncoder.encode((String) map.get("ZL"),"UTF-8")).append("&") | ||
125 | .append("ZDMJ=").append(map.get("ZDMJ")).append("&") | ||
126 | .append("YT=").append(URLEncoder.encode((String) map.get("YT"),"UTF-8")); | ||
127 | String url1=zhjurl+"/dclp/hzapi/ZDJGMS"+params.toString(); | ||
128 | Integer code=doPostForNew(url1,"", token); | ||
129 | if(code==200){ | ||
130 | synZhjInfoMapper.updatezdzt(busBdcqzsdjxxDo.getYwh()); | ||
131 | } | ||
132 | } | ||
133 | } | ||
134 | |||
135 | } | ||
136 | } | ||
137 | }catch (Exception ex){ | ||
138 | ex.printStackTrace(); | ||
139 | } | ||
140 | |||
141 | } | ||
142 | /** | ||
143 | * 根据业务通过swagger接口手动推送户信息 | ||
144 | * @param ywh | ||
145 | * @param | ||
146 | */ | ||
147 | public void synHInfoByYwh(String ywh){ | ||
148 | List<RegBusBdcqzsdjxxDo> zsdjInfoList =regBusBdcqzsdjxxMapper.getZsdjInfoListByYwh(ywh); | ||
149 | if(zsdjInfoList!=null && zsdjInfoList.size()>0){ | ||
150 | String url=zhjurl+"/dclp/hzapi/token?appKey="+appkey+"&appSecret="+appSecret; | ||
151 | Map map1=doGetForNew(url); | ||
152 | if(map1!=null && (Integer)map1.get("code")==200){ | ||
153 | Map map2= (Map) map1.get("data"); | ||
154 | String token= (String) map2.get("token"); | ||
155 | synHInfo(zsdjInfoList,token); | ||
156 | } | ||
157 | } | ||
158 | } | ||
159 | /** | ||
160 | * 给智慧局推送户基本信息 | ||
161 | * @param zsdjInfoList | ||
162 | * @param token | ||
163 | */ | ||
164 | public void synHInfo(List<RegBusBdcqzsdjxxDo> zsdjInfoList,String token){ | ||
165 | try{ | ||
166 | if(zsdjInfoList!=null && zsdjInfoList.size()>0){ | ||
167 | for (int i = 0; i < zsdjInfoList.size(); i++) { | ||
168 | RegBusBdcqzsdjxxDo busBdcqzsdjxxDo= zsdjInfoList.get(i); | ||
169 | List<Map> hlist = regBusBdcqzsdjxxMapper.getHQSInfoByZddm(busBdcqzsdjxxDo); | ||
170 | if(hlist!=null && hlist.size()>0){ | ||
171 | for (int j = 0; j < hlist.size(); j++) { | ||
172 | Map map=hlist.get(j); | ||
173 | StringBuilder params = new StringBuilder(); | ||
174 | params.append("?").append("BDCDYH=").append(map.get("BDCDYH")).append("&") | ||
175 | .append("ZRZH=").append(map.get("ZRZH")).append("&") | ||
176 | .append("CH=").append(map.get("CH")).append("&") | ||
177 | .append("ZL=").append(URLEncoder.encode((String) map.get("ZL"),"UTF-8")).append("&") | ||
178 | .append("SJCS=").append(map.get("SJCS")).append("&") | ||
179 | .append("SHBW=").append(URLEncoder.encode((String) map.get("SHBW"),"UTF-8")).append("&") | ||
180 | .append("HX=").append(map.get("HX")).append("&") | ||
181 | .append("HXJG=").append(map.get("HXJG")).append("&") | ||
182 | .append("FWYT1=").append(map.get("FWYT1")).append("&") | ||
183 | .append("SCJZMJ=").append(map.get("SCJZMJ")).append("&") | ||
184 | .append("SCTNJZMJ=").append(map.get("SCTNJZMJ")).append("&") | ||
185 | .append("SCDXBFJZMJ=").append(map.get("SCDXBFJZMJ")).append("&") | ||
186 | .append("FTTDMJ=").append(map.get("FTTDMJ")).append("&") | ||
187 | .append("FWLX=").append(map.get("FWLX")).append("&") | ||
188 | .append("FWXZ=").append(map.get("FWXZ")).append("&") | ||
189 | .append("QLLX=").append(map.get("QLLX")).append("&") | ||
190 | .append("DJLX=").append(map.get("DJLX")).append("&") | ||
191 | .append("SYQMJ=").append(map.get("SYQMJ")).append("&") | ||
192 | .append("SYQQSSJ=").append(map.get("SYQQSSJ")).append("&") | ||
193 | .append("SYQJSSJ=").append(map.get("SYQJSSJ")).append("&") | ||
194 | .append("BDCQZH=").append(URLEncoder.encode((String) map.get("BDCQZH"),"UTF-8")).append("&") | ||
195 | .append("QXDM=").append(map.get("QXDM")).append("&") | ||
196 | .append("DJSJ=").append(map.get("DJSJ")).append("&") | ||
197 | .append("QSZT=").append(map.get("QSZT")).append("&") | ||
198 | .append("ZT=").append(map.get("ZT")); | ||
199 | |||
200 | String url1=zhjurl+"/dclp/hzapi/HQSJGMS"+params.toString(); | ||
201 | Integer code=doPostForNew(url1,"", token); | ||
202 | if(code==200){ | ||
203 | synZhjInfoMapper.updatezdzt(busBdcqzsdjxxDo.getYwh()); | ||
204 | } | ||
205 | } | ||
206 | } | ||
207 | } | ||
208 | } | ||
209 | }catch (Exception ex){ | ||
210 | ex.printStackTrace(); | ||
211 | } | ||
212 | |||
213 | } | ||
214 | |||
215 | /** | ||
216 | * 给智慧局推送权属状态基本信息 | ||
217 | * @param ywh | ||
218 | * @param | ||
219 | */ | ||
220 | public void synQSZTInfoByYwh(String ywh){ | ||
221 | List<RegBusBdcqzsdjxxDo> zsdjInfoList =regBusBdcqzsdjxxMapper.getZsdjInfoListByYwh(ywh); | ||
222 | if(zsdjInfoList!=null && zsdjInfoList.size()>0){ | ||
223 | String url=zhjurl+"/dclp/hzapi/token?appKey="+appkey+"&appSecret="+appSecret; | ||
224 | Map map1=doGetForNew(url); | ||
225 | if(map1!=null && (Integer)map1.get("code")==200){ | ||
226 | Map map2= (Map) map1.get("data"); | ||
227 | String token= (String) map2.get("token"); | ||
228 | synQSZTInfo(zsdjInfoList,token); | ||
229 | } | ||
230 | } | ||
231 | } | ||
232 | /** | ||
233 | * 给智慧局推送权属状态基本信息 | ||
234 | * @param zsdjInfoList | ||
235 | * @param token | ||
236 | */ | ||
237 | public void synQSZTInfo(List<RegBusBdcqzsdjxxDo> zsdjInfoList,String token){ | ||
238 | if(zsdjInfoList!=null && zsdjInfoList.size()>0){ | ||
239 | for (int i = 0; i < zsdjInfoList.size(); i++) { | ||
240 | RegBusBdcqzsdjxxDo busBdcqzsdjxxDo= zsdjInfoList.get(i); | ||
241 | List<Map> qsztList = regBusBdcqzsdjxxMapper.getQSZTInfoByZddm(busBdcqzsdjxxDo); | ||
242 | if(qsztList!=null && qsztList.size()>0){ | ||
243 | for (int j = 0; j < qsztList.size(); j++) { | ||
244 | Map map=qsztList.get(j); | ||
245 | StringBuilder params = new StringBuilder(); | ||
246 | params.append("?").append("BDCDYH=").append(map.get("BDCDYH")).append("&") | ||
247 | .append("DYQSZT=").append(map.get("DYQSZT")).append("&") | ||
248 | .append("YYQSZT=").append(map.get("YYQSZT")).append("&") | ||
249 | .append("CFQSZT=").append(map.get("CFQSZT")).append("&") | ||
250 | .append("YGQSZT=").append(map.get("YGQSZT")); | ||
251 | String url1=zhjurl+"/dclp/hzapi/QSZT"+params.toString(); | ||
252 | Integer code=doPostForNew(url1,"", token); | ||
253 | if(code==200){ | ||
254 | synZhjInfoMapper.updatezdzt(busBdcqzsdjxxDo.getYwh()); | ||
255 | } | ||
256 | } | ||
257 | } | ||
258 | } | ||
259 | } | ||
260 | } | ||
261 | |||
262 | public Map doGetForNew(String url) { | ||
263 | logger.info("http request url:" + url); | ||
264 | BufferedReader in = null; | ||
265 | String result = ""; | ||
266 | Map jsonObject=new HashMap(); | ||
267 | try{ | ||
268 | URL url1=new URL(url); | ||
269 | HttpURLConnection conn= (HttpURLConnection) url1.openConnection(); | ||
270 | conn.setRequestMethod("GET"); | ||
271 | conn.setRequestProperty("accept","*/*"); | ||
272 | conn.setRequestProperty("connection","Keep-Alive"); | ||
273 | conn.setRequestProperty("Charset", "utf-8"); | ||
274 | conn.setDoInput(true); | ||
275 | conn.setDoOutput(false); | ||
276 | //x-qys-signature生成方式:Md5(AppToken + AppSecret + timestamp),获取32位小写值 | ||
277 | conn.connect(); | ||
278 | in = new BufferedReader(new InputStreamReader(conn.getInputStream(),"UTF-8")); | ||
279 | String line; | ||
280 | while ((line = in.readLine()) != null) { | ||
281 | result += line; | ||
282 | } | ||
283 | jsonObject=JSONObject.parseObject(result,Map.class); | ||
284 | logger.info("http request back:" + jsonObject); | ||
285 | }catch (Exception ex){ | ||
286 | logger.info("发送 POST 请求出现异常!" + ex); | ||
287 | ex.printStackTrace(); | ||
288 | }finally { | ||
289 | try { | ||
290 | if (in != null) { | ||
291 | in.close(); | ||
292 | } | ||
293 | } catch (IOException ex) { | ||
294 | ex.printStackTrace(); | ||
295 | } | ||
296 | } | ||
297 | return jsonObject; | ||
298 | } | ||
299 | |||
300 | |||
301 | public Integer doPostForNew(String url, String params,String token) { | ||
302 | logger.info("http request url:" + url); | ||
303 | logger.info("http request params:" + params); | ||
304 | PrintWriter out = null; | ||
305 | BufferedReader in = null; | ||
306 | String result = ""; | ||
307 | Map jsonObject=new HashMap(); | ||
308 | Integer code=200; | ||
309 | try{ | ||
310 | URL url1=new URL(url); | ||
311 | HttpURLConnection conn= (HttpURLConnection) url1.openConnection(); | ||
312 | conn.setRequestMethod("POST"); | ||
313 | conn.setRequestProperty("accept","*/*"); | ||
314 | conn.setRequestProperty("connection","Keep-Alive"); | ||
315 | conn.setDoInput(true); | ||
316 | conn.setDoOutput(true); | ||
317 | conn.setRequestProperty("Content-Type", "application/json;charset=utf-8"); | ||
318 | conn.setRequestProperty("X-Access-Token", token); | ||
319 | out=new PrintWriter(new OutputStreamWriter(conn.getOutputStream(),"utf-8")); | ||
320 | out.print(params); | ||
321 | out.flush(); | ||
322 | in = new BufferedReader(new InputStreamReader(conn.getInputStream(),"UTF-8")); | ||
323 | String line; | ||
324 | while ((line = in.readLine()) != null) { | ||
325 | result += line; | ||
326 | } | ||
327 | jsonObject=JSONObject.parseObject(result,Map.class); | ||
328 | logger.info("http request back:" + jsonObject); | ||
329 | code= (Integer) jsonObject.get("code"); | ||
330 | }catch (Exception ex){ | ||
331 | logger.info("发送 POST 请求出现异常!" + ex); | ||
332 | ex.printStackTrace(); | ||
333 | code=-1; | ||
334 | }finally { | ||
335 | try { | ||
336 | if (out != null) { | ||
337 | out.close(); | ||
338 | } | ||
339 | if (in != null) { | ||
340 | in.close(); | ||
341 | } | ||
342 | } catch (IOException ex) { | ||
343 | ex.printStackTrace(); | ||
344 | } | ||
345 | } | ||
346 | return code; | ||
347 | } | ||
348 | |||
349 | |||
350 | |||
351 | } |
src/main/resources/application.yaml
0 → 100644
src/main/resources/logback-spring.xml
0 → 100644
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 --> | ||
3 | <!-- scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true --> | ||
4 | <!-- scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。 --> | ||
5 | <!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 --> | ||
6 | <configuration scan="true" scanPeriod="10 seconds"> | ||
7 | |||
8 | <!--<include resource="org/springframework/boot/logging/logback/base.xml" />--> | ||
9 | <include resource="org/springframework/boot/logging/logback/defaults.xml"/> | ||
10 | |||
11 | <contextName>logback</contextName> | ||
12 | <!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 --> | ||
13 | <property name="log.path" value="/home/project/logs"/> | ||
14 | |||
15 | <!-- 彩色日志 --> | ||
16 | <!-- 彩色日志依赖的渲染类 --> | ||
17 | <!--<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />--> | ||
18 | <!--<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />--> | ||
19 | <!--<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />--> | ||
20 | <!-- 彩色日志格式 --> | ||
21 | <!--<property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>--> | ||
22 | |||
23 | |||
24 | <!--输出到控制台--> | ||
25 | <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> | ||
26 | <!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息--> | ||
27 | <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> | ||
28 | <level>debug</level> | ||
29 | </filter> | ||
30 | <encoder> | ||
31 | <Pattern>${CONSOLE_LOG_PATTERN}</Pattern> | ||
32 | <!-- 设置字符集 --> | ||
33 | <charset>UTF-8</charset> | ||
34 | </encoder> | ||
35 | </appender> | ||
36 | |||
37 | |||
38 | <!--输出到文件--> | ||
39 | |||
40 | <!--时间滚动输出 level为 DEBUG 日志 --> | ||
41 | <appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
42 | <!-- 正在记录的日志文件的路径及文件名 --> | ||
43 | <file>${log.path}/log_debug.log</file> | ||
44 | <!--日志文件输出格式--> | ||
45 | <encoder> | ||
46 | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> | ||
47 | <charset>UTF-8</charset> <!-- 设置字符集 --> | ||
48 | </encoder> | ||
49 | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> | ||
50 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
51 | <!-- 日志归档 --> | ||
52 | <fileNamePattern>${log.path}/debug/log-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern> | ||
53 | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | ||
54 | <maxFileSize>100MB</maxFileSize> | ||
55 | </timeBasedFileNamingAndTriggeringPolicy> | ||
56 | <!--日志文件保留天数--> | ||
57 | <maxHistory>15</maxHistory> | ||
58 | </rollingPolicy> | ||
59 | <!-- 此日志文件只记录debug级别的 --> | ||
60 | <filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
61 | <level>debug</level> | ||
62 | <onMatch>ACCEPT</onMatch> | ||
63 | <onMismatch>DENY</onMismatch> | ||
64 | </filter> | ||
65 | </appender> | ||
66 | |||
67 | <!-- 时间滚动输出 level为 INFO 日志 --> | ||
68 | <appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
69 | <!-- 正在记录的日志文件的路径及文件名 --> | ||
70 | <file>${log.path}/log_info.log</file> | ||
71 | <!--日志文件输出格式--> | ||
72 | <encoder> | ||
73 | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> | ||
74 | <charset>UTF-8</charset> | ||
75 | </encoder> | ||
76 | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> | ||
77 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
78 | <!-- 每天日志归档路径以及格式 --> | ||
79 | <fileNamePattern>${log.path}/info/log-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern> | ||
80 | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | ||
81 | <maxFileSize>100MB</maxFileSize> | ||
82 | </timeBasedFileNamingAndTriggeringPolicy> | ||
83 | <!--日志文件保留天数--> | ||
84 | <maxHistory>15</maxHistory> | ||
85 | </rollingPolicy> | ||
86 | <!-- 此日志文件只记录info级别的 --> | ||
87 | <filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
88 | <level>info</level> | ||
89 | <onMatch>ACCEPT</onMatch> | ||
90 | <onMismatch>DENY</onMismatch> | ||
91 | </filter> | ||
92 | </appender> | ||
93 | |||
94 | <!-- 时间滚动输出 level为 WARN 日志 --> | ||
95 | <appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
96 | <!-- 正在记录的日志文件的路径及文件名 --> | ||
97 | <file>${log.path}/log_warn.log</file> | ||
98 | <!--日志文件输出格式--> | ||
99 | <encoder> | ||
100 | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> | ||
101 | <charset>UTF-8</charset> <!-- 此处设置字符集 --> | ||
102 | </encoder> | ||
103 | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> | ||
104 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
105 | <fileNamePattern>${log.path}/warn/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern> | ||
106 | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | ||
107 | <maxFileSize>100MB</maxFileSize> | ||
108 | </timeBasedFileNamingAndTriggeringPolicy> | ||
109 | <!--日志文件保留天数--> | ||
110 | <maxHistory>15</maxHistory> | ||
111 | </rollingPolicy> | ||
112 | <!-- 此日志文件只记录warn级别的 --> | ||
113 | <filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
114 | <level>warn</level> | ||
115 | <onMatch>ACCEPT</onMatch> | ||
116 | <onMismatch>DENY</onMismatch> | ||
117 | </filter> | ||
118 | </appender> | ||
119 | |||
120 | <!-- 时间滚动输出 level为 ERROR 日志 --> | ||
121 | <appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
122 | <!-- 正在记录的日志文件的路径及文件名 --> | ||
123 | <file>${log.path}/log_error.log</file> | ||
124 | <!--日志文件输出格式--> | ||
125 | <encoder> | ||
126 | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> | ||
127 | <charset>UTF-8</charset> <!-- 此处设置字符集 --> | ||
128 | </encoder> | ||
129 | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> | ||
130 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
131 | <fileNamePattern>${log.path}/error/log-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern> | ||
132 | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | ||
133 | <maxFileSize>100MB</maxFileSize> | ||
134 | </timeBasedFileNamingAndTriggeringPolicy> | ||
135 | <!--日志文件保留天数--> | ||
136 | <maxHistory>15</maxHistory> | ||
137 | </rollingPolicy> | ||
138 | <!-- 此日志文件只记录ERROR级别的 --> | ||
139 | <filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
140 | <level>ERROR</level> | ||
141 | <onMatch>ACCEPT</onMatch> | ||
142 | <onMismatch>DENY</onMismatch> | ||
143 | </filter> | ||
144 | </appender> | ||
145 | |||
146 | <!-- | ||
147 | <logger>用来设置某一个包或者具体的某一个类的日志打印级别、 | ||
148 | 以及指定<appender>。<logger>仅有一个name属性, | ||
149 | 一个可选的level和一个可选的addtivity属性。 | ||
150 | name:用来指定受此logger约束的某一个包或者具体的某一个类。 | ||
151 | level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF, | ||
152 | 还有一个特俗值INHERITED或者同义词NULL,代表强制执行上级的级别。 | ||
153 | 如果未设置此属性,那么当前logger将会继承上级的级别。 | ||
154 | addtivity:是否向上级logger传递打印信息。默认是true。 | ||
155 | --> | ||
156 | <!--<logger name="org.springframework.web" level="info"/>--> | ||
157 | <!--<logger name="org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor" level="INFO"/>--> | ||
158 | <!-- | ||
159 | 使用mybatis的时候,sql语句是debug下才会打印,而这里我们只配置了info,所以想要查看sql语句的话,有以下两种操作: | ||
160 | 第一种把<root level="info">改成<root level="DEBUG">这样就会打印sql,不过这样日志那边会出现很多其他消息 | ||
161 | 第二种就是单独给dao下目录配置debug模式,代码如下,这样配置sql语句会打印,其他还是正常info级别: | ||
162 | --> | ||
163 | <!--<logger name="com.pashanhoo.*" level="DEBUG" />--> | ||
164 | |||
165 | <!--开发环境:打印控制台--> | ||
166 | <springProfile name="dev"> | ||
167 | <logger name="com.pashanhoo" level="debug" additivity="false"> | ||
168 | <appender-ref ref="CONSOLE"/> | ||
169 | </logger> | ||
170 | </springProfile> | ||
171 | <!-- 生产环境. --> | ||
172 | <springProfile name="prod"> | ||
173 | <logger name="com.pashanhoo" level="INFO" additivity="false"> | ||
174 | <appender-ref ref="INFO_FILE"/> | ||
175 | </logger> | ||
176 | </springProfile> | ||
177 | |||
178 | <!-- | ||
179 | root节点是必选节点,用来指定最基础的日志输出级别,只有一个level属性 | ||
180 | level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF, | ||
181 | 不能设置为INHERITED或者同义词NULL。默认是DEBUG | ||
182 | 可以包含零个或多个元素,标识这个appender将会添加到这个logger。 | ||
183 | --> | ||
184 | <root level="INFO"> | ||
185 | <appender-ref ref="CONSOLE"/> | ||
186 | <!-- <appender-ref ref="DEBUG_FILE" />--> | ||
187 | <appender-ref ref="INFO_FILE"/> | ||
188 | <appender-ref ref="WARN_FILE"/> | ||
189 | <appender-ref ref="ERROR_FILE"/> | ||
190 | </root> | ||
191 | |||
192 | <!--生产环境:输出到文件--> | ||
193 | <!--<springProfile name="pro">--> | ||
194 | <!--<root level="info">--> | ||
195 | <!--<appender-ref ref="CONSOLE" />--> | ||
196 | <!--<appender-ref ref="DEBUG_FILE" />--> | ||
197 | <!--<appender-ref ref="INFO_FILE" />--> | ||
198 | <!--<appender-ref ref="ERROR_FILE" />--> | ||
199 | <!--<appender-ref ref="WARN_FILE" />--> | ||
200 | <!--</root>--> | ||
201 | <!--</springProfile>--> | ||
202 | |||
203 | </configuration> |
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
3 | <mapper namespace="com.pashanhoo.qys.mapper.ElecLicenseInfoMapper"> | ||
4 | <update id="updateEciInfo"> | ||
5 | update ELEC_LICENSE_INFO set ERR_STATE='0',DZZZ_STATE='1' where biz_id=#{bizId} | ||
6 | </update> | ||
7 | |||
8 | <select id="getEciInfoByZsbs" resultType="com.pashanhoo.qys.entity.ElecLicenseInfoDo"> | ||
9 | select * from ELEC_LICENSE_INFO where zsbs=#{zsbs} | ||
10 | </select> | ||
11 | |||
12 | <select id="getDocumentIdIsNull" resultType="com.pashanhoo.qys.entity.ElecLicenseInfoDo"> | ||
13 | select * | ||
14 | from ELEC_LICENSE_INFO | ||
15 | where DOCUMENT_ID is null and htzt='COMPLETE' and ywh = #{ywh} | ||
16 | </select> | ||
17 | <select id="getWaitForDownload" resultType="com.pashanhoo.qys.entity.ElecLicenseInfoDo"> | ||
18 | select * | ||
19 | from ELEC_LICENSE_INFO | ||
20 | where DOCUMENT_ID is not null | ||
21 | and SFXZ = '2' and ywh = #{ywh} | ||
22 | </select> | ||
23 | <select id="getWaitForConvert" resultType="com.pashanhoo.qys.entity.ElecLicenseInfoDo"> | ||
24 | select * | ||
25 | from ELEC_LICENSE_INFO | ||
26 | where SFXZ = '1' | ||
27 | and SFZH = '2' | ||
28 | and ofd_wjdz is not null and ywh = #{ywh} | ||
29 | </select> | ||
30 | <select id="getYwrMcByCOnditon" resultType="java.lang.String"> | ||
31 | select qlrmc as ywr | ||
32 | from reg_bus_ywr c | ||
33 | where ywh = #{ywh} | ||
34 | and bdcdyh = #{bdcdyh} | ||
35 | and del_flag = '0' | ||
36 | and qszt = '1' | ||
37 | </select> | ||
38 | <select id="getElecLicenseInfo" resultType="com.pashanhoo.qys.entity.ElecLicenseInfoDo"> | ||
39 | select * | ||
40 | from ELEC_LICENSE_INFO | ||
41 | where ywh = #{ywh} and zsbs=#{zsbs} and zsbh=#{zsbh} and zjh=#{zjh} | ||
42 | </select> | ||
43 | |||
44 | |||
45 | </mapper> |
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
3 | <mapper namespace="com.pashanhoo.zhj.mapper.RegBusBdcqzsdjxxMapper"> | ||
4 | <update id="updateBdcqzsjbxxInfo"> | ||
5 | update reg_bus_bdcqzsdjxx set ISCJDZZZ='1' where ID=#{id} | ||
6 | </update> | ||
7 | |||
8 | <select id="getZsdjInfoList" resultType="com.pashanhoo.zhj.entity.RegBusBdcqzsdjxxDo" parameterType="com.pashanhoo.zhj.entity.SynZhjInfoDo"> | ||
9 | select * from reg_bus_bdcqzsdjxx where | ||
10 | del_flag='0' | ||
11 | and | ||
12 | ywh in | ||
13 | <foreach collection="list" item="selectAllListInfo" open="(" close=")" separator=","> | ||
14 | #{selectAllListInfo.ywh,jdbcType=VARCHAR} | ||
15 | </foreach> | ||
16 | |||
17 | </select> | ||
18 | <select id="getZsdjInfoListByYwh" resultType="com.pashanhoo.zhj.entity.RegBusBdcqzsdjxxDo" parameterType="java.lang.String"> | ||
19 | select * from reg_bus_bdcqzsdjxx where | ||
20 | del_flag='0' | ||
21 | and ywh=#{ywh} | ||
22 | </select> | ||
23 | |||
24 | |||
25 | |||
26 | <select id="getZdInfoByZddm" parameterType="string" resultType="java.util.Map"> | ||
27 | select c.seachcity as djqdm, | ||
28 | (select label | ||
29 | from sys_dict b | ||
30 | where type = 'reg_bus_djq' | ||
31 | and b.value = c.seachcity) as djqmc, | ||
32 | c.seachdistrict as djzqdm, | ||
33 | (select label | ||
34 | from sys_dict b | ||
35 | where type = 'reg_bus_djzq' | ||
36 | and b.value = c.seachdistrict) as djzqmc, | ||
37 | c.bdcdyh, | ||
38 | c.zl, | ||
39 | c.zdmj, | ||
40 | c.yt | ||
41 | from reg_base_zdjbxx c,reg_bus_bdcqzsdjxx a | ||
42 | where a.del_flag = '0' | ||
43 | and a.islogout = '0' | ||
44 | and a.bdcdyh = c.bdcdyh | ||
45 | and a.bdcdyh=#{bdcdyh} | ||
46 | and a.ywh=#{ywh} | ||
47 | and c.del_flag = '0' | ||
48 | </select> | ||
49 | <select id="getHQSInfoByZddm" parameterType="string" resultType="java.util.Map"> | ||
50 | select c.bdcdyh, | ||
51 | c.zrzh, | ||
52 | c.ch, | ||
53 | c.zl, | ||
54 | c.sjcs, | ||
55 | c.shbw, | ||
56 | c.hx, | ||
57 | c.hxjg, | ||
58 | c.fwyt1, | ||
59 | c.scjzmj, | ||
60 | c.sctnjzmj, | ||
61 | c.scdxbfjzmj, | ||
62 | c.fttdmj, | ||
63 | c.fwlx, | ||
64 | c.fwxz, | ||
65 | b.qllx, | ||
66 | b.djlx, | ||
67 | b.syqmj, | ||
68 | to_char(trunc(b.syqqssj),'yyyy-mm-dd') as syqqssj, | ||
69 | to_char(trunc(b.syqjssj),'yyyy-mm-dd') as syqjssj, | ||
70 | b.bdcqzh, | ||
71 | b.qxdm, | ||
72 | to_char(trunc(b.djsj),'yyyy-mm-dd') as djsj, | ||
73 | b.qszt, | ||
74 | c.zt | ||
75 | from reg_base_h c, reg_bus_jsydsyq b | ||
76 | where c.del_flag = '0' | ||
77 | and c.rights != '3' | ||
78 | and exists (select 1 | ||
79 | from reg_bus_bdcqzsdjxx a | ||
80 | where a.del_flag = '0' | ||
81 | and a.islogout = '0' | ||
82 | and a.bdcdyh = c.bdcdyh | ||
83 | and a.ywh=#{ywh} | ||
84 | and a.bdcdyh =#{bdcdyh}) | ||
85 | and c.zddm=b.zddm | ||
86 | and b.del_flag = '0' | ||
87 | </select> | ||
88 | <select id="getQSZTInfoByZddm" parameterType="string" resultType="java.util.Map"> | ||
89 | select #{bdcdyh} as bdcdyh, | ||
90 | nvl((select decode(qszt,'1','0','1') from reg_bus_dyaq where ywh=#{ywh} and bdcdyh=#{bdcdyh} and del_flag='0' and qszt=1),'0') as dyqszt, | ||
91 | nvl((select decode(qszt,'1','0','1') from reg_bus_ygdj where ywh=#{ywh} and bdcdyh=#{bdcdyh} and del_flag='0' and qszt=1),'0') as ygqszt, | ||
92 | nvl((select decode(qszt,'1','0','1') from reg_bus_yydj where ywh=#{ywh} and bdcdyh=#{bdcdyh} and del_flag='0' and qszt=1),'0') as yyqszt, | ||
93 | nvl((select decode(qszt,'1','0','1') from reg_bus_cfdj where ywh=#{ywh} and bdcdyh=#{bdcdyh} and del_flag='0' and qszt=1),'0') as cfqszt | ||
94 | from dual | ||
95 | </select> | ||
96 | <select id="getBdcqzsjbxxInfo" resultType="java.util.Map"> | ||
97 | select c.id, | ||
98 | c.ywh, | ||
99 | c.bdcdyh, | ||
100 | c.bdcqzh, | ||
101 | c.create_date, | ||
102 | c.qlrmc, | ||
103 | c.gyqk, | ||
104 | c.zl, | ||
105 | (select label from sys_dict c where type ='reg_bus_qllx' and value= c.qllx and del_flag='0') qllx, | ||
106 | c.djlx, | ||
107 | c.qlxz, | ||
108 | c.qt, | ||
109 | c.yt, | ||
110 | c.mj, | ||
111 | c.syqx, | ||
112 | c.qlqtzk, | ||
113 | c.fj, | ||
114 | c.rights, | ||
115 | REPLACE(c.dbsj,'-','') as djsj, | ||
116 | to_char(to_date(c.dbsj, 'yyyy-mm-dd'),'YYYY') as y, | ||
117 | to_char(to_date(c.dbsj, 'yyyy-mm-dd'),'MM') as m, | ||
118 | to_char(to_date(c.dbsj, 'yyyy-mm-dd'),'dd') as d, | ||
119 | c.bdcqzbh as bh | ||
120 | from reg_bus_bdcqzsdjxx c | ||
121 | where c.del_flag = '0' | ||
122 | and c.isxydzzz = '1' | ||
123 | and c.iscjdzzz = '0' | ||
124 | and dbsj is not null | ||
125 | </select> | ||
126 | |||
127 | <select id="getBdcqzsjbxxInfoByYwh" resultType="java.util.Map"> | ||
128 | select c.id, | ||
129 | c.ywh, | ||
130 | c.bdcdyh, | ||
131 | c.bdcqzh, | ||
132 | c.create_date, | ||
133 | c.qlrmc, | ||
134 | c.gyqk, | ||
135 | c.zl, | ||
136 | (select label from sys_dict c where type ='reg_bus_qllx' and value= c.qllx and del_flag='0') qllx, | ||
137 | c.djlx, | ||
138 | c.qlxz, | ||
139 | c.qt, | ||
140 | c.yt, | ||
141 | c.mj, | ||
142 | c.syqx, | ||
143 | c.qlqtzk, | ||
144 | c.fj, | ||
145 | c.rights, | ||
146 | REPLACE(c.dbsj,'-','') as djsj, | ||
147 | to_char(to_date(c.dbsj, 'yyyy-mm-dd'),'YYYY') as y, | ||
148 | to_char(to_date(c.dbsj, 'yyyy-mm-dd'),'MM') as m, | ||
149 | to_char(to_date(c.dbsj, 'yyyy-mm-dd'),'dd') as d, | ||
150 | c.bdcqzbh as bh | ||
151 | from reg_bus_bdcqzsdjxx c | ||
152 | where c.del_flag = '0' | ||
153 | and c.isxydzzz = '1' | ||
154 | and c.iscjdzzz = '0' | ||
155 | and c.ywh=#{ywh} | ||
156 | and dbsj is not null | ||
157 | </select> | ||
158 | <select id="getQlrInfoByYwh" resultType="java.util.Map"> | ||
159 | select wm_concat(qlrmc) as qlrmc,wm_concat(zjh) as zjh from reg_bus_qlr c where ywh =#{ywh} and del_flag='0' and qszt='1' order by sxh | ||
160 | </select> | ||
161 | <select id="getQlrInfoByYwhAndqlr" resultType="java.lang.String"> | ||
162 | select zjh from reg_bus_qlr c where ywh =#{ywh} and qlrmc=#{qlrmc} and del_flag='0' and qszt='1' order by sxh | ||
163 | </select> | ||
164 | <select id="getBdcqzsJbxxById" resultType="java.util.Map"> | ||
165 | select c.id, | ||
166 | c.ywh, | ||
167 | c.bdcdyh, | ||
168 | c.bdcqzh, | ||
169 | c.create_date, | ||
170 | c.qlrmc, | ||
171 | c.gyqk, | ||
172 | c.zl, | ||
173 | (select label from sys_dict c where type ='reg_bus_qllx' and value= c.qllx and del_flag='0') qllx, | ||
174 | c.djlx, | ||
175 | c.qlxz, | ||
176 | c.qt, | ||
177 | c.yt, | ||
178 | c.mj, | ||
179 | c.syqx, | ||
180 | c.qlqtzk, | ||
181 | c.fj, | ||
182 | c.rights, | ||
183 | REPLACE(c.dbsj,'-','') as djsj, | ||
184 | to_char(to_date(c.dbsj, 'yyyy-mm-dd'),'YYYY') as y, | ||
185 | to_char(to_date(c.dbsj, 'yyyy-mm-dd'),'MM') as m, | ||
186 | to_char(to_date(c.dbsj, 'yyyy-mm-dd'),'dd') as d, | ||
187 | c.bdcqzbh as bh | ||
188 | from reg_bus_bdcqzsdjxx c | ||
189 | where c.id=#{id} | ||
190 | </select> | ||
191 | <select id="getInfoByValue" resultType="java.lang.String"> | ||
192 | select label from sys_dict c where del_flag='0' and type=#{type} and value=#{value} | ||
193 | </select> | ||
194 | <select id="getRightsInfo" resultType="java.util.Map"> | ||
195 | select * from ( SELECT * FROM reg_bus_rights a WHERE a.bdcdyh = #{bdcdyh} order by del_flag ) where rownum=1 | ||
196 | </select> | ||
197 | |||
198 | <select id="getDyqqInfo" resultType="java.util.Map"> | ||
199 | select c.bdbzzqse,to_char(c.zwlxqssj,'yyyymmdd') as zwlxqssj,to_char(c.zwlxjssj,'yyyymmdd') as zwlxjssj from reg_bus_dyaq c where ywh=#{ywh} and bdcdyh=#{bdcdyh} and qszt='1' | ||
200 | </select> | ||
201 | <select id="getHtbhInfo" resultType="java.lang.String"> | ||
202 | select htbh from reg_bus_ygdj c where qszt='1' and del_flag='0' and ywh=#{ywh} | ||
203 | </select> | ||
204 | <select id="getBdcjbxxInfo" resultType="java.util.Map"> | ||
205 | select * from reg_bus_bdcqzsdjxx c where bdcdyh=#{bdcdyh} and islogout='0' and dbsj is not null and del_flag='0' | ||
206 | </select> | ||
207 | <select id="getJbxxInfoByYwhAndBdcdyh" resultType="java.util.Map"> | ||
208 | select * from reg_bus_bdcqzsdjxx c where ywh=#{ywh} and bdcdyh=#{bdcdyh} and islogout='0' and dbsj is not null and del_flag='0' | ||
209 | </select> | ||
210 | <select id="getJbxxById" resultType="java.util.Map"> | ||
211 | select * from reg_bus_bdcqzsdjxx c where id=#{id} | ||
212 | </select> | ||
213 | <select id="getZdjbxxByZddm" resultType="java.util.Map"> | ||
214 | select * from reg_base_zdjbxx where del_flag='0' and zddm=#{zddm} and islogout='0' | ||
215 | </select> | ||
216 | <select id="getZrzInfo" resultType="java.util.Map"> | ||
217 | select * from reg_base_zrz where bdcdyh=#{bdcdyh} and del_flag='0' | ||
218 | </select> | ||
219 | <select id="getHInfo" resultType="java.util.Map"> | ||
220 | select * from reg_base_h c where bdcdyh=#{bdcdyh} and islogout='0' and del_flag='0' | ||
221 | </select> | ||
222 | </mapper> |
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
3 | <mapper namespace="com.pashanhoo.zhj.mapper.SynZhjInfoMapper"> | ||
4 | |||
5 | <select id="selectAllInfo" resultType="com.pashanhoo.zhj.entity.SynZhjInfoDo"> | ||
6 | select * from syn_zhjinfo where ZD_STATE='0' and H_STATE='0' and HQS_STATE='0' and del_flag='0' | ||
7 | </select> | ||
8 | |||
9 | <update id="updatezdzt"> | ||
10 | update syn_zhjinfo set ZD_STATE='1' where ywh=#{ywh} | ||
11 | </update> | ||
12 | <update id="updateHzt"> | ||
13 | update syn_zhjinfo set H_STATE='1' where ywh=#{ywh} | ||
14 | </update> | ||
15 | <update id="updateHqszt"> | ||
16 | update syn_zhjinfo set HQS_STATE='1' where ywh=#{ywh} | ||
17 | </update> | ||
18 | </mapper> |
-
Please register or sign in to post a comment