| | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | 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; |
| | |
| | | |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | |
| | | @Autowired |
| | | private IDingTalkService dingTalkService; |
| | | |
| | | |
| | | @Value("${localIP}") |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 定时发送异常信息-景宁 |
| | | */ |
| | | public void sendExceptInfo() throws Exception { |
| | | //1.获取发送人工号 |
| | | ServiceSubtaskDetailTraceVO subtaskDetailTraceVO = new ServiceSubtaskDetailTraceVO(); |
| | | subtaskDetailTraceVO.setHandleFlag("0"); |
| | | List<ServiceSubtaskDetailTrace> serviceSubtaskDetailTraces = |
| | | serviceSubtaskDetailTraceService.selectServiceSubtaskDetailTtraceList(subtaskDetailTraceVO); |
| | | // 把 dutyDeptPersonCode 整理到 list 中(如果多个人用逗号分割,则展开并去重) |
| | | List<String> dutyDeptPersonCodeList = serviceSubtaskDetailTraces.stream() |
| | | .map(ServiceSubtaskDetailTrace::getDutyDeptPersonCode) |
| | | .filter(StringUtils::isNotBlank) |
| | | .flatMap(code -> Arrays.stream(code.split(","))) |
| | | .map(String::trim) |
| | | .filter(StringUtils::isNotBlank).distinct() // 去重 |
| | | .collect(Collectors.toList()); |
| | | // 获取“异常内容提醒" |
| | | SysConfig sysConfig = sysConfigMapper.checkConfigKeyUnique("send.except.content"); |
| | | String exceptContent = sysConfig.getConfigValue(); |
| | | |
| | | // 获取“内容提醒测试人工号” |
| | | String testPerson = sysConfigMapper.checkConfigKeyUnique("send.test.person").getConfigValue(); |
| | | if (StringUtils.isNotBlank(testPerson)) { |
| | | String[] split = testPerson.split(","); |
| | | if (CollectionUtils.isEmpty(dutyDeptPersonCodeList)) dutyDeptPersonCodeList = Arrays.asList(split); |
| | | else dutyDeptPersonCodeList.addAll(Arrays.asList(split)); |
| | | } |
| | | |
| | | if (CollectionUtils.isNotEmpty(dutyDeptPersonCodeList)) { |
| | | for (String dutyDeptPersonCode : dutyDeptPersonCodeList) { |
| | | log.info("【sendExceptInfo】发送人工号:{}", dutyDeptPersonCode); |
| | | String dutyDeptPerson = dingTalkService.getDingTalkUserByMobile(dutyDeptPersonCode); |
| | | dingTalkService.sendDingTalkText(exceptContent, dutyDeptPerson); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 定时处理外链的数据 |
| | |
| | | iIcd10Service.queryAddIcd10(); |
| | | } |
| | | |
| | | // nhfy/sltd回溯30天分段采集判断(每段最多7天) |
| | | // nhfy/sltd回溯30天分段采集判断(每段最多4天) |
| | | boolean isBackfill = (active.trim().equals("nhfy") || active.trim().equals("sltd")) && StringUtils.isNotBlank(todayZeroStr); |
| | | if (isBackfill) { |
| | | DateTimeFormatter dateFmt = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | |
| | | LocalDate segEndDate = todayZero.toLocalDate(); |
| | | int segCount = 0; |
| | | while (!segStart.isAfter(segEndDate)) { |
| | | LocalDate segEnd = segStart.plusDays(6); |
| | | LocalDate segEnd = segStart.plusDays(3); |
| | | if (segEnd.isAfter(segEndDate)) { |
| | | segEnd = segEndDate; |
| | | } |
| | |
| | | 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 |