作者 朱兆平

主单FWB入业务表BUG

... ... @@ -33,7 +33,7 @@ public class LogWebsockController {
webSocketSet.add(this);
addOnlineCount();
try {
process = Runtime.getRuntime().exec("tail -f logs/imf.log");
process = Runtime.getRuntime().exec("tail -f logs/log_warn.log");
inputStream = process.getInputStream();
IO_Log_Handle thread = new IO_Log_Handle(inputStream, session);
thread.start();
... ...
... ... @@ -6,6 +6,7 @@ import com.tianbo.analysis.model.ORIGINMANIFESTMASTER;
import com.tianbo.analysis.service.FFMInfoService;
import com.tianbo.analysis.service.ManifestMasterService;
import com.tianbo.analysis.service.ManifestSecondService;
import com.tianbo.util.Date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
... ... @@ -27,7 +28,7 @@ public class ManifestMasterServiceImp implements ManifestMasterService{
public int insertManifestWithMaster(FFMInfo item){
ORIGINMANIFESTMASTER master = new ORIGINMANIFESTMASTER();
String flightDate = item.getFlightdate().toString();
String flightDate = DateUtil.dateToString(item.getFlightdate());
String flightNo = item.getFlightno();
String weibillMaster = item.getWaybillnomaster();
String weight = item.getManifesttotalweight();
... ... @@ -55,7 +56,7 @@ public class ManifestMasterServiceImp implements ManifestMasterService{
master.setManifesttotalpiece(item.getManifesttotalpiece());
//舱单重量
master.setManifesttotalweight(item.getManifesttotalweight());
master.setCustomsstatus("01");
master.setStatus("01");
master.setCustomscode(item.getCustomscode());
master.setReportorder("");
master.setIslast("");
... ... @@ -73,7 +74,7 @@ public class ManifestMasterServiceImp implements ManifestMasterService{
}else {
//重复数据不操作,直接更新掉临时表数据状态
ffmInfoService.setDealstatusSuccess(item);
log.info("运单号:"+item.getWaybillnomaster()+"数据已存在与业务库不更新,更新此运单舱单临时表业务数据为已处理");
log.info("运单号:"+item.getWaybillnomaster()+"业务库数据已存在与业务库不更新,更新此运单舱单临时表业务数据为已处理");
}
return 0;
}
... ...
... ... @@ -5,6 +5,7 @@ import com.tianbo.analysis.service.FFMInfoService;
import com.tianbo.analysis.service.FWBInfoService;
import com.tianbo.analysis.service.ManifestMasterService;
import com.tianbo.analysis.service.ManifestSecondService;
import com.tianbo.util.Date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -60,10 +61,10 @@ public class FFMInfoHandle {
if (ffmInfoList!=null && !ffmInfoList.isEmpty()){
for (FFMInfo item_f:ffmInfoList) {
String flightDate = item_f.getFlightdate().toString();
String flightDate = DateUtil.dateToString(item_f.getFlightdate());
String flghtNo = item_f.getFlightno();
StringBuilder sb = new StringBuilder();
log.info(sb.append("开始处理航班:").append(flghtNo).append("/").append(flightDate).toString());
log.warn(sb.append("开始处理航班带板箱数据:").append(flghtNo).append("/").append(flightDate).append("\n").toString());
//针对补发报文处理,补发的报文: FFM_INFOB表数据,存储的报文批次01对应标识是LAST
List<FFMInfo> ffmlist_reportorder_1 = ffmInfoHandle.ffmInfoService.getFFMLastReportOrderByPallet(item_f,false);
... ... @@ -77,8 +78,12 @@ public class FFMInfoHandle {
if (ffmlist_reportorder_1 !=null && !ffmlist_reportorder_1.isEmpty()){
for (FFMInfo item:ffmlist_reportorder_1) {
log.info(new StringBuilder("--------------开始入库").append(flghtNo).append("/").append(flightDate).append(":").append(item.getWaybillnomaster()).append("------------").toString());
result = updateFFM2Manifest(item);
log.info(new StringBuilder("开始入库").append(item.getFlightno()).append("/").append(item.getFlightdate()).append(":").append(item.getWaybillnomaster()).toString());
log.info("-----------入库结束--------------结果:"+result);
}
}
/**
... ... @@ -100,8 +105,14 @@ public class FFMInfoHandle {
if (ffmlist != null && ffmlist.size() > 0){
for (FFMInfo item:ffmlist) {
log.info(new StringBuilder("开始入库").append(flghtNo).append("/").append(flightDate).append(":").append(item.getWaybillnomaster()).toString());
result = updateFFM2Manifest(item);
log.info(new StringBuilder("开始入库").append(item.getFlightno()).append("/").append(item.getFlightdate()).append(":").append(item.getWaybillnomaster()).toString());
log.info("------------入库结束-------------结果:"+result);
}
}
... ... @@ -110,6 +121,9 @@ public class FFMInfoHandle {
}
}
}
//空板箱舱单入库:
// dealFFMInfoWithNullPallet();
}catch (Exception e){
e.printStackTrace();
}
... ... @@ -130,19 +144,19 @@ public class FFMInfoHandle {
* 业务库存在此航班的运单数据则不会插入,并更新ffminfo临时表的此舱单的数据状态为已处理 返回 0
* @return 0 or 1
*/
String fwb = item.getWaybillnomaster();
Flag = ffmInfoHandle.manifestMasterService.insertManifestWithMaster(item);
log.info(new StringBuilder("运单号:").append(item.getWaybillnomaster()).append("入库数量为:").append(Flag).toString());
log.info(new StringBuilder("运单号:").append(fwb).append("->入库:").append(Flag).toString());
if (Flag > 0) {
//业务数据入库成功后,更新舱单待处理表的数据状态为 1,根据航班号+航班日期+主单号
int ffm_i = ffmInfoHandle.ffmInfoService.setDealstatusSuccess(item);
log.info(new StringBuilder("更新运单:").append(item.getWaybillnomaster()).append("舱单临时表状态为:").append("已处理:").append(ffm_i).toString());
log.info(new StringBuilder("更新运单:").append("舱单临时表状态为已处理:").append(ffm_i).toString());
//舱单报文入库后, 更新FWB信息,将FWB临时表的信息更新到 舱单业务表
int fwb_i=ffmInfoHandle.fwbInfoService.updateFwbToManifest(item.getWaybillnomaster());
log.info(new StringBuilder("更新运单:").append(item.getWaybillnomaster()).append("运单FWB数据到业务库:").append(fwb_i).toString());
log.info(new StringBuilder("更新运单:").append("运单FWB数据到业务库:").append(fwb_i).toString());
//分单挂主单
int fhl_i = ffmInfoHandle.secondService.setManifestMaster(item);
... ... @@ -167,6 +181,11 @@ public class FFMInfoHandle {
// CustomsCargoSystem.Helper.Log.ffminfo_log("舱单数据入业务库调试信息", "舱单数据入业务库调试信息(板号空).txt",
//string.Format(@"{0}入业务库开始航班号:{1},航班日期:{2}" + Environment.NewLine, DateTime.Now, item_f.flightno, item_f.flightdate));
//针对补发报文处理
String flightDate = DateUtil.dateToString(item_f.getFlightdate());
String flghtNo = item_f.getFlightno();
StringBuilder sb = new StringBuilder();
log.warn(sb.append("开始处理航班空板箱:").append(flghtNo).append("/").append(flightDate).append("\n").toString());
List<FFMInfo> ffmlist_reportorder_1 = ffmInfoHandle.ffmInfoService.getFFMLastReportOrderByPallet(item_f,true);
/**
... ... @@ -175,7 +194,9 @@ public class FFMInfoHandle {
*/
if (ffmlist_reportorder_1 !=null && !ffmlist_reportorder_1.isEmpty()){
for (FFMInfo item:ffmlist_reportorder_1) {
log.info(new StringBuilder("开始入库").append(flghtNo).append("/").append(flightDate).append(":").append(item.getWaybillnomaster()).toString());
result = updateFFM2Manifest(item);
log.info("------------入库结束-------------结果:"+result);
}
}
/**
... ... @@ -198,7 +219,10 @@ public class FFMInfoHandle {
if (ffmlist != null && ffmlist.size() > 0){
for (FFMInfo item:ffmlist) {
log.info(new StringBuilder("开始入库").append(flghtNo).append("/").append(flightDate).append(":").append(item.getWaybillnomaster()).toString());
result = updateFFM2Manifest(item);
log.info("------------入库结束-------------结果:"+result);
}
}
... ...