作者 朱兆平

新舱单辅助管理-直接改配业务管理

正在显示 40 个修改的文件 包含 1401 行增加124 行删除
@@ -11,7 +11,12 @@ spring: @@ -11,7 +11,12 @@ spring:
11 mvc: 11 mvc:
12 #静态资源,设置上传文件的访问, 12 #静态资源,设置上传文件的访问,
13 static-path-pattern: /** 13 static-path-pattern: /**
14 - 14 + thymeleaf:
  15 + cache: false
  16 + encoding: UTF-8
  17 + mode: XML
  18 + suffix: .xml
  19 + prefix: classpath:/templates/
15 resources: 20 resources:
16 static-locations: classpath:/META-INF/resources/,classpath:/static,classpath:/resources/,file:${web.upload-path} 21 static-locations: classpath:/META-INF/resources/,classpath:/static,classpath:/resources/,file:${web.upload-path}
17 22
@@ -43,12 +48,12 @@ spring: @@ -43,12 +48,12 @@ spring:
43 type: com.alibaba.druid.pool.DruidDataSource 48 type: com.alibaba.druid.pool.DruidDataSource
44 #oracle 49 #oracle
45 driver-class-name: oracle.jdbc.OracleDriver 50 driver-class-name: oracle.jdbc.OracleDriver
46 -# url: jdbc:oracle:thin:@10.50.3.69:1521:CGODB  
47 -# username: CGONMS  
48 -# password: 1q2w3e4r  
49 - url: jdbc:oracle:thin:@192.168.1.253:1522:ORCLL 51 + url: jdbc:oracle:thin:@192.168.1.199:10069:CGODB
50 username: CGONMS 52 username: CGONMS
51 - password: vmvnv1v2 53 + password: 1q2w3e4r
  54 +# url: jdbc:oracle:thin:@192.168.1.253:1522:ORCLL
  55 +# username: CGONMS
  56 +# password: vmvnv1v2
52 #spring datasource mysql,注意编码配置,缺少数据库编码配置容易引起中文入库乱码 57 #spring datasource mysql,注意编码配置,缺少数据库编码配置容易引起中文入库乱码
53 # url: jdbc:mysql://127.0.0.1:3307/statistics?useUnicode=true&characterEncoding=utf8 58 # url: jdbc:mysql://127.0.0.1:3307/statistics?useUnicode=true&characterEncoding=utf8
54 # username: root 59 # username: root
@@ -126,6 +131,10 @@ logging: @@ -126,6 +131,10 @@ logging:
126 #Java Web Token 时效时间,单位秒 131 #Java Web Token 时效时间,单位秒
127 jwt: 132 jwt:
128 max-alive: 300 133 max-alive: 300
  134 +customs:
  135 + #生成报文文件夹路径,尾部要带斜杠/
  136 + xml-path: customTemplate/
  137 + transport-number: 460470678920X
129 info: 138 info:
130 version: 1.0 139 version: 1.0
131 description: "新舱单辅助管理服务-统一认证、转运管理、提前运抵等" 140 description: "新舱单辅助管理服务-统一认证、转运管理、提前运抵等"
@@ -34,6 +34,10 @@ @@ -34,6 +34,10 @@
34 </dependency> 34 </dependency>
35 <dependency> 35 <dependency>
36 <groupId>org.springframework.boot</groupId> 36 <groupId>org.springframework.boot</groupId>
  37 + <artifactId>spring-boot-starter-thymeleaf</artifactId>
  38 + </dependency>
  39 + <dependency>
  40 + <groupId>org.springframework.boot</groupId>
37 <artifactId>spring-boot-starter-websocket</artifactId> 41 <artifactId>spring-boot-starter-websocket</artifactId>
38 <exclusions> 42 <exclusions>
39 <exclusion> 43 <exclusion>
  1 +Manifest-Version: 1.0
  2 +Main-Class: com.tianbo.analysis.CustomAnalysisBootApplication
  3 +Class-Path: jackson-annotations-2.10.0.jar aspectjweaver-1.9.4.jar sprin
  4 + g-aop-5.2.0.RELEASE.jar xml-apis-1.4.01.jar spring-boot-starter-aop-2.2
  5 + .0.BUILD-20191016.163422-713.jar httpclient-4.5.10.jar spring-boot-2.2.
  6 + 0.BUILD-20191016.163506-711.jar dom4j-2.1.0.jar javax.inject-1.jar neko
  7 + html-1.9.22.jar guava-16.0.jar spring-context-5.2.0.RELEASE.jar jakarta
  8 + .validation-api-2.0.1.jar unbescape-1.1.6.RELEASE.jar jboss-logging-3.4
  9 + .1.Final.jar jersey-client-1.19.1.jar rxjava-1.3.8.jar spring-cloud-com
  10 + mons-2.1.5.BUILD-20200131.003036-348.jar ribbon-eureka-2.3.0.jar aopall
  11 + iance-1.0.jar spring-boot-starter-websocket-2.2.0.BUILD-20191016.163500
  12 + -711.jar archaius-core-0.7.6.jar freemarker-2.3.29.jar HdrHistogram-2.1
  13 + .9.jar commons-collections4-4.3.jar spring-jcl-5.2.0.RELEASE.jar thymel
  14 + eaf-extras-java8time-3.0.4.RELEASE.jar log4j-api-2.12.1.jar tomcat-embe
  15 + d-websocket-9.0.27.jar spring-cloud-netflix-ribbon-2.1.5.BUILD-20200131
  16 + .211941-597.jar poi-ooxml-4.1.0.jar spring-cloud-starter-2.1.5.BUILD-20
  17 + 200131.003057-348.jar netflix-eventbus-0.3.0.jar netflix-infix-0.3.0.ja
  18 + r ribbon-loadbalancer-2.3.0.jar hibernate-validator-6.0.17.Final.jar ju
  19 + l-to-slf4j-1.7.28.jar mybatis-3.4.6.jar rxnetty-contexts-0.4.9.jar bcpk
  20 + ix-jdk15on-1.64.jar spring-web-5.2.0.RELEASE.jar spring-boot-starter-va
  21 + lidation-2.2.0.BUILD-20191016.163457-711.jar mybatis-spring-1.3.2.jar s
  22 + pring-boot-starter-jdbc-2.2.0.BUILD-20191016.163441-713.jar spring-boot
  23 + -starter-2.2.0.BUILD-20191016.163501-711.jar antlr-runtime-3.4.jar poi-
  24 + ooxml-schemas-4.1.0.jar xmlbeans-3.1.0.jar ojdbc6-11.2.0.4.0-atlassian-
  25 + hosted.jar tomcat-embed-el-9.0.27.jar spring-boot-starter-thymeleaf-2.2
  26 + .0.BUILD-20191016.163455-712.jar snakeyaml-1.25.jar mybatis-spring-boot
  27 + -starter-1.3.2.jar jersey-core-1.19.1.jar bcprov-jdk15on-1.64.jar woods
  28 + tox-core-5.2.1.jar spring-cloud-starter-netflix-archaius-2.1.5.BUILD-20
  29 + 200131.212322-596.jar jakarta.annotation-api-1.3.5.jar rxnetty-servo-0.
  30 + 4.9.jar spring-messaging-5.2.0.RELEASE.jar commons-math-2.2.jar guice-4
  31 + .1.0.jar xstream-1.4.11.1.jar spring-jdbc-5.2.0.RELEASE.jar poi-4.1.0.j
  32 + ar attoparser-2.0.5.RELEASE.jar spring-tx-5.2.0.RELEASE.jar ribbon-core
  33 + -2.3.0.jar spring-boot-autoconfigure-2.2.0.BUILD-20191016.163400-713.ja
  34 + r jackson-datatype-jsr310-2.10.0.jar spring-cloud-starter-netflix-eurek
  35 + a-client-2.1.5.BUILD-20200131.212334-596.jar mybatis-spring-boot-autoco
  36 + nfigure-1.3.2.jar curvesapi-1.06.jar eureka-core-1.9.13.jar commons-lan
  37 + g-2.6.jar servo-core-0.12.21.jar netflix-statistics-0.1.1.jar commons-c
  38 + odec-1.13.jar spring-security-crypto-5.2.0.RELEASE.jar spring-boot-star
  39 + ter-json-2.2.0.BUILD-20191016.163444-713.jar gson-2.8.6.jar ribbon-2.3.
  40 + 0.jar spring-expression-5.2.0.RELEASE.jar stringtemplate-3.2.1.jar spri
  41 + ng-websocket-5.2.0.RELEASE.jar ribbon-transport-2.3.0.jar spring-boot-s
  42 + tarter-web-2.2.0.BUILD-20191016.163459-711.jar netflix-commons-util-0.3
  43 + .0.jar eureka-client-1.9.13.jar spring-boot-starter-tomcat-2.2.0.BUILD-
  44 + 20191016.163456-712.jar ribbon-httpclient-2.3.0.jar antlr-2.7.7.jar com
  45 + mons-io-2.6.jar rxnetty-0.4.9.jar classmate-1.5.0.jar xpp3_min-1.1.4c.j
  46 + ar jsr311-api-1.1.1.jar jackson-core-2.10.0.jar spring-security-rsa-1.0
  47 + .9.RELEASE.jar logback-classic-1.2.3.jar spring-cloud-starter-netflix-r
  48 + ibbon-2.1.5.BUILD-20200131.212329-596.jar stax2-api-4.2.jar spring-clou
  49 + d-context-2.1.5.BUILD-20200131.002935-351.jar tomcat-embed-core-9.0.27.
  50 + jar spring-webmvc-5.2.0.RELEASE.jar thymeleaf-3.0.11.RELEASE.jar druid-
  51 + 1.1.9.jar xmlpull-1.1.3.1.jar httpcore-4.4.12.jar spring-core-5.2.0.REL
  52 + EASE.jar commons-collections-3.2.2.jar tomcat-annotations-api-9.0.27.ja
  53 + r jaxen-1.2.0.jar commons-configuration-1.8.jar log4j-to-slf4j-2.12.1.j
  54 + ar commons-jxpath-1.3.jar joda-time-2.10.4.jar spring-cloud-netflix-eur
  55 + eka-client-2.1.5.BUILD-20200131.212304-596.jar jackson-module-parameter
  56 + -names-2.10.0.jar commons-compress-1.18.jar spring-cloud-netflix-archai
  57 + us-2.1.5.BUILD-20200131.211909-597.jar stax-api-1.0.1.jar spring-beans-
  58 + 5.2.0.RELEASE.jar amqp-client-5.7.3.jar jersey-apache-client4-1.19.1.ja
  59 + r xercesImpl-2.11.0.jar jettison-1.3.7.jar hystrix-core-1.5.18.jar jack
  60 + son-datatype-jdk8-2.10.0.jar slf4j-api-1.7.28.jar HikariCP-3.4.1.jar co
  61 + mmons-math3-3.6.1.jar annotations-19.0.0.jar logback-core-1.2.3.jar jac
  62 + kson-databind-2.10.0.jar spring-boot-starter-logging-2.2.0.BUILD-201910
  63 + 16.163447-713.jar spring-cloud-netflix-hystrix-2.1.5.BUILD-20200131.212
  64 + 025-597.jar thymeleaf-spring5-3.0.11.RELEASE.jar
  65 +
@@ -18,8 +18,8 @@ public class ErrorPageConfig implements ErrorPageRegistrar { @@ -18,8 +18,8 @@ public class ErrorPageConfig implements ErrorPageRegistrar {
18 @Override 18 @Override
19 public void registerErrorPages(ErrorPageRegistry registry){ 19 public void registerErrorPages(ErrorPageRegistry registry){
20 ErrorPage[] errorPages=new ErrorPage[2]; 20 ErrorPage[] errorPages=new ErrorPage[2];
21 - errorPages[0]=new ErrorPage(HttpStatus.NOT_FOUND,"/error404");  
22 - errorPages[1]=new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR,"/error500"); 21 + errorPages[0]=new ErrorPage(HttpStatus.NOT_FOUND,"/error/404");
  22 + errorPages[1]=new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR,"/error/500");
23 23
24 registry.addErrorPages(errorPages); 24 registry.addErrorPages(errorPages);
25 } 25 }
1 -package com.tianbo.analysis.config;  
2 -  
3 -import org.springframework.context.annotation.Bean;  
4 -import org.springframework.context.annotation.Configuration;  
5 -import org.springframework.web.socket.server.standard.ServerEndpointExporter;  
6 -  
7 -@Configuration  
8 -public class WebSocketConfig {  
9 - @Bean  
10 - public ServerEndpointExporter serverEndpointExporter() {  
11 - return new ServerEndpointExporter();  
12 - }  
13 -}  
@@ -81,6 +81,8 @@ public class DomTransController { @@ -81,6 +81,8 @@ public class DomTransController {
81 domtransit.setOriginHousewaybill(awbh); 81 domtransit.setOriginHousewaybill(awbh);
82 domtransit.setOriginFlightno(flightNo); 82 domtransit.setOriginFlightno(flightNo);
83 domtransit.setTransitType(transType); 83 domtransit.setTransitType(transType);
  84 +
  85 + //todo:权限校验,有管理权限的 显示全部数据
84 if (!"admin".equals(username)){ 86 if (!"admin".equals(username)){
85 domtransit.setUserName(username); 87 domtransit.setUserName(username);
86 } 88 }
@@ -91,7 +93,7 @@ public class DomTransController { @@ -91,7 +93,7 @@ public class DomTransController {
91 } 93 }
92 94
93 @ApiOperation(value = "审核接口",notes = "中转审核,id及状态必填") 95 @ApiOperation(value = "审核接口",notes = "中转审核,id及状态必填")
94 - @PutMapping("audit") 96 + @PostMapping("audit")
95 @UserPermissionCheck 97 @UserPermissionCheck
96 public ResultJson audit(@Validated(ValidateAudit.class) @RequestBody DOMTRANSIT domtransit, 98 public ResultJson audit(@Validated(ValidateAudit.class) @RequestBody DOMTRANSIT domtransit,
97 @CookieValue("username") String username, 99 @CookieValue("username") String username,
1 -package com.tianbo.analysis.controller;  
2 -  
3 -import com.tianbo.analysis.handle.IO_Log_Handle;  
4 -import org.springframework.stereotype.Component;  
5 -  
6 -import javax.websocket.OnClose;  
7 -import javax.websocket.OnError;  
8 -import javax.websocket.OnOpen;  
9 -import javax.websocket.Session;  
10 -import javax.websocket.server.ServerEndpoint;  
11 -import java.io.IOException;  
12 -import java.io.InputStream;  
13 -import java.util.concurrent.CopyOnWriteArraySet;  
14 -  
15 -  
16 -@ServerEndpoint(value = "/log")  
17 -@Component  
18 -public class LogWebsockController {  
19 - private Process process;  
20 - private InputStream inputStream;  
21 - //与某个客户端的连接会话,需要通过它来给客户端发送数据  
22 - private Session session;  
23 -  
24 - //静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。  
25 - private static int onlineCount = 0;  
26 - //concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。  
27 - private static CopyOnWriteArraySet<LogWebsockController> webSocketSet = new CopyOnWriteArraySet<LogWebsockController>();  
28 -  
29 -  
30 - @OnOpen  
31 - public void onOpen(Session session){  
32 - this.session = session;  
33 - webSocketSet.add(this);  
34 - addOnlineCount();  
35 - try {  
36 - process = Runtime.getRuntime().exec("tail -f logs/imf.log");  
37 - inputStream = process.getInputStream();  
38 - IO_Log_Handle thread = new IO_Log_Handle(inputStream, session);  
39 - thread.start();  
40 -  
41 - }catch (IOException e){  
42 - e.printStackTrace();  
43 - }  
44 -  
45 - }  
46 - /**  
47 - * WebSocket请求关闭  
48 - */  
49 - @OnClose  
50 - public void onClose() {  
51 - try {  
52 - if(inputStream != null) {  
53 - inputStream.close();  
54 - }  
55 - } catch (Exception e) {  
56 - e.printStackTrace();  
57 - }  
58 - if(process != null){  
59 - process.destroy();  
60 - }  
61 -  
62 - }  
63 -  
64 - @OnError  
65 - public void onError(Throwable thr) {  
66 - thr.printStackTrace();  
67 - }  
68 -  
69 - public static synchronized void addOnlineCount() {  
70 - LogWebsockController.onlineCount++;  
71 - }  
72 - public static synchronized int getOnlineCount() {  
73 - return onlineCount;  
74 - }  
75 -  
76 -  
77 -}  
1 package com.tianbo.analysis.controller; 1 package com.tianbo.analysis.controller;
2 2
3 import com.github.pagehelper.PageInfo; 3 import com.github.pagehelper.PageInfo;
  4 +import com.tianbo.analysis.annotation.UserPermissionCheck;
  5 +import com.tianbo.analysis.controller.bean.ResponseReason;
  6 +
4 import com.tianbo.analysis.model.MANIFEST_AIR_CHANGE; 7 import com.tianbo.analysis.model.MANIFEST_AIR_CHANGE;
5 import com.tianbo.analysis.model.ResultJson; 8 import com.tianbo.analysis.model.ResultJson;
6 import com.tianbo.analysis.service.MT8204Service; 9 import com.tianbo.analysis.service.MT8204Service;
  10 +
7 import com.tianbo.util.Date.DateUtil; 11 import com.tianbo.util.Date.DateUtil;
  12 +import io.swagger.annotations.ApiOperation;
8 import lombok.extern.slf4j.Slf4j; 13 import lombok.extern.slf4j.Slf4j;
  14 +
9 import org.apache.commons.lang.StringUtils; 15 import org.apache.commons.lang.StringUtils;
10 import org.springframework.beans.factory.annotation.Autowired; 16 import org.springframework.beans.factory.annotation.Autowired;
11 -import org.springframework.web.bind.annotation.GetMapping;  
12 -import org.springframework.web.bind.annotation.RequestMapping;  
13 -import org.springframework.web.bind.annotation.RequestParam;  
14 -import org.springframework.web.bind.annotation.RestController;  
15 17
  18 +import org.springframework.web.bind.annotation.*;
  19 +
  20 +
  21 +import org.xml.sax.SAXException;
  22 +
  23 +import javax.xml.XMLConstants;
  24 +import javax.xml.transform.stream.StreamSource;
  25 +import javax.xml.validation.Schema;
  26 +import javax.xml.validation.SchemaFactory;
  27 +import javax.xml.validation.Validator;
  28 +import java.io.File;
  29 +
  30 +import java.io.IOException;
16 import java.util.Date; 31 import java.util.Date;
17 32
  33 +
18 @Slf4j 34 @Slf4j
19 @RestController 35 @RestController
20 @RequestMapping("/mt8024/") 36 @RequestMapping("/mt8024/")
@@ -26,9 +42,9 @@ public class MT8204Controller { @@ -26,9 +42,9 @@ public class MT8204Controller {
26 @GetMapping("/") 42 @GetMapping("/")
27 public ResultJson index(@RequestParam(value = "page",defaultValue = "1") int page, 43 public ResultJson index(@RequestParam(value = "page",defaultValue = "1") int page,
28 @RequestParam(value = "limit",defaultValue = "10") int limit, 44 @RequestParam(value = "limit",defaultValue = "10") int limit,
29 - @RequestParam(value = "flightNo",required = false) String flightNo, 45 + @RequestParam(value = "flightno",required = false) String flightNo,
30 @RequestParam(value = "flightDate",required = false) String flightDate, 46 @RequestParam(value = "flightDate",required = false) String flightDate,
31 - @RequestParam(value = "waybillNo",required = false) String waybillNo){ 47 + @RequestParam(value = "waybillnomaster",required = false) String waybillNo){
32 MANIFEST_AIR_CHANGE manifest_air_change = new MANIFEST_AIR_CHANGE(); 48 MANIFEST_AIR_CHANGE manifest_air_change = new MANIFEST_AIR_CHANGE();
33 if(StringUtils.isNotEmpty(flightDate)){ 49 if(StringUtils.isNotEmpty(flightDate)){
34 Date flight_Date = DateUtil.parseDate(flightDate,"yyyy-MM-dd"); 50 Date flight_Date = DateUtil.parseDate(flightDate,"yyyy-MM-dd");
@@ -39,4 +55,37 @@ public class MT8204Controller { @@ -39,4 +55,37 @@ public class MT8204Controller {
39 PageInfo<MANIFEST_AIR_CHANGE> result = mt8204Service.selectList(manifest_air_change,page,limit); 55 PageInfo<MANIFEST_AIR_CHANGE> result = mt8204Service.selectList(manifest_air_change,page,limit);
40 return new ResultJson("200","success",result); 56 return new ResultJson("200","success",result);
41 } 57 }
  58 +
  59 + @ApiOperation(value = "添加直接改配申请接口")
  60 + @PostMapping("add")
  61 + public ResultJson add(@RequestBody MANIFEST_AIR_CHANGE manifest_air_change){
  62 + return mt8204Service.add(manifest_air_change) ? new ResultJson(ResponseReason.MT8204_SUCCESS) : new ResultJson(ResponseReason.MT8204_ADD_ERR);
  63 + }
  64 +
  65 + @ApiOperation(value = "编辑直接改配申请接口")
  66 + @PostMapping("edit")
  67 + public ResultJson edit(@RequestBody MANIFEST_AIR_CHANGE manifest_air_change){
  68 + manifest_air_change.setChangetime(new Date());
  69 + return mt8204Service.edit(manifest_air_change) ? new ResultJson(ResponseReason.MT8204_SUCCESS) : new ResultJson(ResponseReason.MT8204_EDIT_ERR);
  70 + }
  71 +
  72 + @ApiOperation(value = "删除直接改配申请接口")
  73 + @UserPermissionCheck
  74 + @PostMapping("del")
  75 + public ResultJson del(@RequestBody MANIFEST_AIR_CHANGE manifest_air_change,@CookieValue("username") String username,@CookieValue("userid") String userid){
  76 + manifest_air_change.setChangetime(new Date());
  77 + return mt8204Service.del(manifest_air_change) ? new ResultJson(ResponseReason.MT8204_SUCCESS) : new ResultJson(ResponseReason.MT8204_DEL_ERR);
  78 + }
  79 +
  80 + @ApiOperation(value = "发送直接改配申请接口")
  81 + @UserPermissionCheck
  82 + @PostMapping("send")
  83 + public ResultJson send(@RequestBody MANIFEST_AIR_CHANGE manifest_air_change,@CookieValue("username") String username,@CookieValue("userid") String userid){
  84 + return mt8204Service.send(manifest_air_change,username) ? new ResultJson(ResponseReason.MT8204_SUCCESS) : new ResultJson(ResponseReason.MT8204_SEND_ERR);
  85 + }
  86 +
  87 + @PostMapping("batchSend")
  88 + public ResultJson batchSend(@RequestBody MANIFEST_AIR_CHANGE manifest_air_change,@CookieValue("username") String username,@CookieValue("userid") String userid){
  89 + return mt8204Service.send(manifest_air_change,username) ? new ResultJson(ResponseReason.MT8204_SUCCESS) : new ResultJson(ResponseReason.MT8204_SEND_ERR);
  90 + }
42 } 91 }
  1 +package com.tianbo.analysis.controller;
  2 +
  3 +
  4 +import com.tianbo.analysis.annotation.UserPermissionCheck;
  5 +import com.tianbo.analysis.model.ResultJson;
  6 +import com.tianbo.analysis.model.SysMenu;
  7 +import com.tianbo.analysis.service.MenuService;
  8 +import lombok.extern.slf4j.Slf4j;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.web.bind.annotation.*;
  11 +
  12 +import java.util.List;
  13 +
  14 +@Slf4j
  15 +@RestController
  16 +@RequestMapping("/menu")
  17 +public class MenuController {
  18 +
  19 + @Autowired
  20 + MenuService menuService;
  21 +
  22 + @UserPermissionCheck
  23 + @GetMapping("/userMenu")
  24 + public ResultJson userMenu(@CookieValue("userid") String userid,@CookieValue("username") String username){
  25 +
  26 + List<SysMenu> userMenus = menuService.userMenuIds(userid);
  27 +
  28 + return new ResultJson("200","user menus getcha",userMenus);
  29 +
  30 + }
  31 +}
  1 +package com.tianbo.analysis.controller;
  2 +
  3 +
  4 +import com.github.pagehelper.PageInfo;
  5 +import com.tianbo.analysis.dao.PREPAREMASTERMapper;
  6 +import com.tianbo.analysis.model.PREPAREMASTER;
  7 +import com.tianbo.analysis.model.ResultJson;
  8 +import com.tianbo.analysis.service.PREPARMASTERService;
  9 +import com.tianbo.util.Date.DateUtil;
  10 +import lombok.extern.slf4j.Slf4j;
  11 +import org.apache.commons.lang.StringUtils;
  12 +import org.springframework.beans.factory.annotation.Autowired;
  13 +import org.springframework.web.bind.annotation.RequestMapping;
  14 +import org.springframework.web.bind.annotation.RequestParam;
  15 +import org.springframework.web.bind.annotation.RestController;
  16 +
  17 +import javax.annotation.Resource;
  18 +import java.util.Date;
  19 +
  20 +@Slf4j
  21 +@RestController
  22 +@RequestMapping("/premaster/")
  23 +public class PREPAREMASTERController {
  24 +
  25 + @Autowired
  26 + PREPARMASTERService preparmasterService;
  27 +
  28 +
  29 + @RequestMapping("search")
  30 + public ResultJson search(@RequestParam(value = "page",defaultValue = "1") int page,
  31 + @RequestParam(value = "limit",defaultValue = "10") int limit,
  32 + @RequestParam(value = "flightNo",required = false) String flightNo,
  33 + @RequestParam(value = "flightDate",required = false) String flightDate,
  34 + @RequestParam(value = "waybillnomaster",required = false) String waybillnomaster,
  35 + @RequestParam(value = "customsCode",required = false) String customsCode
  36 + ){
  37 + PREPAREMASTER preparemaster = new PREPAREMASTER();
  38 + preparemaster.setWaybillnomaster(waybillnomaster);
  39 + preparemaster.setCustomscode(customsCode);
  40 + if(StringUtils.isNotEmpty(flightNo)){
  41 + preparemaster.setFlightno(flightNo.substring(2));
  42 + preparemaster.setCarrier(flightNo.substring(0,2));
  43 + }
  44 +
  45 + if(StringUtils.isNotEmpty(flightDate)){
  46 + Date flight_Date = DateUtil.parseDate(flightDate,"yyyy-MM-dd");
  47 + preparemaster.setFlightdate(flight_Date);
  48 + }
  49 +
  50 + PageInfo<PREPAREMASTER> pageInfo= preparmasterService.search(preparemaster,page,limit);
  51 + return new ResultJson("200","OK",pageInfo);
  52 + }
  53 +}
  1 +package com.tianbo.analysis.controller;
  2 +
  3 +import com.tianbo.analysis.dao.SENDLOGMapper;
  4 +import com.tianbo.analysis.model.ResultJson;
  5 +import com.tianbo.analysis.model.SENDLOG;
  6 +import com.tianbo.analysis.service.SendLogService;
  7 +import io.swagger.annotations.ApiOperation;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.web.bind.annotation.RequestMapping;
  10 +import org.springframework.web.bind.annotation.RequestParam;
  11 +import org.springframework.web.bind.annotation.RestController;
  12 +
  13 +import javax.annotation.Resource;
  14 +import java.util.List;
  15 +
  16 +@RestController
  17 +@RequestMapping("/sendlog")
  18 +public class SendLogController {
  19 +
  20 + @Resource
  21 + SENDLOGMapper sendlogMapper;
  22 +
  23 + @Autowired
  24 + SendLogService sendLogService;
  25 +
  26 + @RequestMapping("/id")
  27 + public ResultJson getById(@RequestParam(value = "id",required = true) String messageId){
  28 + List<SENDLOG> result = sendlogMapper.selectByMessageId(messageId);
  29 + return new ResultJson<>("200","success",result);
  30 + }
  31 +
  32 + @ApiOperation(value = "查询进出港运单放行信息")
  33 + @RequestMapping("checkWaybillPermit")
  34 + public ResultJson checkWaybillPermit(@RequestParam(value = "waybill",required = true) String waybill){
  35 + return new ResultJson("200","success",sendLogService.checkWaybillPermit(waybill));
  36 + }
  37 +}
  1 +package com.tianbo.analysis.controller.bean;
  2 +
  3 +public enum ResponseReason {
  4 + MT8204_SUCCESS("200","直接改配申请操作成功"),
  5 + MT8204_ADD_ERR("8204400","直接改配申请添加失败,存在重复申请,请检查后重试"),
  6 + MT8204_EDIT_ERR("8204401","直接改配申请更新失败"),
  7 + MT8204_DEL_ERR("8204402","直接改配申请更新失败"),
  8 + MT8204_SEND_ERR("8204404","直接改配发送失败");
  9 + private String code;
  10 + private String msg;
  11 +
  12 + ResponseReason(String code, String msg) {
  13 + this.code = code;
  14 + this.msg = msg;
  15 + }
  16 +
  17 + public String getCode() {
  18 + return code;
  19 + }
  20 +
  21 + public void setCode(String code) {
  22 + this.code = code;
  23 + }
  24 +
  25 + public String getMsg() {
  26 + return msg;
  27 + }
  28 +
  29 + public void setMsg(String msg) {
  30 + this.msg = msg;
  31 + }
  32 +}
@@ -11,11 +11,12 @@ public interface MANIFEST_AIR_CHANGEMapper { @@ -11,11 +11,12 @@ public interface MANIFEST_AIR_CHANGEMapper {
11 11
12 int insertSelective(MANIFEST_AIR_CHANGE record); 12 int insertSelective(MANIFEST_AIR_CHANGE record);
13 13
  14 + List<MANIFEST_AIR_CHANGE> insertCheckRepeat(MANIFEST_AIR_CHANGE record);
  15 +
14 MANIFEST_AIR_CHANGE selectByPrimaryKey(String autoid); 16 MANIFEST_AIR_CHANGE selectByPrimaryKey(String autoid);
15 17
16 List<MANIFEST_AIR_CHANGE> selectList(MANIFEST_AIR_CHANGE record); 18 List<MANIFEST_AIR_CHANGE> selectList(MANIFEST_AIR_CHANGE record);
17 19
18 -  
19 int updateByPrimaryKeySelective(MANIFEST_AIR_CHANGE record); 20 int updateByPrimaryKeySelective(MANIFEST_AIR_CHANGE record);
20 21
21 int updateByPrimaryKey(MANIFEST_AIR_CHANGE record); 22 int updateByPrimaryKey(MANIFEST_AIR_CHANGE record);
@@ -20,6 +20,8 @@ public interface PREPAREMASTERMapper { @@ -20,6 +20,8 @@ public interface PREPAREMASTERMapper {
20 */ 20 */
21 List<PREPAREMASTER> selectArrivedAheadByWaybillNo(String waybillNo); 21 List<PREPAREMASTER> selectArrivedAheadByWaybillNo(String waybillNo);
22 22
  23 + List<PREPAREMASTER> selectBy(PREPAREMASTER record);
  24 +
23 int updateByPrimaryKeySelective(PREPAREMASTER record); 25 int updateByPrimaryKeySelective(PREPAREMASTER record);
24 26
25 int updateByPrimaryKey(PREPAREMASTER record); 27 int updateByPrimaryKey(PREPAREMASTER record);
  1 +package com.tianbo.analysis.dao;
  2 +
  3 +import com.tianbo.analysis.model.RoleMenu;
  4 +
  5 +public interface RoleMenuDao {
  6 + int insert(RoleMenu record);
  7 +
  8 + int insertSelective(RoleMenu record);
  9 +
  10 + RoleMenu getUserMenus(String userid);
  11 +}
@@ -2,7 +2,14 @@ package com.tianbo.analysis.dao; @@ -2,7 +2,14 @@ package com.tianbo.analysis.dao;
2 2
3 import com.tianbo.analysis.model.SENDLOG; 3 import com.tianbo.analysis.model.SENDLOG;
4 4
  5 +import java.util.List;
  6 +
5 public interface SENDLOGMapper { 7 public interface SENDLOGMapper {
  8 +
  9 + List<SENDLOG> selectByMessageId(String messageautoid);
  10 +
  11 + List<SENDLOG> checkWaybillPermit(String waybillno);
  12 +
6 int insert(SENDLOG record); 13 int insert(SENDLOG record);
7 14
8 int insertSelective(SENDLOG record); 15 int insertSelective(SENDLOG record);
  1 +package com.tianbo.analysis.dao;
  2 +
  3 +import com.tianbo.analysis.model.SysMenu;
  4 +
  5 +import java.util.List;
  6 +import java.util.Map;
  7 +
  8 +public interface SysMenuDao {
  9 + int deleteByPrimaryKey(Integer id);
  10 +
  11 + int insert(SysMenu record);
  12 +
  13 + int insertSelective(SysMenu record);
  14 +
  15 + SysMenu selectByPrimaryKey(Integer id);
  16 +
  17 + List<SysMenu> selectRoleMenu(Map ids);
  18 +
  19 + List<SysMenu> selectByParentId(Integer id);
  20 +
  21 + int updateByPrimaryKeySelective(SysMenu record);
  22 +
  23 + int updateByPrimaryKey(SysMenu record);
  24 +}
  1 +package com.tianbo.analysis.model;
  2 +
  3 +import lombok.Data;
  4 +
  5 +import java.util.Date;
  6 +
  7 +@Data
  8 +public class CustomsHead {
  9 +
  10 + private String messageId;
  11 + private String functionCode;
  12 + private String messageType;
  13 + private String senderID;
  14 + private String receiverID;
  15 + private String sendTime;
  16 +
  17 +}
1 package com.tianbo.analysis.model; 1 package com.tianbo.analysis.model;
2 2
  3 +import com.fasterxml.jackson.annotation.JsonFormat;
  4 +
3 import java.util.Date; 5 import java.util.Date;
  6 +import java.util.List;
4 7
5 public class MANIFEST_AIR_CHANGE { 8 public class MANIFEST_AIR_CHANGE {
6 private String autoid; 9 private String autoid;
@@ -23,8 +26,16 @@ public class MANIFEST_AIR_CHANGE { @@ -23,8 +26,16 @@ public class MANIFEST_AIR_CHANGE {
23 26
24 private String changeCarrier; 27 private String changeCarrier;
25 28
26 - private Date flightDate; 29 + private String customsCode;
  30 +
  31 + private String receiption;
27 32
  33 + //批量新增列表
  34 + private List<String> waybillList;
  35 +
  36 + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
  37 + private Date flightDate;
  38 + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
28 private Date changeFlightDate; 39 private Date changeFlightDate;
29 40
30 public String getAutoid() { 41 public String getAutoid() {
@@ -122,4 +133,29 @@ public class MANIFEST_AIR_CHANGE { @@ -122,4 +133,29 @@ public class MANIFEST_AIR_CHANGE {
122 public void setChangeFlightDate(Date changeFlightDate) { 133 public void setChangeFlightDate(Date changeFlightDate) {
123 this.changeFlightDate = changeFlightDate; 134 this.changeFlightDate = changeFlightDate;
124 } 135 }
  136 +
  137 + public String getCustomsCode() {
  138 + return customsCode;
  139 + }
  140 +
  141 + public void setCustomsCode(String customsCode) {
  142 + this.customsCode = customsCode;
  143 + }
  144 +
  145 + public String getReceiption() {
  146 + return receiption;
  147 + }
  148 +
  149 + public void setReceiption(String receiption) {
  150 + this.receiption = receiption;
  151 + }
  152 +
  153 + public List<String> getWaybillList() {
  154 + return waybillList;
  155 + }
  156 +
  157 + public void setWaybillList(List<String> waybillList) {
  158 + this.waybillList = waybillList;
  159 + }
  160 +
125 } 161 }
1 package com.tianbo.analysis.model; 1 package com.tianbo.analysis.model;
2 2
  3 +import com.tianbo.analysis.controller.bean.ResponseReason;
3 import lombok.Data; 4 import lombok.Data;
4 5
5 import java.io.Serializable; 6 import java.io.Serializable;
@@ -19,6 +20,8 @@ public class ResultJson<T> implements Serializable{ @@ -19,6 +20,8 @@ public class ResultJson<T> implements Serializable{
19 //返回的JWT 20 //返回的JWT
20 private String jwtToken; 21 private String jwtToken;
21 22
  23 + private ResponseReason responseReason;
  24 +
22 public ResultJson() { 25 public ResultJson() {
23 } 26 }
24 27
@@ -40,4 +43,11 @@ public class ResultJson<T> implements Serializable{ @@ -40,4 +43,11 @@ public class ResultJson<T> implements Serializable{
40 this.msg = msg; 43 this.msg = msg;
41 this.data = data; 44 this.data = data;
42 } 45 }
  46 +
  47 + public ResultJson(ResponseReason responseReason) {
  48 + this.responseReason = responseReason;
  49 + this.code = responseReason.getCode();
  50 + this.msg = responseReason.getMsg();
  51 +
  52 + }
43 } 53 }
  1 +package com.tianbo.analysis.model;
  2 +
  3 +import java.io.Serializable;
  4 +import java.util.Date;
  5 +import lombok.Data;
  6 +
  7 +/**
  8 + * ROLE_MENU
  9 + * @author
  10 + */
  11 +@Data
  12 +public class RoleMenu implements Serializable {
  13 + private String id;
  14 +
  15 + private String rolename;
  16 +
  17 + private String menuid;
  18 +
  19 + private Date createtime;
  20 +
  21 + private static final long serialVersionUID = 1L;
  22 +}
  1 +package com.tianbo.analysis.model;
  2 +
  3 +import java.io.Serializable;
  4 +import java.util.Date;
  5 +import java.util.List;
  6 +
  7 +import lombok.Data;
  8 +
  9 +/**
  10 + * SYS_MENU
  11 + * @author
  12 + */
  13 +@Data
  14 +public class SysMenu extends VUERouter implements Serializable {
  15 + private Integer id;
  16 +
  17 + /**
  18 + * ????ID
  19 + */
  20 + private Integer parentid;
  21 +
  22 + /**
  23 + * ????
  24 + */
  25 + private Date createtime;
  26 +
  27 + /**
  28 + * ??
  29 + */
  30 + private String menuSort;
  31 +
  32 + private String menuControll;
  33 +
  34 + /**
  35 + * ??url????/sys_menu_/sys_menu_list?
  36 + */
  37 + private String menuView;
  38 +
  39 + /**
  40 + * ????
  41 + */
  42 + private String menuName;
  43 +
  44 + private static final long serialVersionUID = 1L;
  45 +
  46 + private List<SysMenu> children;
  47 +
  48 + public void setMenuView(String menuView) {
  49 + this.path = this.menuView = menuView;
  50 + }
  51 +
  52 + public void setMenuName(String menuName) {
  53 + this.name = this.menuName = menuName;
  54 + this.meta = new VUERouterMeta(menuName);
  55 + }
  56 +
  57 + public void setChildren(List<SysMenu> children) {
  58 + if (children!=null && !children.isEmpty()){
  59 + this.children = children;
  60 + }else {
  61 + this.children = null;
  62 + }
  63 +
  64 + }
  65 +
  66 + @Override
  67 + public String toString() {
  68 + StringBuilder sb = new StringBuilder();
  69 + sb.append(getClass().getSimpleName());
  70 + sb.append(" [");
  71 + sb.append("Hash = ").append(hashCode());
  72 + sb.append(", id=").append(id);
  73 + sb.append(", parentid=").append(parentid);
  74 + sb.append(", createtime=").append(createtime);
  75 + sb.append(", menuSort=").append(menuSort);
  76 + sb.append(", menuControll=").append(menuControll);
  77 + sb.append(", menuView=").append(menuView);
  78 + sb.append(", menuName=").append(menuName);
  79 + sb.append(", serialVersionUID=").append(serialVersionUID);
  80 + sb.append("]");
  81 + return sb.toString();
  82 + }
  83 +}
  1 +package com.tianbo.analysis.model;
  2 +
  3 +import lombok.Data;
  4 +
  5 +@Data
  6 +public class VUERouter {
  7 +
  8 + public String path;
  9 +
  10 + public String redirect;
  11 +
  12 + public String name;
  13 +
  14 + public VUERouterMeta meta;
  15 +}
  1 +package com.tianbo.analysis.model;
  2 +
  3 +import lombok.Data;
  4 +
  5 +@Data
  6 +public class VUERouterMeta {
  7 +
  8 + public String title;
  9 +
  10 + public String icon = "clipboard";
  11 +
  12 + public VUERouterMeta(String title) {
  13 + this.title = title;
  14 + }
  15 +}
@@ -8,4 +8,13 @@ import com.tianbo.analysis.model.MANIFEST_AIR_CHANGE; @@ -8,4 +8,13 @@ import com.tianbo.analysis.model.MANIFEST_AIR_CHANGE;
8 public interface MT8204Service { 8 public interface MT8204Service {
9 9
10 PageInfo<MANIFEST_AIR_CHANGE> selectList(MANIFEST_AIR_CHANGE record, int pageNum, int pageSize); 10 PageInfo<MANIFEST_AIR_CHANGE> selectList(MANIFEST_AIR_CHANGE record, int pageNum, int pageSize);
  11 +
  12 + boolean add(MANIFEST_AIR_CHANGE record);
  13 +
  14 + boolean edit(MANIFEST_AIR_CHANGE record);
  15 +
  16 + boolean del(MANIFEST_AIR_CHANGE record);
  17 +
  18 + boolean send(MANIFEST_AIR_CHANGE record,String username);
  19 +
11 } 20 }
  1 +package com.tianbo.analysis.service;
  2 +
  3 +import com.tianbo.analysis.model.SysMenu;
  4 +
  5 +import java.util.List;
  6 +
  7 +public interface MenuService {
  8 + List<SysMenu> userMenuIds(String userId);
  9 +}
  1 +package com.tianbo.analysis.service;
  2 +
  3 +import com.github.pagehelper.PageInfo;
  4 +import com.tianbo.analysis.model.PREPAREMASTER;
  5 +
  6 +public interface PREPARMASTERService {
  7 + PageInfo<PREPAREMASTER> search(PREPAREMASTER preparemaster,int pageNum, int pageSize);
  8 +}
  1 +package com.tianbo.analysis.service;
  2 +
  3 +import com.tianbo.analysis.model.SENDLOG;
  4 +
  5 +import java.util.List;
  6 +
  7 +public interface SendLogService {
  8 + List<SENDLOG> selectByMessageId(String messageautoid);
  9 +
  10 + List<SENDLOG> checkWaybillPermit(String waybillno);
  11 +}
@@ -25,6 +25,7 @@ public class DomtransitServiceImpl implements DomTransitService { @@ -25,6 +25,7 @@ public class DomtransitServiceImpl implements DomTransitService {
25 25
26 @Override 26 @Override
27 public int insertSelective(DOMTRANSIT record) { 27 public int insertSelective(DOMTRANSIT record) {
  28 + //todo:检查重复
28 String id= UUID.randomUUID().toString(); 29 String id= UUID.randomUUID().toString();
29 record.setId(id); 30 record.setId(id);
30 return domtransitMapper.insertSelective(record); 31 return domtransitMapper.insertSelective(record);
@@ -4,19 +4,68 @@ import com.github.pagehelper.Page; @@ -4,19 +4,68 @@ import com.github.pagehelper.Page;
4 import com.github.pagehelper.PageHelper; 4 import com.github.pagehelper.PageHelper;
5 import com.github.pagehelper.PageInfo; 5 import com.github.pagehelper.PageInfo;
6 import com.tianbo.analysis.dao.MANIFEST_AIR_CHANGEMapper; 6 import com.tianbo.analysis.dao.MANIFEST_AIR_CHANGEMapper;
  7 +import com.tianbo.analysis.dao.SENDLOGMapper;
  8 +import com.tianbo.analysis.model.CustomsHead;
7 import com.tianbo.analysis.model.MANIFEST_AIR_CHANGE; 9 import com.tianbo.analysis.model.MANIFEST_AIR_CHANGE;
  10 +import com.tianbo.analysis.model.SENDLOG;
8 import com.tianbo.analysis.service.MT8204Service; 11 import com.tianbo.analysis.service.MT8204Service;
  12 +import com.tianbo.util.Date.DateUtil;
  13 +import lombok.extern.slf4j.Slf4j;
  14 +import org.apache.commons.io.FileUtils;
  15 +import org.apache.commons.lang.StringUtils;
  16 +import org.springframework.beans.factory.annotation.Autowired;
  17 +import org.springframework.beans.factory.annotation.Value;
9 import org.springframework.stereotype.Service; 18 import org.springframework.stereotype.Service;
  19 +import org.springframework.util.ResourceUtils;
  20 +import org.thymeleaf.TemplateEngine;
  21 +import org.thymeleaf.context.Context;
10 22
11 import javax.annotation.Resource; 23 import javax.annotation.Resource;
  24 +import javax.xml.XMLConstants;
  25 +import javax.xml.transform.Source;
  26 +import javax.xml.transform.stream.StreamSource;
  27 +import javax.xml.validation.Schema;
  28 +import javax.xml.validation.SchemaFactory;
  29 +import javax.xml.validation.Validator;
  30 +import java.io.*;
  31 +import java.nio.charset.StandardCharsets;
  32 +import java.util.Date;
12 import java.util.List; 33 import java.util.List;
  34 +import java.util.Locale;
  35 +import java.util.UUID;
  36 +import org.thymeleaf.TemplateEngine;
  37 +import org.thymeleaf.context.Context;
  38 +import org.springframework.util.ResourceUtils;
  39 +import org.apache.commons.io.FileUtils;
  40 +import com.tianbo.analysis.model.CustomsHead;
  41 +import org.thymeleaf.exceptions.TemplateInputException;
  42 +import org.xml.sax.SAXException;
  43 +
  44 +import java.io.FileNotFoundException;
  45 +import java.nio.charset.StandardCharsets;
  46 +
13 47
14 @Service 48 @Service
  49 +@Slf4j
15 public class MT8204ServiceImp implements MT8204Service { 50 public class MT8204ServiceImp implements MT8204Service {
16 51
17 @Resource 52 @Resource
18 MANIFEST_AIR_CHANGEMapper manifest_air_changeMapper; 53 MANIFEST_AIR_CHANGEMapper manifest_air_changeMapper;
19 54
  55 + @Resource
  56 + SENDLOGMapper sendlogMapper;
  57 +
  58 + @Autowired
  59 + private TemplateEngine templateEngine;
  60 +
  61 + @Value("${customs.xml-path}")
  62 + private String saveXmlDir;
  63 +
  64 +
  65 + @Value("${customs.transport-number}")
  66 + private String transportNo;
  67 +
  68 + @Override
20 public PageInfo<MANIFEST_AIR_CHANGE> selectList(MANIFEST_AIR_CHANGE record, int pageNum, int pageSize){ 69 public PageInfo<MANIFEST_AIR_CHANGE> selectList(MANIFEST_AIR_CHANGE record, int pageNum, int pageSize){
21 70
22 Page<MANIFEST_AIR_CHANGE> page = PageHelper.startPage(pageNum,pageSize); 71 Page<MANIFEST_AIR_CHANGE> page = PageHelper.startPage(pageNum,pageSize);
@@ -25,4 +74,140 @@ public class MT8204ServiceImp implements MT8204Service { @@ -25,4 +74,140 @@ public class MT8204ServiceImp implements MT8204Service {
25 return result; 74 return result;
26 } 75 }
27 76
  77 + @Override
  78 + public boolean add(MANIFEST_AIR_CHANGE record) {
  79 + if (record.getWaybillList()!=null && !record.getWaybillList().isEmpty()){
  80 + int i=0;
  81 + for (String waybillNo : record.getWaybillList()) {
  82 + MANIFEST_AIR_CHANGE manifest_air_change = new MANIFEST_AIR_CHANGE();
  83 + manifest_air_change = record;
  84 + manifest_air_change.setWaybillnomaster(waybillNo);
  85 + manifest_air_change.setChangeWaybillnomaster(waybillNo);
  86 + manifest_air_change.setAutoid(UUID.randomUUID().toString());
  87 +
  88 + //TODO:插入前的重复校验
  89 + if (add_checkRpeat(manifest_air_change)){
  90 + i =+ manifest_air_changeMapper.insertSelective(manifest_air_change);
  91 + }else {
  92 + log.info("运单号{}存在直接改配申请",manifest_air_change.getWaybillnomaster());
  93 + }
  94 + log.info(String.valueOf(i));
  95 + }
  96 + return i>0;
  97 + }else {
  98 + if (add_checkRpeat(record)){
  99 + record.setAutoid(UUID.randomUUID().toString());
  100 + return manifest_air_changeMapper.insertSelective(record)>0;
  101 + }else {
  102 + log.info("运单号{}存在直接改配申请",record.getWaybillnomaster());
  103 + }
  104 + return false;
  105 + }
  106 + }
  107 + boolean add_checkRpeat(MANIFEST_AIR_CHANGE manifest_air_change){
  108 + //TODO:插入前的重复校验
  109 + List<MANIFEST_AIR_CHANGE> l = manifest_air_changeMapper.insertCheckRepeat(manifest_air_change);
  110 + return l.isEmpty();
  111 + }
  112 + @Override
  113 + public boolean edit(MANIFEST_AIR_CHANGE record) {
  114 + if (StringUtils.isNotEmpty(record.getAutoid())){
  115 + return manifest_air_changeMapper.updateByPrimaryKeySelective(record)>0;
  116 + }
  117 + return false;
  118 + }
  119 +
  120 + @Override
  121 + public boolean del(MANIFEST_AIR_CHANGE record) {
  122 + if (StringUtils.isNotEmpty(record.getAutoid())){
  123 + return manifest_air_changeMapper.deleteByPrimaryKey(record.getAutoid())>0;
  124 + }
  125 + return false;
  126 + }
  127 +
  128 + @Override
  129 + public boolean send(MANIFEST_AIR_CHANGE record,String username) {
  130 + try{
  131 + record.setWaybillnomaster(record.getWaybillnomaster().replace("-",""));
  132 + record.setChangeWaybillnomaster(record.getChangeWaybillnomaster().replace("-",""));
  133 + CustomsHead customsHead = new CustomsHead();
  134 +
  135 + //从配置文件读取
  136 +
  137 + String nowStr = DateUtil.getCurrentTime17();
  138 + String messageID = "CN_"
  139 + + "MT8204"
  140 + + "_1P0_"
  141 + + transportNo+
  142 + "_" + nowStr;
  143 +
  144 + Context context = new Context();
  145 + context.setVariable("body",record);
  146 + context.setVariable("head",customsHead);
  147 + context.setLocale(Locale.SIMPLIFIED_CHINESE);
  148 +
  149 + customsHead.setMessageId(messageID);
  150 + customsHead.setSendTime(nowStr);
  151 +
  152 + //生成的文件名
  153 + String fileName = messageID + ".xml";
  154 + //生成的报文路径,带斜杠
  155 + String filePath = saveXmlDir+fileName;
  156 + File file = ResourceUtils.getFile(filePath);
  157 + /**
  158 + * 中文的地方在模板中要用utext,否则中文会被 escape 转义
  159 + */
  160 + String xmlStr = templateEngine.process("mt8204/MT8204",context);
  161 +
  162 + boolean valied = validateXMLSchema("xsd/Manifest_Change_Transport_Air_8204_2.xsd",xmlStr);
  163 + if (valied){
  164 + FileUtils.writeStringToFile(file,xmlStr, StandardCharsets.UTF_8);
  165 + SENDLOG sendlog = new SENDLOG();
  166 + sendlog.setAutoid(UUID.randomUUID().toString());
  167 + sendlog.setMessageautoid(record.getAutoid());
  168 + sendlog.setMessagetype("MT8204");
  169 + sendlog.setCreatedate(new Date());
  170 + StringBuilder sb = new StringBuilder("已申请直接改配,改配后信息")
  171 + .append(record.getChangeWaybillnomaster())
  172 + .append("/")
  173 + .append(record.getChangeFlightno())
  174 + .append("/")
  175 + .append(DateUtil.dateToString(record.getChangeFlightDate(),"yyyyMMdd"));
  176 + sendlog.setReceiption(sb.toString());
  177 + sendlog.setOpauthor(username);
  178 + sendlogMapper.insertSelective(sendlog);
  179 + return true;
  180 + }else {
  181 + return false;
  182 + }
  183 + }catch (FileNotFoundException e){
  184 + e.printStackTrace();
  185 + return false;
  186 + } catch (IOException e) {
  187 + e.printStackTrace();
  188 + return false;
  189 + }catch (TemplateInputException e){
  190 + return false;
  191 + }
  192 + }
  193 +
  194 + public boolean validateXMLSchema(String xsdPath, String xmlStr) throws IOException {
  195 + ByteArrayInputStream bais = new ByteArrayInputStream(xmlStr.getBytes("UTF-8"));
  196 + try {
  197 + SchemaFactory factory =
  198 + SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
  199 + Schema schema = factory.newSchema(new File(xsdPath));
  200 + Validator validator = schema.newValidator();
  201 +
  202 + Source source = new StreamSource(bais);
  203 + validator.validate(source);
  204 + } catch (IOException | SAXException e) {
  205 + e.printStackTrace();
  206 + log.error("Exception:{}",e.getMessage());
  207 + return false;
  208 + }finally {
  209 + bais.close();
  210 + }
  211 + return true;
  212 + }
28 } 213 }
  1 +package com.tianbo.analysis.service.imp;
  2 +
  3 +import com.tianbo.analysis.dao.RoleMenuDao;
  4 +import com.tianbo.analysis.dao.SysMenuDao;
  5 +import com.tianbo.analysis.model.RoleMenu;
  6 +import com.tianbo.analysis.model.SysMenu;
  7 +import com.tianbo.analysis.service.MenuService;
  8 +import org.springframework.stereotype.Service;
  9 +
  10 +import javax.annotation.Resource;
  11 +import java.util.*;
  12 +
  13 +@Service
  14 +public class MenuServiceImpl implements MenuService {
  15 +
  16 +
  17 + @Resource
  18 + RoleMenuDao roleMenuDao;
  19 +
  20 + @Resource
  21 + SysMenuDao sysMenuDao;
  22 +
  23 + @Override
  24 + public List<SysMenu> userMenuIds(String userId) {
  25 + RoleMenu userRoleMenu = roleMenuDao.getUserMenus(userId);
  26 + if(userRoleMenu!=null){
  27 + String ids_str = userRoleMenu.getMenuid();
  28 + List<String> ids = Arrays.asList(ids_str.split(","));
  29 + Map map = new HashMap();
  30 + map.put("ids",ids);
  31 + List<SysMenu> roleMenu = sysMenuDao.selectRoleMenu(map);
  32 + return roleMenu;
  33 + }
  34 + return new ArrayList<>();
  35 + }
  36 +}
  1 +package com.tianbo.analysis.service.imp;
  2 +
  3 +import com.github.pagehelper.Page;
  4 +import com.github.pagehelper.PageHelper;
  5 +import com.github.pagehelper.PageInfo;
  6 +import com.tianbo.analysis.dao.PREPAREMASTERMapper;
  7 +import com.tianbo.analysis.model.MANIFEST_AIR_CHANGE;
  8 +import com.tianbo.analysis.model.PREPAREMASTER;
  9 +import com.tianbo.analysis.service.PREPARMASTERService;
  10 +import org.springframework.stereotype.Service;
  11 +
  12 +import javax.annotation.Resource;
  13 +import java.util.List;
  14 +
  15 +@Service
  16 +public class PREPARMASTERServiceImpl implements PREPARMASTERService {
  17 +
  18 + @Resource
  19 + PREPAREMASTERMapper preparemasterMapper;
  20 +
  21 + @Override
  22 + public PageInfo<PREPAREMASTER> search(PREPAREMASTER preparemaster,int pageNum, int pageSize) {
  23 + Page<PREPAREMASTER> page = PageHelper.startPage(pageNum,pageSize);
  24 + List<PREPAREMASTER> list = preparemasterMapper.selectBy(preparemaster);
  25 + PageInfo<PREPAREMASTER> result = new PageInfo<PREPAREMASTER>(list);
  26 + return result;
  27 + }
  28 +}
  1 +package com.tianbo.analysis.service.imp;
  2 +
  3 +import com.tianbo.analysis.dao.SENDLOGMapper;
  4 +import com.tianbo.analysis.model.SENDLOG;
  5 +import com.tianbo.analysis.service.SendLogService;
  6 +import org.springframework.stereotype.Service;
  7 +
  8 +import javax.annotation.Resource;
  9 +import java.util.List;
  10 +
  11 +@Service
  12 +public class SendLogServiceImpl implements SendLogService {
  13 +
  14 + @Resource
  15 + SENDLOGMapper sendlogMapper;
  16 +
  17 + @Override
  18 + public List<SENDLOG> selectByMessageId(String messageautoid) {
  19 + return sendlogMapper.selectByMessageId(messageautoid);
  20 + }
  21 +
  22 + @Override
  23 + public List<SENDLOG> checkWaybillPermit(String waybillno) {
  24 + List<SENDLOG> sendlogs = sendlogMapper.checkWaybillPermit(waybillno);
  25 + return sendlogs;
  26 +
  27 + }
  28 +}
@@ -12,12 +12,18 @@ @@ -12,12 +12,18 @@
12 <result column="CHANGETIME" property="changetime" jdbcType="TIMESTAMP" /> 12 <result column="CHANGETIME" property="changetime" jdbcType="TIMESTAMP" />
13 <result column="CARRIER" property="carrier" jdbcType="VARCHAR" /> 13 <result column="CARRIER" property="carrier" jdbcType="VARCHAR" />
14 <result column="CHANGE_CARRIER" property="changeCarrier" jdbcType="VARCHAR" /> 14 <result column="CHANGE_CARRIER" property="changeCarrier" jdbcType="VARCHAR" />
15 - <result column="FLIGHT_DATE" property="flightDate" jdbcType="TIMESTAMP" />  
16 - <result column="CHANGE_FLIGHT_DATE" property="changeFlightDate" jdbcType="TIMESTAMP" /> 15 + <result column="CUSTOMS_CODE" property="customsCode" jdbcType="VARCHAR" />
  16 + <result column="RECEIPTION" property="receiption" jdbcType="VARCHAR" />
  17 + <result column="FLIGHT_DATE" property="flightDate" jdbcType="DATE" />
  18 + <result column="CHANGE_FLIGHT_DATE" property="changeFlightDate" jdbcType="DATE" />
17 </resultMap> 19 </resultMap>
18 <sql id="Base_Column_List" > 20 <sql id="Base_Column_List" >
19 AUTOID, FLIGHTNO, CHANGE_FLIGHTNO, WAYBILLNOMASTER, CHANGE_WAYBILLNOMASTER, CONT, 21 AUTOID, FLIGHTNO, CHANGE_FLIGHTNO, WAYBILLNOMASTER, CHANGE_WAYBILLNOMASTER, CONT,
20 - CREATEDATE, CHANGETIME, CARRIER, CHANGE_CARRIER, FLIGHT_DATE, CHANGE_FLIGHT_DATE 22 + CREATEDATE, CHANGETIME, CARRIER, CHANGE_CARRIER, FLIGHT_DATE, CHANGE_FLIGHT_DATE,CUSTOMS_CODE
  23 + </sql>
  24 + <sql id="Custom_Receipt">
  25 + <include refid="Base_Column_List" />
  26 + ,RECEIPTION
21 </sql> 27 </sql>
22 <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" > 28 <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
23 select 29 select
@@ -25,21 +31,51 @@ @@ -25,21 +31,51 @@
25 from CGONMS.MANIFEST_AIR_CHANGE 31 from CGONMS.MANIFEST_AIR_CHANGE
26 where AUTOID = #{autoid,jdbcType=VARCHAR} 32 where AUTOID = #{autoid,jdbcType=VARCHAR}
27 </select> 33 </select>
28 - <select id="selectList" resultMap="BaseResultMap" parameterType="com.tianbo.analysis.model.MANIFEST_AIR_CHANGE" > 34 + <select id="insertCheckRepeat" parameterType="com.tianbo.analysis.model.MANIFEST_AIR_CHANGE" resultMap="BaseResultMap">
29 select 35 select
30 - <include refid="Base_Column_List" /> 36 + AUTOID
31 from CGONMS.MANIFEST_AIR_CHANGE 37 from CGONMS.MANIFEST_AIR_CHANGE
32 - <where>  
33 - <if test="flightno != null and flightno != ''"> 38 + where
34 FLIGHTNO = #{flightno,jdbcType=VARCHAR} 39 FLIGHTNO = #{flightno,jdbcType=VARCHAR}
  40 + and
  41 + FLIGHT_DATE = #{flightDate,jdbcType=DATE}
  42 + and
  43 + WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
  44 + </select>
  45 + <select id="selectList" resultMap="BaseResultMap" parameterType="com.tianbo.analysis.model.MANIFEST_AIR_CHANGE" >
  46 +
  47 + SELECT
  48 + <include refid="Custom_Receipt" />
  49 + FROM
  50 + (
  51 + SELECT
  52 + <include refid="Custom_Receipt" />
  53 + FROM
  54 + MANIFEST_AIR_CHANGE t1
  55 + LEFT JOIN (
  56 + SELECT
  57 + RECEIPTION,
  58 + MESSAGEAUTOID,
  59 + MESSAGETYPE,
  60 + ROW_NUMBER () OVER ( PARTITION BY MESSAGEAUTOID ORDER BY CREATEDATE DESC ) rn
  61 + FROM
  62 + SENDLOG
  63 + where
  64 + MESSAGETYPE = 'MT8204'
  65 + ) t2 ON t1.AUTOID = t2.MESSAGEAUTOID
  66 + AND t2.rn = 1
  67 + ) t3
  68 + where 1=1
  69 + <if test="flightno != null and flightno != ''">
  70 + and FLIGHTNO = #{flightno,jdbcType=VARCHAR}
35 </if> 71 </if>
36 - <if test="flightDate != null and flightDate != ''"> 72 + <if test="flightDate != null">
37 AND FLIGHT_DATE = #{flightDate,jdbcType=DATE} 73 AND FLIGHT_DATE = #{flightDate,jdbcType=DATE}
38 </if> 74 </if>
39 <if test="waybillnomaster != null and waybillnomaster != ''"> 75 <if test="waybillnomaster != null and waybillnomaster != ''">
40 AND WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR} 76 AND WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
41 </if> 77 </if>
42 - </where> 78 + order by CREATEDATE desc
43 </select> 79 </select>
44 <delete id="deleteByPrimaryKey" parameterType="java.lang.String" > 80 <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
45 delete from CGONMS.MANIFEST_AIR_CHANGE 81 delete from CGONMS.MANIFEST_AIR_CHANGE
@@ -50,12 +86,12 @@ @@ -50,12 +86,12 @@
50 WAYBILLNOMASTER, CHANGE_WAYBILLNOMASTER, 86 WAYBILLNOMASTER, CHANGE_WAYBILLNOMASTER,
51 CONT, CREATEDATE, CHANGETIME, 87 CONT, CREATEDATE, CHANGETIME,
52 CARRIER, CHANGE_CARRIER, FLIGHT_DATE, 88 CARRIER, CHANGE_CARRIER, FLIGHT_DATE,
53 - CHANGE_FLIGHT_DATE) 89 + CHANGE_FLIGHT_DATE, CUSTOMS_CODE)
54 values (#{autoid,jdbcType=VARCHAR}, #{flightno,jdbcType=VARCHAR}, #{changeFlightno,jdbcType=VARCHAR}, 90 values (#{autoid,jdbcType=VARCHAR}, #{flightno,jdbcType=VARCHAR}, #{changeFlightno,jdbcType=VARCHAR},
55 #{waybillnomaster,jdbcType=VARCHAR}, #{changeWaybillnomaster,jdbcType=VARCHAR}, 91 #{waybillnomaster,jdbcType=VARCHAR}, #{changeWaybillnomaster,jdbcType=VARCHAR},
56 #{cont,jdbcType=VARCHAR}, #{createdate,jdbcType=TIMESTAMP}, #{changetime,jdbcType=TIMESTAMP}, 92 #{cont,jdbcType=VARCHAR}, #{createdate,jdbcType=TIMESTAMP}, #{changetime,jdbcType=TIMESTAMP},
57 - #{carrier,jdbcType=VARCHAR}, #{changeCarrier,jdbcType=VARCHAR}, #{flightDate,jdbcType=TIMESTAMP},  
58 - #{changeFlightDate,jdbcType=TIMESTAMP}) 93 + #{carrier,jdbcType=VARCHAR}, #{changeCarrier,jdbcType=VARCHAR}, #{flightDate,jdbcType=DATE},
  94 + #{changeFlightDate,jdbcType=DATE}, #{customsCode,jdbcType=VARCHAR})
59 </insert> 95 </insert>
60 <insert id="insertSelective" parameterType="com.tianbo.analysis.model.MANIFEST_AIR_CHANGE" > 96 <insert id="insertSelective" parameterType="com.tianbo.analysis.model.MANIFEST_AIR_CHANGE" >
61 insert into CGONMS.MANIFEST_AIR_CHANGE 97 insert into CGONMS.MANIFEST_AIR_CHANGE
@@ -96,6 +132,9 @@ @@ -96,6 +132,9 @@
96 <if test="changeFlightDate != null" > 132 <if test="changeFlightDate != null" >
97 CHANGE_FLIGHT_DATE, 133 CHANGE_FLIGHT_DATE,
98 </if> 134 </if>
  135 + <if test="customsCode != null" >
  136 + CUSTOMS_CODE,
  137 + </if>
99 </trim> 138 </trim>
100 <trim prefix="values (" suffix=")" suffixOverrides="," > 139 <trim prefix="values (" suffix=")" suffixOverrides="," >
101 <if test="autoid != null" > 140 <if test="autoid != null" >
@@ -134,6 +173,9 @@ @@ -134,6 +173,9 @@
134 <if test="changeFlightDate != null" > 173 <if test="changeFlightDate != null" >
135 #{changeFlightDate,jdbcType=DATE}, 174 #{changeFlightDate,jdbcType=DATE},
136 </if> 175 </if>
  176 + <if test="customsCode != null" >
  177 + #{customsCode,jdbcType=VARCHAR},
  178 + </if>
137 </trim> 179 </trim>
138 </insert> 180 </insert>
139 <update id="updateByPrimaryKeySelective" parameterType="com.tianbo.analysis.model.MANIFEST_AIR_CHANGE" > 181 <update id="updateByPrimaryKeySelective" parameterType="com.tianbo.analysis.model.MANIFEST_AIR_CHANGE" >
@@ -167,10 +209,13 @@ @@ -167,10 +209,13 @@
167 CHANGE_CARRIER = #{changeCarrier,jdbcType=VARCHAR}, 209 CHANGE_CARRIER = #{changeCarrier,jdbcType=VARCHAR},
168 </if> 210 </if>
169 <if test="flightDate != null" > 211 <if test="flightDate != null" >
170 - FLIGHT_DATE = #{flightDate,jdbcType=TIMESTAMP}, 212 + FLIGHT_DATE = #{flightDate,jdbcType=DATE},
171 </if> 213 </if>
172 <if test="changeFlightDate != null" > 214 <if test="changeFlightDate != null" >
173 - CHANGE_FLIGHT_DATE = #{changeFlightDate,jdbcType=TIMESTAMP}, 215 + CHANGE_FLIGHT_DATE = #{changeFlightDate,jdbcType=DATE},
  216 + </if>
  217 + <if test="customsCode != null" >
  218 + CUSTOMS_CODE = #{customsCode,jdbcType=VARCHAR},
174 </if> 219 </if>
175 </set> 220 </set>
176 where AUTOID = #{autoid,jdbcType=VARCHAR} 221 where AUTOID = #{autoid,jdbcType=VARCHAR}
@@ -186,8 +231,9 @@ @@ -186,8 +231,9 @@
186 CHANGETIME = #{changetime,jdbcType=TIMESTAMP}, 231 CHANGETIME = #{changetime,jdbcType=TIMESTAMP},
187 CARRIER = #{carrier,jdbcType=VARCHAR}, 232 CARRIER = #{carrier,jdbcType=VARCHAR},
188 CHANGE_CARRIER = #{changeCarrier,jdbcType=VARCHAR}, 233 CHANGE_CARRIER = #{changeCarrier,jdbcType=VARCHAR},
189 - FLIGHT_DATE = #{flightDate,jdbcType=TIMESTAMP},  
190 - CHANGE_FLIGHT_DATE = #{changeFlightDate,jdbcType=TIMESTAMP} 234 + FLIGHT_DATE = #{flightDate,jdbcType=DATE},
  235 + CHANGE_FLIGHT_DATE = #{changeFlightDate,jdbcType=DATE},
  236 + CUSTOMS_CODE = #{customsCode,jdbcType=VARCHAR}
191 where AUTOID = #{autoid,jdbcType=VARCHAR} 237 where AUTOID = #{autoid,jdbcType=VARCHAR}
192 </update> 238 </update>
193 </mapper> 239 </mapper>
@@ -66,6 +66,33 @@ @@ -66,6 +66,33 @@
66 and STATUS = '04' 66 and STATUS = '04'
67 order by CREATEDATE desc 67 order by CREATEDATE desc
68 </select> 68 </select>
  69 +
  70 + <select id="selectBy" resultMap="BaseResultMap" parameterType="com.tianbo.analysis.model.PREPAREMASTER" >
  71 +
  72 + SELECT
  73 + <include refid="Base_Column_List" />
  74 + FROM
  75 + PREPAREMASTER
  76 + <where>
  77 + <if test="flightdate != null " >
  78 + FLIGHTDATE = #{flightdate,jdbcType=DATE}
  79 + </if>
  80 + <if test="flightno != null and flightno != ''" >
  81 + and FLIGHTNO = #{flightno,jdbcType=VARCHAR}
  82 + </if>
  83 + <if test="waybillnomaster != null and waybillnomaster != ''">
  84 + and WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
  85 + </if>
  86 + <if test="carrier != null and carrier != ''">
  87 + and CARRIER = #{carrier,jdbcType=VARCHAR}
  88 + </if>
  89 + <if test="customscode != null and customscode != ''">
  90 + and CUSTOMSCODE = #{customscode,jdbcType=VARCHAR}
  91 + </if>
  92 + </where>
  93 + order by CREATEDATE desc
  94 +
  95 + </select>
69 <delete id="deleteByPrimaryKey" parameterType="java.lang.String" > 96 <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
70 delete from CGONMS.PREPAREMASTER 97 delete from CGONMS.PREPAREMASTER
71 where AUTOID = #{autoid,jdbcType=VARCHAR} 98 where AUTOID = #{autoid,jdbcType=VARCHAR}
@@ -510,4 +537,5 @@ @@ -510,4 +537,5 @@
510 ARRIVED_AHEAD = #{arrivedAhead,jdbcType=VARCHAR} 537 ARRIVED_AHEAD = #{arrivedAhead,jdbcType=VARCHAR}
511 where WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR} 538 where WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
512 </update> 539 </update>
  540 +
513 </mapper> 541 </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.tianbo.analysis.dao.RoleMenuDao">
  4 + <resultMap id="BaseResultMap" type="com.tianbo.analysis.model.RoleMenu">
  5 + <result column="ID" jdbcType="VARCHAR" property="id" />
  6 + <result column="ROLENAME" jdbcType="VARCHAR" property="rolename" />
  7 + <result column="MENUID" jdbcType="VARCHAR" property="menuid" />
  8 + <result column="CREATETIME" jdbcType="TIMESTAMP" property="createtime" />
  9 + </resultMap>
  10 + <insert id="insert" parameterType="com.tianbo.analysis.model.RoleMenu">
  11 + insert into ROLE_MENU (ID, ROLENAME, MENUID,
  12 + CREATETIME)
  13 + values (#{id,jdbcType=VARCHAR}, #{rolename,jdbcType=VARCHAR}, #{menuid,jdbcType=VARCHAR},
  14 + #{createtime,jdbcType=TIMESTAMP})
  15 + </insert>
  16 + <insert id="insertSelective" parameterType="com.tianbo.analysis.model.RoleMenu">
  17 + insert into ROLE_MENU
  18 + <trim prefix="(" suffix=")" suffixOverrides=",">
  19 + <if test="id != null">
  20 + ID,
  21 + </if>
  22 + <if test="rolename != null">
  23 + ROLENAME,
  24 + </if>
  25 + <if test="menuid != null">
  26 + MENUID,
  27 + </if>
  28 + <if test="createtime != null">
  29 + CREATETIME,
  30 + </if>
  31 + </trim>
  32 + <trim prefix="values (" suffix=")" suffixOverrides=",">
  33 + <if test="id != null">
  34 + #{id,jdbcType=VARCHAR},
  35 + </if>
  36 + <if test="rolename != null">
  37 + #{rolename,jdbcType=VARCHAR},
  38 + </if>
  39 + <if test="menuid != null">
  40 + #{menuid,jdbcType=VARCHAR},
  41 + </if>
  42 + <if test="createtime != null">
  43 + #{createtime,jdbcType=TIMESTAMP},
  44 + </if>
  45 + </trim>
  46 + </insert>
  47 + <select id="getUserMenus" parameterType="java.lang.String" resultMap="BaseResultMap">
  48 + SELECT B.MENUID
  49 + FROM COMPANYUSER A
  50 + LEFT JOIN ROLE_MENU B ON A.ROLENAMEID = B.ID
  51 + WHERE A.ID = #{userid,jdbcType=VARCHAR}
  52 + </select>
  53 +</mapper>
@@ -11,7 +11,38 @@ @@ -11,7 +11,38 @@
11 <result column="MESSAGETYPE" property="messagetype" jdbcType="VARCHAR" /> 11 <result column="MESSAGETYPE" property="messagetype" jdbcType="VARCHAR" />
12 <result column="MESSAGEAUTOID" property="messageautoid" jdbcType="VARCHAR" /> 12 <result column="MESSAGEAUTOID" property="messageautoid" jdbcType="VARCHAR" />
13 </resultMap> 13 </resultMap>
14 - <insert id="insert" parameterType="com.tianbo.analysis.model.SENDLOG" > 14 + <sql id="Base_Column_List">
  15 + AUTOID, CREATEDATE, OPAUTHOR, SENDPEICE, SENDWEIGHT, RECEIPTION, MESSAGETYPE
  16 + </sql>
  17 + <select id="selectByMessageId" parameterType="java.lang.String" resultMap="BaseResultMap">
  18 + select
  19 + <include refid="Base_Column_List" />
  20 + from
  21 + CGONMS.SENDLOG
  22 + where
  23 + MESSAGEAUTOID = #{messageautoid,jdbcType=VARCHAR}
  24 + </select>
  25 +
  26 + <select id="checkWaybillPermit" parameterType="java.lang.String" resultMap="BaseResultMap">
  27 + SELECT
  28 + *
  29 +FROM
  30 + SENDLOG
  31 +WHERE
  32 + MESSAGEAUTOID IN (
  33 + SELECT
  34 + AUTOID
  35 + FROM
  36 + ORIGINMANIFESTMASTER
  37 + WHERE
  38 + WAYBILLNOMASTER = #{waybillno,jdbcType=VARCHAR}
  39 + )
  40 + AND
  41 + RECEIPTION LIKE '%放行%'
  42 + AND
  43 + MESSAGETYPE = 'MT1201'
  44 + </select>
  45 + <insert id="insert" parameterType="com.tianbo.analysis.model.SENDLOG">
15 insert into CGONMS.SENDLOG (AUTOID, CREATEDATE, OPAUTHOR, 46 insert into CGONMS.SENDLOG (AUTOID, CREATEDATE, OPAUTHOR,
16 SENDPEICE, SENDWEIGHT, RECEIPTION, 47 SENDPEICE, SENDWEIGHT, RECEIPTION,
17 MESSAGETYPE, MESSAGEAUTOID) 48 MESSAGETYPE, MESSAGEAUTOID)
  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.tianbo.analysis.dao.SysMenuDao">
  4 + <resultMap id="BaseResultMap" type="com.tianbo.analysis.model.SysMenu">
  5 + <id column="ID" jdbcType="DECIMAL" property="id" />
  6 + <result column="PARENTID" jdbcType="DECIMAL" property="parentid" />
  7 + <result column="CREATETIME" jdbcType="TIMESTAMP" property="createtime" />
  8 + <result column="MENU_SORT" jdbcType="VARCHAR" property="menuSort" />
  9 + <result column="MENU_CONTROLL" jdbcType="VARCHAR" property="menuControll" />
  10 + <result column="MENU_VIEW" jdbcType="VARCHAR" property="menuView" />
  11 + <result column="MENU_NAME" jdbcType="VARCHAR" property="menuName" />
  12 + </resultMap>
  13 + <resultMap id="treeMap" type="com.tianbo.analysis.model.SysMenu">
  14 + <id column="ID" jdbcType="DECIMAL" property="id" />
  15 + <result column="PARENTID" jdbcType="DECIMAL" property="parentid" />
  16 + <result column="CREATETIME" jdbcType="TIMESTAMP" property="createtime" />
  17 + <result column="MENU_SORT" jdbcType="VARCHAR" property="menuSort" />
  18 + <result column="MENU_CONTROLL" jdbcType="VARCHAR" property="menuControll" />
  19 + <result column="MENU_VIEW" jdbcType="VARCHAR" property="menuView" />
  20 + <result column="MENU_NAME" jdbcType="VARCHAR" property="menuName" />
  21 + <collection property="children" column="ID" javaType="java.util.ArrayList" ofType="com.tianbo.analysis.model.SysMenu" select="selectByParentId">
  22 + </collection>
  23 + </resultMap>
  24 + <sql id="Base_Column_List">
  25 + ID, PARENTID, CREATETIME, MENU_SORT, MENU_CONTROLL, MENU_VIEW, MENU_NAME
  26 + </sql>
  27 + <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  28 + select
  29 + <include refid="Base_Column_List" />
  30 + from SYS_MENU
  31 + where ID = #{id,jdbcType=DECIMAL}
  32 + </select>
  33 +
  34 + <select id="selectByParentId" parameterType="java.lang.Integer" resultMap="treeMap">
  35 + select
  36 + <include refid="Base_Column_List" />
  37 + from SYS_MENU
  38 + where PARENTID = #{id,jdbcType=DECIMAL}
  39 + </select>
  40 +
  41 + <select id="selectRoleMenu" parameterType="java.util.Map" resultMap="treeMap">
  42 + SELECT
  43 + <include refid="Base_Column_List" />
  44 + FROM SYS_MENU
  45 + WHERE menu_controll = '1'
  46 + and PARENTID = 0
  47 + AND ID IN
  48 + <foreach collection="ids" item="id" index="index" open="(" close=")" separator=",">
  49 + #{id}
  50 + </foreach>
  51 + ORDER BY PARENTID, MENU_SORT
  52 + </select>
  53 + <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  54 + delete from SYS_MENU
  55 + where ID = #{id,jdbcType=DECIMAL}
  56 + </delete>
  57 + <insert id="insert" keyColumn="ID" keyProperty="id" parameterType="com.tianbo.analysis.model.SysMenu" useGeneratedKeys="true">
  58 + insert into SYS_MENU (PARENTID, CREATETIME, MENU_SORT,
  59 + MENU_CONTROLL, MENU_VIEW, MENU_NAME
  60 + )
  61 + values (#{parentid,jdbcType=DECIMAL}, #{createtime,jdbcType=TIMESTAMP}, #{menuSort,jdbcType=VARCHAR},
  62 + #{menuControll,jdbcType=VARCHAR}, #{menuView,jdbcType=VARCHAR}, #{menuName,jdbcType=VARCHAR}
  63 + )
  64 + </insert>
  65 + <insert id="insertSelective" keyColumn="ID" keyProperty="id" parameterType="com.tianbo.analysis.model.SysMenu" useGeneratedKeys="true">
  66 + insert into SYS_MENU
  67 + <trim prefix="(" suffix=")" suffixOverrides=",">
  68 + <if test="parentid != null">
  69 + PARENTID,
  70 + </if>
  71 + <if test="createtime != null">
  72 + CREATETIME,
  73 + </if>
  74 + <if test="menuSort != null">
  75 + MENU_SORT,
  76 + </if>
  77 + <if test="menuControll != null">
  78 + MENU_CONTROLL,
  79 + </if>
  80 + <if test="menuView != null">
  81 + MENU_VIEW,
  82 + </if>
  83 + <if test="menuName != null">
  84 + MENU_NAME,
  85 + </if>
  86 + </trim>
  87 + <trim prefix="values (" suffix=")" suffixOverrides=",">
  88 + <if test="parentid != null">
  89 + #{parentid,jdbcType=DECIMAL},
  90 + </if>
  91 + <if test="createtime != null">
  92 + #{createtime,jdbcType=TIMESTAMP},
  93 + </if>
  94 + <if test="menuSort != null">
  95 + #{menuSort,jdbcType=VARCHAR},
  96 + </if>
  97 + <if test="menuControll != null">
  98 + #{menuControll,jdbcType=VARCHAR},
  99 + </if>
  100 + <if test="menuView != null">
  101 + #{menuView,jdbcType=VARCHAR},
  102 + </if>
  103 + <if test="menuName != null">
  104 + #{menuName,jdbcType=VARCHAR},
  105 + </if>
  106 + </trim>
  107 + </insert>
  108 + <update id="updateByPrimaryKeySelective" parameterType="com.tianbo.analysis.model.SysMenu">
  109 + update SYS_MENU
  110 + <set>
  111 + <if test="parentid != null">
  112 + PARENTID = #{parentid,jdbcType=DECIMAL},
  113 + </if>
  114 + <if test="createtime != null">
  115 + CREATETIME = #{createtime,jdbcType=TIMESTAMP},
  116 + </if>
  117 + <if test="menuSort != null">
  118 + MENU_SORT = #{menuSort,jdbcType=VARCHAR},
  119 + </if>
  120 + <if test="menuControll != null">
  121 + MENU_CONTROLL = #{menuControll,jdbcType=VARCHAR},
  122 + </if>
  123 + <if test="menuView != null">
  124 + MENU_VIEW = #{menuView,jdbcType=VARCHAR},
  125 + </if>
  126 + <if test="menuName != null">
  127 + MENU_NAME = #{menuName,jdbcType=VARCHAR},
  128 + </if>
  129 + </set>
  130 + where ID = #{id,jdbcType=DECIMAL}
  131 + </update>
  132 + <update id="updateByPrimaryKey" parameterType="com.tianbo.analysis.model.SysMenu">
  133 + update SYS_MENU
  134 + set PARENTID = #{parentid,jdbcType=DECIMAL},
  135 + CREATETIME = #{createtime,jdbcType=TIMESTAMP},
  136 + MENU_SORT = #{menuSort,jdbcType=VARCHAR},
  137 + MENU_CONTROLL = #{menuControll,jdbcType=VARCHAR},
  138 + MENU_VIEW = #{menuView,jdbcType=VARCHAR},
  139 + MENU_NAME = #{menuName,jdbcType=VARCHAR}
  140 + where ID = #{id,jdbcType=DECIMAL}
  141 + </update>
  142 +</mapper>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<Manifest xmlns="urn:Declaration:datamodel:standard:CN:MT8204:1" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  3 + <Head th:object="${head}">
  4 + <MessageID th:text="*{messageId}"></MessageID>
  5 + <FunctionCode>2</FunctionCode>
  6 + <MessageType>MT8204</MessageType>
  7 + <SenderID>460470678920X_DXPENT0000460002</SenderID>
  8 + <ReceiverID th:text="${body.customsCode}"></ReceiverID>
  9 + <SendTime th:text="*{sendTime}"></SendTime>
  10 + <Version>1.0</Version>
  11 + </Head>
  12 + <Declaration th:object="${body}">
  13 + <BorderTransportMeans>
  14 + <JourneyID th:text="|*{flightno}/*{#dates.format(flightDate,'yyyyMMdd')}|"></JourneyID>
  15 + </BorderTransportMeans>
  16 + <ChangeBorderTransportMeans>
  17 + <JourneyID th:text="|*{changeFlightno}/*{#dates.format(changeFlightDate,'yyyyMMdd')}|"></JourneyID>
  18 + </ChangeBorderTransportMeans>
  19 + <Consignment>
  20 + <TransportContractDocument>
  21 + <ID th:text="*{waybillnomaster}"></ID>
  22 + </TransportContractDocument>
  23 + <ChangeConsignment>
  24 + <TransportContractDocument>
  25 + <ID th:text="*{changeWaybillnomaster}">&gt;</ID>
  26 + </TransportContractDocument>
  27 + </ChangeConsignment>
  28 + </Consignment>
  29 + <AdditionalInformation th:if="*{cont}">
  30 + <Content th:utext="*{cont}"></Content>
  31 + </AdditionalInformation>
  32 + </Declaration>
  33 +</Manifest>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!-- edited with XMLSpy v2008 (http://www.altova.com) by lei_ying (szc) -->
  3 +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:Declaration:datamodel:standard:CN:MT8204:1" xmlns:xdb="http://xmlns.oracle.com/xdb" targetNamespace="urn:Declaration:datamodel:standard:CN:MT8204:1" elementFormDefault="qualified" attributeFormDefault="unqualified">
  4 + <!--******中国海关空运出口变更运输工具申请报文定义文档******-->
  5 + <!--命名空间:urn:Declaration:datamodel:standard:CN:MT8104:1-->
  6 +
  7 +
  8 +
  9 +
  10 + <!--******根元素定义******-->
  11 + <!--出口变更运输工具申请报文以Manifest作为根节点-->
  12 + <xs:element name="Manifest" type="Manifest">
  13 + <xs:annotation>
  14 + <xs:documentation>空运出口变更运输工具申请</xs:documentation>
  15 + </xs:annotation>
  16 + </xs:element>
  17 + <!--******根元素结构定义******-->
  18 +
  19 +
  20 + <xs:complexType name="Manifest">
  21 + <xs:annotation>
  22 + <xs:documentation>空运出口变更运输工具申请</xs:documentation>
  23 + </xs:annotation>
  24 + <xs:sequence>
  25 + <xs:element name="Head" type="Head">
  26 + <xs:annotation>
  27 + <xs:documentation>报文头(循环次数:1)</xs:documentation>
  28 + </xs:annotation>
  29 + </xs:element>
  30 + <xs:element name="Declaration">
  31 + <xs:annotation>
  32 + <xs:documentation>报文体(循环次数:1)</xs:documentation>
  33 + </xs:annotation>
  34 + <xs:complexType>
  35 + <xs:complexContent>
  36 + <xs:extension base="Declaration"/>
  37 + </xs:complexContent>
  38 + </xs:complexType>
  39 +
  40 +
  41 + </xs:element>
  42 + </xs:sequence>
  43 + </xs:complexType>
  44 + <!--******报文头结构定义******-->
  45 + <!--MessageType/报文类型代码:MT8204-->
  46 + <!--FunctionCode/报文功能代码:2-->
  47 +
  48 + <xs:complexType name="Head">
  49 + <xs:annotation>
  50 + <xs:documentation>报文头</xs:documentation>
  51 + </xs:annotation>
  52 + <xs:sequence>
  53 + <xs:element name="MessageID" >
  54 + <xs:annotation>
  55 + <xs:documentation>报文编号(循环次数:1)</xs:documentation>
  56 + </xs:annotation>
  57 + </xs:element>
  58 + <xs:element name="FunctionCode" fixed="2">
  59 + <xs:annotation>
  60 + <xs:documentation>报文功能代码(循环次数:1)</xs:documentation>
  61 + </xs:annotation>
  62 + </xs:element>
  63 + <xs:element name="MessageType" fixed="MT8204">
  64 + <xs:annotation>
  65 + <xs:documentation>报文类型代码(循环次数:1)</xs:documentation>
  66 + </xs:annotation>
  67 + </xs:element>
  68 + <xs:element name="SenderID" >
  69 + <xs:annotation>
  70 + <xs:documentation>发送方代码(循环次数:1)</xs:documentation>
  71 + </xs:annotation>
  72 + </xs:element>
  73 + <xs:element name="ReceiverID" >
  74 + <xs:annotation>
  75 + <xs:documentation>接受方代码(循环次数:1)</xs:documentation>
  76 + </xs:annotation>
  77 + </xs:element>
  78 + <xs:element name="SendTime" >
  79 + <xs:annotation>
  80 + <xs:documentation>发送时间(循环次数:1)</xs:documentation>
  81 + </xs:annotation>
  82 + </xs:element>
  83 + <xs:element name="Version" >
  84 + <xs:annotation>
  85 + <xs:documentation>报文版本号(循环次数:1)</xs:documentation>
  86 + </xs:annotation>
  87 + </xs:element>
  88 + </xs:sequence>
  89 + </xs:complexType>
  90 + <!--******报文体结构定义******-->
  91 +
  92 + <xs:complexType name="Declaration">
  93 + <xs:annotation>
  94 + <xs:documentation>报文体</xs:documentation>
  95 + </xs:annotation>
  96 + <xs:sequence>
  97 + <xs:element name="BorderTransportMeans" type="BorderTransportMeans">
  98 + <xs:annotation>
  99 + <xs:documentation>运输工具数据段(循环次数:1)</xs:documentation>
  100 + </xs:annotation>
  101 + </xs:element>
  102 + <xs:element name="ChangeBorderTransportMeans" type="BorderTransportMeans">
  103 + <xs:annotation>
  104 + <xs:documentation>变更后运输工具数据段(循环次数:1)</xs:documentation>
  105 + </xs:annotation>
  106 + </xs:element>
  107 + <xs:element name="Consignment" type="Consignment" maxOccurs="5000">
  108 + <xs:annotation>
  109 + <xs:documentation>提(运)单数据段(循环次数:1-9999)</xs:documentation>
  110 + </xs:annotation>
  111 + </xs:element>
  112 + <xs:element name="AdditionalInformation" type="AdditionalInformation" minOccurs="0">
  113 + <xs:annotation>
  114 + <xs:documentation>备注(循环次数:0-1)</xs:documentation>
  115 + </xs:annotation>
  116 + </xs:element>
  117 + </xs:sequence>
  118 + </xs:complexType>
  119 + <!--******运输工具数据段******-->
  120 + <xs:complexType name="BorderTransportMeans">
  121 + <xs:annotation>
  122 + <xs:documentation>运输工具数据段</xs:documentation>
  123 + </xs:annotation>
  124 + <xs:sequence>
  125 + <xs:element name="JourneyID" >
  126 + <xs:annotation>
  127 + <xs:documentation>149 Conveyance reference number 航次航班编号(循环次数:1)</xs:documentation>
  128 + </xs:annotation>
  129 + </xs:element>
  130 + <xs:element name="ID" minOccurs="0" maxOccurs="0">
  131 + <xs:annotation>
  132 + <xs:documentation>167 Identification of means of transport crossing the border code 运输工具代码(循环次数:0)</xs:documentation>
  133 + </xs:annotation>
  134 + </xs:element>
  135 + </xs:sequence>
  136 + </xs:complexType>
  137 + <!--******变更后运输工具数据段******-->
  138 + <xs:complexType name="Consignment">
  139 + <xs:annotation>
  140 + <xs:documentation>变更后运输工具数据段</xs:documentation>
  141 + </xs:annotation>
  142 + <xs:sequence>
  143 + <xs:element name="TransportContractDocument" type="TransportContractDocument">
  144 + <xs:annotation>
  145 + <xs:documentation>运输合同信息(循环次数:1)</xs:documentation>
  146 + </xs:annotation>
  147 + </xs:element>
  148 + <xs:element name="ChangeConsignment" type="ChangeConsignment" minOccurs="0">
  149 + <xs:annotation>
  150 + <xs:documentation>变更后提(运)单信息(循环次数:0-1)</xs:documentation>
  151 + </xs:annotation>
  152 + </xs:element>
  153 + </xs:sequence>
  154 + </xs:complexType>
  155 + <!--变更后提(运)单信息-->
  156 + <xs:complexType name="ChangeConsignment">
  157 + <xs:annotation>
  158 + <xs:documentation>变更后提(运)单信息</xs:documentation>
  159 + </xs:annotation>
  160 + <xs:sequence>
  161 + <xs:element name="TransportContractDocument" type="TransportContractDocument">
  162 + <xs:annotation>
  163 + <xs:documentation>运输合同信息(循环次数:1)</xs:documentation>
  164 + </xs:annotation>
  165 + </xs:element>
  166 + </xs:sequence>
  167 + </xs:complexType>
  168 + <!--运输合同信息-->
  169 + <xs:complexType name="TransportContractDocument">
  170 + <xs:annotation>
  171 + <xs:documentation>运输合同信息</xs:documentation>
  172 + </xs:annotation>
  173 + <xs:sequence>
  174 + <xs:element name="ID" >
  175 + <xs:annotation>
  176 + <xs:documentation>015 Transport document number 总提(运)单号(循环次数:1)</xs:documentation>
  177 + </xs:annotation>
  178 + </xs:element>
  179 + </xs:sequence>
  180 + </xs:complexType>
  181 + <!--******补充信息数据段******-->
  182 + <xs:complexType name="AdditionalInformation">
  183 + <xs:annotation>
  184 + <xs:documentation>补充信息</xs:documentation>
  185 + </xs:annotation>
  186 + <xs:sequence>
  187 + <xs:element name="Content" >
  188 + <xs:annotation>
  189 + <xs:documentation>105 Free text 备注(循环次数:1)</xs:documentation>
  190 + </xs:annotation>
  191 + </xs:element>
  192 + </xs:sequence>
  193 + </xs:complexType>
  194 +</xs:schema>