This commit is contained in:
linfso 2024-06-24 14:24:33 +08:00
parent 57ec20a095
commit d363bc53d6
4 changed files with 43 additions and 16 deletions

View File

@ -998,25 +998,18 @@ public class EmisBaseService {
waybillProblemInfo.setDataFrom(WaybillHelper.getDataFrom());
emisWaybillProblemInfoMapper.insertEmisWaybillProblemInfo(waybillProblemInfo);
String billCode=waybillProblemInfo.getBillCode();
// 更新运单状态为问题件
String mainBillCode = billCode;
if(billCode.startsWith("T7080") && billCode.length()>14 ){
mainBillCode=billCode.substring(0,14);
}
// 记录延迟天数
EmisProblemType emisProblemType =getEmisProblemTypebyTypeId(waybillProblemInfo.getProblemType());
EmisWaybill waybill = new EmisWaybill();
waybill.setBillCode(mainBillCode);
waybill.setBillCode(waybillProblemInfo.getMainBillCode());
waybill.setBlIsQuestion("1");
waybill.setProblemType(waybillProblemInfo.getProblemType());
waybill.setProblemCause(waybillProblemInfo.getProblemCause());
waybill.setProblemDelayDays(emisProblemType.getDelayDay());
// 重新计算预估时间
EmisWaybill oldEmisWaybill=getWaybillByBillCode(billCode);
EmisWaybill oldEmisWaybill=getWaybillByBillCode(waybillProblemInfo.getMainBillCode());
Date oldEstDate=oldEmisWaybill.getEstimateDate();
Date currentTime=new Date();
Date startDate=oldEmisWaybill.getSendDate();
@ -1045,12 +1038,12 @@ public class EmisBaseService {
String receivingcountry=oldEmisWaybill.getReceiveCountryName();
content = content.replace("${Sendingcountry}",sendingcountry);
content = content.replace("${Receivingcountry}",receivingcountry);
content = content.replace("${name}",mainBillCode);
content = content.replace("${name}",waybillProblemInfo.getMainBillCode());
content = content.replace("${Problemtype}",emisProblemType.getTypeName());
content = content.replace("${time}",DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,newEstDate));
EmisSmsSendRecord emisSmsSendRecord = new EmisSmsSendRecord();
emisSmsSendRecord.setBillCode(mainBillCode);
emisSmsSendRecord.setBillCode(waybillProblemInfo.getMainBillCode());
emisSmsSendRecord.setSmsType("3"); // 问题件
emisSmsSendRecord.setPhone(waybill.getSendMobile());
emisSmsSendRecord.setContent(content);

View File

@ -68,6 +68,11 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
private EmisWaybillTransferMapper emisWaybillTransferMapper;
@Autowired
private EmisWaybillProblemInfoMapper emisWaybillProblemInfoMapper;
/**
* 查询TMS扫描记录
@ -619,9 +624,10 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
// 需要记录大类及原因
String problemTypeName="";
EmisProblemType emisProblemType =getEmisProblemTypebyTypeId(Integer.valueOf(problemType));
if(emisProblemType!=null){
problemTypeName=emisProblemType.getTypeName();
if(emisProblemType==null) {
throw new EmisBizError(EmisBizErrorType.SCAN_PARAM_ERROR,"问题类型错误");
}
problemTypeName=emisProblemType.getTypeName();
// 子单号处理
for (String scanBillCode : billCodeArr) {
@ -653,8 +659,20 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
return itemList;
}
// 同站点,同问题原因不允许重复登记,不同站点允许重复登记
EmisWaybillProblemInfo emisWaybillProblemInfo = new EmisWaybillProblemInfo();
emisWaybillProblemInfo.setBillCode(scanBillCode);
emisWaybillProblemInfo.setProblemType(Integer.valueOf(problemType));
emisWaybillProblemInfo.setRegisterSiteCode(getCurrentUser().getOwnerSiteCode());
int rnt=emisWaybillProblemInfoMapper.checkUnique(emisWaybillProblemInfo);
if (rnt>0) {
scanResultItem.setResult("fail");
scanResultItem.setMessage("重复登记");
scanResultItem.setErrorCode(EmisBizErrorType.SCAN_REPEAT.errorCode);
itemList.add(scanResultItem);
return itemList;
}
// 同站点,同问题原因不允许重复登记,不同站点允许重复登记
scanResultItem.getData().put("billWeight", 0f);
scanResultItem.getData().put("totalVolume", 0f);
scanResultItem.getData().put("parcelQty", 0f);
@ -985,6 +1003,19 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
return itemList;
}
EmisWaybillProblemInfo emisWaybillProblemInfo = new EmisWaybillProblemInfo();
emisWaybillProblemInfo.setBillCode(scanBillCode);
emisWaybillProblemInfo.setProblemType(Integer.valueOf(problemType));
emisWaybillProblemInfo.setRegisterSiteCode(getCurrentUser().getOwnerSiteCode());
int rnt=emisWaybillProblemInfoMapper.checkUnique(emisWaybillProblemInfo);
if (rnt>0) {
scanResultItem.setResult("fail");
scanResultItem.setMessage("重复登记");
scanResultItem.setErrorCode(EmisBizErrorType.SCAN_REPEAT.errorCode);
itemList.add(scanResultItem);
return itemList;
}
// 生成扫描记录
EmisTmsScanRecord emisTmsScanRecord = new EmisTmsScanRecord();
emisTmsScanRecord.setBillCode(scanBillCode);
@ -1001,7 +1032,8 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
// 登记问题件
EmisWaybillProblemInfo waybillProblemInfo = new EmisWaybillProblemInfo();
waybillProblemInfo.setBillCode(emisTmsScanRecord.getMainBillCode());
waybillProblemInfo.setBillCode(emisTmsScanRecord.getBillCode());
waybillProblemInfo.setMainBillCode(emisTmsScanRecord.getMainBillCode());
waybillProblemInfo.setProblemType(Integer.valueOf(problemType));
waybillProblemInfo.setProblemCause(remark);

View File

@ -242,7 +242,7 @@
<!-- 检查子单号是否存在 -->
<select id="checkDbSubBillIsExists" resultType="int">
select count(1) as cnt from emis_waybill
where bill_code=#{billCode} and bl_gen_subbill='1' and #{subNum} <![CDATA[ <= ]]> parcel_qty
where bill_code=#{billCode} and bl_gen_subbill='1' and #{subNum} <![CDATA[ >= ]]> 1 and #{subNum} <![CDATA[ <= ]]> parcel_qty
limit 1
</select>

View File

@ -123,6 +123,8 @@
where del_flag='0'
and bill_code = #{billCode}
and problem_type = #{problemType}
and register_site_code = #{registerSiteCode}
and to_days(create_time) = to_days(now())
limit 1
</select>