demand: TMS系统 - 运单录入/运单修改/网点费用申请 - 线路为海运的产品 界面功能调整;

This commit is contained in:
aike 2026-04-21 17:00:22 +08:00
parent 029e97d5f3
commit 35a202a92f

View File

@ -6363,84 +6363,84 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
}
for (EmisWaybill waybill : waybillList) {
if (waybill == null || StringUtils.isBlank(waybill.getBillCode())) {
continue;
}
try {
// 收集需要通知的员工姓名:销售联系人、销售支持、销售分享人
Set<String> notifyEmpNames = new LinkedHashSet<>();
// 销售联系人
if (!StringUtils.isBlank(waybill.getSalesmen())) {
String salesmen = waybill.getSalesmen();
notifyEmpNames.add(salesmen);
// 销售分享关系:salesmen -> salesAss(使用当前批次预加载的关系)
List<EmisSalesmenRel> relList = salesRelMap.get(salesmen);
if (!CollectionUtils.isEmpty(relList)) {
for (EmisSalesmenRel rel : relList) {
if (rel == null || StringUtils.isBlank(rel.getSalesAss())) {
continue;
}
notifyEmpNames.add(rel.getSalesAss());
}
}
}
// 销售支持
EmisWaybillOther waybillOther = waybill.getWaybillOther();
if (waybillOther != null && !StringUtils.isBlank(waybillOther.getSalesSupport())) {
String[] supports = waybillOther.getSalesSupport().split("[,,]");
for (String support : supports) {
if (!StringUtils.isBlank(support)) {
notifyEmpNames.add(support.trim());
}
}
}
if (notifyEmpNames.isEmpty()) {
if (waybill == null || StringUtils.isBlank(waybill.getBillCode())) {
continue;
}
// 根据notifyEmpNames查询sys_user获取所有的notifyEmpCodes
Set<String> notifyEmpCodes = new LinkedHashSet<>();
for (String empName : notifyEmpNames) {
try {
SysUser cond = new SysUser();
cond.setEmpName(empName);
List<SysUser> users = sysUserMapper.selectUserList(cond);
if (!CollectionUtils.isEmpty(users)) {
for (SysUser u : users) {
if (u != null && !StringUtils.isBlank(u.getEmpCode())) {
notifyEmpCodes.add(u.getEmpCode());
try {
// 收集需要通知的员工姓名:销售联系人、销售支持、销售分享人
Set<String> notifyEmpNames = new LinkedHashSet<>();
// 销售联系人
if (!StringUtils.isBlank(waybill.getSalesmen())) {
String salesmen = waybill.getSalesmen();
notifyEmpNames.add(salesmen);
// 销售分享关系:salesmen -> salesAss(使用当前批次预加载的关系)
List<EmisSalesmenRel> relList = salesRelMap.get(salesmen);
if (!CollectionUtils.isEmpty(relList)) {
for (EmisSalesmenRel rel : relList) {
if (rel == null || StringUtils.isBlank(rel.getSalesAss())) {
continue;
}
notifyEmpNames.add(rel.getSalesAss());
}
}
}
// 销售支持
EmisWaybillOther waybillOther = waybill.getWaybillOther();
if (waybillOther != null && !StringUtils.isBlank(waybillOther.getSalesSupport())) {
String[] supports = waybillOther.getSalesSupport().split("[,,]");
for (String support : supports) {
if (!StringUtils.isBlank(support)) {
notifyEmpNames.add(support.trim());
}
}
}
if (notifyEmpNames.isEmpty()) {
continue;
}
// 根据notifyEmpNames查询sys_user获取所有的notifyEmpCodes
Set<String> notifyEmpCodes = new LinkedHashSet<>();
for (String empName : notifyEmpNames) {
try {
SysUser cond = new SysUser();
cond.setEmpName(empName);
List<SysUser> users = sysUserMapper.selectUserList(cond);
if (!CollectionUtils.isEmpty(users)) {
for (SysUser u : users) {
if (u != null && !StringUtils.isBlank(u.getEmpCode())) {
notifyEmpCodes.add(u.getEmpCode());
}
}
}
} catch (Exception ex) {
log.error("autoTraceWarning: query sys_user error, billCode={}, empName={}", waybill.getBillCode(), empName, ex);
}
} catch (Exception ex) {
log.error("autoTraceWarning: query sys_user error, billCode={}, empName={}", waybill.getBillCode(), empName, ex);
}
}
if (notifyEmpCodes.isEmpty()) {
continue;
}
String billCode = waybill.getBillCode();
String url = "/d24/waybillManagement/SendWaybillList?billCode=" + billCode;
notifyEmpCodes.forEach(empCode -> {
try {
String timeStr = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, now);
String title = "轨迹异常:运单【" + billCode + "】停留超过3天_" + empCode + "_" + timeStr;
String content = title;
NoticeUtils.outSendNoticeToInner(title, content, url, empCode, 2);
} catch (Exception ex) {
log.error("autoTraceWarning: send notice error, billCode={}, empCode={}", billCode, empCode, ex);
if (notifyEmpCodes.isEmpty()) {
continue;
}
});
} catch (Exception ex) {
log.error("autoTraceWarning: handle waybill error, billCode={}", waybill.getBillCode(), ex);
}
String billCode = waybill.getBillCode();
String url = "/d24/waybillManagement/SendWaybillList?billCode=" + billCode;
notifyEmpCodes.forEach(empCode -> {
try {
String timeStr = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, now);
String title = "轨迹异常:运单【" + billCode + "】停留超过3天_" + empCode + "_" + timeStr;
String content = title;
NoticeUtils.outSendNoticeToInner(title, content, url, empCode, 2);
} catch (Exception ex) {
log.error("autoTraceWarning: send notice error, billCode={}, empCode={}", billCode, empCode, ex);
}
});
} catch (Exception ex) {
log.error("autoTraceWarning: handle waybill error, billCode={}", waybill.getBillCode(), ex);
}
}
if (waybillList.size() < pageSize) {