INPORTALLOCATEServiceImp.java
2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package com.tianbo.analysis.service.imp;
import com.tianbo.analysis.dao.INPORTALLOCATEMapper;
import com.tianbo.analysis.model.INPORTALLOCATE;
import com.tianbo.analysis.service.INPORTALLOCATEService;
import com.tianbo.analysis.model.NmmsBase;
import com.tianbo.analysis.tools.AWBTools;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Auther: shenhl
* @Date: 2019/8/28 11:21
*/
@Service
@Slf4j
@Async
public class INPORTALLOCATEServiceImp extends NmmsBase implements INPORTALLOCATEService{
@Autowired
INPORTALLOCATEMapper inportallocateMapper;
@Override
public int master() {
INPORTALLOCATE inportallocate = new INPORTALLOCATE();
inportallocate.setReceiptinformation(reception);
String[] flightInfo = AWBTools.splitFlight(customReception.getFlightNo());
inportallocate.setFlightno(flightInfo[1]);
inportallocate.setCarrier(flightInfo[0]);
inportallocate.setFlightdate(flightDate);
//设置主分单的 主单号
inportallocate.setWaybillno(awbA);
inportallocate.setStatus(nmsStatusCode);
//更新主单回执
int i = inportallocateMapper.updateRECEIPTION(inportallocate);
//获取分单autoid
List<INPORTALLOCATE> arrivedmasterList = inportallocateMapper.selectAutoIdByAwb(inportallocate);
if(!arrivedmasterList.isEmpty()){
INPORTALLOCATE departuresloading1 = arrivedmasterList.get(0);
String autoId = departuresloading1.getId();
//插入sendlog记录表
log.info("即将插入日志运单号为:"+awbA+"->autoid="+autoId);
int ii =coustomAnalysisServiceImp.insertSendlog("MT6202",reception,autoId);
int iii = shareServiceImp.updateMessages(customReception);
if (i>0 && ii>0 ){
log.info("运单号 {} 分拨申请回执更新成功",awbA);
return 1;
}
if (iii > 0){
return 1;
}
}
return 0;
}
}