| | |
| | | import com.google.gson.Gson; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.core.service.IDingTalkService; |
| | | import com.ruoyi.common.dx.MessageSend; |
| | | import com.ruoyi.common.enums.MsgLSEnum; |
| | | import com.ruoyi.common.enums.ServiceFromEnum; |
| | |
| | | import com.ruoyi.system.mapper.SysConfigMapper; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.smartor.common.LSHospTokenUtil; |
| | | import com.smartor.common.MtSubmitSmUtil; |
| | | import com.smartor.common.QwenLLMUtil; |
| | |
| | | |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | |
| | | @Autowired |
| | | private IDingTalkService dingTalkService; |
| | | |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | |
| | | |
| | | @Value("${localIP}") |
| | |
| | | for (String dutyDeptPersonCode : dutyDeptPersonCodeList) { |
| | | log.info("【sendSLTDMYDExceptInfo】发送人工号:{}", dutyDeptPersonCode); |
| | | String data = MessageSend.sendMsg(exceptContent, "7", dutyDeptPersonCode, LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 定时发送异常信息-景宁 |
| | | */ |
| | | public void sendExceptInfo() throws Exception { |
| | | //1.获取发送人工号 |
| | | ServiceSubtaskDetailTraceVO subtaskDetailTraceVO = new ServiceSubtaskDetailTraceVO(); |
| | | subtaskDetailTraceVO.setHandleFlag("0"); |
| | | List<ServiceSubtaskDetailTrace> serviceSubtaskDetailTraces = |
| | | serviceSubtaskDetailTraceService.selectServiceSubtaskDetailTtraceList(subtaskDetailTraceVO); |
| | | // 获取“异常内容提醒" |
| | | SysConfig sysConfig = sysConfigMapper.checkConfigKeyUnique("send.except.content"); |
| | | String exceptContent = sysConfig.getConfigValue(); |
| | | |
| | | // 获取“内容提醒测试人工号” |
| | | SysConfig testPersonConfig = sysConfigMapper.checkConfigKeyUnique("send.test.person"); |
| | | String testPerson = ObjectUtils.isNotEmpty(testPersonConfig) ? testPersonConfig.getConfigValue() : ""; |
| | | if(CollectionUtils.isNotEmpty(serviceSubtaskDetailTraces)){ |
| | | for (ServiceSubtaskDetailTrace serviceSubtaskDetailTrace : serviceSubtaskDetailTraces) { |
| | | List<String> dutyDeptPersonCodeList = new ArrayList<>(); |
| | | // 把 dutyDeptPersonCode 整理到 list 中(如果多个人用逗号分割,则展开并去重) |
| | | String dutyDeptPersonCodeStr = serviceSubtaskDetailTrace.getDutyDeptPersonCode(); |
| | | if(StringUtils.isNotEmpty(dutyDeptPersonCodeStr)){ |
| | | String[] dutyDeptPersonCodeSplit = dutyDeptPersonCodeStr.split(","); |
| | | if (CollectionUtils.isEmpty(dutyDeptPersonCodeList)) { |
| | | dutyDeptPersonCodeList = new ArrayList<>(Arrays.asList(dutyDeptPersonCodeSplit)); |
| | | } else { |
| | | dutyDeptPersonCodeList.addAll(Arrays.asList(dutyDeptPersonCodeSplit)); |
| | | } |
| | | |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(testPerson)) { |
| | | String[] split = testPerson.split(","); |
| | | if (CollectionUtils.isEmpty(dutyDeptPersonCodeList)) { |
| | | dutyDeptPersonCodeList = new ArrayList<>(Arrays.asList(split)); |
| | | } else { |
| | | dutyDeptPersonCodeList.addAll(Arrays.asList(split)); |
| | | } |
| | | } |
| | | |
| | | if (CollectionUtils.isNotEmpty(dutyDeptPersonCodeList)) { |
| | | for (String dutyDeptPersonCode : dutyDeptPersonCodeList) { |
| | | log.info("【sendExceptInfo】发送人工号:{}", dutyDeptPersonCode); |
| | | SysUser sysUser = new SysUser(); |
| | | SysUser sysUserVo = new SysUser(); |
| | | sysUserVo.setUserCode(dutyDeptPersonCode); |
| | | // sysUserVo.setOrgid(serviceSubtaskDetailTrace.getOrgid()); |
| | | List<SysUser> users = userService.getUserList(sysUserVo); |
| | | String phoneNumber = ""; |
| | | if(ObjectUtils.isNotEmpty(users)){ |
| | | sysUser = users.get(0); |
| | | phoneNumber = sysUser.getPhonenumber(); |
| | | }else { |
| | | continue; |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(phoneNumber)){ |
| | | continue; |
| | | } |
| | | String dutyDeptPerson = dingTalkService.getDingTalkUserByMobile(phoneNumber); |
| | | if(StringUtils.isNotBlank(dutyDeptPerson)){ |
| | | String context = TemplateUtils.render(exceptContent, serviceSubtaskDetailTrace); |
| | | dingTalkService.sendDingTalkText(context, dutyDeptPerson); |
| | | //更新状态 |
| | | serviceSubtaskDetailTrace.setHandleFlag("1"); |
| | | serviceSubtaskDetailTrace.setUpdateTime(new Date()); |
| | | serviceSubtaskDetailTraceService.updateServiceSubtaskDetailTtrace(serviceSubtaskDetailTrace); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | serviceOutPath.setCreateTime(new Date()); |
| | | serviceOutPath.setOrgid(serviceSubtask.getOrgid()); |
| | | iServiceOutPathService.insertServiceOutPath(serviceOutPath); |
| | | String url = ""; |
| | | String format = String.format("%03X", serviceOutPath.getId()); |
| | | serviceOutPath.setRadix(format); |
| | | serviceOutPath.setUpdateTime(new Date()); |
| | | iServiceOutPathService.updateServiceOutPath(serviceOutPath); |
| | | //先判断一下发的是不是宣教 |
| | | if (!"3".equals(serviceSubtask.getType())) { |
| | | sendMagParam.setPhone(serviceSubtask.getPhone()); |
| | | |
| | | sendMagParam.setUrl(StringUtils.isNotEmpty(req_path) ? localIP + ":" + req_path + "/wt?p=" + format : localIP + "/wt?p=" + format); |
| | | url = StringUtils.isNotEmpty(req_path) ? localIP + ":" + req_path + "/wt?p=" + format : localIP + "/wt?p=" + format; |
| | | sendMagParam.setUrl(url); |
| | | //如果type是语音随访的话(说明补偿发送方式中有电话随访的方式,这里的外链就地址只能用/sf) |
| | | if (serviceSubtask.getType().equals("1")) |
| | | sendMagParam.setUrl(StringUtils.isNotEmpty(req_path) ? localIP + ":" + req_path + "/sf?p=" + format : localIP + "/sf?p=" + format); |
| | | url = StringUtils.isNotEmpty(req_path) ? localIP + ":" + req_path + "/sf?p=" + format : localIP + "/sf?p=" + format; |
| | | sendMagParam.setUrl(url); |
| | | |
| | | // SysConfig sysConfig = sysConfigMapper.checkConfigKeyUnique("wj.sms.template"); |
| | | SysConfig sysConfig = new SysConfig(); |
| | |
| | | HeLibrary heLibrary = heLibraryMapper.selectHeLibraryById(serviceSubtask.getLibtemplateid()); |
| | | if (heLibrary.getHetype().equals("1")) { |
| | | sendMagParam.setPhone(serviceSubtask.getPhone()); |
| | | sendMagParam.setUrl(StringUtils.isNotEmpty(req_path) ? localIP + ":" + req_path + "/xj?p=" + format : localIP + "/xj?p=" + format); |
| | | url = StringUtils.isNotEmpty(req_path) ? localIP + ":" + req_path + "/xj?p=" + format : localIP + "/xj?p=" + format; |
| | | |
| | | sendMagParam.setUrl(url); |
| | | |
| | | SysConfig sysConfig = sysConfigMapper.checkConfigKeyUnique("xj.sms.template"); |
| | | if (!Objects.isNull(sysConfig)) { |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | serviceOutPath.setRadix(format); |
| | | serviceOutPath.setUpdateTime(new Date()); |
| | | serviceOutPath.setUrl(url); |
| | | iServiceOutPathService.updateServiceOutPath(serviceOutPath); |
| | | String isSuccess = null; |
| | | log.info("active的值为:{}", active); |
| | | if (active.equals("xh")) { |
| | |
| | | String format = String.format("%03X", serviceOutPath.getId()); |
| | | serviceOutPath.setRadix(format); |
| | | serviceOutPath.setUpdateTime(new Date()); |
| | | serviceOutPath.setUrl(url); |
| | | iServiceOutPathService.updateServiceOutPath(serviceOutPath); |
| | | |
| | | //获取微信公众号请求信息根据机构ID |