| | |
| | | import java.time.ZoneId; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 定时任务调度测试 |
| | |
| | | |
| | | @Autowired |
| | | private IPatMedInhospService iPatMedInhospService; |
| | | |
| | | @Autowired |
| | | private IPatMedOperationService iPatMedOperationService; |
| | | |
| | | @Autowired |
| | | private IServiceSubtaskService iServiceSubtaskService; |
| | |
| | | iPatMedInhospService.dealOutHospInfo(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 处理手术信息,进入子任务表 |
| | | */ |
| | | public void dealOperationInfo() { |
| | | iPatMedOperationService.dealOperationInfo(); |
| | | } |
| | | |
| | | /** |
| | | * 处理患者信息,进入子任务表(微信小程序) |
| | | */ |
| | |
| | | ServiceSubtaskVO ivrTaskcall = new ServiceSubtaskVO(); |
| | | ivrTaskcall.setTaskid(commonTaskcallMQ.getTaskid()); |
| | | ivrTaskcall.setSendstate(2L); |
| | | List<ServiceSubtask> selectServiceSubtaskList = iServiceSubtaskService.selectServiceSubtaskList(ivrTaskcall); |
| | | List<ServiceSubtask> subtaskList = iServiceSubtaskService.selectServiceSubtaskList(ivrTaskcall); |
| | | |
| | | // 按照 endtime 离当前时间最近的排序 |
| | | List<ServiceSubtask> selectServiceSubtaskList = subtaskList.stream().sorted(Comparator.comparing(subtask -> Math.abs(subtask.getEndtime().getTime() - new Date().getTime()))).collect(Collectors.toList()); |
| | | |
| | | if (descByCode.equals("电话")) { |
| | | String value = ""; |
| | | List<String> list = new ArrayList<>(); |
| | |
| | | } |
| | | //将要执行的放到缓存中 |
| | | if (list.size() > 0) { |
| | | redisCache.setCacheListLeft("cache-0", list); |
| | | // redisCache.setCacheListLeft("cache-0", list); |
| | | redisCache.setCacheListLeftAndDistinct("cache-0", list); |
| | | } |
| | | } else if (descByCode.equals("多媒体")) { |
| | | //多媒体 |
| | |
| | | //纸质 |
| | | } else if (descByCode.equals("微信小程序")) { |
| | | //微信小程序 |
| | | for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) { |
| | | log.error("微信小程序期任务发送---------进来了吗?{}", serviceSubtask); |
| | | if (ivrTask1.getPatCycle() == 1) { |
| | | //说明该任务的患者是循环执行的 |
| | | ServiceSubtaskVO serviceSubtaskVO = new ServiceSubtaskVO(); |
| | | serviceSubtaskVO.setTaskid(ivrTask1.getTaskid()); |
| | | List<ServiceSubtask> serviceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskVO); |
| | | //这里需要根据身份证去重 |
| | | List<ServiceSubtask> serviceSubtaskListFilter = new ArrayList<>(); |
| | | aa: |
| | | for (ServiceSubtask serviceSubtask : serviceSubtaskList) { |
| | | for (ServiceSubtask ss : serviceSubtaskListFilter) { |
| | | if (ss.getSfzh().equals(serviceSubtask.getSfzh())) { |
| | | continue aa; |
| | | } |
| | | } |
| | | serviceSubtaskListFilter.add(serviceSubtask); |
| | | } |
| | | for (ServiceSubtask serviceSubtask : serviceSubtaskListFilter) { |
| | | //将子任务ID删除 、sendstate改成3 |
| | | serviceSubtask.setSendstate(3L); |
| | | serviceSubtask.setId(null); |
| | | serviceSubtask.setCreateTime(new Date()); |
| | | serviceSubtask.setUpdateTime(new Date()); |
| | | serviceSubtaskMapper.insertServiceSubtask(serviceSubtask); |
| | | } |
| | | } |
| | | } else if (descByCode.equals("短信")) { |
| | | RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); |