From c14b91a81a05bf2c772aa145bf4cf06e5fe9d30e Mon Sep 17 00:00:00 2001 From: aike <17730485278@139.com> Date: Fri, 16 Jan 2026 10:53:23 +0800 Subject: [PATCH] =?UTF-8?q?demand:=20=E6=96=B0=E5=A2=9E=E8=BD=A8=E8=BF=B9?= =?UTF-8?q?=E9=A2=84=E8=AD=A6=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E6=89=AB=E6=8F=8F=E8=BD=A8=E8=BF=B9=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E7=9A=84=E8=BF=90=E5=8D=95=EF=BC=8C=E5=B9=B6=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E7=9B=B8=E5=85=B3=E8=B4=A3=E4=BB=BB=E4=BA=BA=20=20tms?= =?UTF-8?q?-=E6=89=AB=E6=8F=8F=E7=AE=A1=E7=90=86-=E5=8F=91=E4=BB=B6?= =?UTF-8?q?=E6=89=AB=E6=8F=8F-=E6=89=AB=E6=8F=8F=E5=8F=AF=E5=8B=BE?= =?UTF-8?q?=E9=80=89`=E8=BD=A8=E8=BF=B9=E5=B7=B2=E7=BB=93=E6=9D=9F`?= =?UTF-8?q?=EF=BC=8C=E7=94=A8=E4=BA=8E=E4=BA=BA=E5=B7=A5=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E8=BF=90=E5=8D=95=E8=BD=A8=E8=BF=B9=E7=BB=93=E6=9D=9F=20=20tms?= =?UTF-8?q?-=E6=89=AB=E6=8F=8F=E7=AE=A1=E7=90=86-=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=9F=A5=E8=AF=A2-=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E5=A2=9E=E5=8A=A0'=E8=BD=A8=E8=BF=B9?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E2=80=98=EF=BC=8C=E6=9F=A5=E8=AF=A2=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=A2=9E=E5=8A=A0'=E8=BD=A8=E8=BF=B9=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E2=80=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/EmisWaybillServiceImpl.java | 51 ++++++++++++++----- 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisWaybillServiceImpl.java b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisWaybillServiceImpl.java index 1226637d4..b7022beef 100644 --- a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisWaybillServiceImpl.java +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisWaybillServiceImpl.java @@ -38,9 +38,10 @@ package com.xdadan.erp.emis.service.impl; import com.xdadan.erp.emis.service.warehouse.DocUtils; import com.xdadan.erp.emis.utils.WaybillHelper; import com.xdadan.erp.emis.utils.sensitive.Convert; - import com.xdadan.erp.system.domain.SysFileInfo; - import com.xdadan.erp.system.service.ISysFileInfoService; - import com.xdadan.erp.system.service.ISysNoticeService; +import com.xdadan.erp.system.domain.SysFileInfo; +import com.xdadan.erp.system.mapper.SysUserMapper; +import com.xdadan.erp.system.service.ISysFileInfoService; +import com.xdadan.erp.system.service.ISysNoticeService; import jodd.util.StringUtil; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections.MapUtils; @@ -156,6 +157,9 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb @Autowired private EmisMoneyUserMapper emisMoneyUserMapper; + @Autowired + private SysUserMapper sysUserMapper; + /** * 保存或更新运单其他信息副表 * @param emisWaybillSave @@ -6236,13 +6240,13 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb } try { - // 收集需要通知的员工编码:销售联系人、销售支持、销售分享人 - Set notifyEmpCodes = new LinkedHashSet<>(); + // 收集需要通知的员工姓名:销售联系人、销售支持、销售分享人 + Set notifyEmpNames = new LinkedHashSet<>(); // 销售联系人 if (!StringUtils.isEmpty(waybill.getSalesmen())) { String salesmen = waybill.getSalesmen(); - notifyEmpCodes.add(salesmen); + notifyEmpNames.add(salesmen); // 销售分享关系:salesmen -> salesAss(使用当前批次预加载的关系) List relList = salesRelMap.get(salesmen); @@ -6251,7 +6255,7 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb if (rel == null || StringUtils.isEmpty(rel.getSalesAss())) { continue; } - notifyEmpCodes.add(rel.getSalesAss()); + notifyEmpNames.add(rel.getSalesAss()); } } } @@ -6262,23 +6266,46 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb String[] supports = waybillOther.getSalesSupport().split("[,,]"); for (String support : supports) { if (!StringUtils.isEmpty(support)) { - notifyEmpCodes.add(support.trim()); + notifyEmpNames.add(support.trim()); } } } + if (notifyEmpNames.isEmpty()) { + continue; + } + + // 根据notifyEmpNames查询sys_user获取所有的notifyEmpCodes + Set notifyEmpCodes = new LinkedHashSet<>(); + for (String empName : notifyEmpNames) { + try { + SysUser cond = new SysUser(); + cond.setEmpName(empName); + List users = sysUserMapper.selectUserList(cond); + if (!CollectionUtils.isEmpty(users)) { + for (SysUser u : users) { + if (u != null && !StringUtils.isEmpty(u.getEmpCode())) { + notifyEmpCodes.add(u.getEmpCode()); + } + } + } + } 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 timeStr = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, now); - String title = "轨迹异常:运单【" + billCode + "】停留超过3天_" + timeStr; - String content = title; String url = "/d24/waybillManagement/SendWaybillList?billCode=" + billCode; notifyEmpCodes.forEach(empCode -> { try { - NoticeUtils.outSendNoticeToInner(title, content, url, empCode, 3); +// String timeStr = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, now); + String title = "轨迹异常:运单【" + billCode + "】停留超过3天_" + empCode; + String content = title; + NoticeUtils.outSendNoticeToInner(title, content, url, empCode, 2); } catch (Exception ex) { log.error("autoTraceWarning: send notice error, billCode={}, empCode={}", billCode, empCode, ex); }