作者 朱兆平

新舱单辅助管理-提前运抵业务优化

@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 <relativePath/> <!-- lookup parent from repository --> 11 <relativePath/> <!-- lookup parent from repository -->
12 </parent> 12 </parent>
13 <groupId>com.tianbo</groupId> 13 <groupId>com.tianbo</groupId>
14 - <artifactId>nmms</artifactId> 14 + <artifactId>nmms-manage</artifactId>
15 <version>1.0-SNAPSHOT</version> 15 <version>1.0-SNAPSHOT</version>
16 <name>nmms-manage</name> 16 <name>nmms-manage</name>
17 <description>nmms management system</description> 17 <description>nmms management system</description>
1 package com.tianbo.analysis.controller; 1 package com.tianbo.analysis.controller;
2 2
3 3
4 -import com.tianbo.analysis.model.CarAndWayBill; 4 +import com.tianbo.analysis.model.AdvanceArrive;
5 import com.tianbo.analysis.model.ResultJson; 5 import com.tianbo.analysis.model.ResultJson;
6 import com.tianbo.analysis.service.ArriveMasterService; 6 import com.tianbo.analysis.service.ArriveMasterService;
7 import com.tianbo.analysis.tools.WaybillTools; 7 import com.tianbo.analysis.tools.WaybillTools;
@@ -22,7 +22,7 @@ public class ArrivedAMasterController { @@ -22,7 +22,7 @@ public class ArrivedAMasterController {
22 22
23 @ApiOperation(value = "提前运抵接口",notes = "接收卡口车辆过卡放行后的通知,车单数据") 23 @ApiOperation(value = "提前运抵接口",notes = "接收卡口车辆过卡放行后的通知,车单数据")
24 @PostMapping("forkako") 24 @PostMapping("forkako")
25 - public ResultJson applyfor(@RequestBody CarAndWayBill carAndWayBill){ 25 + public ResultJson applyfor(@RequestBody AdvanceArrive carAndWayBill){
26 boolean result = arriveMasterService.arrivedAhead(carAndWayBill); 26 boolean result = arriveMasterService.arrivedAhead(carAndWayBill);
27 return result? new ResultJson("200","处理完毕"):new ResultJson("处理失败"); 27 return result? new ResultJson("200","处理完毕"):new ResultJson("处理失败");
28 } 28 }
@@ -32,4 +32,11 @@ public class ArrivedAMasterController { @@ -32,4 +32,11 @@ public class ArrivedAMasterController {
32 WaybillTools.checkWaybillFormat(waybill); 32 WaybillTools.checkWaybillFormat(waybill);
33 } 33 }
34 34
  35 + @ApiOperation(value = "提前运抵-接收申请数据通知接口",notes = "接收卡口进出场申请中的提前运抵运单数据,并更新到预配中")
  36 + @PostMapping("prebill")
  37 + public ResultJson acceptWaybill(@RequestBody AdvanceArrive preArrivedWaybillList){
  38 + int result = arriveMasterService.updatePremasterArrivedHeadStatus(preArrivedWaybillList);
  39 + return result>0? new ResultJson("200","提前运抵状态已更新"):new ResultJson("提前运抵状态更新失败");
  40 + }
  41 +
35 } 42 }
@@ -40,6 +40,13 @@ public class DomTransController { @@ -40,6 +40,13 @@ public class DomTransController {
40 return domTransitService.deleteByPrimaryKey(domtransit.getId())>0 ? new ResultJson("200","删除成功") :new ResultJson("400","删除失败"); 40 return domTransitService.deleteByPrimaryKey(domtransit.getId())>0 ? new ResultJson("200","删除成功") :new ResultJson("400","删除失败");
41 } 41 }
42 42
  43 + @ApiOperation(value = "删除转运申请,非RESFUL支持IIS",notes = "id必须传")
  44 + @PostMapping("domDel")
  45 + @UserPermissionCheck
  46 + public ResultJson delDom(@RequestBody DOMTRANSIT domtransit,@CookieValue("username") String username,@CookieValue("userid") String userid){
  47 + return domTransitService.deleteByPrimaryKey(domtransit.getId())>0 ? new ResultJson("200","删除成功") :new ResultJson("400","删除失败");
  48 + }
  49 +
43 @ApiOperation(value = "修改转运申请",notes = "id必须传") 50 @ApiOperation(value = "修改转运申请",notes = "id必须传")
44 @PutMapping("dom") 51 @PutMapping("dom")
45 @UserPermissionCheck 52 @UserPermissionCheck
@@ -47,6 +54,13 @@ public class DomTransController { @@ -47,6 +54,13 @@ public class DomTransController {
47 return domTransitService.updateByPrimaryKeySelective(domtransit)>0 ? new ResultJson("200","修改成功") :new ResultJson("400","修改失败"); 54 return domTransitService.updateByPrimaryKeySelective(domtransit)>0 ? new ResultJson("200","修改成功") :new ResultJson("400","修改失败");
48 } 55 }
49 56
  57 + @ApiOperation(value = "修改转运申请非RESFUL,IIS不支持",notes = "id必须传")
  58 + @PostMapping("domUpdate")
  59 + @UserPermissionCheck
  60 + public ResultJson updateDom(@Validated(ValidateUpdate.class) @RequestBody DOMTRANSIT domtransit,@CookieValue("username") String username,@CookieValue("userid") String userid){
  61 + return domTransitService.updateByPrimaryKeySelective(domtransit)>0 ? new ResultJson("200","修改成功") :new ResultJson("400","修改失败");
  62 + }
  63 +
50 64
51 @ApiOperation(value = "转运申请查询搜索",notes = "awba转运前主单,awbh转运前分单,flightDate,flightNo转运前航班信息") 65 @ApiOperation(value = "转运申请查询搜索",notes = "awba转运前主单,awbh转运前分单,flightDate,flightNo转运前航班信息")
52 @GetMapping("dom") 66 @GetMapping("dom")
@@ -59,12 +73,14 @@ public class DomTransController { @@ -59,12 +73,14 @@ public class DomTransController {
59 @RequestParam(value = "originHousewaybill",required = false) String awbh, 73 @RequestParam(value = "originHousewaybill",required = false) String awbh,
60 @RequestParam(value = "originFlightdate",required = false) String flightDate, 74 @RequestParam(value = "originFlightdate",required = false) String flightDate,
61 @RequestParam(value = "originFlightno",required = false) String flightNo, 75 @RequestParam(value = "originFlightno",required = false) String flightNo,
  76 + @RequestParam(value = "transType",required = false) String transType,
62 @CookieValue("username") String username, 77 @CookieValue("username") String username,
63 @CookieValue("userid") String userid){ 78 @CookieValue("userid") String userid){
64 DOMTRANSIT domtransit = new DOMTRANSIT(); 79 DOMTRANSIT domtransit = new DOMTRANSIT();
65 domtransit.setOriginMasterwaybill(awba); 80 domtransit.setOriginMasterwaybill(awba);
66 domtransit.setOriginHousewaybill(awbh); 81 domtransit.setOriginHousewaybill(awbh);
67 domtransit.setOriginFlightno(flightNo); 82 domtransit.setOriginFlightno(flightNo);
  83 + domtransit.setTransitType(transType);
68 if (!"admin".equals(username)){ 84 if (!"admin".equals(username)){
69 domtransit.setUserName(username); 85 domtransit.setUserName(username);
70 } 86 }
  1 +package com.tianbo.analysis.controller;
  2 +
  3 +import com.github.pagehelper.PageInfo;
  4 +import com.tianbo.analysis.model.MANIFEST_AIR_CHANGE;
  5 +import com.tianbo.analysis.model.ResultJson;
  6 +import com.tianbo.analysis.service.MT8204Service;
  7 +import com.tianbo.util.Date.DateUtil;
  8 +import lombok.extern.slf4j.Slf4j;
  9 +import org.apache.commons.lang.StringUtils;
  10 +import org.springframework.beans.factory.annotation.Autowired;
  11 +import org.springframework.web.bind.annotation.GetMapping;
  12 +import org.springframework.web.bind.annotation.RequestMapping;
  13 +import org.springframework.web.bind.annotation.RequestParam;
  14 +import org.springframework.web.bind.annotation.RestController;
  15 +
  16 +import java.util.Date;
  17 +
  18 +@Slf4j
  19 +@RestController
  20 +@RequestMapping("/mt8024/")
  21 +public class MT8204Controller {
  22 +
  23 + @Autowired
  24 + MT8204Service mt8204Service;
  25 +
  26 + @GetMapping("/")
  27 + public ResultJson index(@RequestParam(value = "page",defaultValue = "1") int page,
  28 + @RequestParam(value = "limit",defaultValue = "10") int limit,
  29 + @RequestParam(value = "flightNo",required = false) String flightNo,
  30 + @RequestParam(value = "flightDate",required = false) String flightDate,
  31 + @RequestParam(value = "waybillNo",required = false) String waybillNo){
  32 + MANIFEST_AIR_CHANGE manifest_air_change = new MANIFEST_AIR_CHANGE();
  33 + if(StringUtils.isNotEmpty(flightDate)){
  34 + Date flight_Date = DateUtil.parseDate(flightDate,"yyyy-MM-dd");
  35 + manifest_air_change.setFlightDate(flight_Date);
  36 + }
  37 + manifest_air_change.setFlightno(flightNo);
  38 + manifest_air_change.setWaybillnomaster(waybillNo);
  39 + PageInfo<MANIFEST_AIR_CHANGE> result = mt8204Service.selectList(manifest_air_change,page,limit);
  40 + return new ResultJson("200","success",result);
  41 + }
  42 +}
  1 +package com.tianbo.analysis.dao;
  2 +
  3 +import com.tianbo.analysis.model.MANIFEST_AIR_CHANGE;
  4 +
  5 +import java.util.List;
  6 +
  7 +public interface MANIFEST_AIR_CHANGEMapper {
  8 + int deleteByPrimaryKey(String autoid);
  9 +
  10 + int insert(MANIFEST_AIR_CHANGE record);
  11 +
  12 + int insertSelective(MANIFEST_AIR_CHANGE record);
  13 +
  14 + MANIFEST_AIR_CHANGE selectByPrimaryKey(String autoid);
  15 +
  16 + List<MANIFEST_AIR_CHANGE> selectList(MANIFEST_AIR_CHANGE record);
  17 +
  18 +
  19 + int updateByPrimaryKeySelective(MANIFEST_AIR_CHANGE record);
  20 +
  21 + int updateByPrimaryKey(MANIFEST_AIR_CHANGE record);
  22 +}
@@ -23,4 +23,6 @@ public interface PREPAREMASTERMapper { @@ -23,4 +23,6 @@ public interface PREPAREMASTERMapper {
23 int updateByPrimaryKeySelective(PREPAREMASTER record); 23 int updateByPrimaryKeySelective(PREPAREMASTER record);
24 24
25 int updateByPrimaryKey(PREPAREMASTER record); 25 int updateByPrimaryKey(PREPAREMASTER record);
  26 +
  27 + int updatePreArrivedBill(PREPAREMASTER record);
26 } 28 }
  1 +package com.tianbo.analysis.filter;
  2 +
  3 +import com.tianbo.analysis.dao.COMPANYUSERMapper;
  4 +import com.tianbo.analysis.model.COMPANYUSER;
  5 +import org.apache.commons.lang.StringUtils;
  6 +import org.springframework.web.servlet.HandlerInterceptor;
  7 +
  8 +import javax.annotation.Resource;
  9 +import javax.servlet.http.Cookie;
  10 +import javax.servlet.http.HttpServletRequest;
  11 +import javax.servlet.http.HttpServletResponse;
  12 +
  13 +import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;
  14 +
  15 +/**
  16 + * 用户提交时的权限拦截器
  17 + * 根据用户的request cookie中的userid 进行用户信息的判定及用户相关权限的判定
  18 + */
  19 +public class UserRquestInterceptor { //implements HandlerInterceptor {
  20 +
  21 + @Resource
  22 + COMPANYUSERMapper companyuserMapper;
  23 +
  24 +// @Override
  25 + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
  26 +
  27 + //1.获取cookie
  28 + Cookie[] requestCookies = request.getCookies();
  29 + COMPANYUSER user = new COMPANYUSER();
  30 + if(requestCookies != null){
  31 + for (Cookie cookie : requestCookies) {
  32 + if ("username".equals(cookie.getName())){
  33 + user.setCropCode(cookie.getValue());
  34 + }
  35 +
  36 + if ("userid".equals(cookie.getName())){
  37 + user.setId(cookie.getValue());
  38 + }
  39 +
  40 + }
  41 + }
  42 +
  43 + //2.判定结果
  44 + if(StringUtils.isNotEmpty(user.getId()) && StringUtils.isNotEmpty(user.getCropCode())){
  45 +
  46 + }else {
  47 + response.sendError(SC_BAD_REQUEST,"unknow user infomation");
  48 + }
  49 +
  50 +
  51 + return false;
  52 + }
  53 +}
  1 +package com.tianbo.analysis.model;
  2 +
  3 +import java.util.List;
  4 +
  5 +public class AdvanceArrive extends Throwable {
  6 + private String vname;
  7 + private List<LAND_BUSINEESTYPE_LIST_INFO> masterList;
  8 +
  9 + public String getVname() {
  10 + return vname;
  11 + }
  12 +
  13 + public void setVname(String vname) {
  14 + this.vname = vname;
  15 + }
  16 +
  17 + public List<LAND_BUSINEESTYPE_LIST_INFO> getMasterList() {
  18 + return masterList;
  19 + }
  20 +
  21 + public void setMasterList(List<LAND_BUSINEESTYPE_LIST_INFO> masterList) {
  22 + this.masterList = masterList;
  23 + }
  24 +}
  1 +package com.tianbo.analysis.model;
  2 +
  3 +public class LAND_BUSINEESTYPE_LIST_INFO {
  4 + private String id;
  5 +
  6 + private String licenseplatenumber;
  7 +
  8 + private String awba;
  9 +
  10 + private String partialidentity;
  11 +
  12 + private String arrivedaheadtime;
  13 +
  14 + private String applicationformid;
  15 +
  16 + private String ext1;
  17 +
  18 + private String ext2;
  19 +
  20 + private String ext3;
  21 +
  22 + private String ext4;
  23 +
  24 + public String getId() {
  25 + return id;
  26 + }
  27 +
  28 + public void setId(String id) {
  29 + this.id = id == null ? null : id.trim();
  30 + }
  31 +
  32 + public String getLicenseplatenumber() {
  33 + return licenseplatenumber;
  34 + }
  35 +
  36 + public void setLicenseplatenumber(String licenseplatenumber) {
  37 + this.licenseplatenumber = licenseplatenumber == null ? null : licenseplatenumber.trim();
  38 + }
  39 +
  40 + public String getAwba() {
  41 + return awba;
  42 + }
  43 +
  44 + public void setAwba(String awba) {
  45 + this.awba = awba == null ? null : awba.trim();
  46 + }
  47 +
  48 + public String getPartialidentity() {
  49 + return partialidentity;
  50 + }
  51 +
  52 + public void setPartialidentity(String partialidentity) {
  53 + this.partialidentity = partialidentity == null ? null : partialidentity.trim();
  54 + }
  55 +
  56 + public String getArrivedaheadtime() {
  57 + return arrivedaheadtime;
  58 + }
  59 +
  60 + public void setArrivedaheadtime(String arrivedaheadtime) {
  61 + this.arrivedaheadtime = arrivedaheadtime == null ? null : arrivedaheadtime.trim();
  62 + }
  63 +
  64 + public String getApplicationformid() {
  65 + return applicationformid;
  66 + }
  67 +
  68 + public void setApplicationformid(String applicationformid) {
  69 + this.applicationformid = applicationformid == null ? null : applicationformid.trim();
  70 + }
  71 +
  72 + public String getExt1() {
  73 + return ext1;
  74 + }
  75 +
  76 + public void setExt1(String ext1) {
  77 + this.ext1 = ext1 == null ? null : ext1.trim();
  78 + }
  79 +
  80 + public String getExt2() {
  81 + return ext2;
  82 + }
  83 +
  84 + public void setExt2(String ext2) {
  85 + this.ext2 = ext2 == null ? null : ext2.trim();
  86 + }
  87 +
  88 + public String getExt3() {
  89 + return ext3;
  90 + }
  91 +
  92 + public void setExt3(String ext3) {
  93 + this.ext3 = ext3 == null ? null : ext3.trim();
  94 + }
  95 +
  96 + public String getExt4() {
  97 + return ext4;
  98 + }
  99 +
  100 + public void setExt4(String ext4) {
  101 + this.ext4 = ext4 == null ? null : ext4.trim();
  102 + }
  103 +}
  1 +package com.tianbo.analysis.model;
  2 +
  3 +import java.util.Date;
  4 +
  5 +public class MANIFEST_AIR_CHANGE {
  6 + private String autoid;
  7 +
  8 + private String flightno;
  9 +
  10 + private String changeFlightno;
  11 +
  12 + private String waybillnomaster;
  13 +
  14 + private String changeWaybillnomaster;
  15 +
  16 + private String cont;
  17 +
  18 + private Date createdate;
  19 +
  20 + private Date changetime;
  21 +
  22 + private String carrier;
  23 +
  24 + private String changeCarrier;
  25 +
  26 + private Date flightDate;
  27 +
  28 + private Date changeFlightDate;
  29 +
  30 + public String getAutoid() {
  31 + return autoid;
  32 + }
  33 +
  34 + public void setAutoid(String autoid) {
  35 + this.autoid = autoid == null ? null : autoid.trim();
  36 + }
  37 +
  38 + public String getFlightno() {
  39 + return flightno;
  40 + }
  41 +
  42 + public void setFlightno(String flightno) {
  43 + this.flightno = flightno == null ? null : flightno.trim();
  44 + }
  45 +
  46 + public String getChangeFlightno() {
  47 + return changeFlightno;
  48 + }
  49 +
  50 + public void setChangeFlightno(String changeFlightno) {
  51 + this.changeFlightno = changeFlightno == null ? null : changeFlightno.trim();
  52 + }
  53 +
  54 + public String getWaybillnomaster() {
  55 + return waybillnomaster;
  56 + }
  57 +
  58 + public void setWaybillnomaster(String waybillnomaster) {
  59 + this.waybillnomaster = waybillnomaster == null ? null : waybillnomaster.trim();
  60 + }
  61 +
  62 + public String getChangeWaybillnomaster() {
  63 + return changeWaybillnomaster;
  64 + }
  65 +
  66 + public void setChangeWaybillnomaster(String changeWaybillnomaster) {
  67 + this.changeWaybillnomaster = changeWaybillnomaster == null ? null : changeWaybillnomaster.trim();
  68 + }
  69 +
  70 + public String getCont() {
  71 + return cont;
  72 + }
  73 +
  74 + public void setCont(String cont) {
  75 + this.cont = cont == null ? null : cont.trim();
  76 + }
  77 +
  78 + public Date getCreatedate() {
  79 + return createdate;
  80 + }
  81 +
  82 + public void setCreatedate(Date createdate) {
  83 + this.createdate = createdate;
  84 + }
  85 +
  86 + public Date getChangetime() {
  87 + return changetime;
  88 + }
  89 +
  90 + public void setChangetime(Date changetime) {
  91 + this.changetime = changetime;
  92 + }
  93 +
  94 + public String getCarrier() {
  95 + return carrier;
  96 + }
  97 +
  98 + public void setCarrier(String carrier) {
  99 + this.carrier = carrier == null ? null : carrier.trim();
  100 + }
  101 +
  102 + public String getChangeCarrier() {
  103 + return changeCarrier;
  104 + }
  105 +
  106 + public void setChangeCarrier(String changeCarrier) {
  107 + this.changeCarrier = changeCarrier == null ? null : changeCarrier.trim();
  108 + }
  109 +
  110 + public Date getFlightDate() {
  111 + return flightDate;
  112 + }
  113 +
  114 + public void setFlightDate(Date flightDate) {
  115 + this.flightDate = flightDate;
  116 + }
  117 +
  118 + public Date getChangeFlightDate() {
  119 + return changeFlightDate;
  120 + }
  121 +
  122 + public void setChangeFlightDate(Date changeFlightDate) {
  123 + this.changeFlightDate = changeFlightDate;
  124 + }
  125 +}
1 package com.tianbo.analysis.service; 1 package com.tianbo.analysis.service;
2 2
3 -import com.tianbo.analysis.model.CarAndWayBill; 3 +import com.tianbo.analysis.model.AdvanceArrive;
4 import com.tianbo.analysis.model.PREPAREMASTER; 4 import com.tianbo.analysis.model.PREPAREMASTER;
5 import org.jetbrains.annotations.NotNull; 5 import org.jetbrains.annotations.NotNull;
6 6
@@ -9,10 +9,12 @@ public interface ArriveMasterService { @@ -9,10 +9,12 @@ public interface ArriveMasterService {
9 /** 9 /**
10 * 提前运抵业务处理 10 * 提前运抵业务处理
11 */ 11 */
12 - boolean arrivedAhead(CarAndWayBill carAndWayBill); 12 + boolean arrivedAhead(AdvanceArrive carAndWayBill);
13 13
14 /** 14 /**
15 * 根据提前运抵的预配主单生成运抵,主分单都会被生成 15 * 根据提前运抵的预配主单生成运抵,主分单都会被生成
16 */ 16 */
17 boolean importFromPreplan(@NotNull PREPAREMASTER preparemasterFirst); 17 boolean importFromPreplan(@NotNull PREPAREMASTER preparemasterFirst);
  18 +
  19 + int updatePremasterArrivedHeadStatus(AdvanceArrive preArrivedWaybillList);
18 } 20 }
  1 +package com.tianbo.analysis.service;
  2 +
  3 +import com.github.pagehelper.PageInfo;
  4 +import com.tianbo.analysis.model.DOMTRANSIT;
  5 +import com.tianbo.analysis.model.LAND_BUSINEESTYPE_LIST_INFO;
  6 +import com.tianbo.analysis.model.MANIFEST_AIR_CHANGE;
  7 +
  8 +public interface MT8204Service {
  9 +
  10 + PageInfo<MANIFEST_AIR_CHANGE> selectList(MANIFEST_AIR_CHANGE record, int pageNum, int pageSize);
  11 +}
@@ -35,17 +35,16 @@ public class ArriveMasterServiceImpl implements ArriveMasterService { @@ -35,17 +35,16 @@ public class ArriveMasterServiceImpl implements ArriveMasterService {
35 SENDLOGMapper sendlogMapper; 35 SENDLOGMapper sendlogMapper;
36 36
37 @Override 37 @Override
38 - public boolean arrivedAhead(CarAndWayBill carAndWayBill) { 38 + public boolean arrivedAhead(AdvanceArrive carAndWayBill) {
39 try { 39 try {
40 /** 40 /**
41 * 根据运单列表,与预配核碰提前运抵货物。 41 * 根据运单列表,与预配核碰提前运抵货物。
42 */ 42 */
43 - log.info("接收到通知车辆{}拉货数据{}",carAndWayBill.vname,carAndWayBill.getMasterList());  
44 - carAndWayBill.setMasterList(carAndWayBill.getMasterList().replace(",",","));  
45 - carAndWayBill.waybillList = Arrays.asList(carAndWayBill.getMasterList().split(","));  
46 - List<String> waybillList = carAndWayBill.waybillList; 43 + List<LAND_BUSINEESTYPE_LIST_INFO> waybillList = carAndWayBill.getMasterList();
47 if (!waybillList.isEmpty()){ 44 if (!waybillList.isEmpty()){
48 - for (String waybillmaster : waybillList) { 45 + log.info("接收到通知车辆{}拉货数据{}条",carAndWayBill.getVname(),carAndWayBill.getMasterList().size());
  46 + for (LAND_BUSINEESTYPE_LIST_INFO waybillmasterInfo : waybillList) {
  47 + String waybillmaster = waybillmasterInfo.getAwba();
49 log.info("开始核对运单{}",waybillmaster); 48 log.info("开始核对运单{}",waybillmaster);
50 /** 49 /**
51 * 校验运单格式,要为172-66666666,中间有减号的才行 50 * 校验运单格式,要为172-66666666,中间有减号的才行
@@ -68,12 +67,12 @@ public class ArriveMasterServiceImpl implements ArriveMasterService { @@ -68,12 +67,12 @@ public class ArriveMasterServiceImpl implements ArriveMasterService {
68 if (!preparemasterList.isEmpty()) { 67 if (!preparemasterList.isEmpty()) {
69 PREPAREMASTER preparemasterFirst = preparemasterList.get(0); 68 PREPAREMASTER preparemasterFirst = preparemasterList.get(0);
70 log.info("查到提前运抵运单:{}", preparemasterFirst.getWaybillnomaster()); 69 log.info("查到提前运抵运单:{}", preparemasterFirst.getWaybillnomaster());
71 - return importFromPreplan(preparemasterFirst); 70 + importFromPreplan(preparemasterFirst);
72 }else { 71 }else {
73 log.info("运单{}不属于提前运抵运单", waybillmaster); 72 log.info("运单{}不属于提前运抵运单", waybillmaster);
74 - return false;  
75 } 73 }
76 } 74 }
  75 + return true;
77 } 76 }
78 return false; 77 return false;
79 } catch (Exception e) { 78 } catch (Exception e) {
@@ -201,4 +200,33 @@ public class ArriveMasterServiceImpl implements ArriveMasterService { @@ -201,4 +200,33 @@ public class ArriveMasterServiceImpl implements ArriveMasterService {
201 200
202 return true; 201 return true;
203 } 202 }
  203 +
  204 + @Override
  205 + public int updatePremasterArrivedHeadStatus(AdvanceArrive preArrivedWaybillList) {
  206 + log.info("接收到来自卡口申请的拉货列表通知");
  207 + if (!preArrivedWaybillList.getMasterList().isEmpty()){
  208 + int m = 0;
  209 + for (LAND_BUSINEESTYPE_LIST_INFO waybillnomaster: preArrivedWaybillList.getMasterList() ) {
  210 + String waybillNo = waybillnomaster.getAwba();
  211 + log.info("开始处理列表中的运单号:[{}]",waybillNo);
  212 + if ("1".equals(waybillnomaster.getArrivedaheadtime())){
  213 + log.info("运单号{}识别为提前运抵业务,即将增加数据标识",waybillNo);
  214 + PREPAREMASTER preparemaster = new PREPAREMASTER();
  215 + preparemaster.setWaybillnomaster(waybillNo);
  216 + preparemaster.setArrivedAhead("Y");
  217 + int i = preparemasterMapper.updatePreArrivedBill(preparemaster);
  218 + if (i > 0) {
  219 + log.info("运单号{}的预配提前运抵标识增加成功", waybillNo);
  220 + } else {
  221 + log.info("ERROR :未找到相关预配信息, 运单号{}的预配提前运抵标识增加失败!!!", waybillNo);
  222 + }
  223 + m =+ i;
  224 + }
  225 +
  226 + }
  227 +
  228 + return m;
  229 + }
  230 + return 0;
  231 + }
204 } 232 }
  1 +package com.tianbo.analysis.service.imp;
  2 +
  3 +import com.github.pagehelper.Page;
  4 +import com.github.pagehelper.PageHelper;
  5 +import com.github.pagehelper.PageInfo;
  6 +import com.tianbo.analysis.dao.MANIFEST_AIR_CHANGEMapper;
  7 +import com.tianbo.analysis.model.MANIFEST_AIR_CHANGE;
  8 +import com.tianbo.analysis.service.MT8204Service;
  9 +import org.springframework.stereotype.Service;
  10 +
  11 +import javax.annotation.Resource;
  12 +import java.util.List;
  13 +
  14 +@Service
  15 +public class MT8204ServiceImp implements MT8204Service {
  16 +
  17 + @Resource
  18 + MANIFEST_AIR_CHANGEMapper manifest_air_changeMapper;
  19 +
  20 + public PageInfo<MANIFEST_AIR_CHANGE> selectList(MANIFEST_AIR_CHANGE record, int pageNum, int pageSize){
  21 +
  22 + Page<MANIFEST_AIR_CHANGE> page = PageHelper.startPage(pageNum,pageSize);
  23 + List<MANIFEST_AIR_CHANGE> list = manifest_air_changeMapper.selectList(record);
  24 + PageInfo<MANIFEST_AIR_CHANGE> result = new PageInfo<MANIFEST_AIR_CHANGE>(list);
  25 + return result;
  26 + }
  27 +
  28 +}
@@ -47,6 +47,6 @@ @@ -47,6 +47,6 @@
47 <property name="enableSubPackages" value="false"/> 47 <property name="enableSubPackages" value="false"/>
48 </javaClientGenerator> 48 </javaClientGenerator>
49 <!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名--> 49 <!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名-->
50 - <table schema="CGONMS" tableName="SENDLOG" domainObjectName="SENDLOG" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table> 50 + <table schema="CGONMS" tableName="MANIFEST_AIR_CHANGE" domainObjectName="MANIFEST_AIR_CHANGE" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
51 </context> 51 </context>
52 </generatorConfiguration> 52 </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.MANIFEST_AIR_CHANGEMapper" >
  4 + <resultMap id="BaseResultMap" type="com.tianbo.analysis.model.MANIFEST_AIR_CHANGE" >
  5 + <id column="AUTOID" property="autoid" jdbcType="VARCHAR" />
  6 + <result column="FLIGHTNO" property="flightno" jdbcType="VARCHAR" />
  7 + <result column="CHANGE_FLIGHTNO" property="changeFlightno" jdbcType="VARCHAR" />
  8 + <result column="WAYBILLNOMASTER" property="waybillnomaster" jdbcType="VARCHAR" />
  9 + <result column="CHANGE_WAYBILLNOMASTER" property="changeWaybillnomaster" jdbcType="VARCHAR" />
  10 + <result column="CONT" property="cont" jdbcType="VARCHAR" />
  11 + <result column="CREATEDATE" property="createdate" jdbcType="TIMESTAMP" />
  12 + <result column="CHANGETIME" property="changetime" jdbcType="TIMESTAMP" />
  13 + <result column="CARRIER" property="carrier" jdbcType="VARCHAR" />
  14 + <result column="CHANGE_CARRIER" property="changeCarrier" jdbcType="VARCHAR" />
  15 + <result column="FLIGHT_DATE" property="flightDate" jdbcType="TIMESTAMP" />
  16 + <result column="CHANGE_FLIGHT_DATE" property="changeFlightDate" jdbcType="TIMESTAMP" />
  17 + </resultMap>
  18 + <sql id="Base_Column_List" >
  19 + AUTOID, FLIGHTNO, CHANGE_FLIGHTNO, WAYBILLNOMASTER, CHANGE_WAYBILLNOMASTER, CONT,
  20 + CREATEDATE, CHANGETIME, CARRIER, CHANGE_CARRIER, FLIGHT_DATE, CHANGE_FLIGHT_DATE
  21 + </sql>
  22 + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  23 + select
  24 + <include refid="Base_Column_List" />
  25 + from CGONMS.MANIFEST_AIR_CHANGE
  26 + where AUTOID = #{autoid,jdbcType=VARCHAR}
  27 + </select>
  28 + <select id="selectList" resultMap="BaseResultMap" parameterType="com.tianbo.analysis.model.MANIFEST_AIR_CHANGE" >
  29 + select
  30 + <include refid="Base_Column_List" />
  31 + from CGONMS.MANIFEST_AIR_CHANGE
  32 + <where>
  33 + <if test="flightno != null and flightno != ''">
  34 + FLIGHTNO = #{flightno,jdbcType=VARCHAR}
  35 + </if>
  36 + <if test="flightDate != null and flightDate != ''">
  37 + AND FLIGHT_DATE = #{flightDate,jdbcType=DATE}
  38 + </if>
  39 + <if test="waybillnomaster != null and waybillnomaster != ''">
  40 + AND WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
  41 + </if>
  42 + </where>
  43 + </select>
  44 + <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  45 + delete from CGONMS.MANIFEST_AIR_CHANGE
  46 + where AUTOID = #{autoid,jdbcType=VARCHAR}
  47 + </delete>
  48 + <insert id="insert" parameterType="com.tianbo.analysis.model.MANIFEST_AIR_CHANGE" >
  49 + insert into CGONMS.MANIFEST_AIR_CHANGE (AUTOID, FLIGHTNO, CHANGE_FLIGHTNO,
  50 + WAYBILLNOMASTER, CHANGE_WAYBILLNOMASTER,
  51 + CONT, CREATEDATE, CHANGETIME,
  52 + CARRIER, CHANGE_CARRIER, FLIGHT_DATE,
  53 + CHANGE_FLIGHT_DATE)
  54 + values (#{autoid,jdbcType=VARCHAR}, #{flightno,jdbcType=VARCHAR}, #{changeFlightno,jdbcType=VARCHAR},
  55 + #{waybillnomaster,jdbcType=VARCHAR}, #{changeWaybillnomaster,jdbcType=VARCHAR},
  56 + #{cont,jdbcType=VARCHAR}, #{createdate,jdbcType=TIMESTAMP}, #{changetime,jdbcType=TIMESTAMP},
  57 + #{carrier,jdbcType=VARCHAR}, #{changeCarrier,jdbcType=VARCHAR}, #{flightDate,jdbcType=TIMESTAMP},
  58 + #{changeFlightDate,jdbcType=TIMESTAMP})
  59 + </insert>
  60 + <insert id="insertSelective" parameterType="com.tianbo.analysis.model.MANIFEST_AIR_CHANGE" >
  61 + insert into CGONMS.MANIFEST_AIR_CHANGE
  62 + <trim prefix="(" suffix=")" suffixOverrides="," >
  63 + <if test="autoid != null" >
  64 + AUTOID,
  65 + </if>
  66 + <if test="flightno != null" >
  67 + FLIGHTNO,
  68 + </if>
  69 + <if test="changeFlightno != null" >
  70 + CHANGE_FLIGHTNO,
  71 + </if>
  72 + <if test="waybillnomaster != null" >
  73 + WAYBILLNOMASTER,
  74 + </if>
  75 + <if test="changeWaybillnomaster != null" >
  76 + CHANGE_WAYBILLNOMASTER,
  77 + </if>
  78 + <if test="cont != null" >
  79 + CONT,
  80 + </if>
  81 + <if test="createdate != null" >
  82 + CREATEDATE,
  83 + </if>
  84 + <if test="changetime != null" >
  85 + CHANGETIME,
  86 + </if>
  87 + <if test="carrier != null" >
  88 + CARRIER,
  89 + </if>
  90 + <if test="changeCarrier != null" >
  91 + CHANGE_CARRIER,
  92 + </if>
  93 + <if test="flightDate != null" >
  94 + FLIGHT_DATE,
  95 + </if>
  96 + <if test="changeFlightDate != null" >
  97 + CHANGE_FLIGHT_DATE,
  98 + </if>
  99 + </trim>
  100 + <trim prefix="values (" suffix=")" suffixOverrides="," >
  101 + <if test="autoid != null" >
  102 + #{autoid,jdbcType=VARCHAR},
  103 + </if>
  104 + <if test="flightno != null" >
  105 + #{flightno,jdbcType=VARCHAR},
  106 + </if>
  107 + <if test="changeFlightno != null" >
  108 + #{changeFlightno,jdbcType=VARCHAR},
  109 + </if>
  110 + <if test="waybillnomaster != null" >
  111 + #{waybillnomaster,jdbcType=VARCHAR},
  112 + </if>
  113 + <if test="changeWaybillnomaster != null" >
  114 + #{changeWaybillnomaster,jdbcType=VARCHAR},
  115 + </if>
  116 + <if test="cont != null" >
  117 + #{cont,jdbcType=VARCHAR},
  118 + </if>
  119 + <if test="createdate != null" >
  120 + #{createdate,jdbcType=TIMESTAMP},
  121 + </if>
  122 + <if test="changetime != null" >
  123 + #{changetime,jdbcType=TIMESTAMP},
  124 + </if>
  125 + <if test="carrier != null" >
  126 + #{carrier,jdbcType=VARCHAR},
  127 + </if>
  128 + <if test="changeCarrier != null" >
  129 + #{changeCarrier,jdbcType=VARCHAR},
  130 + </if>
  131 + <if test="flightDate != null" >
  132 + #{flightDate,jdbcType=DATE},
  133 + </if>
  134 + <if test="changeFlightDate != null" >
  135 + #{changeFlightDate,jdbcType=DATE},
  136 + </if>
  137 + </trim>
  138 + </insert>
  139 + <update id="updateByPrimaryKeySelective" parameterType="com.tianbo.analysis.model.MANIFEST_AIR_CHANGE" >
  140 + update CGONMS.MANIFEST_AIR_CHANGE
  141 + <set >
  142 + <if test="flightno != null" >
  143 + FLIGHTNO = #{flightno,jdbcType=VARCHAR},
  144 + </if>
  145 + <if test="changeFlightno != null" >
  146 + CHANGE_FLIGHTNO = #{changeFlightno,jdbcType=VARCHAR},
  147 + </if>
  148 + <if test="waybillnomaster != null" >
  149 + WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR},
  150 + </if>
  151 + <if test="changeWaybillnomaster != null" >
  152 + CHANGE_WAYBILLNOMASTER = #{changeWaybillnomaster,jdbcType=VARCHAR},
  153 + </if>
  154 + <if test="cont != null" >
  155 + CONT = #{cont,jdbcType=VARCHAR},
  156 + </if>
  157 + <if test="createdate != null" >
  158 + CREATEDATE = #{createdate,jdbcType=TIMESTAMP},
  159 + </if>
  160 + <if test="changetime != null" >
  161 + CHANGETIME = #{changetime,jdbcType=TIMESTAMP},
  162 + </if>
  163 + <if test="carrier != null" >
  164 + CARRIER = #{carrier,jdbcType=VARCHAR},
  165 + </if>
  166 + <if test="changeCarrier != null" >
  167 + CHANGE_CARRIER = #{changeCarrier,jdbcType=VARCHAR},
  168 + </if>
  169 + <if test="flightDate != null" >
  170 + FLIGHT_DATE = #{flightDate,jdbcType=TIMESTAMP},
  171 + </if>
  172 + <if test="changeFlightDate != null" >
  173 + CHANGE_FLIGHT_DATE = #{changeFlightDate,jdbcType=TIMESTAMP},
  174 + </if>
  175 + </set>
  176 + where AUTOID = #{autoid,jdbcType=VARCHAR}
  177 + </update>
  178 + <update id="updateByPrimaryKey" parameterType="com.tianbo.analysis.model.MANIFEST_AIR_CHANGE" >
  179 + update CGONMS.MANIFEST_AIR_CHANGE
  180 + set FLIGHTNO = #{flightno,jdbcType=VARCHAR},
  181 + CHANGE_FLIGHTNO = #{changeFlightno,jdbcType=VARCHAR},
  182 + WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR},
  183 + CHANGE_WAYBILLNOMASTER = #{changeWaybillnomaster,jdbcType=VARCHAR},
  184 + CONT = #{cont,jdbcType=VARCHAR},
  185 + CREATEDATE = #{createdate,jdbcType=TIMESTAMP},
  186 + CHANGETIME = #{changetime,jdbcType=TIMESTAMP},
  187 + CARRIER = #{carrier,jdbcType=VARCHAR},
  188 + CHANGE_CARRIER = #{changeCarrier,jdbcType=VARCHAR},
  189 + FLIGHT_DATE = #{flightDate,jdbcType=TIMESTAMP},
  190 + CHANGE_FLIGHT_DATE = #{changeFlightDate,jdbcType=TIMESTAMP}
  191 + where AUTOID = #{autoid,jdbcType=VARCHAR}
  192 + </update>
  193 +</mapper>
@@ -503,4 +503,11 @@ @@ -503,4 +503,11 @@
503 ARRIVED_AHEAD = #{arrivedAhead,jdbcType=VARCHAR} 503 ARRIVED_AHEAD = #{arrivedAhead,jdbcType=VARCHAR}
504 where AUTOID = #{autoid,jdbcType=VARCHAR} 504 where AUTOID = #{autoid,jdbcType=VARCHAR}
505 </update> 505 </update>
  506 +
  507 + <update id="updatePreArrivedBill" parameterType="com.tianbo.analysis.model.PREPAREMASTER">
  508 + update CGONMS.PREPAREMASTER
  509 + set
  510 + ARRIVED_AHEAD = #{arrivedAhead,jdbcType=VARCHAR}
  511 + where WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
  512 + </update>
506 </mapper> 513 </mapper>
  1 +
  2 +import com.tianbo.analysis.NmmsAdminApplication;
  3 +import lombok.extern.slf4j.Slf4j;
  4 +import org.springframework.boot.test.context.SpringBootTest;
  5 +
  6 +@SpringBootTest(classes = NmmsAdminApplication.class)
  7 +@Slf4j
  8 +public class Test {
  9 +
  10 +
  11 + @org.junit.jupiter.api.Test
  12 + public void send(){
  13 +// MSGS msgs = new MSGS();
  14 +// MSG msg = new MSG();
  15 +//
  16 +// HEADER header = new HEADER();
  17 +// header.setSNDR("TXD");
  18 +// header.setDDTM("20210429103322081");
  19 +// header.setSEQNO(2021042910);
  20 +// header.setTYPE("HYXX");
  21 +// header.setSTYPE("ISLI");
  22 +//
  23 +// msg.setHEADER(header);
  24 +// msg.setBODY("111test");
  25 +//
  26 +//
  27 +//
  28 +//
  29 +// msgs.setMSG(msg);
  30 +//
  31 +// ResultJson response = kafkaSendApi.send(msgs);
  32 +// log.info(response.toString());
  33 + }
  34 +}