作者 朱兆平

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

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