This commit is contained in:
linfso 2024-06-19 13:29:41 +08:00
parent 152231b267
commit 7e153a21fd
7 changed files with 448 additions and 216 deletions

View File

@ -62,8 +62,15 @@ public class EmisTmsPack extends BaseEntity
private BigDecimal totalVolume;
/* 总重量 */
private BigDecimal totalWeight;
/* 合包状态 1-合包 2-拆包 */
/* 合包状态 0-初始 1-合包 2-拆包 */
private String packStatus;
/* 打印状态 0-未打印 1-已打印 */
private String printStatus;
/* 打印次数 */
private Integer printCount;
/* 打印时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date printDate;
/* 扩展数据 */
private String extData;
/* 操作员 */

View File

@ -32,13 +32,16 @@ import lombok.Data;
public class EmisTmsPackDtl extends BaseEntity
{
private static final long serialVersionUID = 1L;
/* id */
private Long id;
/* 合包号 */
private String packNo;
/* 运单号 */
/* 扫描单号 */
private String billCode;
/* 主单号 */
private String mainBillCode;
/* 是否子单 */
private String blSubBill;
/* 扫描时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date scanDate;
@ -48,6 +51,8 @@ public class EmisTmsPackDtl extends BaseEntity
private String packStatus;
/* 扫描员 */
private String scanMan;
/* 扫描站点 */
private String scanSite;
// 扩展参数
private EmisWaybill waybillDetail;

View File

@ -28,6 +28,9 @@ public interface EmisTmsPackDtlMapper extends BaseMapper<EmisTmsPackDtl>
*/
public EmisTmsPackDtl selectEmisTmsPackDtlById(Long id);
public EmisTmsPackDtl selectEmisTmsPackDtlByBillCode(String billCode);
/**
* 查询列表
*
@ -36,6 +39,23 @@ public interface EmisTmsPackDtlMapper extends BaseMapper<EmisTmsPackDtl>
*/
public List<EmisTmsPackDtl> selectEmisTmsPackDtlList(EmisTmsPackDtl emisTmsPackDtl);
/**
* 检查是否重复
*
* @param emisTmsPackDtl
* @return 数量
*/
public int checkUnique(EmisTmsPackDtl emisTmsPackDtl);
/**
* 检查是否存在组包信息
*
* @param billCode
* @return 数量
*/
public int checkIsExists(String billCode);
/**
* 新增
*

View File

@ -36,6 +36,16 @@ public interface EmisTmsPackMapper extends BaseMapper<EmisTmsPack>
*/
public List<EmisTmsPack> selectEmisTmsPackList(EmisTmsPack emisTmsPack);
/**
* 检查是否重复
*
* @param emisTmsPack
* @return 数量
*/
public int checkUnique(EmisTmsPack emisTmsPack);
/**
* 新增
*

View File

@ -56,6 +56,9 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
@Autowired
private EmisTmsScanPicInfoMapper emisTmsScanPicInfoMapper;
@Autowired
private EmisTmsPackMapper emisTmsPackMapper;
@Autowired
private EmisTmsPackDtlMapper emisTmsPackDtlMapper;
@ -238,120 +241,326 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
public List<ScanResultItem> doScan(String scanType,Map<String,Object> scanDataItem,String dataFrom) throws EmisBizError {
List<ScanResultItem> itemList = new ArrayList<>();
String billCodeInStr = MapUtils.getString(scanDataItem,"billCode",null);
if(StringUtils.isEmpty(billCodeInStr)){
ScanResultItem scanResultItem = new ScanResultItem();
scanResultItem.setBillCode(billCodeInStr);
scanResultItem.setResult("fail");
scanResultItem.setMessage("billCode为空");
itemList.add(scanResultItem);
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR1,"扫描单号不能为空");
// return itemList;
}
// 开始检查数据
String[] billCodeArr = billCodeInStr.split(",");
// 检查数据
// 扫描时间,扫描单号必填
String scanDateStr=MapUtils.getString(scanDataItem,"scanDate",null);
String billCodeInStr = MapUtils.getString(scanDataItem,"billCode",null);
if(StringUtils.isEmpty(scanDateStr)){
ScanResultItem scanResultItem = new ScanResultItem();
scanResultItem.setBillCode(billCodeInStr);
scanResultItem.setResult("fail");
scanResultItem.setMessage("scanDate为空");
itemList.add(scanResultItem);
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS,"扫描时间不能为空");
// return itemList;
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS,"扫描时间必填");
}
Date scanDate = DateUtils.parseDate(scanDateStr);;
for (String scanBillCode:billCodeArr) {
if(StringUtils.isEmpty(billCodeInStr)){
ScanResultItem scanResultItem = new ScanResultItem();
scanResultItem.setBillCode(billCodeInStr);
scanResultItem.setResult("fail");
scanResultItem.setMessage("billCode为空");
itemList.add(scanResultItem);
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR1,"扫描单号必填");
}
String[] billCodeArr = billCodeInStr.split(",");
Date scanDate = DateUtils.parseDate(scanDateStr);
// 合包和拆包需单独处理
if(ScanType.CO_PACKING.opCode.equals(scanType)){
// 合包扫描
return doPackScan(itemList,billCodeArr,scanDataItem,scanDate,dataFrom);
}
// 拆包
else if(ScanType.UN_PACKING.opCode.equals(scanType)){
return doUnPackScan(itemList,billCodeArr,scanDataItem,scanDate,dataFrom);
// "billCode": "T001,T002,T002",
// "scanDate": "2024-05-02 12:03:05",
// "scanWeight": "0.2"
// String packNo = (String)scanDataItem.get("bagNo");
// emisTmsScanRecord.setBagNo(packNo);
}
else {
// 其他扫描方式
for (String scanBillCode : billCodeArr) {
// 返回原始数据返回
ScanResultItem scanResultItem = new ScanResultItem();
scanResultItem.setBillCode(scanBillCode);
scanResultItem.getData().putAll(scanDataItem);
// 获取主单号
String mainBillCode = getMainBillCode(scanBillCode);
// 判断是主单还是子单
boolean isExists = checkWaybillIsExists(mainBillCode);
// 检查运单号是否存在
if (!isExists) {
scanResultItem.setResult("fail");
scanResultItem.setMessage("运单号不存在");
itemList.add(scanResultItem);
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS, "运单号不存在");
}
// 已签收不允许扫描
boolean isSign = checkWaybillIsSign(mainBillCode);
if (isSign) {
scanResultItem.setResult("fail");
scanResultItem.setMessage("运单已签收");
itemList.add(scanResultItem);
throw new EmisBizError(EmisBizErrorType.EXISTS, "运单已签收");
}
// 重复扫描
// 同站点,同动作,同一天不允许重复扫描
int scanCnt = emisTmsScanRecordMapper.checkSiteScanUnique(scanBillCode, scanType, getCurrentUser().getOwnerSiteCode(), scanDate);
if (scanCnt > 0) {
scanResultItem.setResult("fail");
scanResultItem.setMessage("单号[" + scanBillCode + "]重复扫描");
itemList.add(scanResultItem);
// T12312321已[转件扫描]
String scanTypeLabel = DictUtils.getDictLabel("emis_scan_type", scanType);
throw new EmisBizError(EmisBizErrorType.EXISTS, "" + scanBillCode + "已[" + scanTypeLabel + "]");
}
// 生成扫描记录并填充公共数据
EmisTmsScanRecord emisTmsScanRecord = new EmisTmsScanRecord();
// 填充扫描单号
emisTmsScanRecord.setBillCode(scanBillCode);
// 获取订单数据
EmisWaybill emisWaybill = getWaybillByBillCode(mainBillCode);
// 填充运单基础数据
emisTmsScanRecord.setMainBillCode(emisWaybill.getBillCode());
emisTmsScanRecord.setOrderSn(emisWaybill.getOrderSn());
emisTmsScanRecord.setWeight(emisWaybill.getBillWeight());
this.fillBillBaseData(emisTmsScanRecord);
// 扫描类型
emisTmsScanRecord.setScanType(scanType);
// 扫描时间
emisTmsScanRecord.setScanDate(scanDate);
// 填充特殊数据
this.fillScanDataByScanType(emisTmsScanRecord, emisWaybill, scanDataItem);
// 返回数据
scanResultItem.getData().put("billWeight", emisWaybill.getBillWeight());
scanResultItem.getData().put("totalVolume", emisWaybill.getTotalVolume());
scanResultItem.getData().put("parcelQty", emisWaybill.getParcelQty());
emisTmsScanRecordMapper.insertEmisTmsScanRecord(emisTmsScanRecord);
// 修改主运单状态
this.changeWaybillStatus(mainBillCode, scanType);
scanResultItem.setResult("success");
scanResultItem.setMessage("操作成功");
itemList.add(scanResultItem);
}
}
return itemList;
}
public List<ScanResultItem> doPackScan(List<ScanResultItem> itemList,String[] billCodeArr,Map<String,Object> scanDataItem,Date scanDate,String dataFrom) throws EmisBizError {
// 检查数据 合包号,重量
String packNo = MapUtils.getString(scanDataItem,"bagNo",null);
String scanWeightStr = MapUtils.getString(scanDataItem,"scanWeight",null);
Map<String,Integer> mainBillMap = new HashMap<>();
if(StringUtils.isAnyEmpty(packNo,scanWeightStr)) {
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR1,"合包号,合包重量不能为空");
}
BigDecimal scanWeight= BigDecimal.valueOf(Double.valueOf(scanWeightStr));
if(scanWeight.compareTo(BigDecimal.ZERO)==0){
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR1,"合包重量不能为0");
}
// 子单号处理
for (String scanBillCode : billCodeArr) {
// 返回原始数据返回
ScanResultItem scanResultItem = new ScanResultItem();
scanResultItem.setBillCode(scanBillCode);
scanResultItem.getData().putAll(scanDataItem);
// 获取主单号
String mainBillCode=getMainBillCode(scanBillCode);
String mainBillCode = getMainBillCode(scanBillCode);
// 判断是主单还是子单
boolean isExists=checkWaybillIsExists(mainBillCode);
boolean isExists = checkWaybillIsExists(mainBillCode);
// 检查运单号是否存在
if(!isExists){
if (!isExists) {
scanResultItem.setResult("fail");
scanResultItem.setMessage("运单号不存在");
itemList.add(scanResultItem);
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS,"运单号不存在");
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS, "运单号不存在");
}
// 已签收不允许扫描
boolean isSign=checkWaybillIsSign(mainBillCode);
if(isSign){
boolean isSign = checkWaybillIsSign(mainBillCode);
if (isSign) {
scanResultItem.setResult("fail");
scanResultItem.setMessage("运单已签收");
itemList.add(scanResultItem);
throw new EmisBizError(EmisBizErrorType.EXISTS,"运单已签收");
throw new EmisBizError(EmisBizErrorType.EXISTS, "运单已签收");
}
// 重复扫描
// 同站点,同动作,同一天不允许重复扫描
int scanCnt=emisTmsScanRecordMapper.checkSiteScanUnique(scanBillCode,scanType,getCurrentUser().getOwnerSiteCode(),scanDate);
if(scanCnt>0){
EmisTmsPackDtl emisTmsPackDtl = new EmisTmsPackDtl();
emisTmsPackDtl.setBillCode(scanBillCode);
emisTmsPackDtl.setMainBillCode(mainBillCode);
if(scanBillCode.equals(mainBillCode)){
emisTmsPackDtl.setBlSubBill("1");
}
// 已组包,不允许再组包
int scanCnt=emisTmsPackDtlMapper.checkUnique(emisTmsPackDtl);
if (scanCnt > 0) {
scanResultItem.setResult("fail");
scanResultItem.setMessage("单号["+scanBillCode+"]重复扫描");
scanResultItem.setMessage("[" + scanBillCode + "]已组包,不允许再组包");
itemList.add(scanResultItem);
// T12312321已[转件扫描]
String scanTypeLabel=DictUtils.getDictLabel("emis_scan_type",scanType);
throw new EmisBizError(EmisBizErrorType.EXISTS,""+scanBillCode+"已["+scanTypeLabel+"]");
throw new EmisBizError(EmisBizErrorType.EXISTS, "[" + scanBillCode + "]已组包,不允许再组包");
}
// 生成扫描记录并填充公共数据
EmisTmsScanRecord emisTmsScanRecord=new EmisTmsScanRecord();
// 填充扫描单号
emisTmsScanRecord.setBillCode(scanBillCode);
// 获取订单数据
EmisWaybill emisWaybill = getWaybillByBillCode(mainBillCode);
// 如果是缅甸允许主单扫描,其他都不允许
if(!"0095".equals(emisWaybill.getReceiveCountry()) && !"1".equals(emisTmsPackDtl.getBlSubBill() ) ){
throw new EmisBizError(EmisBizErrorType.EXISTS, "非缅甸不允许主单组包");
}
// 填充运单基础数据
this.fillBillBaseData(emisTmsScanRecord,mainBillCode,emisWaybill);
if(!mainBillMap.containsKey(mainBillCode)){
mainBillMap.put(mainBillCode,1);
}
// 扫描类型
emisTmsScanRecord.setScanType(scanType);
// 生成扫描记录
EmisTmsScanRecord emisTmsScanRecord = new EmisTmsScanRecord();
emisTmsScanRecord.setBillCode(scanBillCode);
emisTmsScanRecord.setMainBillCode(emisWaybill.getBillCode());
emisTmsScanRecord.setOrderSn(emisWaybill.getOrderSn());
emisTmsScanRecord.setWeight(emisWaybill.getBillWeight());
// 扫描时间
emisTmsScanRecord.setScanType(ScanType.CO_PACKING.opCode);
emisTmsScanRecord.setScanDate(scanDate);
emisTmsScanRecord.setBagNo(packNo);
// 填充特殊数据
this.fillScanDataByScanType(emisTmsScanRecord,mainBillCode,scanType,scanDataItem);
// 填充公共数据
this.fillBillBaseData(emisTmsScanRecord);
// 返回数据
scanResultItem.getData().put("billWeight",emisWaybill.getBillWeight());
scanResultItem.getData().put("totalVolume",emisWaybill.getTotalVolume());
scanResultItem.getData().put("parcelQty",emisWaybill.getParcelQty());
emisTmsScanRecordMapper.insertEmisTmsScanRecord(emisTmsScanRecord);
// 修改主运单状态
this.changeWaybillStatus(mainBillCode,scanType);
// 合包数据插入
emisTmsPackDtl.setPackNo(packNo);
emisTmsPackDtl.setPackStatus("1");
emisTmsPackDtl.setScanStatus("1");
emisTmsPackDtl.setScanDate(emisTmsScanRecord.getScanDate());
emisTmsPackDtl.setScanMan(emisTmsScanRecord.getScanManCode());
emisTmsPackDtlMapper.insertEmisTmsPackDtl(emisTmsPackDtl);
// 修改主运单状态,子单做合包扫描,主单不变化
// this.changeWaybillStatus(mainBillCode, ScanType.CO_PACKING.opCode);
scanResultItem.getData().put("billWeight", emisWaybill.getBillWeight());
scanResultItem.getData().put("totalVolume", emisWaybill.getTotalVolume());
scanResultItem.getData().put("parcelQty", emisWaybill.getParcelQty());
scanResultItem.setResult("success");
scanResultItem.setMessage("操作成功");
itemList.add(scanResultItem);
}
// 更新合包总重量
EmisTmsPack emisTmsPack = new EmisTmsPack();
emisTmsPack.setPackNo(packNo);
emisTmsPack.setTotalWeight(scanWeight);
emisTmsPack.setTotalWaybillQty(mainBillMap.size());
emisTmsPack.setTotalParcelQty(billCodeArr.length);
int eCnt=emisTmsPackMapper.checkUnique(emisTmsPack);
if(eCnt>0){
emisTmsPackMapper.updateEmisTmsPack(emisTmsPack);
}else{
emisTmsPackMapper.insertEmisTmsPack(emisTmsPack);
}
return itemList;
}
public List<ScanResultItem> doUnPackScan(List<ScanResultItem> itemList,String[] billCodeArr,Map<String,Object> scanDataItem,Date scanDate,String dataFrom) throws EmisBizError {
String packNo=null;
// 子单号处理
for (String scanBillCode : billCodeArr) {
// 返回原始数据返回
ScanResultItem scanResultItem = new ScanResultItem();
scanResultItem.setBillCode(scanBillCode);
scanResultItem.getData().putAll(scanDataItem);
// 检查是否存在
EmisTmsPackDtl emisTmsPackDtl =emisTmsPackDtlMapper.selectEmisTmsPackDtlByBillCode(scanBillCode);
// 找不到组包信息
if (emisTmsPackDtl == null) {
scanResultItem.setResult("fail");
scanResultItem.setMessage("未组包");
itemList.add(scanResultItem);
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS, "未组包");
}
packNo=emisTmsPackDtl.getPackNo();
// 生成扫描记录
EmisTmsScanRecord emisTmsScanRecord = new EmisTmsScanRecord();
emisTmsScanRecord.setBillCode(scanBillCode);
emisTmsScanRecord.setMainBillCode(emisTmsPackDtl.getMainBillCode());
emisTmsScanRecord.setScanType(ScanType.UN_PACKING.opCode);
emisTmsScanRecord.setScanDate(scanDate);
emisTmsScanRecord.setBagNo(emisTmsPackDtl.getPackNo());
// 填充公共数据
this.fillBillBaseData(emisTmsScanRecord);
emisTmsScanRecordMapper.insertEmisTmsScanRecord(emisTmsScanRecord);
// 更新合包运单扫描状态 ,拆包
emisTmsPackDtl.setBillCode(scanBillCode);
emisTmsPackDtl.setPackStatus("0");
emisTmsPackDtl.setScanStatus("1");
emisTmsPackDtl.setScanDate(emisTmsScanRecord.getScanDate());
emisTmsPackDtl.setScanMan(emisTmsScanRecord.getScanManCode());
emisTmsPackDtlMapper.updateScanStatus(emisTmsPackDtl);
// 修改主运单状态,子单做合包扫描,主单不变化
// this.changeWaybillStatus(mainBillCode, ScanType.CO_PACKING.opCode);
scanResultItem.getData().put("billWeight", 0f);
scanResultItem.getData().put("totalVolume", 0f);
scanResultItem.getData().put("parcelQty", 0f);
scanResultItem.setResult("success");
scanResultItem.setMessage("操作成功");
itemList.add(scanResultItem);
}
// 更新合包为拆包状态
EmisTmsPack emisTmsPack = new EmisTmsPack();
emisTmsPack.setPackNo(packNo);
emisTmsPack.setPackStatus("2");
emisTmsPackMapper.updateEmisTmsPack(emisTmsPack);
return itemList;
}
/**
* 填充公共数据
* @param emisTmsScanRecord
* @param emisWaybill
*/
private void fillBillBaseData(EmisTmsScanRecord emisTmsScanRecord,String mainBillCode,EmisWaybill emisWaybill){
private void fillBillBaseData(EmisTmsScanRecord emisTmsScanRecord){
// 公共部分
emisTmsScanRecord.setMainBillCode(emisWaybill.getBillCode());
emisTmsScanRecord.setOrderSn(emisWaybill.getOrderSn());
emisTmsScanRecord.setWeight(emisWaybill.getBillWeight());
emisTmsScanRecord.setScanManCode(getCurrentUser().getEmpCode());
emisTmsScanRecord.setScanManPhone(getCurrentUser().getPhonenumber());
emisTmsScanRecord.setScanMan(getCurrentUser().getEmpName());
@ -375,13 +584,12 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
/**
* 填充扫描特殊数据
* @param emisTmsScanRecord
* @param mainBillCode
* @param scanType
* @param scanDataItem
* @throws EmisBizError
*/
public void fillScanDataByScanType(EmisTmsScanRecord emisTmsScanRecord,String mainBillCode, String scanType, Map<String,Object> scanDataItem) throws EmisBizError {
public void fillScanDataByScanType(EmisTmsScanRecord emisTmsScanRecord,EmisWaybill emisWaybill, Map<String,Object> scanDataItem) throws EmisBizError {
String scanType = emisTmsScanRecord.getScanType();
// 揽收扫描
if(ScanType.GOT.opCode.equals(scanType)){
// String scanWeightStr = (String)scanDataItem.get("scanWeight");
@ -435,21 +643,18 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
changeWaybillNextSite(emisTmsScanRecord.getBillCode(),preOrNextStationCode);
// 判断是否需要发寄件短信
String billCode=emisTmsScanRecord.getBillCode();
EmisWaybill waybill=getWaybillByBillCode(mainBillCode);
if( "1".equals(waybill.getBlMessage()) ) {
if( "1".equals(emisWaybill.getBlMessage()) ) {
//发送寄件短信
String content="尊敬的客户:您寄往${Nationalcity}的包裹已寄出,运单号${name}。如有疑问,详询服务热线4000257080,感谢您使用探路速运!";
String nationalcity=waybill.getReceiveCountryName()+""+waybill.getReceiveProvinceName();
String nationalcity=emisWaybill.getReceiveCountryName()+""+emisWaybill.getReceiveProvinceName();
content = content.replace("${Nationalcity}",nationalcity);
content = content.replace("${name}",mainBillCode);
content = content.replace("${name}",emisWaybill.getBillCode());
EmisSmsSendRecord emisSmsSendRecord = new EmisSmsSendRecord();
emisSmsSendRecord.setBillCode(emisTmsScanRecord.getBillCode());
emisSmsSendRecord.setSmsType("1"); // 发件短信
emisSmsSendRecord.setPhone(waybill.getSendMobile());
emisSmsSendRecord.setPhone(emisWaybill.getSendMobile());
emisSmsSendRecord.setContent(content);
emisSmsSendRecord.setSendSiteCode(emisTmsScanRecord.getScanSiteCode());
emisSmsSendRecord.setSendSiteName(emisTmsScanRecord.getScanSite());
@ -465,10 +670,9 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
// 到件扫描
else if(ScanType.ARRIVAL.opCode.equals(scanType)){
EmisWaybill waybill=getWaybillByBillCode(emisTmsScanRecord.getBillCode());
if(!StringUtils.isEmpty(waybill.getCurrentSiteCode())) {
EmisSite site = getSiteByCode(waybill.getCurrentSiteCode());
if(!StringUtils.isEmpty(emisWaybill.getCurrentSiteCode())) {
EmisSite site = getSiteByCode(emisWaybill.getCurrentSiteCode());
// 获取上一站
emisTmsScanRecord.setPreOrNextStationCode(site.getSiteCode());
emisTmsScanRecord.setPreOrNextStation(site.getSiteName());
@ -476,7 +680,7 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
}
// 改变当前站点
changeWaybillCurrentSite(emisTmsScanRecord.getBillCode(),emisTmsScanRecord.getScanSiteCode());
changeWaybillCurrentSite(emisWaybill.getBillCode(),emisTmsScanRecord.getScanSiteCode());
}
// 派送扫描
else if(ScanType.SENT.opCode.equals(scanType)){
@ -569,19 +773,18 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
changeWaybillCurrentSite(emisTmsScanRecord.getBillCode(),emisTmsScanRecord.getScanSiteCode());
EmisWaybill waybill=getWaybillByBillCode(mainBillCode);
if( "1".equals(waybill.getBlMessage()) ) {
if( "1".equals(emisWaybill.getBlMessage()) ) {
//发送寄件短信
String content="尊敬的客户:您寄往${Nationalcity}的快递${name}已被签收,感谢您使用探路速运。";
String nationalcity=waybill.getReceiveCountryName()+""+waybill.getReceiveProvinceName();
String nationalcity=emisWaybill.getReceiveCountryName()+""+emisWaybill.getReceiveProvinceName();
content = content.replace("${Nationalcity}",nationalcity);
content = content.replace("${name}",mainBillCode);
content = content.replace("${name}",emisWaybill.getBillCode());
EmisSmsSendRecord emisSmsSendRecord = new EmisSmsSendRecord();
emisSmsSendRecord.setBillCode(emisTmsScanRecord.getBillCode());
emisSmsSendRecord.setSmsType("2"); // 签收短信
emisSmsSendRecord.setPhone(waybill.getSendMobile());
emisSmsSendRecord.setPhone(emisWaybill.getSendMobile());
emisSmsSendRecord.setContent(content);
emisSmsSendRecord.setSendSiteCode(emisTmsScanRecord.getScanSiteCode());
emisSmsSendRecord.setSendSiteName(emisTmsScanRecord.getScanSite());
@ -646,6 +849,10 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
Float transferVolume =MapUtils.getFloat(scanDataItem,"transferVolume",null) ;
Float transferFee =MapUtils.getFloat(scanDataItem,"transferFee",null) ;
if(StringUtils.isAnyEmpty(transferCode,transferBillcode,destCity)) {
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR1,"转件公司,转单号,目标城市必填");
}
emisTmsScanRecord.setPreOrNextStation(destCity);
// 获取快递公司
@ -697,17 +904,21 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
// "scanDate": "2024-05-02 12:03:05",
// "scanWeight": "0.2"
Integer problemType = Integer.valueOf(scanDataItem.get("problemType").toString());
String notifySite = (String)scanDataItem.get("notifySite");
String picUrl = (String)scanDataItem.get("picUrl");
String remark = (String)scanDataItem.get("remark");
String problemType = MapUtils.getString(scanDataItem,"problemType",null);
String notifySite = MapUtils.getString(scanDataItem,"notifySite",null);
String picUrl = MapUtils.getString(scanDataItem,"picUrl",null);
String remark = MapUtils.getString(scanDataItem,"remark",null);
if(StringUtils.isAnyEmpty(problemType,notifySite,remark)) {
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR1,"问题类型,通知网点,问题原因必填");
}
emisTmsScanRecord.setRemark(remark);
// 登记问题件
EmisWaybillProblemInfo waybillProblemInfo = new EmisWaybillProblemInfo();
waybillProblemInfo.setBillCode(emisTmsScanRecord.getBillCode());
waybillProblemInfo.setProblemType(problemType);
waybillProblemInfo.setProblemType(Integer.valueOf(problemType));
waybillProblemInfo.setProblemCause(remark);
waybillProblemInfo.setSendSiteCode(notifySite);
@ -727,58 +938,7 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
}
registerWaybillProblemInfo(waybillProblemInfo);
}
// 合包
else if(ScanType.CO_PACKING.opCode.equals(scanType)){
// "billCode": "T001,T002,T002",
// "bagNo": "合包袋号",
// "scanDate": "2024-05-02 12:03:05",
// "scanWeight": "0.2"
String packNo = (String)scanDataItem.get("bagNo");
if(StringUtils.isEmpty(packNo)) {
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR1,"合包号不能为空");
}
// 只允许扫子单
boolean isMainBill=checkWaybillIsExists(emisTmsScanRecord.getBillCode());
if(isMainBill){
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR1,"非子单号,不允许扫描!");
}
emisTmsScanRecord.setBagNo(packNo);
// 更新合包运单扫描状态
EmisTmsPackDtl emisTmsPackDtl = new EmisTmsPackDtl();
emisTmsPackDtl.setBillCode(emisTmsScanRecord.getBillCode());
emisTmsPackDtl.setPackNo(packNo);
emisTmsPackDtl.setPackStatus("1");
emisTmsPackDtl.setScanStatus("1");
emisTmsPackDtl.setScanDate(emisTmsScanRecord.getScanDate());
emisTmsPackDtl.setScanMan(emisTmsScanRecord.getScanManCode());
emisTmsPackDtlMapper.updateScanStatus(emisTmsPackDtl);
}
// 拆包
else if(ScanType.UN_PACKING.opCode.equals(scanType)){
// "billCode": "T001,T002,T002",
// "scanDate": "2024-05-02 12:03:05",
// "scanWeight": "0.2"
String packNo = (String)scanDataItem.get("bagNo");
emisTmsScanRecord.setBagNo(packNo);
// 更新合包运单扫描状态 ,拆包
EmisTmsPackDtl emisTmsPackDtl = new EmisTmsPackDtl();
emisTmsPackDtl.setBillCode(emisTmsScanRecord.getBillCode());
emisTmsPackDtl.setPackNo(packNo);
emisTmsPackDtl.setPackStatus("0");
emisTmsPackDtl.setScanStatus("1");
emisTmsPackDtl.setScanDate(emisTmsScanRecord.getScanDate());
emisTmsPackDtl.setScanMan(emisTmsScanRecord.getScanManCode());
emisTmsPackDtlMapper.updateScanStatus(emisTmsPackDtl);
}
// 装车
else if(ScanType.LOADING.opCode.equals(scanType)){
// "billCode": "T001",
@ -832,36 +992,42 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
// 下一站
// String scanWeightStr = (String)scanDataItem.get("scanWeight");
String preOrNextStationCode = (String)scanDataItem.get("preOrNextStationCode");
if(!StringUtils.isEmpty(preOrNextStationCode)) {
EmisSite site=getSiteByCode(preOrNextStationCode);
emisTmsScanRecord.setPreOrNextStationCode(preOrNextStationCode);
emisTmsScanRecord.setPreOrNextStation(site.getSiteName());
emisTmsScanRecord.setPreOrNextStationPhone(site.getPhone());
// 当前站点
changeWaybillCurrentSite(emisTmsScanRecord.getBillCode(),emisTmsScanRecord.getScanSiteCode());
// 下一站点
changeWaybillNextSite(emisTmsScanRecord.getBillCode(),preOrNextStationCode);
if(StringUtils.isEmpty(preOrNextStationCode)) {
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR1,"下一站必填");
}
EmisSite site=getSiteByCode(preOrNextStationCode);
emisTmsScanRecord.setPreOrNextStationCode(preOrNextStationCode);
emisTmsScanRecord.setPreOrNextStation(site.getSiteName());
emisTmsScanRecord.setPreOrNextStationPhone(site.getPhone());
// 当前站点
changeWaybillCurrentSite(emisTmsScanRecord.getBillCode(),emisTmsScanRecord.getScanSiteCode());
// 下一站点
changeWaybillNextSite(emisTmsScanRecord.getBillCode(),preOrNextStationCode);
}
// 清关扫描
else if(ScanType.CLEARANCE.opCode.equals(scanType)){
// 下一站
// String scanWeightStr = (String)scanDataItem.get("scanWeight");
String preOrNextStationCode = (String)scanDataItem.get("preOrNextStationCode");
if(!StringUtils.isEmpty(preOrNextStationCode)) {
EmisSite site=getSiteByCode(preOrNextStationCode);
emisTmsScanRecord.setPreOrNextStationCode(preOrNextStationCode);
emisTmsScanRecord.setPreOrNextStation(site.getSiteName());
emisTmsScanRecord.setPreOrNextStationPhone(site.getPhone());
// 当前站点
changeWaybillCurrentSite(emisTmsScanRecord.getBillCode(),emisTmsScanRecord.getScanSiteCode());
// 下一站点
changeWaybillNextSite(emisTmsScanRecord.getBillCode(),preOrNextStationCode);
if(StringUtils.isEmpty(preOrNextStationCode)) {
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR1,"下一站必填");
}
EmisSite site=getSiteByCode(preOrNextStationCode);
emisTmsScanRecord.setPreOrNextStationCode(preOrNextStationCode);
emisTmsScanRecord.setPreOrNextStation(site.getSiteName());
emisTmsScanRecord.setPreOrNextStationPhone(site.getPhone());
// 当前站点
changeWaybillCurrentSite(emisTmsScanRecord.getBillCode(),emisTmsScanRecord.getScanSiteCode());
// 下一站点
changeWaybillNextSite(emisTmsScanRecord.getBillCode(),preOrNextStationCode);
}
}

View File

@ -8,18 +8,20 @@
<result property="id" column="id" />
<result property="packNo" column="pack_no" />
<result property="billCode" column="bill_code" />
<result property="mainBillCode" column="main_bill_code" />
<result property="blSubBill" column="bl_sub_bill" />
<result property="scanDate" column="scan_date" />
<result property="scanStatus" column="scan_status" />
<result property="packStatus" column="pack_status" />
<result property="scanMan" column="scan_man" />
<result property="scanSite" column="scan_site" />
</resultMap>
<resultMap id="EmisTmsPackDtlResult" type="EmisTmsPackDtl" extends="BaseEmisTmsPackDtlResult" >
<association property="waybillDetail"
column="bill_code"
column="main_bill_code"
select="com.xdadan.erp.emis.mapper.EmisWaybillMapper.selectWaybillBaseInfoByBillCode"
fetchType="lazy"
/>
@ -27,7 +29,7 @@
</resultMap>
<sql id="selectEmisTmsPackDtlVo">
select id, pack_no, bill_code, scan_date, scan_status, pack_status, scan_man, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_tms_pack_dtl
select id, pack_no, bill_code, main_bill_code, bl_sub_bill, scan_date, scan_status, pack_status, scan_man, scan_site, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_tms_pack_dtl
</sql>
<select id="selectEmisTmsPackDtlList" parameterType="EmisTmsPackDtl" resultMap="EmisTmsPackDtlResult">
@ -36,21 +38,23 @@
del_flag='0'
<if test="id != null "> and id = #{id}</if>
<if test="packNo != null and packNo != ''"> and ( FIND_IN_SET(`pack_no`,#{packNo}) or pack_no like concat('%', #{packNo}, '%') )</if>
<if test="billCode != null and billCode != ''"> and ( FIND_IN_SET(`bill_code`,#{billCode}) or bill_code like concat('%', #{billCode}, '%') )</if>
<if test="billCode != null and billCode != ''"> and ( FIND_IN_SET(`bill_code`,#{billCode}) or FIND_IN_SET(`main_bill_code`,#{billCode}) or bill_code like concat('%', #{billCode}, '%') or main_bill_code like concat('%', #{billCode}, '%') )</if>
<if test="mainBillCode != null and mainBillCode != ''"> and main_bill_code = #{mainBillCode}</if>
<if test="blSubBill != null and blSubBill != ''"> and bl_sub_bill = #{blSubBill}</if>
<if test="scanDate != null "> and scan_date = #{scanDate}</if>
<if test="scanStatus != null and scanStatus != ''"> and scan_status=#{scanStatus}</if>
<if test="packStatus != null and packStatus != ''"> and pack_status=#{packStatus}</if>
<if test="scanMan != null and scanMan != ''"> and scan_man like concat('%', #{scanMan}, '%')</if>
<if test="scanStatus != null and scanStatus != ''"> and scan_status = #{scanStatus}</if>
<if test="packStatus != null and packStatus != ''"> and pack_status = #{packStatus}</if>
<if test="scanMan != null and scanMan != ''"> and scan_man = #{scanMan}</if>
<if test="scanSite != null and scanSite != ''"> and scan_site = #{scanSite}</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
<if test="tenantId != null and tenantId != ''"> and tenant_id like concat('%', #{tenantId}, '%')</if>
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
<if test="tenantId != null and tenantId != ''"> and tenant_id = #{tenantId}</if>
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
<if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy}</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
<if test="createSite != null and createSite != ''"> and create_site=#{createSite}</if>
<if test="updateSite != null and updateSite != ''"> and update_site=#{updateSite}</if>
<if test="createSite != null and createSite != ''"> and create_site = #{createSite}</if>
<if test="updateSite != null and updateSite != ''"> and update_site = #{updateSite}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != ''">
and create_time <![CDATA[ >= ]]> #{params.beginCreateTime}
@ -75,10 +79,31 @@
order by create_time desc
</select>
<select id="checkUnique" parameterType="EmisTmsPackDtl" resultType="int">
select count(1) from emis_tms_pack_dtl
where del_flag='0'
and pack_no = #{packNo}
and bill_code = #{billCode}
limit 1
</select>
<select id="checkIsExists" parameterType="EmisTmsPackDtl" resultType="int">
select count(1) from emis_tms_pack_dtl
where del_flag='0'
and bill_code = #{billCode}
limit 1
</select>
<select id="selectEmisTmsPackDtlById" parameterType="Long" resultMap="EmisTmsPackDtlResult">
select id, pack_no, bill_code, scan_date, scan_status, pack_status, scan_man, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
select id, pack_no, bill_code, main_bill_code, bl_sub_bill, scan_date, scan_status, pack_status, scan_man, scan_site, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_tms_pack_dtl a
where a.id = #{id}
where del_flag='0' and a.id = #{id}
</select>
<select id="selectEmisTmsPackDtlByBillCode" parameterType="String" resultMap="EmisTmsPackDtlResult">
select id, pack_no, bill_code, main_bill_code, bl_sub_bill, scan_date, scan_status, pack_status, scan_man, scan_site, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_tms_pack_dtl a
where del_flag='0' and a.bill_code = #{billCode}
</select>
<insert id="insertEmisTmsPackDtl" parameterType="EmisTmsPackDtl" useGeneratedKeys="true" keyProperty="id">
@ -87,10 +112,13 @@
<if test="id != null">id,</if>
<if test="packNo != null and packNo != ''">pack_no,</if>
<if test="billCode != null and billCode != ''">bill_code,</if>
<if test="mainBillCode != null and mainBillCode != ''">main_bill_code,</if>
<if test="blSubBill != null and blSubBill != ''">bl_sub_bill,</if>
<if test="scanDate != null">scan_date,</if>
<if test="scanStatus != null and scanStatus != ''">scan_status,</if>
<if test="packStatus != null and packStatus != ''">pack_status,</if>
<if test="scanMan != null and scanMan != ''">scan_man,</if>
<if test="scanSite != null and scanSite != ''">scan_site,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="tenantId != null and tenantId != ''">tenant_id,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
@ -105,10 +133,13 @@
<if test="id != null">#{id},</if>
<if test="packNo != null and packNo != ''">#{packNo},</if>
<if test="billCode != null and billCode != ''">#{billCode},</if>
<if test="mainBillCode != null and mainBillCode != ''">#{mainBillCode},</if>
<if test="blSubBill != null and blSubBill != ''">#{blSubBill},</if>
<if test="scanDate != null">#{scanDate},</if>
<if test="scanStatus != null and scanStatus != ''">#{scanStatus},</if>
<if test="packStatus != null and packStatus != ''">#{packStatus},</if>
<if test="scanMan != null and scanMan != ''">#{scanMan},</if>
<if test="scanSite != null and scanSite != ''">#{scanSite},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="tenantId != null and tenantId != ''">#{tenantId},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
@ -126,10 +157,13 @@
<trim prefix="SET" suffixOverrides=",">
<if test="packNo != null and packNo != ''">pack_no = #{packNo},</if>
<if test="billCode != null and billCode != ''">bill_code = #{billCode},</if>
<if test="mainBillCode != null and mainBillCode != ''">main_bill_code = #{mainBillCode},</if>
<if test="blSubBill != null and blSubBill != ''">bl_sub_bill = #{blSubBill},</if>
<if test="scanDate != null">scan_date = #{scanDate},</if>
<if test="scanStatus != null and scanStatus != ''">scan_status = #{scanStatus},</if>
<if test="packStatus != null and packStatus != ''">pack_status = #{packStatus},</if>
<if test="scanMan != null and scanMan != ''">scan_man = #{scanMan},</if>
<if test="scanSite != null and scanSite != ''">scan_site = #{scanSite},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="tenantId != null and tenantId != ''">tenant_id = #{tenantId},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
@ -158,11 +192,11 @@
</update>
<delete id="deleteEmisTmsPackDtlById" parameterType="Long">
delete from emis_tms_pack_dtl where id = #{id}
update from emis_tms_pack_dtl where id = #{id}
</delete>
<delete id="deleteEmisTmsPackDtlByIds" parameterType="String">
delete from emis_tms_pack_dtl where id in
update from emis_tms_pack_dtl where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>

View File

@ -5,6 +5,7 @@
<mapper namespace="com.xdadan.erp.emis.mapper.EmisTmsPackMapper">
<resultMap type="EmisTmsPack" id="EmisTmsPackResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
<result property="id" column="id" />
<result property="packNo" column="pack_no" />
<result property="packName" column="pack_name" />
@ -20,6 +21,9 @@
<result property="totalVolume" column="total_volume" />
<result property="totalWeight" column="total_weight" />
<result property="packStatus" column="pack_status" />
<result property="printStatus" column="print_status" />
<result property="printCount" column="print_count" />
<result property="printDate" column="print_date" />
<result property="extData" column="ext_data" />
<result property="opMan" column="op_man" />
<result property="ext1" column="ext1" />
@ -30,7 +34,7 @@
</resultMap>
<sql id="selectEmisTmsPackVo">
select id, pack_no, pack_name, pack_date, dest_country, dest_country_name, bl_unpack, send_stite_code, next_site_code, next_station, total_parcel_qty, total_waybill_qty, total_volume, total_weight, pack_status, ext_data, op_man, ext1, ext2, ext3, ext4, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_tms_pack
select id, pack_no, pack_name, pack_date, dest_country, dest_country_name, bl_unpack, send_stite_code, next_site_code, next_station, total_parcel_qty, total_waybill_qty, total_volume, total_weight, pack_status, print_status, print_count, print_date, ext_data, op_man, ext1, ext2, ext3, ext4, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_tms_pack
</sql>
<select id="selectEmisTmsPackList" parameterType="EmisTmsPack" resultMap="EmisTmsPackResult">
@ -41,28 +45,35 @@
<if test="packNo != null and packNo != ''"> and ( FIND_IN_SET(`pack_no`,#{packNo}) or pack_no like concat('%', #{packNo}, '%') )</if>
<if test="packName != null and packName != ''"> and pack_name like concat('%', #{packName}, '%')</if>
<if test="packDate != null "> and pack_date like concat('%', #{packDate}, '%')</if>
<if test="destCountry != null and destCountry != ''"> and dest_country=#{destCountry}</if>
<if test="destCountry != null and destCountry != ''"> and dest_country = #{destCountry}</if>
<if test="destCountryName != null and destCountryName != ''"> and dest_country_name like concat('%', #{destCountryName}, '%')</if>
<if test="blUnpack != null and blUnpack != ''"> and bl_unpack= #{blUnpack}</if>
<if test="sendStiteCode != null and sendStiteCode != ''"> and send_stite_code= #{sendStiteCode}</if>
<if test="nextSiteCode != null and nextSiteCode != ''"> and next_site_code=#{nextSiteCode}</if>
<if test="nextStation != null and nextStation != ''"> and next_station like concat('%', #{nextStation}, '%')</if>
<if test="blUnpack != null and blUnpack != ''"> and bl_unpack = #{blUnpack}</if>
<if test="sendStiteCode != null and sendStiteCode != ''"> and send_stite_code = #{sendStiteCode}</if>
<if test="nextSiteCode != null and nextSiteCode != ''"> and next_site_code = #{nextSiteCode}</if>
<if test="nextStation != null and nextStation != ''"> and next_station = #{nextStation}</if>
<if test="totalParcelQty != null "> and total_parcel_qty = #{totalParcelQty}</if>
<if test="totalWaybillQty != null "> and total_waybill_qty = #{totalWaybillQty}</if>
<if test="totalVolume != null "> and total_volume = #{totalVolume}</if>
<if test="totalWeight != null "> and total_weight = #{totalWeight}</if>
<if test="packStatus != null and packStatus != ''"> and pack_status=#{packStatus}</if>
<if test="packStatus != null and packStatus != ''"> and pack_status = #{packStatus}</if>
<if test="printStatus != null and printStatus != ''"> and print_status = #{printStatus}</if>
<if test="printCount != null "> and print_count = #{printCount}</if>
<if test="printDate != null "> and print_date = #{printDate}</if>
<if test="extData != null and extData != ''"> and ext_data like concat('%', #{extData}, '%')</if>
<if test="opMan != null and opMan != ''"> and op_man like concat('%', #{opMan}, '%')</if>
<if test="opMan != null and opMan != ''"> and op_man = #{opMan}</if>
<if test="ext1 != null and ext1 != ''"> and ext1 like concat('%', #{ext1}, '%')</if>
<if test="ext2 != null and ext2 != ''"> and ext2 like concat('%', #{ext2}, '%')</if>
<if test="ext3 != null and ext3 != ''"> and ext3 like concat('%', #{ext3}, '%')</if>
<if test="ext4 != null and ext4 != ''"> and ext4 like concat('%', #{ext4}, '%')</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
<if test="tenantId != null and tenantId != ''"> and tenant_id like concat('%', #{tenantId}, '%')</if>
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
<if test="createBy != null and createBy != ''"> and create_by=#{createBy}</if>
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and update_by=#{updateBy}</if>
<if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy}</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
<if test="createSite != null and createSite != ''"> and create_site=#{createSite}</if>
<if test="updateSite != null and updateSite != ''"> and update_site=#{updateSite}</if>
<if test="createSite != null and createSite != ''"> and create_site = #{createSite}</if>
<if test="updateSite != null and updateSite != ''"> and update_site = #{updateSite}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != ''">
and create_time <![CDATA[ >= ]]> #{params.beginCreateTime}
@ -93,7 +104,6 @@
)
</if>
</where>
order by create_time desc
</select>
@ -101,41 +111,12 @@
<select id="checkUnique" parameterType="EmisTmsPack" resultType="int">
select count(1) from emis_tms_pack
where del_flag='0'
and id = #{id}
and pack_no = #{packNo}
and pack_name = #{packName}
and pack_date = #{packDate}
and dest_country = #{destCountry}
and dest_country_name = #{destCountryName}
and bl_unpack = #{blUnpack}
and send_stite_code = #{sendStiteCode}
and next_site_code = #{nextSiteCode}
and next_station = #{nextStation}
and total_parcel_qty = #{totalParcelQty}
and total_waybill_qty = #{totalWaybillQty}
and total_volume = #{totalVolume}
and total_weight = #{totalWeight}
and pack_status = #{packStatus}
and ext_data = #{extData}
and op_man = #{opMan}
and ext1 = #{ext1}
and ext2 = #{ext2}
and ext3 = #{ext3}
and ext4 = #{ext4}
and remark = #{remark}
and tenant_id = #{tenantId}
and del_flag = #{delFlag}
and create_by = #{createBy}
and create_time = #{createTime}
and update_by = #{updateBy}
and update_time = #{updateTime}
and create_site = #{createSite}
and update_site = #{updateSite}
limit 1
</select>
<select id="selectEmisTmsPackById" parameterType="Long" resultMap="EmisTmsPackResult">
select id, pack_no, pack_name, pack_date, dest_country, dest_country_name, bl_unpack, send_stite_code, next_site_code, next_station, total_parcel_qty, total_waybill_qty, total_volume, total_weight, pack_status, ext_data, op_man, ext1, ext2, ext3, ext4, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
select id, pack_no, pack_name, pack_date, dest_country, dest_country_name, bl_unpack, send_stite_code, next_site_code, next_station, total_parcel_qty, total_waybill_qty, total_volume, total_weight, pack_status, print_status, print_count, print_date, ext_data, op_man, ext1, ext2, ext3, ext4, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_tms_pack a
where a.id = #{id}
</select>
@ -158,6 +139,9 @@
<if test="totalVolume != null">total_volume,</if>
<if test="totalWeight != null">total_weight,</if>
<if test="packStatus != null and packStatus != ''">pack_status,</if>
<if test="printStatus != null and printStatus != ''">print_status,</if>
<if test="printCount != null">print_count,</if>
<if test="printDate != null">print_date,</if>
<if test="extData != null and extData != ''">ext_data,</if>
<if test="opMan != null and opMan != ''">op_man,</if>
<if test="ext1 != null and ext1 != ''">ext1,</if>
@ -190,6 +174,9 @@
<if test="totalVolume != null">#{totalVolume},</if>
<if test="totalWeight != null">#{totalWeight},</if>
<if test="packStatus != null and packStatus != ''">#{packStatus},</if>
<if test="printStatus != null and printStatus != ''">#{printStatus},</if>
<if test="printCount != null">#{printCount},</if>
<if test="printDate != null">#{printDate},</if>
<if test="extData != null and extData != ''">#{extData},</if>
<if test="opMan != null and opMan != ''">#{opMan},</if>
<if test="ext1 != null and ext1 != ''">#{ext1},</if>
@ -225,6 +212,9 @@
<if test="totalVolume != null">total_volume = #{totalVolume},</if>
<if test="totalWeight != null">total_weight = #{totalWeight},</if>
<if test="packStatus != null and packStatus != ''">pack_status = #{packStatus},</if>
<if test="printStatus != null and printStatus != ''">print_status = #{printStatus},</if>
<if test="printCount != null">print_count = #{printCount},</if>
<if test="printDate != null">print_date = #{printDate},</if>
<if test="extData != null and extData != ''">ext_data = #{extData},</if>
<if test="opMan != null and opMan != ''">op_man = #{opMan},</if>
<if test="ext1 != null and ext1 != ''">ext1 = #{ext1},</if>