This commit is contained in:
linfso 2024-06-17 05:43:07 +08:00
parent 99eeedf40c
commit 9574a52ac1
3 changed files with 111 additions and 28 deletions

View File

@ -607,24 +607,33 @@ public class EmisBaseService {
} }
public EmisProblemType getEmisProblemTypebyTypeId(Integer typeId){
return emisProblemTypeMapper.selectEmisProblemTypeById(typeId);
}
/** /**
* 更新问题件状态 * 登记问题件
* @param billCode * @param waybillProblemInfo
*/ */
public void updateProblemStatus(String billCode,Integer problemType,String problemCause) { public void registerWaybillProblemInfo(EmisWaybillProblemInfo waybillProblemInfo){
emisWaybillProblemInfoMapper.insertEmisWaybillProblemInfo(waybillProblemInfo);
String billCode=waybillProblemInfo.getBillCode();
// 更新运单状态为问题件
String mainBillCode = billCode; String mainBillCode = billCode;
if(billCode.startsWith("T7080") && billCode.length()>14 ){ if(billCode.startsWith("T7080") && billCode.length()>14 ){
mainBillCode=billCode.substring(0,14); mainBillCode=billCode.substring(0,14);
} }
// 记录延迟天数
EmisProblemType emisProblemType =getEmisProblemTypebyTypeId(waybillProblemInfo.getProblemType());
EmisWaybill waybill = new EmisWaybill(); EmisWaybill waybill = new EmisWaybill();
waybill.setBillCode(mainBillCode); waybill.setBillCode(mainBillCode);
waybill.setBlIsQuestion("1"); waybill.setBlIsQuestion("1");
waybill.setProblemType(problemType); waybill.setProblemType(waybillProblemInfo.getProblemType());
waybill.setProblemCause(problemCause); waybill.setProblemCause(waybillProblemInfo.getProblemCause());
// 记录延迟天数
EmisProblemType emisProblemType =getEmisProblemTypebyTypeId(problemType);
waybill.setProblemDelayDays(emisProblemType.getDelayDay()); waybill.setProblemDelayDays(emisProblemType.getDelayDay());
// 重新计算预估时间 // 重新计算预估时间
@ -648,18 +657,31 @@ public class EmisBaseService {
waybill.preUpdate(); waybill.preUpdate();
emisWaybillMapper.updateProblemStatus(waybill); emisWaybillMapper.updateProblemStatus(waybill);
} // 判断是否需要发问题件短信
if( "1".equals(emisProblemType.getIsSendSms()) ) {
public EmisProblemType getEmisProblemTypebyTypeId(Integer typeId){ //发送寄件短信
return emisProblemTypeMapper.selectEmisProblemTypeById(typeId); String content="尊敬的用户:您的运单${name}从${Sendingcountry}寄往${Receivingcountry}因${Problemtype}的问题导致货物时效延误预计送达时间${time},详询400-025-7080感谢您对探路速运的支持!";
} String sendingcountry=oldEmisWaybill.getSendCountryName();
String receivingcountry=oldEmisWaybill.getReceiveCountryName();
content = content.replace("${Sendingcountry}",receivingcountry);
content = content.replace("${Receivingcountry}",sendingcountry);
content = content.replace("${name}",mainBillCode);
EmisSmsSendRecord emisSmsSendRecord = new EmisSmsSendRecord();
emisSmsSendRecord.setBillCode(mainBillCode);
emisSmsSendRecord.setSmsType("2"); // 签收短信
emisSmsSendRecord.setPhone(waybill.getReceiveMobile());
emisSmsSendRecord.setContent(content);
emisSmsSendRecord.setSendSiteCode(waybillProblemInfo.getRegisterSiteCode());
emisSmsSendRecord.setSendSiteName(waybillProblemInfo.getRegisterSiteName());
emisSmsSendRecord.setSendManCode(waybillProblemInfo.getRegisterManCode());
emisSmsSendRecord.setSendManName(waybillProblemInfo.getRegisterManName());
sendBizSmsMessage(emisSmsSendRecord);
}
/**
* 登记问题件
* @param waybillProblemInfo
*/
public void registerWaybillProblemInfo(EmisWaybillProblemInfo waybillProblemInfo){
emisWaybillProblemInfoMapper.insertEmisWaybillProblemInfo(waybillProblemInfo);
} }

View File

@ -412,20 +412,15 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
// 判断是否需要发寄件短信 // 判断是否需要发寄件短信
String billCode=emisTmsScanRecord.getBillCode(); String billCode=emisTmsScanRecord.getBillCode();
boolean isSubBill=false;
// 判断是否是子单 // 判断是否是子单
String mainBillCode = ""; String mainBillCode = "";
String subBillSuffix = "";
if(billCode.startsWith("T7080") && billCode.length()>14 ){ if(billCode.startsWith("T7080") && billCode.length()>14 ){
isSubBill = true;
mainBillCode=billCode.substring(0,14); mainBillCode=billCode.substring(0,14);
subBillSuffix=billCode.substring(14);
}else{ }else{
mainBillCode=billCode; mainBillCode=billCode;
} }
EmisWaybill waybill=getWaybillByBillCode(emisTmsScanRecord.getBillCode()); EmisWaybill waybill=getWaybillByBillCode(mainBillCode);
if( "1".equals(waybill.getBlMessage()) ) { if( "1".equals(waybill.getBlMessage()) ) {
//发送寄件短信 //发送寄件短信
@ -497,6 +492,39 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
// 改变当前站点 // 改变当前站点
changeWaybillCurrentSite(emisTmsScanRecord.getBillCode(),emisTmsScanRecord.getScanSiteCode()); changeWaybillCurrentSite(emisTmsScanRecord.getBillCode(),emisTmsScanRecord.getScanSiteCode());
// // 判断是否需要发派件短信
// String billCode=emisTmsScanRecord.getBillCode();
// // 判断是否是子单
// String mainBillCode = "";
// if(billCode.startsWith("T7080") && billCode.length()>14 ){
// mainBillCode=billCode.substring(0,14);
// }else{
// mainBillCode=billCode;
// }
//
// EmisWaybill waybill=getWaybillByBillCode(mainBillCode);
// if( "1".equals(waybill.getBlMessage()) ) {
//
// //发送寄件短信
// String content="尊敬的客户:您寄往${Nationalcity}的快递${name}已被签收,感谢您使用探路速运。";
// String nationalcity=waybill.getReceiveCountryName()+""+waybill.getReceiveProvinceName();
// content = content.replace("${Nationalcity}",nationalcity);
// content = content.replace("${name}",mainBillCode);
//
// EmisSmsSendRecord emisSmsSendRecord = new EmisSmsSendRecord();
// emisSmsSendRecord.setBillCode(emisTmsScanRecord.getBillCode());
// emisSmsSendRecord.setSmsType("2"); // 派送短信
// emisSmsSendRecord.setPhone(waybill.getReceiveMobile());
// emisSmsSendRecord.setContent(content);
// emisSmsSendRecord.setSendSiteCode(emisTmsScanRecord.getScanSiteCode());
// emisSmsSendRecord.setSendSiteName(emisTmsScanRecord.getScanSite());
// emisSmsSendRecord.setSendManCode(emisTmsScanRecord.getScanManCode());
// emisSmsSendRecord.setSendManName(emisTmsScanRecord.getScanMan());
//
// sendBizSmsMessage(emisSmsSendRecord);
//
// }
} }
// 签收扫描 // 签收扫描
else if(ScanType.SIGNED.opCode.equals(scanType)){ else if(ScanType.SIGNED.opCode.equals(scanType)){
@ -552,6 +580,39 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
changeWaybillCurrentSite(emisTmsScanRecord.getBillCode(),emisTmsScanRecord.getScanSiteCode()); changeWaybillCurrentSite(emisTmsScanRecord.getBillCode(),emisTmsScanRecord.getScanSiteCode());
// 判断是否需要发寄件短信
String billCode=emisTmsScanRecord.getBillCode();
// 判断是否是子单
String mainBillCode = "";
if(billCode.startsWith("T7080") && billCode.length()>14 ){
mainBillCode=billCode.substring(0,14);
}else{
mainBillCode=billCode;
}
EmisWaybill waybill=getWaybillByBillCode(mainBillCode);
if( "1".equals(waybill.getBlMessage()) ) {
//发送寄件短信
String content="尊敬的客户:您寄往${Nationalcity}的快递${name}已被签收,感谢您使用探路速运。";
String nationalcity=waybill.getReceiveCountryName()+""+waybill.getReceiveProvinceName();
content = content.replace("${Nationalcity}",nationalcity);
content = content.replace("${name}",mainBillCode);
EmisSmsSendRecord emisSmsSendRecord = new EmisSmsSendRecord();
emisSmsSendRecord.setBillCode(emisTmsScanRecord.getBillCode());
emisSmsSendRecord.setSmsType("2"); // 签收短信
emisSmsSendRecord.setPhone(waybill.getReceiveMobile());
emisSmsSendRecord.setContent(content);
emisSmsSendRecord.setSendSiteCode(emisTmsScanRecord.getScanSiteCode());
emisSmsSendRecord.setSendSiteName(emisTmsScanRecord.getScanSite());
emisSmsSendRecord.setSendManCode(emisTmsScanRecord.getScanManCode());
emisSmsSendRecord.setSendManName(emisTmsScanRecord.getScanMan());
sendBizSmsMessage(emisSmsSendRecord);
}
} }
// 留仓 // 留仓
else if(ScanType.HOLD.opCode.equals(scanType)){ else if(ScanType.HOLD.opCode.equals(scanType)){
@ -647,14 +708,13 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
waybillProblemInfo.setProblemTitle(remark); waybillProblemInfo.setProblemTitle(remark);
waybillProblemInfo.setFilePath(picUrl); waybillProblemInfo.setFilePath(picUrl);
waybillProblemInfo.setRegisterSiteName(emisTmsScanRecord.getScanSite());
waybillProblemInfo.setRegisterManName(emisTmsScanRecord.getScanMan());
if(emisTmsScanRecord.getScanSiteCode().equals(notifySite)){ if(emisTmsScanRecord.getScanSiteCode().equals(notifySite)){
waybillProblemInfo.setIsSendSiteRegister("1"); waybillProblemInfo.setIsSendSiteRegister("1");
} }
registerWaybillProblemInfo(waybillProblemInfo); registerWaybillProblemInfo(waybillProblemInfo);
// 更新运单状态为问题件
updateProblemStatus(emisTmsScanRecord.getBillCode(),problemType,waybillProblemInfo.getProblemCause());
} }
// 合包 // 合包
else if(ScanType.CO_PACKING.opCode.equals(scanType)){ else if(ScanType.CO_PACKING.opCode.equals(scanType)){

View File

@ -98,6 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and bill_code = #{billCode} and bill_code = #{billCode}
and sms_type = #{smsType} and sms_type = #{smsType}
and phone = #{phone} and phone = #{phone}
and content = #{content}
limit 1 limit 1
</select> </select>