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