作者 朱兆平

处理带板箱的舱单入库

package com.tianbo.analysis.dao;
import com.tianbo.analysis.model.FFMInfo;
import java.util.List;
public interface FFMInfoMapper {
int insert(FFMInfo record);
int insertSelective(FFMInfo record);
/**
* 板号为空的航班数据
* @return
*/
List<FFMInfo> getDistinctFlightWithPalletNull();
/**
* 板号非空的航班数据
* @return
*/
List<FFMInfo> getDistinctFlightWithPallet();
/**
* 根据航班号 航班日期 确定报文最大的LAST序号
* @param record 带有航班号航班日期的FFMinfo
* @return 未处理的空板箱(散装货)的ffminfo
*/
List<FFMInfo> getLastReportOrderByNullPallet(FFMInfo record);
/**
* 根据航班号 航班日期 确定报文最大的LAST序号
* @param record 带有航班号航班日期的FFMinfo
* @return 未处理的带板箱的ffminfo
*/
List<FFMInfo> getLastReportOrderByPallet(FFMInfo record);
/**
* 针对补发报文处理,补发的报文: FFM_INFO表数据,存储的报文批次01对应标识是LAST
* @param record
* @return
*/
List<FFMInfo> getFFMLastReportOrderByNullPallet(FFMInfo record);
/**
* 针对补发报文处理,补发的报文: FFM_INFO表数据,存储的报文批次01对应标识是LAST
* @param record
* @return
*/
List<FFMInfo> getFFMLastReportOrderByPallet(FFMInfo record);
List<FFMInfo> lastCountByNullPallet(FFMInfo record);
List<FFMInfo> lastCountByPallet(FFMInfo record);
List<FFMInfo> getFFMinfoByNullpallet(FFMInfo record);
List<FFMInfo> getFFMinfoBypallet(FFMInfo record);
int updateSelective(FFMInfo record);
}
\ No newline at end of file
... ...
package com.tianbo.analysis.dao;
import com.tianbo.analysis.model.FWBINFO;
import java.util.List;
public interface FWBINFOMapper {
int insert(FWBINFO record);
int insertSelective(FWBINFO record);
List<FWBINFO> queryFwbInfo(String waybillnomaster);
}
\ No newline at end of file
... ...
package com.tianbo.analysis.dao;
import com.tianbo.analysis.model.FWBINFO;
import com.tianbo.analysis.model.ORIGINMANIFESTMASTER;
import java.util.List;
... ... @@ -11,5 +12,11 @@ public interface ORIGINMANIFESTMASTERMapper {
int updateRECEIPTION(ORIGINMANIFESTMASTER record);
int updateFWBByFWBInfoAndStatus(FWBINFO record);
int updateSelective(ORIGINMANIFESTMASTER record);
List<ORIGINMANIFESTMASTER> selectAutoIdByAwb(ORIGINMANIFESTMASTER record);
List<ORIGINMANIFESTMASTER> queryMasterInfo(ORIGINMANIFESTMASTER record);
}
\ No newline at end of file
... ...
... ... @@ -11,5 +11,9 @@ public interface OriginmanifestsecondaryMapper {
int updateRECEIPTION(Originmanifestsecondary record);
int updateMasterAutoId(Originmanifestsecondary record);
List<Originmanifestsecondary> selectAutoIdByawbAawbH (Originmanifestsecondary record);
List<Originmanifestsecondary> selectByFWb(String waybillnomaster);
}
\ No newline at end of file
... ...
package com.tianbo.analysis.model;
import java.util.Date;
public class FFMInfo {
private String autoid;
private Date createdate;
private String flightno;
private Date flightdate;
private String waybillnomaster;
private String originatingstation;
private String destinationstation;
private String manifesttotalpiece;
private String manifesttotalweight;
private String productname;
private String specialgoodscode;
private String customscode;
private String customsstatus;
private String isbatch;
private String pallet;
private String reportorder;
private String islast;
private String originatingstationBill;
private String destinationstationBill;
private String totalpiece;
private String dealstatus;
public String getAutoid() {
return autoid;
}
public void setAutoid(String autoid) {
this.autoid = autoid == null ? null : autoid.trim();
}
public Date getCreatedate() {
return createdate;
}
public void setCreatedate(Date createdate) {
this.createdate = createdate;
}
public String getFlightno() {
return flightno;
}
public void setFlightno(String flightno) {
this.flightno = flightno == null ? null : flightno.trim();
}
public Date getFlightdate() {
return flightdate;
}
public void setFlightdate(Date flightdate) {
this.flightdate = flightdate;
}
public String getWaybillnomaster() {
return waybillnomaster;
}
public void setWaybillnomaster(String waybillnomaster) {
this.waybillnomaster = waybillnomaster == null ? null : waybillnomaster.trim();
}
public String getOriginatingstation() {
return originatingstation;
}
public void setOriginatingstation(String originatingstation) {
this.originatingstation = originatingstation == null ? null : originatingstation.trim();
}
public String getDestinationstation() {
return destinationstation;
}
public void setDestinationstation(String destinationstation) {
this.destinationstation = destinationstation == null ? null : destinationstation.trim();
}
public String getManifesttotalpiece() {
return manifesttotalpiece;
}
public void setManifesttotalpiece(String manifesttotalpiece) {
this.manifesttotalpiece = manifesttotalpiece == null ? null : manifesttotalpiece.trim();
}
public String getManifesttotalweight() {
return manifesttotalweight;
}
public void setManifesttotalweight(String manifesttotalweight) {
this.manifesttotalweight = manifesttotalweight == null ? null : manifesttotalweight.trim();
}
public String getProductname() {
return productname;
}
public void setProductname(String productname) {
this.productname = productname == null ? null : productname.trim();
}
public String getSpecialgoodscode() {
return specialgoodscode;
}
public void setSpecialgoodscode(String specialgoodscode) {
this.specialgoodscode = specialgoodscode == null ? null : specialgoodscode.trim();
}
public String getCustomscode() {
return customscode;
}
public void setCustomscode(String customscode) {
this.customscode = customscode == null ? null : customscode.trim();
}
public String getCustomsstatus() {
return customsstatus;
}
public void setCustomsstatus(String customsstatus) {
this.customsstatus = customsstatus == null ? null : customsstatus.trim();
}
public String getIsbatch() {
return isbatch;
}
public void setIsbatch(String isbatch) {
this.isbatch = isbatch == null ? null : isbatch.trim();
}
public String getPallet() {
return pallet;
}
public void setPallet(String pallet) {
this.pallet = pallet == null ? null : pallet.trim();
}
public String getReportorder() {
return reportorder;
}
public void setReportorder(String reportorder) {
this.reportorder = reportorder == null ? null : reportorder.trim();
}
public String getIslast() {
return islast;
}
public void setIslast(String islast) {
this.islast = islast == null ? null : islast.trim();
}
public String getOriginatingstationBill() {
return originatingstationBill;
}
public void setOriginatingstationBill(String originatingstationBill) {
this.originatingstationBill = originatingstationBill == null ? null : originatingstationBill.trim();
}
public String getDestinationstationBill() {
return destinationstationBill;
}
public void setDestinationstationBill(String destinationstationBill) {
this.destinationstationBill = destinationstationBill == null ? null : destinationstationBill.trim();
}
public String getTotalpiece() {
return totalpiece;
}
public void setTotalpiece(String totalpiece) {
this.totalpiece = totalpiece == null ? null : totalpiece.trim();
}
public String getDealstatus() {
return dealstatus;
}
public void setDealstatus(String dealstatus) {
this.dealstatus = dealstatus == null ? null : dealstatus.trim();
}
}
\ No newline at end of file
... ...
package com.tianbo.analysis.model;
import java.util.Date;
public class FWBINFO {
private String autoid;
private String waybillnomaster;
private String totalweight;
private String totalpiece;
private String productname;
private String carrier1;
private String arrivalstation1;
private String carrier2;
private String arrivalstation2;
private String carrier3;
private String arrivalstation3;
private String paymode;
private String specialgoodscode;
private String shippername;
private String shipperaddress;
private String consigneename;
private String consigneeaddress;
private Date createdate;
private String istransfer;
private String shipperCode;
private String shipperCountrycode;
private String shipperPhone;
private String shipperFax;
private String consigneeCode;
private String consigneeCountrycode;
private String consigneeFax;
private String specificConsigneename;
private String specificConsigneePhone;
private String consigneePhone;
public String getAutoid() {
return autoid;
}
public void setAutoid(String autoid) {
this.autoid = autoid == null ? null : autoid.trim();
}
public String getWaybillnomaster() {
return waybillnomaster;
}
public void setWaybillnomaster(String waybillnomaster) {
this.waybillnomaster = waybillnomaster == null ? null : waybillnomaster.trim();
}
public String getTotalweight() {
return totalweight;
}
public void setTotalweight(String totalweight) {
this.totalweight = totalweight == null ? null : totalweight.trim();
}
public String getTotalpiece() {
return totalpiece;
}
public void setTotalpiece(String totalpiece) {
this.totalpiece = totalpiece == null ? null : totalpiece.trim();
}
public String getProductname() {
return productname;
}
public void setProductname(String productname) {
this.productname = productname == null ? null : productname.trim();
}
public String getCarrier1() {
return carrier1;
}
public void setCarrier1(String carrier1) {
this.carrier1 = carrier1 == null ? null : carrier1.trim();
}
public String getArrivalstation1() {
return arrivalstation1;
}
public void setArrivalstation1(String arrivalstation1) {
this.arrivalstation1 = arrivalstation1 == null ? null : arrivalstation1.trim();
}
public String getCarrier2() {
return carrier2;
}
public void setCarrier2(String carrier2) {
this.carrier2 = carrier2 == null ? null : carrier2.trim();
}
public String getArrivalstation2() {
return arrivalstation2;
}
public void setArrivalstation2(String arrivalstation2) {
this.arrivalstation2 = arrivalstation2 == null ? null : arrivalstation2.trim();
}
public String getCarrier3() {
return carrier3;
}
public void setCarrier3(String carrier3) {
this.carrier3 = carrier3 == null ? null : carrier3.trim();
}
public String getArrivalstation3() {
return arrivalstation3;
}
public void setArrivalstation3(String arrivalstation3) {
this.arrivalstation3 = arrivalstation3 == null ? null : arrivalstation3.trim();
}
public String getPaymode() {
return paymode;
}
public void setPaymode(String paymode) {
this.paymode = paymode == null ? null : paymode.trim();
}
public String getSpecialgoodscode() {
return specialgoodscode;
}
public void setSpecialgoodscode(String specialgoodscode) {
this.specialgoodscode = specialgoodscode == null ? null : specialgoodscode.trim();
}
public String getShippername() {
return shippername;
}
public void setShippername(String shippername) {
this.shippername = shippername == null ? null : shippername.trim();
}
public String getShipperaddress() {
return shipperaddress;
}
public void setShipperaddress(String shipperaddress) {
this.shipperaddress = shipperaddress == null ? null : shipperaddress.trim();
}
public String getConsigneename() {
return consigneename;
}
public void setConsigneename(String consigneename) {
this.consigneename = consigneename == null ? null : consigneename.trim();
}
public String getConsigneeaddress() {
return consigneeaddress;
}
public void setConsigneeaddress(String consigneeaddress) {
this.consigneeaddress = consigneeaddress == null ? null : consigneeaddress.trim();
}
public Date getCreatedate() {
return createdate;
}
public void setCreatedate(Date createdate) {
this.createdate = createdate;
}
public String getIstransfer() {
return istransfer;
}
public void setIstransfer(String istransfer) {
this.istransfer = istransfer == null ? null : istransfer.trim();
}
public String getShipperCode() {
return shipperCode;
}
public void setShipperCode(String shipperCode) {
this.shipperCode = shipperCode == null ? null : shipperCode.trim();
}
public String getShipperCountrycode() {
return shipperCountrycode;
}
public void setShipperCountrycode(String shipperCountrycode) {
this.shipperCountrycode = shipperCountrycode == null ? null : shipperCountrycode.trim();
}
public String getShipperPhone() {
return shipperPhone;
}
public void setShipperPhone(String shipperPhone) {
this.shipperPhone = shipperPhone == null ? null : shipperPhone.trim();
}
public String getShipperFax() {
return shipperFax;
}
public void setShipperFax(String shipperFax) {
this.shipperFax = shipperFax == null ? null : shipperFax.trim();
}
public String getConsigneeCode() {
return consigneeCode;
}
public void setConsigneeCode(String consigneeCode) {
this.consigneeCode = consigneeCode == null ? null : consigneeCode.trim();
}
public String getConsigneeCountrycode() {
return consigneeCountrycode;
}
public void setConsigneeCountrycode(String consigneeCountrycode) {
this.consigneeCountrycode = consigneeCountrycode == null ? null : consigneeCountrycode.trim();
}
public String getConsigneeFax() {
return consigneeFax;
}
public void setConsigneeFax(String consigneeFax) {
this.consigneeFax = consigneeFax == null ? null : consigneeFax.trim();
}
public String getSpecificConsigneename() {
return specificConsigneename;
}
public void setSpecificConsigneename(String specificConsigneename) {
this.specificConsigneename = specificConsigneename == null ? null : specificConsigneename.trim();
}
public String getSpecificConsigneePhone() {
return specificConsigneePhone;
}
public void setSpecificConsigneePhone(String specificConsigneePhone) {
this.specificConsigneePhone = specificConsigneePhone == null ? null : specificConsigneePhone.trim();
}
public String getConsigneePhone() {
return consigneePhone;
}
public void setConsigneePhone(String consigneePhone) {
this.consigneePhone = consigneePhone == null ? null : consigneePhone.trim();
}
}
\ No newline at end of file
... ...
package com.tianbo.analysis.service;
import com.tianbo.analysis.model.FFMInfo;
import java.util.List;
public interface FFMInfoService {
List<FFMInfo> getDistinctFlightWithPallet(Boolean pallatIsNull);
/**
*
* @param record ffm数据
* @param pallatIsNull 板箱号是否为空
* @return
*/
List<FFMInfo> getFFMLastReportOrderByPallet(FFMInfo record,Boolean pallatIsNull);
int updateSelective(FFMInfo record);
/**
* 更新ffminfo临时表处理完毕的航班舱单信息状态为已处理
* @param ffm 可处理的舱单信息
* @return
*/
int setDealstatusSuccess(FFMInfo ffm);
/**
*
* @param record 带有航班号航班日期的FFMINFO实体
* @param pallatIsNull 板箱号是否为空,为空返回空板箱的数据,不为空返回非空板箱的数据
* @return ffm报文中带有LAST的报文批次号
*/
List<FFMInfo> getLastReportOrder(FFMInfo record,Boolean pallatIsNull);
List<FFMInfo> getLastCountByPallet(FFMInfo record,Boolean pallatIsNull);
/**
* 得到报文到齐的整个航班的舱单数据
* @param record 带有航班号航班日期的FFMINFO实体
* @param pallatIsNull 板箱号是否为空,为空返回空板箱的数据,不为空返回非空板箱的数据
* @return 可入业务库的临时表的舱单数据
*/
List<FFMInfo> getFFMinfoByPallet(FFMInfo record,Boolean pallatIsNull);
}
... ...
package com.tianbo.analysis.service;
public interface FWBInfoService {
int updateFwbToManifest(String waybillMaster);
}
... ...
package com.tianbo.analysis.service;
import com.tianbo.analysis.model.FFMInfo;
public interface ManifestMasterService {
int insertManifestWithMaster(FFMInfo ffmInfo);
}
... ...
package com.tianbo.analysis.service;
import com.tianbo.analysis.model.FFMInfo;
public interface ManifestSecondService {
/**
* 根据舱单挂载分单 到相对航班仓单上
* 目前这种用舱单的逻辑挂载 是因为 主单表和舱单表是一个表
* TODO: 2019/5/7 以后架构变了后 分单表跟主单表关联就行 主单表跟 舱单表关联 。不用这种方式挂载了就
* @param ffm 舱单数据
* @return
*/
int setManifestMaster(FFMInfo ffm);
}
... ...
package com.tianbo.analysis.service.imp;
import com.tianbo.analysis.dao.FFMInfoMapper;
import com.tianbo.analysis.model.FFMInfo;
import com.tianbo.analysis.service.FFMInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class FFMInfoServiceImp implements FFMInfoService {
@Autowired
FFMInfoMapper ffmInfoMapper;
@Override
public List<FFMInfo> getDistinctFlightWithPallet(Boolean pallatIsNull){
if (pallatIsNull){
return ffmInfoMapper.getDistinctFlightWithPalletNull();
}else {
return ffmInfoMapper.getDistinctFlightWithPallet();
}
}
@Override
public List<FFMInfo> getFFMLastReportOrderByPallet(FFMInfo record,Boolean pallatIsNull){
if (pallatIsNull){
return ffmInfoMapper.getFFMLastReportOrderByNullPallet(record);
}else {
return ffmInfoMapper.getFFMLastReportOrderByPallet(record);
}
}
@Override
public int updateSelective(FFMInfo record){
return ffmInfoMapper.updateSelective(record);
}
@Override
public int setDealstatusSuccess(FFMInfo ffm){
//舱单业务数据入业务库成功后,更新舱单待处理表的数据状态为 1,根据航班号+航班日期+主单号
FFMInfo temp_ffm = new FFMInfo();
temp_ffm.setFlightno(ffm.getFlightno());
temp_ffm.setFlightdate(ffm.getFlightdate());
temp_ffm.setWaybillnomaster(ffm.getWaybillnomaster());
temp_ffm.setDealstatus("1");
return updateSelective(temp_ffm);
}
@Override
public List<FFMInfo> getLastReportOrder(FFMInfo record,Boolean pallatIsNull){
if (pallatIsNull){
return ffmInfoMapper.getLastReportOrderByNullPallet(record);
}else {
return ffmInfoMapper.getLastReportOrderByPallet(record);
}
}
@Override
public List<FFMInfo> getLastCountByPallet(FFMInfo record,Boolean pallatIsNull){
if (pallatIsNull){
return ffmInfoMapper.lastCountByNullPallet(record);
}else {
return ffmInfoMapper.lastCountByPallet(record);
}
}
@Override
public List<FFMInfo> getFFMinfoByPallet(FFMInfo record,Boolean pallatIsNull){
if (pallatIsNull){
return ffmInfoMapper.getFFMinfoByNullpallet(record);
}else {
return ffmInfoMapper.getFFMinfoBypallet(record);
}
}
}
... ...
package com.tianbo.analysis.service.imp;
import com.tianbo.analysis.dao.FWBINFOMapper;
import com.tianbo.analysis.dao.ORIGINMANIFESTMASTERMapper;
import com.tianbo.analysis.model.FWBINFO;
import com.tianbo.analysis.service.FWBInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class FWBInfoServiceImp implements FWBInfoService {
@Autowired
FWBINFOMapper fwbinfoMapper;
@Autowired
ORIGINMANIFESTMASTERMapper originmanifestmasterMapper;
@Override
public int updateFwbToManifest(String waybillMaster){
//舱单报文入库后, 更新FWB信息,将FWB临时表的信息更新到 舱单业务表
List<FWBINFO> fwbinfos = fwbinfoMapper.queryFwbInfo(waybillMaster);
if (fwbinfos!=null && !fwbinfos.isEmpty()){
FWBINFO _model_fwb = fwbinfos.get(0);
return originmanifestmasterMapper.updateFWBByFWBInfoAndStatus(_model_fwb);
}
return 0;
}
}
... ...
package com.tianbo.analysis.service.imp;
import com.tianbo.analysis.dao.ORIGINMANIFESTMASTERMapper;
import com.tianbo.analysis.model.FFMInfo;
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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service
public class ManifestMasterServiceImp implements ManifestMasterService{
@Autowired
ORIGINMANIFESTMASTERMapper originmanifestmasterMapper;
@Autowired
FFMInfoService ffmInfoService;
@Override
public int insertManifestWithMaster(FFMInfo item){
ORIGINMANIFESTMASTER master = new ORIGINMANIFESTMASTER();
master.setWaybillnomaster(item.getWaybillnomaster());
master.setFlightDate(item.getFlightdate());
master.setFlightno(item.getFlightno());
List<ORIGINMANIFESTMASTER> _masterinfo = originmanifestmasterMapper.queryMasterInfo(master);
//业务库没此运单的数据,则写入业务库数据,否则更新临时表此运单处理状态
if (_masterinfo!=null && _masterinfo.size()==0){
master.setAutoid(item.getAutoid());
master.setOriginatingstation(item.getOriginatingstation());
master.setDestinationstation(item.getDestinationstation());
master.setSegment(item.getOriginatingstation() + "-" + item.getDestinationstation());
//填写分批标识
master.setIsbatch(item.getIsbatch());
//运单起始地
master.setOriginatingstationBill(item.getOriginatingstationBill());
//运单目的地
master.setDestinationstationBill(item.getDestinationstationBill());
//舱单件数
master.setManifesttotalpiece(item.getManifesttotalpiece());
//舱单重量
master.setManifesttotalweight(item.getManifesttotalweight());
master.setCustomsstatus("01");
master.setCustomscode(item.getCustomscode());
master.setReportorder("");
master.setIslast("");
master.setCreatedate(new Date());
return originmanifestmasterMapper.insertSelective(master);
//写入完毕
}else {
//重复数据不操作,直接更新掉临时表数据状态
ffmInfoService.setDealstatusSuccess(item);
}
return 0;
}
}
... ...
package com.tianbo.analysis.service.imp;
import com.tianbo.analysis.dao.OriginmanifestsecondaryMapper;
import com.tianbo.analysis.model.FFMInfo;
import com.tianbo.analysis.model.Originmanifestsecondary;
import com.tianbo.analysis.service.ManifestSecondService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class ManifestSecondServiceImp implements ManifestSecondService {
@Autowired
OriginmanifestsecondaryMapper originmanifestsecondaryMapper;
@Override
public int setManifestMaster(FFMInfo ffm){
String isBatch = ffm.getIsbatch();
isBatch = (isBatch == null) ? "" : isBatch;
//未分批的分单 如果已经挂载到主单上就不挂载了
if (isBatch.equals("T") || isBatch.equals("S") || isBatch.equals("D") || isBatch.equals("P") || isBatch.equals("M")){
}
//否则是分批标识的 要挂载到最新的航班的主单下 Todo: 这里后面判断是否需要做分批和非分批的挂载方式判定
//从分单表取属于此主单下的分单列表,更新主分单关系
List<Originmanifestsecondary> list_seondary = originmanifestsecondaryMapper.selectByFWb(ffm.getWaybillnomaster());
if (list_seondary != null && !list_seondary.isEmpty()){
for (Originmanifestsecondary manifestsecondary : list_seondary) {
Originmanifestsecondary secondary = new Originmanifestsecondary();
secondary.setAutoid(manifestsecondary.getAutoid());
secondary.setOriginmanifestmasterautoid(ffm.getAutoid());
secondary.setCustomsstatus(ffm.getCustomsstatus());
int i =originmanifestsecondaryMapper.updateMasterAutoId(secondary);
return i;
}
}
return 0;
}
}
... ...
package com.tianbo.analysis.task;
import com.netflix.discovery.converters.Auto;
import com.tianbo.analysis.dao.FWBINFOMapper;
import com.tianbo.analysis.dao.ORIGINMANIFESTMASTERMapper;
import com.tianbo.analysis.dao.OriginmanifestsecondaryMapper;
import com.tianbo.analysis.model.FFMInfo;
import com.tianbo.analysis.model.FWBINFO;
import com.tianbo.analysis.model.ORIGINMANIFESTMASTER;
import com.tianbo.analysis.model.Originmanifestsecondary;
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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;
/**
* ffm临时业务表处理入业务库
*
*/
@Component
public class FFMInfoHandle {
@Autowired
FFMInfoService ffmInfoService;
@Autowired
ORIGINMANIFESTMASTERMapper originmanifestmasterMapper;
@Autowired
ManifestMasterService manifestMasterService;
@Autowired
FWBInfoService fwbInfoService;
@Autowired
OriginmanifestsecondaryMapper originmanifestsecondaryMapper;
@Autowired
ManifestSecondService secondService;
public boolean dealFFMInfo(){
boolean result =false;
try {
//1.处理板箱非空的数据
List<FFMInfo> ffmInfoList = ffmInfoService.getDistinctFlightWithPallet(false);
if (ffmInfoList!=null && !ffmInfoList.isEmpty()){
for (FFMInfo item_f:ffmInfoList) {
//针对补发报文处理,补发的报文: FFM_INFOB表数据,存储的报文批次01对应标识是LAST
List<FFMInfo> ffmlist_reportorder_1 = ffmInfoService.getFFMLastReportOrderByPallet(item_f,false);
/**
* 判断列表是否为空
* 不为空则说明 FFM只有一份,第一份报文包含LAST标识
*/
if (ffmlist_reportorder_1 !=null && !ffmlist_reportorder_1.isEmpty()){
for (FFMInfo item:ffmlist_reportorder_1) {
//1.1 查看舱单运单业务表是否已存在运单数据,不存在则插入业务表,存在则更新临时表的数据为已处理
int Flag = 0;
Flag = manifestMasterService.insertManifestWithMaster(item);
if (Flag>0){
result = true;
//业务数据入库成功后,更新舱单待处理表的数据状态为 1,根据航班号+航班日期+主单号
ffmInfoService.setDealstatusSuccess(item);
//舱单报文入库后, 更新FWB信息,将FWB临时表的信息更新到 舱单业务表
fwbInfoService.updateFwbToManifest(item.getWaybillnomaster());
//分单挂主单
int i = secondService.setManifestMaster(item);
}
}
}
/**
*FFM文件多份处理
*/
else
{
//首先确定带有LAST的ffm的最批次大序号
//根据航班号+航班日期 判断LAST报对应的报文批次
List<FFMInfo> _last = ffmInfoService.getLastReportOrder(item_f,false);
List<FFMInfo> _last_count = ffmInfoService.getLastCountByPallet(item_f,false);
if (_last != null && _last.size() > 0 && _last_count != null && _last_count.size() > 0){
int mm = Integer.parseInt(_last.get(0).getReportorder());
int nn = Integer.parseInt(_last_count.get(0).getReportorder());
if (mm > 0 && nn > 0 && mm == nn){
// 业务数据 开始入库
List<FFMInfo> ffmlist = ffmInfoService.getFFMinfoByPallet(item_f,false);
if (ffmlist != null && ffmlist.size() > 0){
for (FFMInfo item:ffmlist) {
int Flag = 0;
Flag = manifestMasterService.insertManifestWithMaster(item);
if (Flag>0){
result = true;
//业务数据入库成功后,更新舱单待处理表的数据状态为 1,根据航班号+航班日期+主单号
ffmInfoService.setDealstatusSuccess(item);
//舱单报文入库后, 更新FWB信息,将FWB临时表的信息更新到 舱单业务表
fwbInfoService.updateFwbToManifest(item.getWaybillnomaster());
//分单挂主单
int i = secondService.setManifestMaster(item);
}
}
}
}
}
}
}
}
}catch (Exception e){
e.printStackTrace();
}
return true;
}
}
... ...
... ... @@ -45,6 +45,6 @@
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
<!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名-->
<table tableName="originmanifestsecondary" domainObjectName="originmanifestsecondary" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
<table tableName="fwb_info" domainObjectName="FWBINFO" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
</context>
</generatorConfiguration>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.tianbo.analysis.dao.FFMInfoMapper" >
<resultMap id="BaseResultMap" type="com.tianbo.analysis.model.FFMInfo" >
<result column="AUTOID" property="autoid" jdbcType="VARCHAR" />
<result column="CREATEDATE" property="createdate" jdbcType="TIMESTAMP" />
<result column="FLIGHTNO" property="flightno" jdbcType="VARCHAR" />
<result column="FLIGHTDATE" property="flightdate" jdbcType="TIMESTAMP" />
<result column="WAYBILLNOMASTER" property="waybillnomaster" jdbcType="VARCHAR" />
<result column="ORIGINATINGSTATION" property="originatingstation" jdbcType="VARCHAR" />
<result column="DESTINATIONSTATION" property="destinationstation" jdbcType="VARCHAR" />
<result column="MANIFESTTOTALPIECE" property="manifesttotalpiece" jdbcType="VARCHAR" />
<result column="MANIFESTTOTALWEIGHT" property="manifesttotalweight" jdbcType="VARCHAR" />
<result column="PRODUCTNAME" property="productname" jdbcType="VARCHAR" />
<result column="SPECIALGOODSCODE" property="specialgoodscode" jdbcType="VARCHAR" />
<result column="CUSTOMSCODE" property="customscode" jdbcType="VARCHAR" />
<result column="CUSTOMSSTATUS" property="customsstatus" jdbcType="VARCHAR" />
<result column="ISBATCH" property="isbatch" jdbcType="VARCHAR" />
<result column="PALLET" property="pallet" jdbcType="VARCHAR" />
<result column="REPORTORDER" property="reportorder" jdbcType="VARCHAR" />
<result column="ISLAST" property="islast" jdbcType="VARCHAR" />
<result column="ORIGINATINGSTATION_BILL" property="originatingstationBill" jdbcType="VARCHAR" />
<result column="DESTINATIONSTATION_BILL" property="destinationstationBill" jdbcType="VARCHAR" />
<result column="TOTALPIECE" property="totalpiece" jdbcType="VARCHAR" />
<result column="DEALSTATUS" property="dealstatus" jdbcType="VARCHAR" />
</resultMap>
<insert id="insert" parameterType="com.tianbo.analysis.model.FFMInfo" >
insert into FFM_INFO (AUTOID, CREATEDATE, FLIGHTNO,
FLIGHTDATE, WAYBILLNOMASTER, ORIGINATINGSTATION,
DESTINATIONSTATION, MANIFESTTOTALPIECE,
MANIFESTTOTALWEIGHT, PRODUCTNAME, SPECIALGOODSCODE,
CUSTOMSCODE, CUSTOMSSTATUS, ISBATCH,
PALLET, REPORTORDER, ISLAST,
ORIGINATINGSTATION_BILL, DESTINATIONSTATION_BILL,
TOTALPIECE, DEALSTATUS)
values (#{autoid,jdbcType=VARCHAR}, #{createdate,jdbcType=TIMESTAMP}, #{flightno,jdbcType=VARCHAR},
#{flightdate,jdbcType=TIMESTAMP}, #{waybillnomaster,jdbcType=VARCHAR}, #{originatingstation,jdbcType=VARCHAR},
#{destinationstation,jdbcType=VARCHAR}, #{manifesttotalpiece,jdbcType=VARCHAR},
#{manifesttotalweight,jdbcType=VARCHAR}, #{productname,jdbcType=VARCHAR}, #{specialgoodscode,jdbcType=VARCHAR},
#{customscode,jdbcType=VARCHAR}, #{customsstatus,jdbcType=VARCHAR}, #{isbatch,jdbcType=VARCHAR},
#{pallet,jdbcType=VARCHAR}, #{reportorder,jdbcType=VARCHAR}, #{islast,jdbcType=VARCHAR},
#{originatingstationBill,jdbcType=VARCHAR}, #{destinationstationBill,jdbcType=VARCHAR},
#{totalpiece,jdbcType=VARCHAR}, #{dealstatus,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.tianbo.analysis.model.FFMInfo" >
insert into FFM_INFO
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="autoid != null" >
AUTOID,
</if>
<if test="createdate != null" >
CREATEDATE,
</if>
<if test="flightno != null" >
FLIGHTNO,
</if>
<if test="flightdate != null" >
FLIGHTDATE,
</if>
<if test="waybillnomaster != null" >
WAYBILLNOMASTER,
</if>
<if test="originatingstation != null" >
ORIGINATINGSTATION,
</if>
<if test="destinationstation != null" >
DESTINATIONSTATION,
</if>
<if test="manifesttotalpiece != null" >
MANIFESTTOTALPIECE,
</if>
<if test="manifesttotalweight != null" >
MANIFESTTOTALWEIGHT,
</if>
<if test="productname != null" >
PRODUCTNAME,
</if>
<if test="specialgoodscode != null" >
SPECIALGOODSCODE,
</if>
<if test="customscode != null" >
CUSTOMSCODE,
</if>
<if test="customsstatus != null" >
CUSTOMSSTATUS,
</if>
<if test="isbatch != null" >
ISBATCH,
</if>
<if test="pallet != null" >
PALLET,
</if>
<if test="reportorder != null" >
REPORTORDER,
</if>
<if test="islast != null" >
ISLAST,
</if>
<if test="originatingstationBill != null" >
ORIGINATINGSTATION_BILL,
</if>
<if test="destinationstationBill != null" >
DESTINATIONSTATION_BILL,
</if>
<if test="totalpiece != null" >
TOTALPIECE,
</if>
<if test="dealstatus != null" >
DEALSTATUS,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="autoid != null" >
#{autoid,jdbcType=VARCHAR},
</if>
<if test="createdate != null" >
#{createdate,jdbcType=TIMESTAMP},
</if>
<if test="flightno != null" >
#{flightno,jdbcType=VARCHAR},
</if>
<if test="flightdate != null" >
#{flightdate,jdbcType=TIMESTAMP},
</if>
<if test="waybillnomaster != null" >
#{waybillnomaster,jdbcType=VARCHAR},
</if>
<if test="originatingstation != null" >
#{originatingstation,jdbcType=VARCHAR},
</if>
<if test="destinationstation != null" >
#{destinationstation,jdbcType=VARCHAR},
</if>
<if test="manifesttotalpiece != null" >
#{manifesttotalpiece,jdbcType=VARCHAR},
</if>
<if test="manifesttotalweight != null" >
#{manifesttotalweight,jdbcType=VARCHAR},
</if>
<if test="productname != null" >
#{productname,jdbcType=VARCHAR},
</if>
<if test="specialgoodscode != null" >
#{specialgoodscode,jdbcType=VARCHAR},
</if>
<if test="customscode != null" >
#{customscode,jdbcType=VARCHAR},
</if>
<if test="customsstatus != null" >
#{customsstatus,jdbcType=VARCHAR},
</if>
<if test="isbatch != null" >
#{isbatch,jdbcType=VARCHAR},
</if>
<if test="pallet != null" >
#{pallet,jdbcType=VARCHAR},
</if>
<if test="reportorder != null" >
#{reportorder,jdbcType=VARCHAR},
</if>
<if test="islast != null" >
#{islast,jdbcType=VARCHAR},
</if>
<if test="originatingstationBill != null" >
#{originatingstationBill,jdbcType=VARCHAR},
</if>
<if test="destinationstationBill != null" >
#{destinationstationBill,jdbcType=VARCHAR},
</if>
<if test="totalpiece != null" >
#{totalpiece,jdbcType=VARCHAR},
</if>
<if test="dealstatus != null" >
#{dealstatus,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="getDistinctFlightWithPalletNull" resultType="com.tianbo.analysis.model.FFMInfo">
select distinct flightno,flightdate from ffm_info
where createdate &lt;= to_date(to_char(sysdate-1/24/60,'yyyy-mm-dd HH24:MI:SS'),'yyyy-mm-dd HH24:MI:SS')
and dealstatus='0'
and islast='LAST'
and pallet is null
</select>
<select id="getDistinctFlightWithPallet" resultType="com.tianbo.analysis.model.FFMInfo">
select distinct flightno,flightdate from ffm_info
where createdate <![CDATA[<=]]> to_date(to_char(sysdate-1/24/60,'yyyy-mm-dd HH24:MI:SS'),'yyyy-mm-dd HH24:MI:SS')
and dealstatus='0'
and islast='LAST'
and pallet is not null
</select>
<select id="getLastReportOrderByNullPallet" resultType="com.tianbo.analysis.model.FFMInfo" parameterType="com.tianbo.analysis.model.FFMInfo">
SELECT
NVL(MAX(reportorder),0) AS reportorder
FROM
FFM_INFO
WHERE
dealstatus='0'
and
islast = 'LAST'
and
flightno= #{flightno,jdbcType=VARCHAR}
and
flightdate= #{flightdate,jdbcType=TIMESTAMP}
and
pallet is null
</select>
<select id="getLastReportOrderByPallet" resultType="com.tianbo.analysis.model.FFMInfo" parameterType="com.tianbo.analysis.model.FFMInfo">
SELECT
NVL(MAX(reportorder),0) AS reportorder
FROM
ffm_info
WHERE
dealstatus='0'
AND
islast = 'LAST'
AND
flightno= #{flightno,jdbcType=VARCHAR}
AND
flightdate= #{flightdate,jdbcType=TIMESTAMP}
AND
pallet is not null
</select>
<select id="lastCountByNullPallet" resultType="com.tianbo.analysis.model.FFMInfo" parameterType="com.tianbo.analysis.model.FFMInfo">
SELECT
count(*) as reportorder
FROM
(
SELECT
distinct reportorder,islast
FROM
ffm_info
WHERE
dealstatus='0'
and
flightno= #{flightno,jdbcType=VARCHAR}
and
flightdate = #{flightdate,jdbcType=TIMESTAMP}
and pallet is null
)
</select>
<select id="lastCountByPallet" resultType="com.tianbo.analysis.model.FFMInfo" parameterType="com.tianbo.analysis.model.FFMInfo">
SELECT
count(*) as reportorder
FROM
(
SELECT
distinct reportorder,islast
FROM
ffm_info
WHERE
dealstatus='0'
and
flightno= #{flightno,jdbcType=VARCHAR}
and
flightdate = #{flightdate,jdbcType=TIMESTAMP}
and pallet is NOT null
)
</select>
<select id="getFFMLastReportOrderByNullPallet" resultType="com.tianbo.analysis.model.FFMInfo" parameterType="com.tianbo.analysis.model.FFMInfo">
SELECT
tb.flightno,
tb.flightdate,
tb.waybillnomaster,
SUM (tb.manifesttotalpiece) manifesttotalpiece,
SUM (tb.manifesttotalweight) manifesttotalweight,
MAX (customscode) customscode,
MAX (customsstatus) customsstatus,
MAX (originatingstation_bill) originatingstation_bill,
MAX (destinationstation_bill) destinationstation_bill,
MAX (isbatch) isbatch,
MAX (autoid) autoid,
MAX (originatingstation) originatingstation,
MAX (destinationstation) destinationstation
FROM
(
SELECT
T .*
FROM
(
SELECT
A .*, ROW_NUMBER () OVER (
PARTITION BY flightno,
flightdate,
waybillnomaster,
pallet,
reportorder
ORDER BY
createdate DESC
) rw
FROM
ffm_info A
WHERE
islast = 'LAST'
AND reportorder = '1'
AND dealstatus = '0'
AND flightno = #{flightno,jdbcType=VARCHAR}
AND flightdate = #{flightdate,jdbcType=TIMESTAMP}
AND pallet IS NULL
) T
WHERE
T .rw = 1
ORDER BY
waybillnomaster
) tb
GROUP BY
tb.flightno,
tb.flightdate,
tb.waybillnomaster
ORDER BY
tb.waybillnomaster
</select>
<select id="getFFMLastReportOrderByPallet" resultType="com.tianbo.analysis.model.FFMInfo" parameterType="com.tianbo.analysis.model.FFMInfo">
SELECT
tb.flightno,
tb.flightdate,
tb.waybillnomaster,
SUM (tb.manifesttotalpiece) manifesttotalpiece,
SUM (tb.manifesttotalweight) manifesttotalweight,
MAX (customscode) customscode,
MAX (customsstatus) customsstatus,
MAX (originatingstation_bill) originatingstation_bill,
MAX (destinationstation_bill) destinationstation_bill,
MAX (isbatch) isbatch,
MAX (autoid) autoid,
MAX (originatingstation) originatingstation,
MAX (destinationstation) destinationstation
FROM
(
SELECT
T .*
FROM
(
SELECT
A .*, ROW_NUMBER () OVER (
PARTITION BY flightno,
flightdate,
waybillnomaster,
pallet,
reportorder
ORDER BY
createdate DESC
) rw
FROM
ffm_info A
WHERE
islast = 'LAST'
AND reportorder = '1'
AND dealstatus = '0'
AND flightno = #{flightno,jdbcType=VARCHAR}
AND flightdate = #{flightdate,jdbcType=TIMESTAMP}
AND pallet IS NOT NULL
) T
WHERE
T .rw = 1
ORDER BY
waybillnomaster
) tb
GROUP BY
tb.flightno,
tb.flightdate,
tb.waybillnomaster
ORDER BY
tb.waybillnomaster
</select>
<select id="getFFMinfoByNullpallet" resultType="com.tianbo.analysis.model.FFMInfo" parameterType="com.tianbo.analysis.model.FFMInfo">
SELECT
tb.flightno,
tb.flightdate,
tb.waybillnomaster,
SUM (tb.manifesttotalpiece) manifesttotalpiece,
SUM (tb.manifesttotalweight) manifesttotalweight,
MAX (customscode) customscode,
MAX (customsstatus) customsstatus,
MAX (originatingstation_bill) originatingstation_bill,
MAX (destinationstation_bill) destinationstation_bill,
MAX (isbatch) isbatch,
MAX (autoid) autoid,
MAX (originatingstation) originatingstation,
MAX (destinationstation) destinationstation
FROM
(
SELECT
T .*
FROM
(
SELECT
A .*, ROW_NUMBER () OVER (
PARTITION BY flightno,
flightdate,
waybillnomaster,
pallet,
reportorder
ORDER BY
createdate DESC
) rw
FROM
ffm_info A
WHERE
dealstatus = '0'
AND flightno = #{flightno,jdbcType=VARCHAR}
AND flightdate = #{flightdate,jdbcType=TIMESTAMP}
AND pallet IS NULL
) T
WHERE
T .rw = 1
ORDER BY
waybillnomaster
) tb
GROUP BY
tb.flightno,
tb.flightdate,
tb.waybillnomaster
ORDER BY
tb.waybillnomaster
</select>
<select id="getFFMinfoBypallet" resultType="com.tianbo.analysis.model.FFMInfo" parameterType="com.tianbo.analysis.model.FFMInfo">
SELECT
tb.flightno,
tb.flightdate,
tb.waybillnomaster,
SUM (tb.manifesttotalpiece) manifesttotalpiece,
SUM (tb.manifesttotalweight) manifesttotalweight,
MAX (customscode) customscode,
MAX (customsstatus) customsstatus,
MAX (originatingstation_bill) originatingstation_bill,
MAX (destinationstation_bill) destinationstation_bill,
MAX (isbatch) isbatch,
MAX (autoid) autoid,
MAX (originatingstation) originatingstation,
MAX (destinationstation) destinationstation
FROM
(
SELECT
T .*
FROM
(
SELECT
A .*, ROW_NUMBER () OVER (
PARTITION BY flightno,
flightdate,
waybillnomaster,
pallet,
reportorder
ORDER BY
createdate DESC
) rw
FROM
ffm_info A
WHERE
dealstatus = '0'
AND flightno = #{flightno,jdbcType=VARCHAR}
AND flightdate = #{flightdate,jdbcType=TIMESTAMP}
AND pallet IS NOT NULL
) T
WHERE
T .rw = 1
ORDER BY
waybillnomaster
) tb
GROUP BY
tb.flightno,
tb.flightdate,
tb.waybillnomaster
ORDER BY
tb.waybillnomaster
</select>
<update id="updateSelective" parameterType="com.tianbo.analysis.model.FFMInfo">
UPDATE FFM_INFO
<set >
<if test="createdate != null" >
CREATEDATE = #{createdate,jdbcType=TIMESTAMP},
</if>
<if test="flightno != null" >
FLIGHTNO = #{flightno,jdbcType=VARCHAR},
</if>
<if test="flightdate != null" >
FLIGHTDATE = #{flightdate,jdbcType=TIMESTAMP},
</if>
<if test="waybillnomaster != null" >
WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR},
</if>
<if test="originatingstation != null" >
ORIGINATINGSTATION = #{originatingstation,jdbcType=VARCHAR},
</if>
<if test="destinationstation != null" >
DESTINATIONSTATION = #{destinationstation,jdbcType=VARCHAR},
</if>
<if test="manifesttotalpiece != null" >
MANIFESTTOTALPIECE = #{manifesttotalpiece,jdbcType=VARCHAR},
</if>
<if test="manifesttotalweight != null" >
MANIFESTTOTALWEIGHT = #{manifesttotalweight,jdbcType=VARCHAR},
</if>
<if test="productname != null" >
PRODUCTNAME = #{productname,jdbcType=VARCHAR},
</if>
<if test="specialgoodscode != null" >
SPECIALGOODSCODE = #{specialgoodscode,jdbcType=VARCHAR},
</if>
<if test="customscode != null" >
CUSTOMSCODE = #{customscode,jdbcType=VARCHAR},
</if>
<if test="customsstatus != null" >
CUSTOMSSTATUS = #{customsstatus,jdbcType=VARCHAR},
</if>
<if test="isbatch != null" >
ISBATCH = #{isbatch,jdbcType=VARCHAR},
</if>
<if test="pallet != null" >
PALLET = #{pallet,jdbcType=VARCHAR},
</if>
<if test="reportorder != null" >
REPORTORDER = #{reportorder,jdbcType=VARCHAR},
</if>
<if test="islast != null" >
ISLAST = #{islast,jdbcType=VARCHAR},
</if>
<if test="originatingstationBill != null" >
ORIGINATINGSTATION_BILL = #{originatingstationBill,jdbcType=VARCHAR},
</if>
<if test="destinationstationBill != null" >
DESTINATIONSTATION_BILL = #{destinationstationBill,jdbcType=VARCHAR},
</if>
<if test="totalpiece != null" >
TOTALPIECE = #{totalpiece,jdbcType=VARCHAR},
</if>
<if test="dealstatus != null" >
DEALSTATUS = #{dealstatus,jdbcType=VARCHAR},
</if>
</set>
WHERE
flightno= #{flightno,jdbcType=VARCHAR}
AND flightdate= #{flightdate,jdbcType=TIMESTAMP}
AND waybillnomaster= #{waybillnomaster,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.tianbo.analysis.dao.FWBINFOMapper" >
<resultMap id="BaseResultMap" type="com.tianbo.analysis.model.FWBINFO" >
<result column="AUTOID" property="autoid" jdbcType="VARCHAR" />
<result column="WAYBILLNOMASTER" property="waybillnomaster" jdbcType="VARCHAR" />
<result column="TOTALWEIGHT" property="totalweight" jdbcType="VARCHAR" />
<result column="TOTALPIECE" property="totalpiece" jdbcType="VARCHAR" />
<result column="PRODUCTNAME" property="productname" jdbcType="VARCHAR" />
<result column="CARRIER1" property="carrier1" jdbcType="VARCHAR" />
<result column="ARRIVALSTATION1" property="arrivalstation1" jdbcType="VARCHAR" />
<result column="CARRIER2" property="carrier2" jdbcType="VARCHAR" />
<result column="ARRIVALSTATION2" property="arrivalstation2" jdbcType="VARCHAR" />
<result column="CARRIER3" property="carrier3" jdbcType="VARCHAR" />
<result column="ARRIVALSTATION3" property="arrivalstation3" jdbcType="VARCHAR" />
<result column="PAYMODE" property="paymode" jdbcType="VARCHAR" />
<result column="SPECIALGOODSCODE" property="specialgoodscode" jdbcType="VARCHAR" />
<result column="SHIPPERNAME" property="shippername" jdbcType="VARCHAR" />
<result column="SHIPPERADDRESS" property="shipperaddress" jdbcType="VARCHAR" />
<result column="CONSIGNEENAME" property="consigneename" jdbcType="VARCHAR" />
<result column="CONSIGNEEADDRESS" property="consigneeaddress" jdbcType="VARCHAR" />
<result column="CREATEDATE" property="createdate" jdbcType="TIMESTAMP" />
<result column="ISTRANSFER" property="istransfer" jdbcType="VARCHAR" />
<result column="SHIPPER_CODE" property="shipperCode" jdbcType="VARCHAR" />
<result column="SHIPPER_COUNTRYCODE" property="shipperCountrycode" jdbcType="VARCHAR" />
<result column="SHIPPER_PHONE" property="shipperPhone" jdbcType="VARCHAR" />
<result column="SHIPPER_FAX" property="shipperFax" jdbcType="VARCHAR" />
<result column="CONSIGNEE_CODE" property="consigneeCode" jdbcType="VARCHAR" />
<result column="CONSIGNEE_COUNTRYCODE" property="consigneeCountrycode" jdbcType="VARCHAR" />
<result column="CONSIGNEE_FAX" property="consigneeFax" jdbcType="VARCHAR" />
<result column="SPECIFIC_CONSIGNEENAME" property="specificConsigneename" jdbcType="VARCHAR" />
<result column="SPECIFIC_CONSIGNEE_PHONE" property="specificConsigneePhone" jdbcType="VARCHAR" />
<result column="CONSIGNEE_PHONE" property="consigneePhone" jdbcType="VARCHAR" />
</resultMap>
<insert id="insert" parameterType="com.tianbo.analysis.model.FWBINFO" >
insert into FWB_INFO (AUTOID, WAYBILLNOMASTER, TOTALWEIGHT,
TOTALPIECE, PRODUCTNAME, CARRIER1,
ARRIVALSTATION1, CARRIER2, ARRIVALSTATION2,
CARRIER3, ARRIVALSTATION3, PAYMODE,
SPECIALGOODSCODE, SHIPPERNAME, SHIPPERADDRESS,
CONSIGNEENAME, CONSIGNEEADDRESS, CREATEDATE,
ISTRANSFER, SHIPPER_CODE, SHIPPER_COUNTRYCODE,
SHIPPER_PHONE, SHIPPER_FAX, CONSIGNEE_CODE,
CONSIGNEE_COUNTRYCODE, CONSIGNEE_FAX, SPECIFIC_CONSIGNEENAME,
SPECIFIC_CONSIGNEE_PHONE, CONSIGNEE_PHONE)
values (#{autoid,jdbcType=VARCHAR}, #{waybillnomaster,jdbcType=VARCHAR}, #{totalweight,jdbcType=VARCHAR},
#{totalpiece,jdbcType=VARCHAR}, #{productname,jdbcType=VARCHAR}, #{carrier1,jdbcType=VARCHAR},
#{arrivalstation1,jdbcType=VARCHAR}, #{carrier2,jdbcType=VARCHAR}, #{arrivalstation2,jdbcType=VARCHAR},
#{carrier3,jdbcType=VARCHAR}, #{arrivalstation3,jdbcType=VARCHAR}, #{paymode,jdbcType=VARCHAR},
#{specialgoodscode,jdbcType=VARCHAR}, #{shippername,jdbcType=VARCHAR}, #{shipperaddress,jdbcType=VARCHAR},
#{consigneename,jdbcType=VARCHAR}, #{consigneeaddress,jdbcType=VARCHAR}, #{createdate,jdbcType=TIMESTAMP},
#{istransfer,jdbcType=VARCHAR}, #{shipperCode,jdbcType=VARCHAR}, #{shipperCountrycode,jdbcType=VARCHAR},
#{shipperPhone,jdbcType=VARCHAR}, #{shipperFax,jdbcType=VARCHAR}, #{consigneeCode,jdbcType=VARCHAR},
#{consigneeCountrycode,jdbcType=VARCHAR}, #{consigneeFax,jdbcType=VARCHAR}, #{specificConsigneename,jdbcType=VARCHAR},
#{specificConsigneePhone,jdbcType=VARCHAR}, #{consigneePhone,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.tianbo.analysis.model.FWBINFO" >
insert into FWB_INFO
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="autoid != null" >
AUTOID,
</if>
<if test="waybillnomaster != null" >
WAYBILLNOMASTER,
</if>
<if test="totalweight != null" >
TOTALWEIGHT,
</if>
<if test="totalpiece != null" >
TOTALPIECE,
</if>
<if test="productname != null" >
PRODUCTNAME,
</if>
<if test="carrier1 != null" >
CARRIER1,
</if>
<if test="arrivalstation1 != null" >
ARRIVALSTATION1,
</if>
<if test="carrier2 != null" >
CARRIER2,
</if>
<if test="arrivalstation2 != null" >
ARRIVALSTATION2,
</if>
<if test="carrier3 != null" >
CARRIER3,
</if>
<if test="arrivalstation3 != null" >
ARRIVALSTATION3,
</if>
<if test="paymode != null" >
PAYMODE,
</if>
<if test="specialgoodscode != null" >
SPECIALGOODSCODE,
</if>
<if test="shippername != null" >
SHIPPERNAME,
</if>
<if test="shipperaddress != null" >
SHIPPERADDRESS,
</if>
<if test="consigneename != null" >
CONSIGNEENAME,
</if>
<if test="consigneeaddress != null" >
CONSIGNEEADDRESS,
</if>
<if test="createdate != null" >
CREATEDATE,
</if>
<if test="istransfer != null" >
ISTRANSFER,
</if>
<if test="shipperCode != null" >
SHIPPER_CODE,
</if>
<if test="shipperCountrycode != null" >
SHIPPER_COUNTRYCODE,
</if>
<if test="shipperPhone != null" >
SHIPPER_PHONE,
</if>
<if test="shipperFax != null" >
SHIPPER_FAX,
</if>
<if test="consigneeCode != null" >
CONSIGNEE_CODE,
</if>
<if test="consigneeCountrycode != null" >
CONSIGNEE_COUNTRYCODE,
</if>
<if test="consigneeFax != null" >
CONSIGNEE_FAX,
</if>
<if test="specificConsigneename != null" >
SPECIFIC_CONSIGNEENAME,
</if>
<if test="specificConsigneePhone != null" >
SPECIFIC_CONSIGNEE_PHONE,
</if>
<if test="consigneePhone != null" >
CONSIGNEE_PHONE,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="autoid != null" >
#{autoid,jdbcType=VARCHAR},
</if>
<if test="waybillnomaster != null" >
#{waybillnomaster,jdbcType=VARCHAR},
</if>
<if test="totalweight != null" >
#{totalweight,jdbcType=VARCHAR},
</if>
<if test="totalpiece != null" >
#{totalpiece,jdbcType=VARCHAR},
</if>
<if test="productname != null" >
#{productname,jdbcType=VARCHAR},
</if>
<if test="carrier1 != null" >
#{carrier1,jdbcType=VARCHAR},
</if>
<if test="arrivalstation1 != null" >
#{arrivalstation1,jdbcType=VARCHAR},
</if>
<if test="carrier2 != null" >
#{carrier2,jdbcType=VARCHAR},
</if>
<if test="arrivalstation2 != null" >
#{arrivalstation2,jdbcType=VARCHAR},
</if>
<if test="carrier3 != null" >
#{carrier3,jdbcType=VARCHAR},
</if>
<if test="arrivalstation3 != null" >
#{arrivalstation3,jdbcType=VARCHAR},
</if>
<if test="paymode != null" >
#{paymode,jdbcType=VARCHAR},
</if>
<if test="specialgoodscode != null" >
#{specialgoodscode,jdbcType=VARCHAR},
</if>
<if test="shippername != null" >
#{shippername,jdbcType=VARCHAR},
</if>
<if test="shipperaddress != null" >
#{shipperaddress,jdbcType=VARCHAR},
</if>
<if test="consigneename != null" >
#{consigneename,jdbcType=VARCHAR},
</if>
<if test="consigneeaddress != null" >
#{consigneeaddress,jdbcType=VARCHAR},
</if>
<if test="createdate != null" >
#{createdate,jdbcType=TIMESTAMP},
</if>
<if test="istransfer != null" >
#{istransfer,jdbcType=VARCHAR},
</if>
<if test="shipperCode != null" >
#{shipperCode,jdbcType=VARCHAR},
</if>
<if test="shipperCountrycode != null" >
#{shipperCountrycode,jdbcType=VARCHAR},
</if>
<if test="shipperPhone != null" >
#{shipperPhone,jdbcType=VARCHAR},
</if>
<if test="shipperFax != null" >
#{shipperFax,jdbcType=VARCHAR},
</if>
<if test="consigneeCode != null" >
#{consigneeCode,jdbcType=VARCHAR},
</if>
<if test="consigneeCountrycode != null" >
#{consigneeCountrycode,jdbcType=VARCHAR},
</if>
<if test="consigneeFax != null" >
#{consigneeFax,jdbcType=VARCHAR},
</if>
<if test="specificConsigneename != null" >
#{specificConsigneename,jdbcType=VARCHAR},
</if>
<if test="specificConsigneePhone != null" >
#{specificConsigneePhone,jdbcType=VARCHAR},
</if>
<if test="consigneePhone != null" >
#{consigneePhone,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="queryFwbInfo" resultType="com.tianbo.analysis.model.FWBINFO" parameterType="java.lang.String">
SELECT * FROM fwb_info
WHERE WAYBILLNOMASTER= #{waybillnomaster,jdbcType=VARCHAR}
order by createdate desc
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -362,7 +362,226 @@
AND
WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
</update>
<update id="updateFWBByFWBInfoAndStatus" parameterType="com.tianbo.analysis.model.FWBINFO">
UPDATE ORIGINMANIFESTMASTER
<set >
<if test="totalweight != null" >
TOTALWEIGHT = #{totalweight,jdbcType=VARCHAR},
</if>
<if test="totalpiece != null" >
TOTALPIECE = #{totalpiece,jdbcType=VARCHAR},
</if>
<if test="productname != null" >
PRODUCTNAME= #{productname,jdbcType=VARCHAR},
</if>
<if test="carrier1 != null" >
CARRIER1= #{carrier1,jdbcType=VARCHAR},
</if>
<if test="arrivalstation1 != null" >
ARRIVALSTATION1 = #{arrivalstation1,jdbcType=VARCHAR},
</if>
<if test="carrier2 != null" >
CARRIER2 = #{carrier2,jdbcType=VARCHAR},
</if>
<if test="arrivalstation2 != null" >
ARRIVALSTATION2 = #{arrivalstation2,jdbcType=VARCHAR},
</if>
<if test="carrier3 != null" >
CARRIER3 = #{carrier3,jdbcType=VARCHAR},
</if>
<if test="arrivalstation3 != null" >
ARRIVALSTATION3 = #{arrivalstation3,jdbcType=VARCHAR},
</if>
<if test="paymode != null" >
PAYMODE = #{paymode,jdbcType=VARCHAR},
</if>
<if test="specialgoodscode != null" >
SPECIALGOODSCODE = #{specialgoodscode,jdbcType=VARCHAR},
</if>
<if test="shippername != null" >
SHIPPERNAME = #{shippername,jdbcType=VARCHAR},
</if>
<if test="shipperaddress != null" >
SHIPPERADDRESS = #{shipperaddress,jdbcType=VARCHAR},
</if>
<if test="consigneename != null" >
CONSIGNEENAME = #{consigneename,jdbcType=VARCHAR},
</if>
<if test="consigneeaddress != null" >
CONSIGNEEADDRESS = #{consigneeaddress,jdbcType=VARCHAR},
</if>
<if test="shipperCode != null" >
SHIPPER_CODE = #{shipperCode,jdbcType=VARCHAR},
</if>
<if test="shipperCountrycode != null" >
SHIPPER_COUNTRYCODE = #{shipperCountrycode,jdbcType=VARCHAR},
</if>
<if test="shipperPhone != null" >
SHIPPER_PHONE = #{shipperPhone,jdbcType=VARCHAR},
</if>
<if test="shipperFax != null" >
SHIPPER_FAX = #{shipperFax,jdbcType=VARCHAR},
</if>
<if test="consigneeCode != null" >
CONSIGNEE_CODE = #{consigneeCode,jdbcType=VARCHAR},
</if>
<if test="consigneeCountrycode != null" >
CONSIGNEE_COUNTRYCODE = #{consigneeCountrycode,jdbcType=VARCHAR},
</if>
<if test="consigneeFax != null" >
CONSIGNEE_FAX = #{consigneeFax,jdbcType=VARCHAR},
</if>
<if test="specificConsigneename != null" >
SPECIFIC_CONSIGNEENAME = #{specificConsigneename,jdbcType=VARCHAR},
</if>
<if test="specificConsigneePhone != null" >
SPECIFIC_CONSIGNEE_PHONE = #{specificConsigneePhone,jdbcType=VARCHAR},
</if>
<if test="consigneePhone != null" >
CONSIGNEE_PHONE = #{consigneePhone,jdbcType=VARCHAR},
</if>
</set>
WHERE
WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
AND STATUS IN ('17','01')
</update>
<update id="updateSelective" parameterType="com.tianbo.analysis.model.ORIGINMANIFESTMASTER">
UPDATE ORIGINMANIFESTMASTER
<set >
<if test="segment != null" >
SEGMENT= #{segment,jdbcType=VARCHAR},
</if>
<if test="originatingstation != null" >
ORIGINATINGSTATION = #{originatingstation,jdbcType=VARCHAR},
</if>
<if test="destinationstation != null" >
DESTINATIONSTATION = #{destinationstation,jdbcType=VARCHAR},
</if>
<if test="totalweight != null" >
TOTALWEIGHT = #{totalweight,jdbcType=VARCHAR},
</if>
<if test="totalpiece != null" >
TOTALPIECE = #{totalpiece,jdbcType=VARCHAR},
</if>
<if test="manifesttotalpiece != null" >
MANIFESTTOTALPIECE = #{manifesttotalpiece,jdbcType=VARCHAR},
</if>
<if test="manifesttotalweight != null" >
MANIFESTTOTALWEIGHT= #{manifesttotalweight,jdbcType=VARCHAR},
</if>
<if test="flightno != null" >
FLIGHTNO = #{flightno,jdbcType=VARCHAR},
</if>
<if test="productname != null" >
PRODUCTNAME= #{productname,jdbcType=VARCHAR},
</if>
<if test="customsstatus != null" >
CUSTOMSSTATUS= #{customsstatus,jdbcType=VARCHAR},
</if>
<if test="carrier1 != null" >
CARRIER1= #{carrier1,jdbcType=VARCHAR},
</if>
<if test="arrivalstation1 != null" >
ARRIVALSTATION1 = #{arrivalstation1,jdbcType=VARCHAR},
</if>
<if test="carrier2 != null" >
CARRIER2 = #{carrier2,jdbcType=VARCHAR},
</if>
<if test="arrivalstation2 != null" >
ARRIVALSTATION2 = #{arrivalstation2,jdbcType=VARCHAR},
</if>
<if test="carrier3 != null" >
CARRIER3 = #{carrier3,jdbcType=VARCHAR},
</if>
<if test="arrivalstation3 != null" >
ARRIVALSTATION3 = #{arrivalstation3,jdbcType=VARCHAR},
</if>
<if test="paymode != null" >
PAYMODE = #{paymode,jdbcType=VARCHAR},
</if>
<if test="specialgoodscode != null" >
SPECIALGOODSCODE = #{specialgoodscode,jdbcType=VARCHAR},
</if>
<if test="customscode != null" >
CUSTOMSCODE = #{customscode,jdbcType=VARCHAR},
</if>
<if test="shippername != null" >
SHIPPERNAME = #{shippername,jdbcType=VARCHAR},
</if>
<if test="shipperaddress != null" >
SHIPPERADDRESS = #{shipperaddress,jdbcType=VARCHAR},
</if>
<if test="consigneename != null" >
CONSIGNEENAME = #{consigneename,jdbcType=VARCHAR},
</if>
<if test="consigneeaddress != null" >
CONSIGNEEADDRESS = #{consigneeaddress,jdbcType=VARCHAR},
</if>
<if test="receiptinformation != null" >
RECEIPTINFORMATION = #{receiptinformation,jdbcType=VARCHAR},
</if>
<if test="createdate != null" >
CREATEDATE = #{createdate,jdbcType=TIMESTAMP},
</if>
<if test="flightDate != null" >
FLIGHT_DATE = #{flightDate,jdbcType=TIMESTAMP},
</if>
<if test="status != null" >
STATUS = #{status,jdbcType=VARCHAR},
</if>
<if test="isbatch != null" >
ISBATCH = #{isbatch,jdbcType=VARCHAR},
</if>
<if test="originatingstationBill != null" >
ORIGINATINGSTATION_BILL = #{originatingstationBill,jdbcType=VARCHAR},
</if>
<if test="destinationstationBill != null" >
DESTINATIONSTATION_BILL = #{destinationstationBill,jdbcType=VARCHAR},
</if>
<if test="reportorder != null" >
REPORTORDER = #{reportorder,jdbcType=VARCHAR},
</if>
<if test="islast != null" >
ISLAST = #{islast,jdbcType=VARCHAR},
</if>
<if test="shipperCode != null" >
SHIPPER_CODE = #{shipperCode,jdbcType=VARCHAR},
</if>
<if test="shipperCountrycode != null" >
SHIPPER_COUNTRYCODE = #{shipperCountrycode,jdbcType=VARCHAR},
</if>
<if test="shipperPhone != null" >
SHIPPER_PHONE = #{shipperPhone,jdbcType=VARCHAR},
</if>
<if test="shipperFax != null" >
SHIPPER_FAX = #{shipperFax,jdbcType=VARCHAR},
</if>
<if test="consigneeCode != null" >
CONSIGNEE_CODE = #{consigneeCode,jdbcType=VARCHAR},
</if>
<if test="consigneeCountrycode != null" >
CONSIGNEE_COUNTRYCODE = #{consigneeCountrycode,jdbcType=VARCHAR},
</if>
<if test="consigneeFax != null" >
CONSIGNEE_FAX = #{consigneeFax,jdbcType=VARCHAR},
</if>
<if test="specificConsigneename != null" >
SPECIFIC_CONSIGNEENAME = #{specificConsigneename,jdbcType=VARCHAR},
</if>
<if test="specificConsigneePhone != null" >
SPECIFIC_CONSIGNEE_PHONE = #{specificConsigneePhone,jdbcType=VARCHAR},
</if>
<if test="consigneePhone != null" >
CONSIGNEE_PHONE = #{consigneePhone,jdbcType=VARCHAR},
</if>
</set>
WHERE
WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
AND
FLIGHTNO= #{flightno,jdbcType=VARCHAR}
AND
FLIGHT_DATE= #{flightDate,jdbcType=TIMESTAMP}
</update>
<select id="selectAutoIdByAwb" parameterType="com.tianbo.analysis.model.ORIGINMANIFESTMASTER" resultType="com.tianbo.analysis.model.ORIGINMANIFESTMASTER">
SELECT AUTOID
FROM ORIGINMANIFESTMASTER
... ... @@ -373,4 +592,15 @@
AND
WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
</select>
<select id="queryMasterInfo" parameterType="com.tianbo.analysis.model.ORIGINMANIFESTMASTER" resultType="com.tianbo.analysis.model.ORIGINMANIFESTMASTER">
SELECT *
FROM ORIGINMANIFESTMASTER
WHERE
FLIGHTNO= #{flightno,jdbcType=VARCHAR}
AND
FLIGHT_DATE= #{flightDate,jdbcType=TIMESTAMP}
AND
WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -267,11 +267,25 @@
WHERE WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
AND WAYBILLNOSECONDARY = #{waybillnosecondary,jdbcType=VARCHAR}
</update>
<update id="updateMasterAutoId" parameterType="com.tianbo.analysis.model.Originmanifestsecondary">
UPDATE
ORIGINMANIFESTSECONDARY
SET
ORIGINMANIFESTMASTERAUTOID = #{originmanifestmasterautoid,jdbcType=VARCHAR},
CUSTOMSSTATUS= #{customsstatus,jdbcType=VARCHAR}
WHERE AutoID= #{autoid,jdbcType=VARCHAR}
</update>
<select id="selectAutoIdByawbAawbH" parameterType="com.tianbo.analysis.model.Originmanifestsecondary" resultType="com.tianbo.analysis.model.Originmanifestsecondary">
SELECT AUTOID
FROM ORIGINMANIFESTSECONDARY
WHERE
WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR} AND WAYBILLNOSECONDARY = #{waybillnosecondary,jdbcType=VARCHAR}
</select>
<select id="selectByFWb" parameterType="java.lang.String" resultType="com.tianbo.analysis.model.Originmanifestsecondary">
SELECT *
FROM ORIGINMANIFESTSECONDARY
WHERE
WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
</select>
</mapper>
\ No newline at end of file
... ...