|
|
@ -793,6 +793,9 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
if (mailAddressAll.length>0) { |
|
|
if (mailAddressAll.length>0) { |
|
|
sendMailUtil(textHead, emailContent.toString(), mailAddressAll, headerData); |
|
|
sendMailUtil(textHead, emailContent.toString(), mailAddressAll, headerData); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 改单导入后的状态处理逻辑 |
|
|
|
|
|
handleNotifyStatusAfterModify(headerData); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
@ -2844,7 +2847,7 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
notifyHeader.setModifyFlag(false); |
|
|
|
|
|
|
|
|
//notifyHeader.setModifyFlag(false); |
|
|
coDelMapper.updateEcssDelHeaderForModify(notifyHeader); |
|
|
coDelMapper.updateEcssDelHeaderForModify(notifyHeader); |
|
|
coDelMapper.updateEcssDelDetailForModify(notifyHeader); |
|
|
coDelMapper.updateEcssDelDetailForModify(notifyHeader); |
|
|
} |
|
|
} |
|
|
@ -3281,4 +3284,56 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 改单导入后处理通知单状态 |
|
|
|
|
|
* 1. 如果当前状态是已报关,则删除对应的报关单 |
|
|
|
|
|
* 2. 将通知单状态更新为已下达 |
|
|
|
|
|
* |
|
|
|
|
|
* @param headerData 发货通知单头数据 |
|
|
|
|
|
* @author AI Assistant |
|
|
|
|
|
* @date 2024-10-09 |
|
|
|
|
|
*/ |
|
|
|
|
|
private void handleNotifyStatusAfterModify(EcssCoDelNotifyHeaderData headerData) { |
|
|
|
|
|
try { |
|
|
|
|
|
log.info("开始处理改单导入后的状态更新,发货通知单号:{}, 当前状态:{}", |
|
|
|
|
|
headerData.getDelNo(), headerData.getNotifyStatus()); |
|
|
|
|
|
|
|
|
|
|
|
// 检查当前通知单状态 |
|
|
|
|
|
String currentStatus = headerData.getNotifyStatus(); |
|
|
|
|
|
|
|
|
|
|
|
// 如果当前状态是已报关,需要删除对应的报关单 |
|
|
|
|
|
if ("已报关".equals(currentStatus)) { |
|
|
|
|
|
log.info("发货通知单{}状态为已报关,开始删除对应的报关单", headerData.getDelNo()); |
|
|
|
|
|
|
|
|
|
|
|
// 查找对应的报关单 |
|
|
|
|
|
EcssDeclarationHeaderData declarationQuery = new EcssDeclarationHeaderData(); |
|
|
|
|
|
declarationQuery.setSite(headerData.getSite()); |
|
|
|
|
|
declarationQuery.setDelNo(headerData.getDelNo()); |
|
|
|
|
|
|
|
|
|
|
|
List<EcssDeclarationHeaderData> declarations = coDelMapper.searchDeclarationHeader( |
|
|
|
|
|
new Page<EcssDeclarationHeaderData>(1, 1000), declarationQuery).getRecords(); |
|
|
|
|
|
|
|
|
|
|
|
// 删除找到的报关单 |
|
|
|
|
|
for (EcssDeclarationHeaderData declaration : declarations) { |
|
|
|
|
|
log.info("删除报关单,报关单号:{}", declaration.getDeclarationNo()); |
|
|
|
|
|
coDelMapper.deleteDeclarationHeader(declaration); |
|
|
|
|
|
coDelMapper.deleteDeclarationDetail(declaration); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
log.info("已删除发货通知单{}对应的{}个报关单", headerData.getDelNo(), declarations.size()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 将通知单状态更新为已下达 |
|
|
|
|
|
headerData.setNotifyStatus("已下达"); |
|
|
|
|
|
coDelMapper.changeEcssDelStatus(headerData); |
|
|
|
|
|
|
|
|
|
|
|
log.info("发货通知单{}状态已更新为已下达", headerData.getDelNo()); |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
log.error("处理改单导入后状态更新失败,发货通知单号:{}, 错误信息:{}", |
|
|
|
|
|
headerData.getDelNo(), e.getMessage(), e); |
|
|
|
|
|
throw new RuntimeException("改单导入后状态处理失败:" + e.getMessage()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |