| | |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.JsonNode; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.google.gson.Gson; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | |
| | | // return map; |
| | | // } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 统计任务各种状态的数量(已优化) |
| | | * 优化说明: |
| | |
| | | } |
| | | if (ObjectUtils.isNotEmpty(serviceTaskVO.getIvrTaskTemplateVO())) { |
| | | tempid = Long.valueOf(ivrTaskTemplateService.saveOrUpdateTempScript(serviceTaskVO.getIvrTaskTemplateVO())); |
| | | tempName = ivrTaskTemplateService.selectIvrTaskTemplateByID(tempid).getTemplateName(); |
| | | log.info("IVR模板插入成功,返回的tempid={}", tempid); |
| | | |
| | | IvrTaskTemplate ivrTaskTemplate = ivrTaskTemplateService.selectIvrTaskTemplateByID(tempid); |
| | | if (ivrTaskTemplate == null) { |
| | | log.error("根据tempid={}查询IVR模板失败,返回null!请检查del_flag字段是否正确设置", tempid); |
| | | throw new BaseException("IVR模板保存成功但查询失败,请联系管理员检查数据"); |
| | | } |
| | | tempName = ivrTaskTemplate.getTemplateName(); |
| | | log.info("IVR模板查询成功,tempName={}", tempName); |
| | | } |
| | | |
| | | //往任务表中,新增任务 |
| | |
| | | stringBuilder.append("入院准备中心电话:89975977。入院办理须知:https://mp.weixin.qq.com/s/OCkotuRyQ8Ld2owFF0YErw"); |
| | | |
| | | String data = MessageSend.sendMsg(stringBuilder.toString(), "6", patArchiveSrmVO.getPhone(), LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); |
| | | if (StringUtils.isNotEmpty(data) && data.contains("result=0")) { |
| | | sendError.add(patArchiveSrmVO); |
| | | if (StringUtils.isNotEmpty(data)) { |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | JsonNode root = null; |
| | | try { |
| | | root = mapper.readTree(data); |
| | | } catch (JsonProcessingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | String status = root.get("result").get(0).get("status").asText(); |
| | | if (status.equals("00000")) { |
| | | sendError.add(patArchiveSrmVO); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | serviceSubtaskPreachform.setTaskid(taskid); |
| | | List<ServiceSubtaskPreachform> serviceSubtaskPreachforms = serviceSubtaskPreachformMapper.selectServiceSubtaskPreachformList(serviceSubtaskPreachform); |
| | | if (CollectionUtils.isNotEmpty(serviceSubtaskPreachforms)) { |
| | | //没有随访时间则按当天来算--临时 |
| | | if (ObjectUtils.isEmpty(visitTime)) { |
| | | visitTime = new Date(); |
| | | } |
| | | |
| | | String compensateTime = serviceSubtaskPreachforms.get(0).getCompensateTime(); |
| | | int hoursToAdd = Integer.valueOf(compensateTime) * 24; |
| | | Calendar calendar = Calendar.getInstance(); |