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)); }