作者 朱兆平

合并分支 'agent' 到 'master'

Agent

合并包含转发放行回执给代理人

查看合并请求 !1
@@ -49,7 +49,8 @@ spring: @@ -49,7 +49,8 @@ spring:
49 type: com.alibaba.druid.pool.DruidDataSource 49 type: com.alibaba.druid.pool.DruidDataSource
50 #oracle 50 #oracle
51 driver-class-name: oracle.jdbc.OracleDriver 51 driver-class-name: oracle.jdbc.OracleDriver
52 - url: jdbc:oracle:thin:@218.28.199.134:8004:CGODB 52 + url: jdbc:oracle:thin:@10.50.3.69:1521:CGODB
  53 +# url: jdbc:oracle:thin:@192.168.1.253:1522:ORCLL
53 username: CGONMS 54 username: CGONMS
54 password: 1q2w3e4r 55 password: 1q2w3e4r
55 #spring datasource mysql,注意编码配置,缺少数据库编码配置容易引起中文入库乱码 56 #spring datasource mysql,注意编码配置,缺少数据库编码配置容易引起中文入库乱码
@@ -132,7 +133,7 @@ jwt: @@ -132,7 +133,7 @@ jwt:
132 #自定义配置 133 #自定义配置
133 custom: 134 custom:
134 #进港放行回执读取目录 135 #进港放行回执读取目录
135 - receptDirectory: /Users/mrz/Downloads/rdp_temp/logs/回执报文样例/20191104 136 + receptDirectory: /Users/mrz/Downloads/rdp_temp/logs/回执报文样例
136 #回执解析成功后的备份目录 137 #回执解析成功后的备份目录
137 receptBakDir: /Users/mrz/Downloads/rdp_temp/logs/success 138 receptBakDir: /Users/mrz/Downloads/rdp_temp/logs/success
138 #解析错误报文的备份目录 139 #解析错误报文的备份目录
@@ -141,6 +142,8 @@ custom: @@ -141,6 +142,8 @@ custom:
141 transmitDir: /Users/mrz/Downloads/rdp_temp/logs/transmit 142 transmitDir: /Users/mrz/Downloads/rdp_temp/logs/transmit
142 #匹配技术回执正则 143 #匹配技术回执正则
143 delTechnologyReceptMatch: CN_MT(.*)_1P0_460470678920X_(.*).xml 144 delTechnologyReceptMatch: CN_MT(.*)_1P0_460470678920X_(.*).xml
  145 + #报文导入生成目录,这个地方目录结尾要带/
  146 + extRedioMsgDir: /Users/mrz/Downloads/rdp_temp/logs/transmit/
144 devops: 147 devops:
145 dir: 148 dir:
146 singlewindow-tcs-recept: D:\TCSSingleWindow\recive 149 singlewindow-tcs-recept: D:\TCSSingleWindow\recive
@@ -61,3 +61,5 @@ @@ -61,3 +61,5 @@
61 * 11-放行; 61 * 11-放行;
62 * 12-拒装; 62 * 12-拒装;
63 * 13-禁卸。 63 * 13-禁卸。
  64 +
  65 +# 心愿
@@ -4,7 +4,6 @@ @@ -4,7 +4,6 @@
4 */ 4 */
5 package com.tianbo.analysis; 5 package com.tianbo.analysis;
6 6
7 -import com.tianbo.analysis.task.TaskAnalysis;  
8 import org.mybatis.spring.annotation.MapperScan; 7 import org.mybatis.spring.annotation.MapperScan;
9 import org.springframework.boot.SpringApplication; 8 import org.springframework.boot.SpringApplication;
10 import org.springframework.boot.autoconfigure.SpringBootApplication; 9 import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -13,11 +12,12 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient; @@ -13,11 +12,12 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
13 import org.springframework.cloud.client.loadbalancer.LoadBalanced; 12 import org.springframework.cloud.client.loadbalancer.LoadBalanced;
14 import org.springframework.context.annotation.Bean; 13 import org.springframework.context.annotation.Bean;
15 import org.springframework.context.annotation.ComponentScan; 14 import org.springframework.context.annotation.ComponentScan;
16 -import org.springframework.scheduling.annotation.EnableAsync;  
17 import org.springframework.scheduling.annotation.EnableScheduling; 15 import org.springframework.scheduling.annotation.EnableScheduling;
18 import org.springframework.transaction.annotation.EnableTransactionManagement; 16 import org.springframework.transaction.annotation.EnableTransactionManagement;
19 import org.springframework.web.client.RestTemplate; 17 import org.springframework.web.client.RestTemplate;
20 18
  19 +import java.time.Duration;
  20 +
21 @SpringBootApplication 21 @SpringBootApplication
22 @EnableScheduling 22 @EnableScheduling
23 @EnableDiscoveryClient 23 @EnableDiscoveryClient
@@ -34,7 +34,8 @@ public class BootApplication { @@ -34,7 +34,8 @@ public class BootApplication {
34 @LoadBalanced 34 @LoadBalanced
35 RestTemplate restTemplate(RestTemplateBuilder builder){ 35 RestTemplate restTemplate(RestTemplateBuilder builder){
36 36
37 - return builder.build(); 37 + return builder.setConnectTimeout(Duration.ofSeconds(15)).setReadTimeout(Duration.ofSeconds(15))
  38 + .build();
38 } 39 }
39 } 40 }
40 41
@@ -56,6 +56,13 @@ public class WlptBaseModel { @@ -56,6 +56,13 @@ public class WlptBaseModel {
56 @Autowired 56 @Autowired
57 public CustomMessageService customMessageService; 57 public CustomMessageService customMessageService;
58 58
  59 + @Autowired
  60 + public MANIFESTLOADMapper manifestloadMapper;
  61 +
  62 + @Autowired
  63 + public MANIFESTLOSTCHANGEMapper manifestlostchangeMapper;
  64 +
  65 +
59 public WlptBaseModel() { 66 public WlptBaseModel() {
60 //处理多线程时 springboot 无法注入bean的问题 67 //处理多线程时 springboot 无法注入bean的问题
61 if (allocatearrivalMapper==null){ 68 if (allocatearrivalMapper==null){
@@ -103,6 +110,12 @@ public class WlptBaseModel { @@ -103,6 +110,12 @@ public class WlptBaseModel {
103 if(customMessageService==null){ 110 if(customMessageService==null){
104 customMessageService = SpringBeanUtitl.getBean(CustomMessageService.class); 111 customMessageService = SpringBeanUtitl.getBean(CustomMessageService.class);
105 } 112 }
  113 + if(manifestloadMapper==null){
  114 + manifestloadMapper = SpringBeanUtitl.getBean(MANIFESTLOADMapper.class);
  115 + }
  116 + if(manifestlostchangeMapper==null){
  117 + manifestlostchangeMapper = SpringBeanUtitl.getBean(MANIFESTLOSTCHANGEMapper.class);
  118 + }
106 119
107 } 120 }
108 121
  1 +package com.tianbo.analysis.controller;
  2 +
  3 +import lombok.extern.slf4j.Slf4j;
  4 +import org.apache.commons.io.FileUtils;
  5 +import org.springframework.beans.factory.annotation.Value;
  6 +import org.springframework.web.bind.annotation.PostMapping;
  7 +import org.springframework.web.bind.annotation.RequestMapping;
  8 +import org.springframework.web.bind.annotation.RestController;
  9 +
  10 +import java.io.File;
  11 +import java.io.IOException;
  12 +import java.util.UUID;
  13 +
  14 +/**
  15 + * 在线报文导入管理
  16 + */
  17 +@RestController
  18 +@RequestMapping("/Rmsg")
  19 +@Slf4j
  20 +public class RadioMsgController {
  21 +
  22 + //备份目录
  23 + @Value("${custom.extRedioMsgDir}")
  24 + private String extRedioMsgDir;
  25 +
  26 + private final static String FFM_HEADER = "<MSG>\n" +
  27 + "<META>\n" +
  28 + "<SNDR>TXD</SNDR>\n" +
  29 + "<DDTM>20200113050339</DDTM>\n" +
  30 + "<TYPE>IATA</TYPE>\n" +
  31 + "<STYP>FFM</STYP>\n" +
  32 + "<SEQN>95205940</SEQN>\n" +
  33 + "</META>\n" +
  34 + "<FFM>\n";
  35 +
  36 + private final static String FFM_FOOTER = "\n</FFM>\n" +
  37 + "</MSG>";
  38 +
  39 + private final static String FWB_HEADER="<MSG>\n" +
  40 + "<META>\n" +
  41 + "<SNDR>TXD</SNDR>\n" +
  42 + "<DDTM>20200113004608</DDTM>\n" +
  43 + "<TYPE>IATA</TYPE>\n" +
  44 + "<STYP>IFWB</STYP>\n" +
  45 + "<SEQN>95203026</SEQN>\n" +
  46 + "</META>\n" +
  47 + "<FWB>\n";
  48 + private final static String FWB_FOOTER="\n</FWB>\n" +
  49 + "</MSG>";
  50 +
  51 + private final static String FHL_HEADER="<MSG>\n" +
  52 + "<META>\n" +
  53 + "<SNDR>TXD</SNDR>\n" +
  54 + "<DDTM>20200113003006</DDTM>\n" +
  55 + "<TYPE>IATA</TYPE>\n" +
  56 + "<STYP>IFHL</STYP>\n" +
  57 + "<SEQN>95202782</SEQN>\n" +
  58 + "</META>\n" +
  59 + "<FHL>\n";
  60 + private final static String FHL_FOOTER="\n</FHL>\n" +
  61 + "</MSG>";
  62 +
  63 + @PostMapping("ffm")
  64 + public int extFFM(String ffmmsg){
  65 + if (ffmmsg!=null){
  66 + ffmmsg = FFM_HEADER + ffmmsg;
  67 + ffmmsg = ffmmsg + FFM_FOOTER;
  68 + File file = new File(extRedioMsgDir+UUID.randomUUID()+".txt");
  69 + try {
  70 + FileUtils.writeStringToFile(file,ffmmsg,"UTF-8");
  71 + log.info("FFM报文导入成功");
  72 + return 1;
  73 + }catch (IOException e){
  74 + e.printStackTrace();
  75 + }
  76 + }
  77 + return 0;
  78 + }
  79 +
  80 +
  81 + @PostMapping("fwb")
  82 + public int extFWB(String ffmmsg){
  83 + if (ffmmsg!=null) {
  84 + ffmmsg = FWB_HEADER + ffmmsg;
  85 + ffmmsg = ffmmsg + FWB_FOOTER;
  86 + File file = new File(extRedioMsgDir + UUID.randomUUID() + ".txt");
  87 + try {
  88 + FileUtils.writeStringToFile(file, ffmmsg, "UTF-8");
  89 + log.info("FWB报文导入成功");
  90 + return 1;
  91 + } catch (IOException e) {
  92 + e.printStackTrace();
  93 + }
  94 + }
  95 + return 0;
  96 + }
  97 +
  98 + @PostMapping("fhl")
  99 + public int extFHL(String ffmmsg){
  100 + if (ffmmsg!=null) {
  101 + ffmmsg = FHL_HEADER + ffmmsg;
  102 + ffmmsg = ffmmsg + FHL_FOOTER;
  103 + File file = new File(extRedioMsgDir + UUID.randomUUID() + ".txt");
  104 + try {
  105 + FileUtils.writeStringToFile(file, ffmmsg, "UTF-8");
  106 + log.info("FHL报文导入成功");
  107 + return 1;
  108 + } catch (IOException e) {
  109 + e.printStackTrace();
  110 + }
  111 + }
  112 + return 0;
  113 + }
  114 +}
  1 +package com.tianbo.analysis.dao;
  2 +
  3 +import com.tianbo.analysis.model.MANIFESTLOAD;
  4 +
  5 +import java.util.List;
  6 +
  7 +public interface MANIFESTLOADMapper {
  8 + int insert(MANIFESTLOAD record);
  9 +
  10 + int insertSelective(MANIFESTLOAD record);
  11 +
  12 + int updateRECEIPTION(MANIFESTLOAD record);
  13 +
  14 + List<MANIFESTLOAD> selectAutoIdByawbAawbH(MANIFESTLOAD record);
  15 +}
  1 +package com.tianbo.analysis.dao;
  2 +
  3 +import com.tianbo.analysis.model.MANIFESTLOSTCHANGE;
  4 +
  5 +import java.util.List;
  6 +
  7 +public interface MANIFESTLOSTCHANGEMapper {
  8 +
  9 + int insert(MANIFESTLOSTCHANGE record);
  10 +
  11 + int insertSelective(MANIFESTLOSTCHANGE record);
  12 +
  13 + int updateRECEIPTION(MANIFESTLOSTCHANGE record);
  14 +
  15 + List<MANIFESTLOSTCHANGE> selectAutoIdByawbAawbH(MANIFESTLOSTCHANGE record);
  16 +}
  1 +package com.tianbo.analysis.handle;
  2 +
  3 +
  4 +import com.tianbo.analysis.model.Agent_Notice;
  5 +import com.tianbo.analysis.model.CustomReception;
  6 +import com.tianbo.analysis.tools.AWBTools;
  7 +import lombok.extern.slf4j.Slf4j;
  8 +
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.http.client.SimpleClientHttpRequestFactory;
  11 +import org.springframework.stereotype.Component;
  12 +import org.springframework.web.client.RestTemplate;
  13 +
  14 +import javax.annotation.PostConstruct;
  15 +
  16 +
  17 +@Slf4j
  18 +@Component
  19 +public class AgentXmlHandle {
  20 +
  21 + private static AgentXmlHandle agentXmlHandle;
  22 +
  23 +
  24 + public void Http_resolver(CustomReception customReception){
  25 + try{
  26 + SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
  27 + requestFactory.setConnectTimeout(5000);
  28 + requestFactory.setReadTimeout(5000);
  29 + RestTemplate restTemplate = new RestTemplate(requestFactory);
  30 +
  31 + String secondSplit = "_";
  32 + String waybillnosecondary="";
  33 + if (customReception.getWayBillSecond()!=null && customReception.getWayBillSecond().contains(secondSplit)){
  34 + //取分单号
  35 + String[] awbhArr = customReception.getWayBillSecond().split("_");
  36 + waybillnosecondary = awbhArr[1];
  37 + }
  38 +
  39 + Agent_Notice notice = restTemplate.getForObject("http://10.50.3.73:1983/agent/receipt/a0608c4054662dd902e1314f7e450e3eaa81c114?message_type={1}&waybillNo={2}&waybillNoSub={3}&response_code={4}&response_text={5}"
  40 + , Agent_Notice.class,"MT2201", AWBTools.awbFormat(customReception.getWayBillMaster()),waybillnosecondary,customReception.getResponseCode(),customReception.getResponseText());
  41 + log.info(notice.toString());
  42 + }catch (Exception e){
  43 + log.error("链接代理人服务器超时或者接口异常,{}",e);
  44 + }
  45 +
  46 +
  47 + }
  48 +
  49 +}
@@ -248,6 +248,8 @@ public class CustomXmlHandleThread implements Runnable{ @@ -248,6 +248,8 @@ public class CustomXmlHandleThread implements Runnable{
248 i=arrivedmaster9999.masterAnalysisReception(); 248 i=arrivedmaster9999.masterAnalysisReception();
249 } 249 }
250 } 250 }
  251 + AgentXmlHandle agentXmlHandle=new AgentXmlHandle();
  252 + agentXmlHandle.Http_resolver(customReception);
251 break; 253 break;
252 case "MT3201": 254 case "MT3201":
253 if (customReception.getWayBillSecond()!=null && customReception.getWayBillSecond().contains(secondSplit)){ 255 if (customReception.getWayBillSecond()!=null && customReception.getWayBillSecond().contains(secondSplit)){
@@ -309,6 +311,14 @@ public class CustomXmlHandleThread implements Runnable{ @@ -309,6 +311,14 @@ public class CustomXmlHandleThread implements Runnable{
309 case "MT8205": 311 case "MT8205":
310 i = transXmlHandel(document,customReception); 312 i = transXmlHandel(document,customReception);
311 break; 313 break;
  314 + case "MT8202":
  315 + MANIFESTLOAD manifestload = new MANIFESTLOAD(customReception);
  316 + i= manifestload.secondAnalysisReception();
  317 + break;
  318 + case "MT8203":
  319 + MANIFESTLOSTCHANGE manifestlostchange = new MANIFESTLOSTCHANGE(customReception);
  320 + i= manifestlostchange.secondAnalysisReception();
  321 + break;
312 default: 322 default:
313 break; 323 break;
314 324
  1 +package com.tianbo.analysis.model;
  2 +
  3 +import lombok.Data;
  4 +
  5 +@Data
  6 +public class Agent_Notice {
  7 + private int status;
  8 + private int code;
  9 + private String msg;
  10 + private Object data;
  11 + private int page;
  12 + private int count;
  13 +}
  1 +package com.tianbo.analysis.model;
  2 +
  3 +import com.tianbo.analysis.bean.WlptBaseModel;
  4 +import com.tianbo.analysis.tools.AWBTools;
  5 +import com.tianbo.util.Date.DateUtil;
  6 +import lombok.extern.slf4j.Slf4j;
  7 +
  8 +import java.util.Date;
  9 +import java.util.List;
  10 +
  11 +@Slf4j
  12 +public class MANIFESTLOAD extends WlptBaseModel {
  13 + private String id;
  14 +
  15 + private Date createdate;
  16 +
  17 + private String flightno;
  18 +
  19 + private String waybillnomaster;
  20 +
  21 + private Date flightdate;
  22 +
  23 + private String waybillnosecondary;
  24 +
  25 + private String remark;
  26 +
  27 + private String status;
  28 +
  29 + private String receiption;
  30 +
  31 + private String customcode;
  32 +
  33 + private String reason;
  34 +
  35 + private String contactname;
  36 +
  37 + private String contacttel;
  38 +
  39 + public String getId() {
  40 + return id;
  41 + }
  42 +
  43 + public void setId(String id) {
  44 + this.id = id == null ? null : id.trim();
  45 + }
  46 +
  47 + public Date getCreatedate() {
  48 + return createdate;
  49 + }
  50 +
  51 + public void setCreatedate(Date createdate) {
  52 + this.createdate = createdate;
  53 + }
  54 +
  55 + public String getFlightno() {
  56 + return flightno;
  57 + }
  58 +
  59 + public void setFlightno(String flightno) {
  60 + this.flightno = flightno == null ? null : flightno.trim();
  61 + }
  62 +
  63 + public String getWaybillnomaster() {
  64 + return waybillnomaster;
  65 + }
  66 +
  67 + public void setWaybillnomaster(String waybillnomaster) {
  68 + this.waybillnomaster = waybillnomaster == null ? null : waybillnomaster.trim();
  69 + }
  70 +
  71 + public Date getFlightdate() {
  72 + return flightdate;
  73 + }
  74 +
  75 + public void setFlightdate(Date flightdate) {
  76 + this.flightdate = flightdate;
  77 + }
  78 +
  79 + public String getWaybillnosecondary() {
  80 + return waybillnosecondary;
  81 + }
  82 +
  83 + public void setWaybillnosecondary(String waybillnosecondary) {
  84 + this.waybillnosecondary = waybillnosecondary == null ? null : waybillnosecondary.trim();
  85 + }
  86 +
  87 + public String getRemark() {
  88 + return remark;
  89 + }
  90 +
  91 + public void setRemark(String remark) {
  92 + this.remark = remark == null ? null : remark.trim();
  93 + }
  94 +
  95 + public String getStatus() {
  96 + return status;
  97 + }
  98 +
  99 + public void setStatus(String status) {
  100 + this.status = status == null ? null : status.trim();
  101 + }
  102 +
  103 + public String getReceiption() {
  104 + return receiption;
  105 + }
  106 +
  107 + public void setReceiption(String receiption) {
  108 + this.receiption = receiption == null ? null : receiption.trim();
  109 + }
  110 +
  111 + public String getCustomcode() {
  112 + return customcode;
  113 + }
  114 +
  115 + public void setCustomcode(String customcode) {
  116 + this.customcode = customcode == null ? null : customcode.trim();
  117 + }
  118 +
  119 + public String getReason() {
  120 + return reason;
  121 + }
  122 +
  123 + public void setReason(String reason) {
  124 + this.reason = reason == null ? null : reason.trim();
  125 + }
  126 +
  127 + public String getContactname() {
  128 + return contactname;
  129 + }
  130 +
  131 + public void setContactname(String contactname) {
  132 + this.contactname = contactname == null ? null : contactname.trim();
  133 + }
  134 +
  135 + public String getContacttel() {
  136 + return contacttel;
  137 + }
  138 +
  139 + public void setContacttel(String contacttel) {
  140 + this.contacttel = contacttel == null ? null : contacttel.trim();
  141 + }
  142 +
  143 + public MANIFESTLOAD() {
  144 +
  145 + }
  146 +
  147 + public MANIFESTLOAD(CustomReception customReception) {
  148 +
  149 + this.waybillnomaster = AWBTools.awbFormat(customReception.getWayBillMaster());
  150 +
  151 +
  152 + //取分单号
  153 + if(!customReception.getWayBillSecond().isEmpty()){
  154 + String[] awbhArr = customReception.getWayBillSecond().split("_");
  155 + this.waybillnosecondary = awbhArr[1];
  156 + }
  157 +
  158 + this.flightno = customReception.getFlightNo();
  159 + this.flightdate = DateUtil.formatByyyyyMMdd(customReception.getFlightDate());
  160 +
  161 + this.status = AWBTools.transCusRspCode(customReception.getResponseCode());
  162 + this.receiption = customReception.getResponseText();
  163 + }
  164 +
  165 + @Override
  166 + public int secondAnalysisReception(){
  167 +
  168 + //更新分单回执
  169 + int i = manifestloadMapper.updateRECEIPTION(this);
  170 + //获取分单autoid
  171 + List<MANIFESTLOAD> secondaryList = manifestloadMapper.selectAutoIdByawbAawbH(this);
  172 + if(!secondaryList.isEmpty()){
  173 + MANIFESTLOAD arrivedSecond = secondaryList.get(0);
  174 + String autoId = arrivedSecond.getId();
  175 + //插入sendlog记录表
  176 + log.info("即将插入回执日志运单号为:{}{},->autoid={}",waybillnomaster,waybillnosecondary,autoId);
  177 + int ii = sendLogService.insertSendlog("MT8202",receiption,autoId);
  178 +
  179 + //todo:同时更新发送日志表的回执信息
  180 +
  181 +
  182 + if (i>0 && ii>0 ){
  183 + log.info("运单号 {} 落装分单回执更新成功",waybillnosecondary);
  184 + return 1;
  185 + }
  186 + }else {
  187 + //todo:如果都没适配到的话,要从发送日志表里面通过回执中的messageid 找到发送信息,适配回执
  188 + }
  189 + return 0;
  190 + }
  191 +}
  1 +package com.tianbo.analysis.model;
  2 +
  3 +import com.tianbo.analysis.bean.WlptBaseModel;
  4 +import com.tianbo.analysis.tools.AWBTools;
  5 +import com.tianbo.util.Date.DateUtil;
  6 +import lombok.extern.slf4j.Slf4j;
  7 +
  8 +import java.util.Date;
  9 +import java.util.List;
  10 +
  11 +@Slf4j
  12 +public class MANIFESTLOSTCHANGE extends WlptBaseModel{
  13 + private String id;
  14 +
  15 + private String flightno;
  16 +
  17 + private Date flightdate;
  18 +
  19 + private String waybillnomaster;
  20 +
  21 + private String waybillnosecondary;
  22 +
  23 + private String cwaybillnomaster;
  24 +
  25 + private String cwaybillnosecondary;
  26 +
  27 + private Date createdate;
  28 +
  29 + private String status;
  30 +
  31 + private String receiption;
  32 +
  33 + private String cflightno;
  34 +
  35 + private Date cflightdate;
  36 +
  37 + private String sequencenumeric;
  38 +
  39 + private String quantity;
  40 +
  41 + private String cargodescription;
  42 +
  43 + private String goodsmeasure;
  44 +
  45 + private String customcode;
  46 +
  47 + private String reason;
  48 +
  49 + private String contactname;
  50 +
  51 + private String contacttel;
  52 +
  53 + public String getId() {
  54 + return id;
  55 + }
  56 +
  57 + public void setId(String id) {
  58 + this.id = id == null ? null : id.trim();
  59 + }
  60 +
  61 + public String getFlightno() {
  62 + return flightno;
  63 + }
  64 +
  65 + public void setFlightno(String flightno) {
  66 + this.flightno = flightno == null ? null : flightno.trim();
  67 + }
  68 +
  69 + public Date getFlightdate() {
  70 + return flightdate;
  71 + }
  72 +
  73 + public void setFlightdate(Date flightdate) {
  74 + this.flightdate = flightdate;
  75 + }
  76 +
  77 + public String getWaybillnomaster() {
  78 + return waybillnomaster;
  79 + }
  80 +
  81 + public void setWaybillnomaster(String waybillnomaster) {
  82 + this.waybillnomaster = waybillnomaster == null ? null : waybillnomaster.trim();
  83 + }
  84 +
  85 + public String getWaybillnosecondary() {
  86 + return waybillnosecondary;
  87 + }
  88 +
  89 + public void setWaybillnosecondary(String waybillnosecondary) {
  90 + this.waybillnosecondary = waybillnosecondary == null ? null : waybillnosecondary.trim();
  91 + }
  92 +
  93 + public String getCwaybillnomaster() {
  94 + return cwaybillnomaster;
  95 + }
  96 +
  97 + public void setCwaybillnomaster(String cwaybillnomaster) {
  98 + this.cwaybillnomaster = cwaybillnomaster == null ? null : cwaybillnomaster.trim();
  99 + }
  100 +
  101 + public String getCwaybillnosecondary() {
  102 + return cwaybillnosecondary;
  103 + }
  104 +
  105 + public void setCwaybillnosecondary(String cwaybillnosecondary) {
  106 + this.cwaybillnosecondary = cwaybillnosecondary == null ? null : cwaybillnosecondary.trim();
  107 + }
  108 +
  109 + public Date getCreatedate() {
  110 + return createdate;
  111 + }
  112 +
  113 + public void setCreatedate(Date createdate) {
  114 + this.createdate = createdate;
  115 + }
  116 +
  117 + public String getStatus() {
  118 + return status;
  119 + }
  120 +
  121 + public void setStatus(String status) {
  122 + this.status = status == null ? null : status.trim();
  123 + }
  124 +
  125 + public String getReceiption() {
  126 + return receiption;
  127 + }
  128 +
  129 + public void setReceiption(String receiption) {
  130 + this.receiption = receiption == null ? null : receiption.trim();
  131 + }
  132 +
  133 + public String getCflightno() {
  134 + return cflightno;
  135 + }
  136 +
  137 + public void setCflightno(String cflightno) {
  138 + this.cflightno = cflightno == null ? null : cflightno.trim();
  139 + }
  140 +
  141 + public Date getCflightdate() {
  142 + return cflightdate;
  143 + }
  144 +
  145 + public void setCflightdate(Date cflightdate) {
  146 + this.cflightdate = cflightdate;
  147 + }
  148 +
  149 + public String getSequencenumeric() {
  150 + return sequencenumeric;
  151 + }
  152 +
  153 + public void setSequencenumeric(String sequencenumeric) {
  154 + this.sequencenumeric = sequencenumeric == null ? null : sequencenumeric.trim();
  155 + }
  156 +
  157 + public String getQuantity() {
  158 + return quantity;
  159 + }
  160 +
  161 + public void setQuantity(String quantity) {
  162 + this.quantity = quantity == null ? null : quantity.trim();
  163 + }
  164 +
  165 + public String getCargodescription() {
  166 + return cargodescription;
  167 + }
  168 +
  169 + public void setCargodescription(String cargodescription) {
  170 + this.cargodescription = cargodescription == null ? null : cargodescription.trim();
  171 + }
  172 +
  173 + public String getGoodsmeasure() {
  174 + return goodsmeasure;
  175 + }
  176 +
  177 + public void setGoodsmeasure(String goodsmeasure) {
  178 + this.goodsmeasure = goodsmeasure == null ? null : goodsmeasure.trim();
  179 + }
  180 +
  181 + public String getCustomcode() {
  182 + return customcode;
  183 + }
  184 +
  185 + public void setCustomcode(String customcode) {
  186 + this.customcode = customcode == null ? null : customcode.trim();
  187 + }
  188 +
  189 + public String getReason() {
  190 + return reason;
  191 + }
  192 +
  193 + public void setReason(String reason) {
  194 + this.reason = reason == null ? null : reason.trim();
  195 + }
  196 +
  197 + public String getContactname() {
  198 + return contactname;
  199 + }
  200 +
  201 + public void setContactname(String contactname) {
  202 + this.contactname = contactname == null ? null : contactname.trim();
  203 + }
  204 +
  205 + public String getContacttel() {
  206 + return contacttel;
  207 + }
  208 +
  209 + public void setContacttel(String contacttel) {
  210 + this.contacttel = contacttel == null ? null : contacttel.trim();
  211 + }
  212 +
  213 +
  214 + public MANIFESTLOSTCHANGE() {
  215 +
  216 + }
  217 +
  218 + public MANIFESTLOSTCHANGE(CustomReception customReception) {
  219 +
  220 + this.waybillnomaster = AWBTools.awbFormat(customReception.getWayBillMaster());
  221 +
  222 +
  223 + //取分单号
  224 + if(!customReception.getWayBillSecond().isEmpty()){
  225 + String[] awbhArr = customReception.getWayBillSecond().split("_");
  226 + this.waybillnosecondary = awbhArr[1];
  227 + }
  228 +
  229 + this.flightno = customReception.getFlightNo();
  230 + this.flightdate = DateUtil.formatByyyyyMMdd(customReception.getFlightDate());
  231 +
  232 + this.status = AWBTools.transCusRspCode(customReception.getResponseCode());
  233 + this.receiption = customReception.getResponseText();
  234 + }
  235 +
  236 + @Override
  237 + public int secondAnalysisReception(){
  238 +
  239 + //更新分单回执
  240 + int i = manifestlostchangeMapper.updateRECEIPTION(this);
  241 + //获取分单autoid
  242 + List<MANIFESTLOSTCHANGE> secondaryList = manifestlostchangeMapper.selectAutoIdByawbAawbH(this);
  243 + if(!secondaryList.isEmpty()){
  244 + MANIFESTLOSTCHANGE arrivedSecond = secondaryList.get(0);
  245 + String autoId = arrivedSecond.getId();
  246 + //插入sendlog记录表
  247 + log.info("即将插入回执日志运单号为:{}{},->autoid={}",waybillnomaster,waybillnosecondary,autoId);
  248 + int ii = sendLogService.insertSendlog("MT8203",receiption,autoId);
  249 +
  250 + //todo:同时更新发送日志表的回执信息
  251 +
  252 +
  253 + if (i>0 && ii>0 ){
  254 + log.info("运单号 {} 落装改配分单回执更新成功",waybillnosecondary);
  255 + return 1;
  256 + }
  257 + }else {
  258 + //todo:如果都没适配到的话,要从发送日志表里面通过回执中的messageid 找到发送信息,适配回执
  259 + }
  260 + return 0;
  261 + }
  262 +}
1 ${AnsiColor.YELLOW} 1 ${AnsiColor.YELLOW}
2 ##################*CETC-TIANBO*######################### 2 ##################*CETC-TIANBO*#########################
3 3
4 - .::::.  
5 - .::::::::.  
6 - :::::::::::  
7 - ..:::::::::::'  
8 - '::::::::::::'  
9 - .::::::::::  
10 - '::::::::::::::..  
11 - ..::::::::::::.  
12 - ``::::::::::::::::  
13 - ::::``:::::::::' .:::.  
14 - ::::' ':::::' .::::::::.  
15 - .::::' :::: .:::::::'::::.  
16 - .:::' ::::: .:::::::::' ':::::.  
17 - .::' :::::.:::::::::' ':::::.  
18 - .::' ::::::::::::::' ``::::.  
19 - ...::: ::::::::::::' ``::.  
20 - ```` ':. ':::::::::' ::::..  
21 - '.:::::' ':'````.. 4 + ,----------------, ,---------,
  5 + ,-----------------------, ," ,"|
  6 + ," ,"| ," ," |
  7 + +-----------------------+ | ," ," |
  8 + | .-----------------. | | +---------+ |
  9 + | | | | | | -==----'| |
  10 + | | I LOVE DOS! | | | | | |
  11 + | | Bad command or | | |/----|`---= | |
  12 + | | C:\>_ | | | ,/|==== ooo | ;
  13 + | | | | | // |(((( [33]| ,"
  14 + | `-----------------' |," .;'| |(((( | ,"
  15 + +-----------------------+ ;; | | |,"
  16 + /_)______________(_/ //' | +---------+
  17 + ___________________________/___ `,
  18 + / oooooooooooooooo .o. oooo /, \,"-----------
  19 + / ==ooooooooooooooo==.o. ooo= // ,`\--{)B ,"
  20 + /_==__==========__==_ooo__ooo=_/' /___________,"
  21 +
  22 +
22 ######################################################### 23 #########################################################
23 24
24 25
@@ -4,8 +4,8 @@ @@ -4,8 +4,8 @@
4 "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd"> 4 "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
5 <generatorConfiguration> 5 <generatorConfiguration>
6 <!-- 数据库驱动:选择你的本地硬盘上面的数据库驱动包--> 6 <!-- 数据库驱动:选择你的本地硬盘上面的数据库驱动包-->
7 - <classPathEntry location="/Users/mrz/Downloads/mybatis-generator-core-1.3.2/lib/mysql-connector-java-5.1.25-bin.jar"/>  
8 - <!--<classPathEntry location="/Users/mrz/Documents/maven/ojdbc6.jar"/>--> 7 + <!--<classPathEntry location="/Users/mrz/Downloads/mybatis-generator-core-1.3.2/lib/mysql-connector-java-5.1.25-bin.jar"/>-->
  8 + <classPathEntry location="/Users/mrz/Documents/maven/ojdbc6.jar"/>
9 <context id="DB2Tables" targetRuntime="MyBatis3"> 9 <context id="DB2Tables" targetRuntime="MyBatis3">
10 <commentGenerator> 10 <commentGenerator>
11 <property name="suppressDate" value="true"/> 11 <property name="suppressDate" value="true"/>
@@ -13,16 +13,16 @@ @@ -13,16 +13,16 @@
13 <property name="suppressAllComments" value="true"/> 13 <property name="suppressAllComments" value="true"/>
14 </commentGenerator> 14 </commentGenerator>
15 <!--数据库链接URL,用户名、密码 --> 15 <!--数据库链接URL,用户名、密码 -->
16 - <jdbcConnection driverClass="com.mysql.jdbc.Driver"  
17 - connectionURL="jdbc:mysql://118.31.66.166:3306/WLPT_NMMS"  
18 - userId="110"  
19 - password="QAHqCJf2kFYCLirM">  
20 - </jdbcConnection>  
21 - <!--<jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver"-->  
22 - <!--connectionURL="jdbc:oracle:thin:@218.28.199.134:8004:CGODB"-->  
23 - <!--userId="CGONMS"-->  
24 - <!--password="1q2w3e4r">--> 16 + <!--<jdbcConnection driverClass="com.mysql.jdbc.Driver"-->
  17 + <!--connectionURL="jdbc:mysql://118.31.66.166:3306/WLPT_NMMS"-->
  18 + <!--userId="110"-->
  19 + <!--password="QAHqCJf2kFYCLirM">-->
25 <!--</jdbcConnection>--> 20 <!--</jdbcConnection>-->
  21 + <jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver"
  22 + connectionURL="jdbc:oracle:thin:@10.50.3.69:1521:CGODB"
  23 + userId="CGONMS"
  24 + password="1q2w3e4r">
  25 + </jdbcConnection>
26 <!-- 默认false,把JDBC DECIMAL 和 NUMERIC 类型解析为 Integer,为 true时把JDBC DECIMAL 和 26 <!-- 默认false,把JDBC DECIMAL 和 NUMERIC 类型解析为 Integer,为 true时把JDBC DECIMAL 和
27 NUMERIC 类型解析为java.math.BigDecimal --> 27 NUMERIC 类型解析为java.math.BigDecimal -->
28 <!--<javaTypeResolver>--> 28 <!--<javaTypeResolver>-->
@@ -45,6 +45,6 @@ @@ -45,6 +45,6 @@
45 <property name="enableSubPackages" value="true"/> 45 <property name="enableSubPackages" value="true"/>
46 </javaClientGenerator> 46 </javaClientGenerator>
47 <!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名--> 47 <!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名-->
48 - <table tableName="CUSTOM_RESPONSE" domainObjectName="CUSTOM_RESPONSE" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table> 48 + <table tableName="MANIFESTLOSTCHANGE" domainObjectName="MANIFESTLOSTCHANGE" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
49 </context> 49 </context>
50 </generatorConfiguration> 50 </generatorConfiguration>
  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.MANIFESTLOADMapper" >
  4 + <resultMap id="BaseResultMap" type="com.tianbo.analysis.model.MANIFESTLOAD" >
  5 + <result column="ID" property="id" jdbcType="VARCHAR" />
  6 + <result column="CREATEDATE" property="createdate" jdbcType="TIMESTAMP" />
  7 + <result column="FLIGHTNO" property="flightno" jdbcType="VARCHAR" />
  8 + <result column="WAYBILLNOMASTER" property="waybillnomaster" jdbcType="VARCHAR" />
  9 + <result column="FLIGHTDATE" property="flightdate" jdbcType="DATE" />
  10 + <result column="WAYBILLNOSECONDARY" property="waybillnosecondary" jdbcType="VARCHAR" />
  11 + <result column="REMARK" property="remark" jdbcType="VARCHAR" />
  12 + <result column="STATUS" property="status" jdbcType="VARCHAR" />
  13 + <result column="RECEIPTION" property="receiption" jdbcType="VARCHAR" />
  14 + <result column="CUSTOMCODE" property="customcode" jdbcType="VARCHAR" />
  15 + <result column="REASON" property="reason" jdbcType="VARCHAR" />
  16 + <result column="CONTACTNAME" property="contactname" jdbcType="VARCHAR" />
  17 + <result column="CONTACTTEL" property="contacttel" jdbcType="VARCHAR" />
  18 + </resultMap>
  19 + <insert id="insert" parameterType="com.tianbo.analysis.model.MANIFESTLOAD" >
  20 + insert into MANIFESTLOAD (ID, CREATEDATE, FLIGHTNO,
  21 + WAYBILLNOMASTER, FLIGHTDATE, WAYBILLNOSECONDARY,
  22 + REMARK, STATUS, RECEIPTION,
  23 + CUSTOMCODE, REASON, CONTACTNAME,
  24 + CONTACTTEL)
  25 + values (#{id,jdbcType=VARCHAR}, #{createdate,jdbcType=TIMESTAMP}, #{flightno,jdbcType=VARCHAR},
  26 + #{waybillnomaster,jdbcType=VARCHAR}, #{flightdate,jdbcType=TIMESTAMP}, #{waybillnosecondary,jdbcType=VARCHAR},
  27 + #{remark,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{receiption,jdbcType=VARCHAR},
  28 + #{customcode,jdbcType=VARCHAR}, #{reason,jdbcType=VARCHAR}, #{contactname,jdbcType=VARCHAR},
  29 + #{contacttel,jdbcType=VARCHAR})
  30 + </insert>
  31 + <insert id="insertSelective" parameterType="com.tianbo.analysis.model.MANIFESTLOAD" >
  32 + insert into MANIFESTLOAD
  33 + <trim prefix="(" suffix=")" suffixOverrides="," >
  34 + <if test="id != null" >
  35 + ID,
  36 + </if>
  37 + <if test="createdate != null" >
  38 + CREATEDATE,
  39 + </if>
  40 + <if test="flightno != null" >
  41 + FLIGHTNO,
  42 + </if>
  43 + <if test="waybillnomaster != null" >
  44 + WAYBILLNOMASTER,
  45 + </if>
  46 + <if test="flightdate != null" >
  47 + FLIGHTDATE,
  48 + </if>
  49 + <if test="waybillnosecondary != null" >
  50 + WAYBILLNOSECONDARY,
  51 + </if>
  52 + <if test="remark != null" >
  53 + REMARK,
  54 + </if>
  55 + <if test="status != null" >
  56 + STATUS,
  57 + </if>
  58 + <if test="receiption != null" >
  59 + RECEIPTION,
  60 + </if>
  61 + <if test="customcode != null" >
  62 + CUSTOMCODE,
  63 + </if>
  64 + <if test="reason != null" >
  65 + REASON,
  66 + </if>
  67 + <if test="contactname != null" >
  68 + CONTACTNAME,
  69 + </if>
  70 + <if test="contacttel != null" >
  71 + CONTACTTEL,
  72 + </if>
  73 + </trim>
  74 + <trim prefix="values (" suffix=")" suffixOverrides="," >
  75 + <if test="id != null" >
  76 + #{id,jdbcType=VARCHAR},
  77 + </if>
  78 + <if test="createdate != null" >
  79 + #{createdate,jdbcType=TIMESTAMP},
  80 + </if>
  81 + <if test="flightno != null" >
  82 + #{flightno,jdbcType=VARCHAR},
  83 + </if>
  84 + <if test="waybillnomaster != null" >
  85 + #{waybillnomaster,jdbcType=VARCHAR},
  86 + </if>
  87 + <if test="flightdate != null" >
  88 + #{flightdate,jdbcType=TIMESTAMP},
  89 + </if>
  90 + <if test="waybillnosecondary != null" >
  91 + #{waybillnosecondary,jdbcType=VARCHAR},
  92 + </if>
  93 + <if test="remark != null" >
  94 + #{remark,jdbcType=VARCHAR},
  95 + </if>
  96 + <if test="status != null" >
  97 + #{status,jdbcType=VARCHAR},
  98 + </if>
  99 + <if test="receiption != null" >
  100 + #{receiption,jdbcType=VARCHAR},
  101 + </if>
  102 + <if test="customcode != null" >
  103 + #{customcode,jdbcType=VARCHAR},
  104 + </if>
  105 + <if test="reason != null" >
  106 + #{reason,jdbcType=VARCHAR},
  107 + </if>
  108 + <if test="contactname != null" >
  109 + #{contactname,jdbcType=VARCHAR},
  110 + </if>
  111 + <if test="contacttel != null" >
  112 + #{contacttel,jdbcType=VARCHAR},
  113 + </if>
  114 + </trim>
  115 + </insert>
  116 + <update id="updateRECEIPTION" parameterType="com.tianbo.analysis.model.MANIFESTLOAD" >
  117 + UPDATE MANIFESTLOAD
  118 + SET
  119 + RECEIPTION= #{receiption,jdbcType=VARCHAR},
  120 + STATUS = #{status,jdbcType=VARCHAR}
  121 + WHERE
  122 + WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
  123 + AND
  124 + WAYBILLNOSECONDARY = #{waybillnosecondary,jdbcType=VARCHAR}
  125 + AND
  126 + FLIGHTNO = #{flightno,jdbcType=VARCHAR}
  127 + AND
  128 + trunc(FLIGHTDATE)= #{flightdate,jdbcType=DATE}
  129 + </update>
  130 + <select id="selectAutoIdByawbAawbH" parameterType="com.tianbo.analysis.model.MANIFESTLOAD" resultType="com.tianbo.analysis.model.MANIFESTLOAD">
  131 + SELECT ID
  132 + FROM MANIFESTLOAD
  133 + WHERE
  134 + WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
  135 + AND
  136 + WAYBILLNOSECONDARY = #{waybillnosecondary,jdbcType=VARCHAR}
  137 + <if test="flightno != null" >
  138 + AND
  139 + FLIGHTNO = #{flightno,jdbcType=VARCHAR}
  140 + </if>
  141 + <if test="flightdate != null" >
  142 + AND
  143 + trunc(FLIGHTDATE)= #{flightdate,jdbcType=DATE}
  144 + </if>
  145 + </select>
  146 +</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.MANIFESTLOSTCHANGEMapper" >
  4 + <resultMap id="BaseResultMap" type="com.tianbo.analysis.model.MANIFESTLOSTCHANGE" >
  5 + <result column="ID" property="id" jdbcType="VARCHAR" />
  6 + <result column="FLIGHTNO" property="flightno" jdbcType="VARCHAR" />
  7 + <result column="FLIGHTDATE" property="flightdate" jdbcType="TIMESTAMP" />
  8 + <result column="WAYBILLNOMASTER" property="waybillnomaster" jdbcType="VARCHAR" />
  9 + <result column="WAYBILLNOSECONDARY" property="waybillnosecondary" jdbcType="VARCHAR" />
  10 + <result column="CWAYBILLNOMASTER" property="cwaybillnomaster" jdbcType="VARCHAR" />
  11 + <result column="CWAYBILLNOSECONDARY" property="cwaybillnosecondary" jdbcType="VARCHAR" />
  12 + <result column="CREATEDATE" property="createdate" jdbcType="TIMESTAMP" />
  13 + <result column="STATUS" property="status" jdbcType="VARCHAR" />
  14 + <result column="RECEIPTION" property="receiption" jdbcType="VARCHAR" />
  15 + <result column="CFLIGHTNO" property="cflightno" jdbcType="VARCHAR" />
  16 + <result column="CFLIGHTDATE" property="cflightdate" jdbcType="DATE" />
  17 + <result column="SEQUENCENUMERIC" property="sequencenumeric" jdbcType="VARCHAR" />
  18 + <result column="QUANTITY" property="quantity" jdbcType="VARCHAR" />
  19 + <result column="CARGODESCRIPTION" property="cargodescription" jdbcType="VARCHAR" />
  20 + <result column="GOODSMEASURE" property="goodsmeasure" jdbcType="VARCHAR" />
  21 + <result column="CUSTOMCODE" property="customcode" jdbcType="VARCHAR" />
  22 + <result column="REASON" property="reason" jdbcType="VARCHAR" />
  23 + <result column="CONTACTNAME" property="contactname" jdbcType="VARCHAR" />
  24 + <result column="CONTACTTEL" property="contacttel" jdbcType="VARCHAR" />
  25 + </resultMap>
  26 + <insert id="insert" parameterType="com.tianbo.analysis.model.MANIFESTLOSTCHANGE" >
  27 + insert into MANIFESTLOSTCHANGE (ID, FLIGHTNO, FLIGHTDATE,
  28 + WAYBILLNOMASTER, WAYBILLNOSECONDARY, CWAYBILLNOMASTER,
  29 + CWAYBILLNOSECONDARY, CREATEDATE, STATUS,
  30 + RECEIPTION, CFLIGHTNO, CFLIGHTDATE,
  31 + SEQUENCENUMERIC, QUANTITY, CARGODESCRIPTION,
  32 + GOODSMEASURE, CUSTOMCODE, REASON,
  33 + CONTACTNAME, CONTACTTEL)
  34 + values (#{id,jdbcType=VARCHAR}, #{flightno,jdbcType=VARCHAR}, #{flightdate,jdbcType=TIMESTAMP},
  35 + #{waybillnomaster,jdbcType=VARCHAR}, #{waybillnosecondary,jdbcType=VARCHAR}, #{cwaybillnomaster,jdbcType=VARCHAR},
  36 + #{cwaybillnosecondary,jdbcType=VARCHAR}, #{createdate,jdbcType=TIMESTAMP}, #{status,jdbcType=VARCHAR},
  37 + #{receiption,jdbcType=VARCHAR}, #{cflightno,jdbcType=VARCHAR}, #{cflightdate,jdbcType=TIMESTAMP},
  38 + #{sequencenumeric,jdbcType=VARCHAR}, #{quantity,jdbcType=VARCHAR}, #{cargodescription,jdbcType=VARCHAR},
  39 + #{goodsmeasure,jdbcType=VARCHAR}, #{customcode,jdbcType=VARCHAR}, #{reason,jdbcType=VARCHAR},
  40 + #{contactname,jdbcType=VARCHAR}, #{contacttel,jdbcType=VARCHAR})
  41 + </insert>
  42 + <insert id="insertSelective" parameterType="com.tianbo.analysis.model.MANIFESTLOSTCHANGE" >
  43 + insert into MANIFESTLOSTCHANGE
  44 + <trim prefix="(" suffix=")" suffixOverrides="," >
  45 + <if test="id != null" >
  46 + ID,
  47 + </if>
  48 + <if test="flightno != null" >
  49 + FLIGHTNO,
  50 + </if>
  51 + <if test="flightdate != null" >
  52 + FLIGHTDATE,
  53 + </if>
  54 + <if test="waybillnomaster != null" >
  55 + WAYBILLNOMASTER,
  56 + </if>
  57 + <if test="waybillnosecondary != null" >
  58 + WAYBILLNOSECONDARY,
  59 + </if>
  60 + <if test="cwaybillnomaster != null" >
  61 + CWAYBILLNOMASTER,
  62 + </if>
  63 + <if test="cwaybillnosecondary != null" >
  64 + CWAYBILLNOSECONDARY,
  65 + </if>
  66 + <if test="createdate != null" >
  67 + CREATEDATE,
  68 + </if>
  69 + <if test="status != null" >
  70 + STATUS,
  71 + </if>
  72 + <if test="receiption != null" >
  73 + RECEIPTION,
  74 + </if>
  75 + <if test="cflightno != null" >
  76 + CFLIGHTNO,
  77 + </if>
  78 + <if test="cflightdate != null" >
  79 + CFLIGHTDATE,
  80 + </if>
  81 + <if test="sequencenumeric != null" >
  82 + SEQUENCENUMERIC,
  83 + </if>
  84 + <if test="quantity != null" >
  85 + QUANTITY,
  86 + </if>
  87 + <if test="cargodescription != null" >
  88 + CARGODESCRIPTION,
  89 + </if>
  90 + <if test="goodsmeasure != null" >
  91 + GOODSMEASURE,
  92 + </if>
  93 + <if test="customcode != null" >
  94 + CUSTOMCODE,
  95 + </if>
  96 + <if test="reason != null" >
  97 + REASON,
  98 + </if>
  99 + <if test="contactname != null" >
  100 + CONTACTNAME,
  101 + </if>
  102 + <if test="contacttel != null" >
  103 + CONTACTTEL,
  104 + </if>
  105 + </trim>
  106 + <trim prefix="values (" suffix=")" suffixOverrides="," >
  107 + <if test="id != null" >
  108 + #{id,jdbcType=VARCHAR},
  109 + </if>
  110 + <if test="flightno != null" >
  111 + #{flightno,jdbcType=VARCHAR},
  112 + </if>
  113 + <if test="flightdate != null" >
  114 + #{flightdate,jdbcType=TIMESTAMP},
  115 + </if>
  116 + <if test="waybillnomaster != null" >
  117 + #{waybillnomaster,jdbcType=VARCHAR},
  118 + </if>
  119 + <if test="waybillnosecondary != null" >
  120 + #{waybillnosecondary,jdbcType=VARCHAR},
  121 + </if>
  122 + <if test="cwaybillnomaster != null" >
  123 + #{cwaybillnomaster,jdbcType=VARCHAR},
  124 + </if>
  125 + <if test="cwaybillnosecondary != null" >
  126 + #{cwaybillnosecondary,jdbcType=VARCHAR},
  127 + </if>
  128 + <if test="createdate != null" >
  129 + #{createdate,jdbcType=TIMESTAMP},
  130 + </if>
  131 + <if test="status != null" >
  132 + #{status,jdbcType=VARCHAR},
  133 + </if>
  134 + <if test="receiption != null" >
  135 + #{receiption,jdbcType=VARCHAR},
  136 + </if>
  137 + <if test="cflightno != null" >
  138 + #{cflightno,jdbcType=VARCHAR},
  139 + </if>
  140 + <if test="cflightdate != null" >
  141 + #{cflightdate,jdbcType=TIMESTAMP},
  142 + </if>
  143 + <if test="sequencenumeric != null" >
  144 + #{sequencenumeric,jdbcType=VARCHAR},
  145 + </if>
  146 + <if test="quantity != null" >
  147 + #{quantity,jdbcType=VARCHAR},
  148 + </if>
  149 + <if test="cargodescription != null" >
  150 + #{cargodescription,jdbcType=VARCHAR},
  151 + </if>
  152 + <if test="goodsmeasure != null" >
  153 + #{goodsmeasure,jdbcType=VARCHAR},
  154 + </if>
  155 + <if test="customcode != null" >
  156 + #{customcode,jdbcType=VARCHAR},
  157 + </if>
  158 + <if test="reason != null" >
  159 + #{reason,jdbcType=VARCHAR},
  160 + </if>
  161 + <if test="contactname != null" >
  162 + #{contactname,jdbcType=VARCHAR},
  163 + </if>
  164 + <if test="contacttel != null" >
  165 + #{contacttel,jdbcType=VARCHAR},
  166 + </if>
  167 + </trim>
  168 + </insert>
  169 +
  170 + <update id="updateRECEIPTION" parameterType="com.tianbo.analysis.model.MANIFESTLOSTCHANGE" >
  171 + UPDATE MANIFESTLOSTCHANGE
  172 + SET
  173 + RECEIPTION= #{receiption,jdbcType=VARCHAR},
  174 + STATUS = #{status,jdbcType=VARCHAR}
  175 + WHERE
  176 + WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
  177 + AND
  178 + WAYBILLNOSECONDARY = #{waybillnosecondary,jdbcType=VARCHAR}
  179 + AND
  180 + FLIGHTNO = #{flightno,jdbcType=VARCHAR}
  181 + AND
  182 + trunc(FLIGHTDATE)= #{flightdate,jdbcType=DATE}
  183 + </update>
  184 + <select id="selectAutoIdByawbAawbH" parameterType="com.tianbo.analysis.model.MANIFESTLOSTCHANGE" resultType="com.tianbo.analysis.model.MANIFESTLOSTCHANGE">
  185 + SELECT ID
  186 + FROM MANIFESTLOSTCHANGE
  187 + WHERE
  188 + WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
  189 + AND
  190 + WAYBILLNOSECONDARY = #{waybillnosecondary,jdbcType=VARCHAR}
  191 + <if test="flightno != null" >
  192 + AND
  193 + FLIGHTNO = #{flightno,jdbcType=VARCHAR}
  194 + </if>
  195 + <if test="flightdate != null" >
  196 + AND
  197 + trunc(FLIGHTDATE)= #{flightdate,jdbcType=DATE}
  198 + </if>
  199 + </select>
  200 +</mapper>