From 9b1abac4586aa89771466de6d8bc1f7b913f125c Mon Sep 17 00:00:00 2001 From: clunt Date: Thu, 31 Jul 2025 14:59:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=86=E9=85=8D=E7=BA=BF=E7=B4=A2?= =?UTF-8?q?=E5=90=8E=E7=9A=84=E7=9F=AD=E4=BF=A1=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/system/ClewController.java | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ClewController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ClewController.java index f8df5ee4..8d8f5340 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ClewController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ClewController.java @@ -420,6 +420,29 @@ public class ClewController extends BaseController clew.setAssignTimes("02"); } clew.setUpdateTime(DateUtils.getNowDate()); + // 线索短信通知 + try { + // 查询销售手机号 + SysUser sysUser = sysUserService.selectUserById(clew.getSaleId()); + JSONObject smsContent = new JSONObject(); + smsContent.put("uid", "12347"); + smsContent.put("pwd", "wJgzaC0u"); + smsContent.put("mobile", sysUser.getLoginName()); + // 证明是普通的手机号 + boolean flag = sysUser.getLoginName().length() > 10; + if(sourceClew.getSourceApp() != null && sourceClew.getSourceApp() == 2L){ + smsContent.put("content", "你有一条来自大象,新线索生成,客户电话:" + sourceClew.getPhone() + "(请注意及时跟进)"); + }else { + smsContent.put("content", "你有一条来自黑猫,新线索生成,客户电话:" + sourceClew.getPhone() + "(请注意及时跟进)"); + } + if(!ObjectUtil.equals(sourceClew.getSourceApp(), 8L) && flag){ + log.info("请求傲众短信入参:{}", smsContent.toJSONString()); + String s = HttpUtils.sendPost("http://www.aozhongyun.com/Admin/index.php/Message/send", smsContent.toJSONString()); + log.info("请求傲众短信url:{}, 响应:{}", "http://www.aozhongyun.com/Admin/index.php/Message/send", s); + } + }catch (Exception e){ + log.error("请求傲众短信url:{}, 报错:{}","http://www.aozhongyun.com/Admin/index.php/Message/send", e.getMessage()); + } return toAjax(clewService.updateClew(clew)); } @@ -469,6 +492,29 @@ public class ClewController extends BaseController } clew.setUpdateTime(DateUtils.getNowDate()); clew.setIdList(Arrays.stream(clew.getIds().split(",")).map(Long::parseLong).collect(Collectors.toList())); + // 线索短信通知 + try { + // 查询销售手机号 + SysUser sysUser = sysUserService.selectUserById(clew.getSaleId()); + JSONObject smsContent = new JSONObject(); + smsContent.put("uid", "12347"); + smsContent.put("pwd", "wJgzaC0u"); + smsContent.put("mobile", sysUser.getLoginName()); + // 证明是普通的手机号 + boolean flag = sysUser.getLoginName().length() > 10; + if(sourceClew.getSourceApp() != null && sourceClew.getSourceApp() == 2L){ + smsContent.put("content", "你有多条来自大象,新线索生成(请注意及时跟进)"); + }else { + smsContent.put("content", "你有一条来自黑猫,新线索生成(请注意及时跟进)"); + } + if(!ObjectUtil.equals(sourceClew.getSourceApp(), 8L) && flag){ + log.info("请求傲众短信入参:{}", smsContent.toJSONString()); + String s = HttpUtils.sendPost("http://www.aozhongyun.com/Admin/index.php/Message/send", smsContent.toJSONString()); + log.info("请求傲众短信url:{}, 响应:{}", "http://www.aozhongyun.com/Admin/index.php/Message/send", s); + } + }catch (Exception e){ + log.error("请求傲众短信url:{}, 报错:{}","http://www.aozhongyun.com/Admin/index.php/Message/send", e.getMessage()); + } return toAjax(clewService.updateBatchClew(clew)); }