|
@@ -2,9 +2,7 @@ package com.tianbo.analysis.service.imp; |
|
@@ -2,9 +2,7 @@ package com.tianbo.analysis.service.imp; |
2
|
|
2
|
|
3
|
import com.tianbo.analysis.dao.ARRIVEDMASTERMapper;
|
3
|
import com.tianbo.analysis.dao.ARRIVEDMASTERMapper;
|
4
|
import com.tianbo.analysis.dao.ARRIVEDSECONDARYMapper;
|
4
|
import com.tianbo.analysis.dao.ARRIVEDSECONDARYMapper;
|
5
|
-import com.tianbo.analysis.model.ARRIVEDMASTER;
|
|
|
6
|
-import com.tianbo.analysis.model.ARRIVEDSECONDARY;
|
|
|
7
|
-import com.tianbo.analysis.model.CustomReception;
|
5
|
+import com.tianbo.analysis.model.*;
|
8
|
import com.tianbo.analysis.service.ARRIVEDMASTERService;
|
6
|
import com.tianbo.analysis.service.ARRIVEDMASTERService;
|
9
|
import com.tianbo.analysis.service.NmmsBaseService;
|
7
|
import com.tianbo.analysis.service.NmmsBaseService;
|
10
|
import com.tianbo.analysis.tools.AWBTools;
|
8
|
import com.tianbo.analysis.tools.AWBTools;
|
|
@@ -37,34 +35,63 @@ public class ARRIVEDMASTERServiceImp extends NmmsBaseService implements ARRIVEDM |
|
@@ -37,34 +35,63 @@ public class ARRIVEDMASTERServiceImp extends NmmsBaseService implements ARRIVEDM |
37
|
// 货物接收运抵主分单
|
35
|
// 货物接收运抵主分单
|
38
|
public int insertRecept(CustomReception customReception) {
|
36
|
public int insertRecept(CustomReception customReception) {
|
39
|
|
37
|
|
40
|
- if (!StringUtils.isEmpty(flightDateStr)) {
|
|
|
41
|
- Date flightDate = DateUtil.formatByyyyyMMdd(flightDateStr);
|
38
|
+ return super.insertRecept(customReception);
|
|
|
39
|
+
|
|
|
40
|
+ }
|
42
|
|
41
|
|
43
|
- // 设置 接收运抵分单 回执
|
|
|
44
|
- ARRIVEDSECONDARY arrivedsecondary = new ARRIVEDSECONDARY();
|
|
|
45
|
- arrivedsecondary.setReceiption(reception);
|
|
|
46
|
|
42
|
|
|
|
43
|
+ /**
|
|
|
44
|
+ * 入库主单回执信息
|
|
|
45
|
+ * @return 成功返回1,失败返回0。
|
|
|
46
|
+ */
|
|
|
47
|
+ @Override
|
|
|
48
|
+ public int master(){
|
47
|
//设置主单回执、航班号、航班日期
|
49
|
//设置主单回执、航班号、航班日期
|
48
|
ARRIVEDMASTER arrivedmaster = new ARRIVEDMASTER();
|
50
|
ARRIVEDMASTER arrivedmaster = new ARRIVEDMASTER();
|
49
|
arrivedmaster.setReceiptinformation(reception);
|
51
|
arrivedmaster.setReceiptinformation(reception);
|
|
|
52
|
+ arrivedmaster.setWaybillnomaster(awbA);
|
50
|
//拆分航班号和承运人
|
53
|
//拆分航班号和承运人
|
51
|
String[] flightInfo = AWBTools.splitFlight(customReception.getFlightNo());
|
54
|
String[] flightInfo = AWBTools.splitFlight(customReception.getFlightNo());
|
52
|
arrivedmaster.setFlightno(flightInfo[1]);
|
55
|
arrivedmaster.setFlightno(flightInfo[1]);
|
53
|
arrivedmaster.setCarrier(flightInfo[0]);
|
56
|
arrivedmaster.setCarrier(flightInfo[0]);
|
54
|
arrivedmaster.setFlightDate(flightDate);
|
57
|
arrivedmaster.setFlightDate(flightDate);
|
|
|
58
|
+ //更新主单回执
|
|
|
59
|
+ int i = arrivedmasterMapper.updateRECEIPTION(arrivedmaster);
|
|
|
60
|
+ //获取分单autoid
|
|
|
61
|
+ List<ARRIVEDMASTER> arrivedmasterList = arrivedmasterMapper.selectAutoIdByAwb(arrivedmaster);
|
|
|
62
|
+ if(!arrivedmasterList.isEmpty()){
|
|
|
63
|
+ ARRIVEDMASTER originMaster = arrivedmasterList.get(0);
|
|
|
64
|
+ String autoId = originMaster.getAutoid();
|
|
|
65
|
+
|
|
|
66
|
+ //插入sendlog记录表
|
|
|
67
|
+ log.info("即将插入日志运单号为:"+awbA+"->autoid="+autoId);
|
|
|
68
|
+ int ii =coustomAnalysisServiceImp.insertSendlog("MT3201",reception,autoId);
|
55
|
|
69
|
|
56
|
- // 判断航班号 航班日期 是否为空
|
|
|
57
|
- if (flightDate != null && customReception.getFlightNo() != null){
|
|
|
58
|
- //处理主单格式,将海关回执的主单号58019316861,变为580-19316861
|
|
|
59
|
- awbA = AWBTools.awbFormat(awbA);
|
70
|
+ int iii = shareServiceImp.updateMessages(customReception);
|
60
|
|
71
|
|
61
|
- //设置主分单的 主单号
|
|
|
62
|
- arrivedsecondary.setWaybillnomaster(awbA);
|
|
|
63
|
- arrivedmaster.setWaybillnomaster(awbA);
|
72
|
+ if (i>0 && ii>0){
|
|
|
73
|
+ log.info("运单号 {} 理货回执更新成功",awbA);
|
|
|
74
|
+ return 1;
|
|
|
75
|
+ }
|
|
|
76
|
+ if ( iii > 0){
|
|
|
77
|
+ return 1;
|
|
|
78
|
+ }
|
64
|
|
79
|
|
|
|
80
|
+ }
|
|
|
81
|
+ return 0;
|
|
|
82
|
+ }
|
65
|
|
83
|
|
66
|
- //有分单号 更新分单回执
|
|
|
67
|
- if(awbA!=null && !awbA.isEmpty() && awbH!=null && !awbH.isEmpty()){
|
84
|
+ /**
|
|
|
85
|
+ * 入库分单回执信息
|
|
|
86
|
+ * @return 成功返回1,失败返回0。
|
|
|
87
|
+ */
|
|
|
88
|
+ @Override
|
|
|
89
|
+ public int second(){
|
|
|
90
|
+ // 设置 接收运抵分单 回执
|
|
|
91
|
+ ARRIVEDSECONDARY arrivedsecondary = new ARRIVEDSECONDARY();
|
|
|
92
|
+ arrivedsecondary.setReceiption(reception);
|
|
|
93
|
+ //设置主分单的 主单号
|
|
|
94
|
+ arrivedsecondary.setWaybillnomaster(awbA);
|
68
|
//取分单号
|
95
|
//取分单号
|
69
|
String[] awbhArr = awbH.split("_");
|
96
|
String[] awbhArr = awbH.split("_");
|
70
|
String awbh = awbhArr[1];
|
97
|
String awbh = awbhArr[1];
|
|
@@ -82,6 +109,7 @@ public class ARRIVEDMASTERServiceImp extends NmmsBaseService implements ARRIVEDM |
|
@@ -82,6 +109,7 @@ public class ARRIVEDMASTERServiceImp extends NmmsBaseService implements ARRIVEDM |
82
|
|
109
|
|
83
|
int iii = shareServiceImp.updateMessages(customReception);
|
110
|
int iii = shareServiceImp.updateMessages(customReception);
|
84
|
if (i>0 && ii>0 ){
|
111
|
if (i>0 && ii>0 ){
|
|
|
112
|
+ log.info("运单号 {} 理货回执更新成功",awbA);
|
85
|
return 1;
|
113
|
return 1;
|
86
|
}
|
114
|
}
|
87
|
if ( iii > 0){
|
115
|
if ( iii > 0){
|
|
@@ -91,41 +119,4 @@ public class ARRIVEDMASTERServiceImp extends NmmsBaseService implements ARRIVEDM |
|
@@ -91,41 +119,4 @@ public class ARRIVEDMASTERServiceImp extends NmmsBaseService implements ARRIVEDM |
91
|
return 0;
|
119
|
return 0;
|
92
|
}
|
120
|
}
|
93
|
|
121
|
|
94
|
-
|
|
|
95
|
- if (awbA!=null && awbA.length()>0){
|
|
|
96
|
- //更新主单回执
|
|
|
97
|
- int i = arrivedmasterMapper.updateRECEIPTION(arrivedmaster);
|
|
|
98
|
- //获取分单autoid
|
|
|
99
|
- List<ARRIVEDMASTER> arrivedmasterList = arrivedmasterMapper.selectAutoIdByAwb(arrivedmaster);
|
|
|
100
|
- if(!arrivedmasterList.isEmpty()){
|
|
|
101
|
- ARRIVEDMASTER originMaster = arrivedmasterList.get(0);
|
|
|
102
|
- String autoId = originMaster.getAutoid();
|
|
|
103
|
-
|
|
|
104
|
- //插入sendlog记录表
|
|
|
105
|
- log.info("即将插入日志运单号为:"+awbA+"->autoid="+autoId);
|
|
|
106
|
- int ii =coustomAnalysisServiceImp.insertSendlog("MT3201",reception,autoId);
|
|
|
107
|
-
|
|
|
108
|
- int iii = shareServiceImp.updateMessages(customReception);
|
|
|
109
|
-
|
|
|
110
|
- if (i>0 && ii>0){
|
|
|
111
|
- return 1;
|
|
|
112
|
- }
|
|
|
113
|
- if ( iii > 0){
|
|
|
114
|
- return 1;
|
|
|
115
|
- }
|
|
|
116
|
-
|
|
|
117
|
- }
|
|
|
118
|
- return 0;
|
|
|
119
|
- }
|
|
|
120
|
- }else {
|
|
|
121
|
- //从发送日志表查找发送MESSAGEID进行二次入库
|
|
|
122
|
- return shareServiceImp.share("MT3201", customReception);
|
|
|
123
|
- }
|
|
|
124
|
- }
|
|
|
125
|
-
|
|
|
126
|
- //未进入主分单解析 返回0 失败
|
|
|
127
|
- return 0;
|
|
|
128
|
- }
|
|
|
129
|
-
|
|
|
130
|
-
|
|
|
131
|
} |
122
|
} |