This commit is contained in:
linfso 2025-01-10 17:40:43 +08:00
parent cf51391fd6
commit 5ed8268164

View File

@ -1762,6 +1762,12 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
// 需要记录大类及原因
String problemTypeName="";
EmisProblemType emisProblemType =getEmisProblemTypebyTypeId(Integer.valueOf(problemType));
boolean isNeedSendSms = false;
if(emisProblemType.getIsSendSms()==1){
isNeedSendSms=true;
}
if(emisProblemType!=null){
problemTypeName=emisProblemType.getTypeName();
}
@ -1871,6 +1877,39 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
// 插入扫描记录
addScanRecord(emisTmsScanRecord);
// 发送问题件短信
if(isNeedSendSms) {
try {
// 获取订单数据
EmisWaybill emisWaybill = getWaybillByBillCode(mainBillCode);
String content = "尊敬的用户:您的运单${name}从${Sendingcountry}寄往${Receivingcountry}因${Problemtype}的问题导致货物时效延误预计送达时间${time},详询400-025-7080感谢您对探路速运的支持!";
content = content.replace("${name}", emisTmsScanRecord.getMainBillCode());
content = content.replace("${Sendingcountry}", emisWaybill.getSendCountryName());
content = content.replace("${Receivingcountry}", emisWaybill.getReceiveCountryName());
content = content.replace("${Problemtype}", problemTypeName);
content = content.replace("${time}", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, emisWaybill.getEstimateDate()));
EmisSmsSendRecord emisSmsSendRecord = new EmisSmsSendRecord();
emisSmsSendRecord.setBillCode(emisTmsScanRecord.getMainBillCode());
emisSmsSendRecord.setSmsType("3"); // 问题件短信
emisSmsSendRecord.setPhone(emisWaybill.getSendMobile());
emisSmsSendRecord.setContent(content);
emisSmsSendRecord.setSendSiteCode(emisTmsScanRecord.getScanSiteCode());
emisSmsSendRecord.setSendSiteName(emisTmsScanRecord.getScanSite());
emisSmsSendRecord.setSendManCode(emisTmsScanRecord.getScanManCode());
emisSmsSendRecord.setSendManName(emisTmsScanRecord.getScanMan());
// 插入短信记录表
insertBizSmsMessage(emisSmsSendRecord);
}catch(Exception ex){
ex.printStackTrace();
}
}
scanResultItem.getData().put("billWeight", 0);
scanResultItem.getData().put("totalVolume", 0);
scanResultItem.getData().put("parcelQty", 0);