| | |
| | | import com.ruoyi.common.utils.RSAPublicKeyExample; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.http.HttpUtils; |
| | | import com.ruoyi.common.utils.sign.Md5Utils; |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.smartor.common.LSHospTokenUtil; |
| | |
| | | |
| | | @Value("${xhsmsPath}") |
| | | private String xhsmsPath; |
| | | |
| | | @Value("${xhsmsAccount}") |
| | | private String xhsmsAccount; |
| | | |
| | | @Value("${xhsmsPwd}") |
| | | private String xhsmsPwd; |
| | | |
| | | @Value("${server.port}") |
| | | private String port; |
| | |
| | | sendMagParam.setContent("您好,邀请您填写出院随访调查表,请点击" + sendMagParam.getUrl() + "查看。感谢您配合!"); |
| | | } else if (active.equals("xh")) { |
| | | sendMagParam.setContent("【新华医院】您好,邀请您填写出院随访调查表,请点击" + sendMagParam.getUrl() + "填写。感谢您配合!"); |
| | | } else if (active.equals("hzszlyy")) { |
| | | sendMagParam.setContent("【杭州市肿瘤医院】您好,邀请您填写出院调查表,请点击" + sendMagParam.getUrl() + "填写。感谢您配合!"); |
| | | } |
| | | |
| | | } else if (type == 2) { |
| | |
| | | sendMagParam.setContent("【新华医院】您好,邀请您填写出院调查表,请点击" + sendMagParam.getUrl() + "填写。感谢您配合!"); |
| | | } else if (active.equals("druid")) { |
| | | sendMagParam.setContent("您好,邀请您填写出院调查表,请点击" + sendMagParam.getUrl() + "填写。感谢您配合!"); |
| | | } else if (active.equals("hzszlyy")) { |
| | | sendMagParam.setContent("【杭州市肿瘤医院】您好,邀请您填写出院调查表,请点击" + sendMagParam.getUrl() + "填写。感谢您配合!"); |
| | | } |
| | | } else if (type == 3) { |
| | | //宣教 |
| | |
| | | sendMagParam.setContent("您好,邀请您填写出院宣教调查表,请点击" + sendMagParam.getUrl() + "查看。感谢您配合!"); |
| | | } else if (active.equals("xh")) { |
| | | sendMagParam.setContent("【新华医院】您好,邀请您填写出院宣教调查表,请点击" + sendMagParam.getUrl() + "查看。感谢您配合!"); |
| | | } else if (active.equals("hzszlyy")) { |
| | | sendMagParam.setContent("【杭州市肿瘤医院】您好,邀请您填写出院宣教调查表,请点击" + sendMagParam.getUrl() + "填写。感谢您配合!"); |
| | | } |
| | | } else if (heLibrary.getHetype().equals("2")) { |
| | | //通知 |
| | |
| | | } else { |
| | | setFailPreachForm(serviceSubtask, sendPreachform, "短信发送失败: " + data, "5"); |
| | | throw new BaseException("短信发送失败"); |
| | | } |
| | | } else if (active.equals("hzszlyy")) { |
| | | //市一 |
| | | long timestamp = new Date().getTime(); |
| | | String sign = Md5Utils.hash(xhsmsAccount + timestamp + Md5Utils.hash(xhsmsPwd)); |
| | | String content = sendMagParam.getContent(); |
| | | String jsonMsg = "{" + "\"userName\": \"" + xhsmsAccount + "\"," + "\"content\": \"" + content + "\"," + "\"phoneList\": [" + sendMagParam.getPhone() + "]," + "\"timestamp\": " + timestamp + "," + "\"sign\": \"" + sign + "\"" + "}"; |
| | | s = HttpUtil.postJsonRequest(xhsmsPath, jsonMsg); |
| | | log.info("------市一短信发送的值为:{}", s); |
| | | if (StringUtils.isNotEmpty(s)) { |
| | | JSONObject jsonObject = JSONObject.parseObject(s); |
| | | Object code = jsonObject.get("code"); |
| | | if (code.equals(0)) { |
| | | s = "true"; |
| | | } else { |
| | | setFailPreachForm(serviceSubtask, sendPreachform, "短信发送失败", "5"); |
| | | throw new BaseException("短信发送失败"); |
| | | } |
| | | } |
| | | } |
| | | if (s.equals("true")) { |
| | |
| | | serviceSubtaskPreachform1.setRemark(remark); |
| | | serviceSubtaskPreachformMapper.updateServiceSubtaskPreachform(serviceSubtaskPreachform1); |
| | | //如果当前的preachform已经是最后一个了,并且本次还是发送失败,那直接将serviceSubtask的sendstate状态改成5就行了(全失败了) |
| | | if (serviceSubtaskPreachform1.getSort() == spSize.size()) { |
| | | if (CollectionUtils.isNotEmpty(spSize) && serviceSubtaskPreachform1.getSort() == spSize.size()) { |
| | | if (serviceSubtaskPreachform1.getSort() == spSize.size()) { |
| | | if (failSendstate.equals("4") || failSendstate.equals("5")) { |
| | | serviceSubtask.setCurrentPreachform(preachform); |
| | |
| | | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.utils.RSAPublicKeyExample; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.sms.smsUtils; |
| | | import com.smartor.domain.ServiceOutPath; |
| | | import com.smartor.domain.smsVO; |
| | |
| | | @ApiOperation("短信发送") |
| | | @PostMapping("/sendTest") |
| | | public AjaxResult send(@RequestBody smsVO vo) { |
| | | String sendMsg=smsUtils.sendSms(xhsmsPath,xhsmsAccount,xhsmsPwd,vo.getPhone(),vo.getContent()); |
| | | String sendMsg = smsUtils.sendSms(xhsmsPath, xhsmsAccount, xhsmsPwd, vo.getPhone(), vo.getContent()); |
| | | return AjaxResult.success(sendMsg); |
| | | } |
| | | |
| | | /** |
| | | * @param |
| | | * @return |
| | |
| | | @ApiOperation("短信发送") |
| | | @PostMapping("/send") |
| | | public AjaxResult sendAsk(@RequestBody smsVO vo) throws UnsupportedEncodingException { |
| | | RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); |
| | | String taskId = rsaPublicKeyExample.encryptedData(vo.getTaskId().toString(), pub_key); |
| | | String patid = rsaPublicKeyExample.encryptedData(vo.getPatId().toString(), pub_key); |
| | | String subId = rsaPublicKeyExample.encryptedData(vo.getSubId().toString(), pub_key); |
| | | Integer radix=iServiceOutPathService.selectAutoId(); |
| | | String format = String.format("%03X", radix); |
| | | ServiceOutPath serviceOutPath = new ServiceOutPath(); |
| | | serviceOutPath.setParam1(taskId); |
| | | serviceOutPath.setParam2(patid); |
| | | serviceOutPath.setParam3(vo.getTaskName()); |
| | | serviceOutPath.setParam6(subId); |
| | | serviceOutPath.setRadix(format); |
| | | serviceOutPath.setCreateTime(new Date()); |
| | | iServiceOutPathService.insertServiceOutPath(serviceOutPath); |
| | | String content = ""; |
| | | if (StringUtils.isNotEmpty(vo.getTaskId()) && StringUtils.isNotEmpty(vo.getPatId()) && StringUtils.isNotEmpty(vo.getSubId())) { |
| | | RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); |
| | | String taskId = rsaPublicKeyExample.encryptedData(vo.getTaskId().toString(), pub_key); |
| | | String patid = rsaPublicKeyExample.encryptedData(vo.getPatId().toString(), pub_key); |
| | | String subId = rsaPublicKeyExample.encryptedData(vo.getSubId().toString(), pub_key); |
| | | Integer radix = iServiceOutPathService.selectAutoId(); |
| | | String format = String.format("%03X", radix); |
| | | ServiceOutPath serviceOutPath = new ServiceOutPath(); |
| | | serviceOutPath.setParam1(taskId); |
| | | serviceOutPath.setParam2(patid); |
| | | serviceOutPath.setParam3(vo.getTaskName()); |
| | | serviceOutPath.setParam6(subId); |
| | | serviceOutPath.setRadix(format); |
| | | serviceOutPath.setCreateTime(new Date()); |
| | | iServiceOutPathService.insertServiceOutPath(serviceOutPath); |
| | | String url = ip + ":" + req_path + "/wt?p=" + format; |
| | | content = "您好,邀请您填写出院调查表,请点击" + url + "填写。感谢您配合!"; |
| | | } |
| | | |
| | | String url = ip + ":" + req_path + "/wt?p=" + format; |
| | | if (ObjectUtils.isNotEmpty(vo.getContent())) content = vo.getContent(); |
| | | |
| | | String content = "您好,邀请您填写出院调查表,请点击" + url + "填写。感谢您配合!"; |
| | | if (ObjectUtils.isNotEmpty(vo.getContent())) |
| | | content = vo.getContent(); |
| | | else |
| | | sendChat(vo); |
| | | String sendMsg = ""; |
| | | try { |
| | | sendMsg = smsUtils.sendSms(xhsmsPath, xhsmsAccount, xhsmsPwd, vo.getPhone(), content); |
| | |
| | | @ApiOperation("微信发送") |
| | | @PostMapping("/sendChat") |
| | | public AjaxResult sendChat(@RequestBody smsVO vo) throws UnsupportedEncodingException { |
| | | RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); |
| | | String taskId = rsaPublicKeyExample.encryptedData(vo.getTaskId().toString(), pub_key); |
| | | String patid = rsaPublicKeyExample.encryptedData(vo.getPatId().toString(), pub_key); |
| | | String subId = rsaPublicKeyExample.encryptedData(vo.getSubId().toString(), pub_key); |
| | | Integer radix=iServiceOutPathService.selectAutoId(); |
| | | String format = String.format("%03X", radix); |
| | | ServiceOutPath serviceOutPath = new ServiceOutPath(); |
| | | serviceOutPath.setParam1(taskId); |
| | | serviceOutPath.setParam2(patid); |
| | | serviceOutPath.setParam3(vo.getTaskName()); |
| | | serviceOutPath.setParam6(subId); |
| | | serviceOutPath.setRadix(format); |
| | | serviceOutPath.setCreateTime(new Date()); |
| | | iServiceOutPathService.insertServiceOutPath(serviceOutPath); |
| | | |
| | | String url = ip + ":" + req_path + "/wt?p=" + format; |
| | | |
| | | |
| | | String sendMsg = smsUtils.sendChat(url,vo.getPhone(),vo.getIdCard()); |
| | | String sendMsg = ""; |
| | | if (StringUtils.isNotEmpty(vo.getTaskId()) && StringUtils.isNotEmpty(vo.getPatId()) && StringUtils.isNotEmpty(vo.getSubId())) { |
| | | RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); |
| | | String taskId = rsaPublicKeyExample.encryptedData(vo.getTaskId().toString(), pub_key); |
| | | String patid = rsaPublicKeyExample.encryptedData(vo.getPatId().toString(), pub_key); |
| | | String subId = rsaPublicKeyExample.encryptedData(vo.getSubId().toString(), pub_key); |
| | | Integer radix = iServiceOutPathService.selectAutoId(); |
| | | String format = String.format("%03X", radix); |
| | | ServiceOutPath serviceOutPath = new ServiceOutPath(); |
| | | serviceOutPath.setParam1(taskId); |
| | | serviceOutPath.setParam2(patid); |
| | | serviceOutPath.setParam3(vo.getTaskName()); |
| | | serviceOutPath.setParam6(subId); |
| | | serviceOutPath.setRadix(format); |
| | | serviceOutPath.setCreateTime(new Date()); |
| | | iServiceOutPathService.insertServiceOutPath(serviceOutPath); |
| | | String url = ip + ":" + req_path + "/wt?p=" + format; |
| | | sendMsg = smsUtils.sendChat(url, vo.getPhone(), vo.getIdCard()); |
| | | } |
| | | return AjaxResult.success(sendMsg); |
| | | } |
| | | } |
| | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 单一任务(随访)Controller |
| | |
| | | |
| | | |
| | | /** |
| | | * 随访统计导出 |
| | | * 随访历史记录导出 |
| | | */ |
| | | //@PreAuthorize("@ss.hasPermi('system:taskcall:export')") |
| | | @Log(title = "随访统计导出)", businessType = BusinessType.EXPORT) |
| | | @Log(title = "随访历史记录导出", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/getSubtaskByDiagnameExport") |
| | | public void getSubtaskByDiagnameExport(HttpServletResponse response, List<ServiceSubtaskDiagname> serviceSubtaskDiagnameList) { |
| | | public void getSubtaskByDiagnameExport(HttpServletResponse response, ServiceSubtask serviceSubtask) { |
| | | LoginUser loginUser = getLoginUser(); |
| | | SysUser user = loginUser.getUser(); |
| | | serviceSubtask.setOrgid(user.getOrgid()); |
| | | serviceSubtask.setPageNum(PageUtils.getOffset(serviceSubtask.getPageNum(), serviceSubtask.getPageSize())); |
| | | List<ServiceSubtask> subtaskList = serviceSubtaskService.selectServiceSubtaskByDiagname(serviceSubtask); |
| | | List<ServiceSubtaskDiagname> serviceSubtaskDiagnameList = new ArrayList<>(); |
| | | if (CollectionUtils.isNotEmpty(subtaskList)) serviceSubtaskDiagnameList = serviceSubtaskService.convertToDiagnameList(subtaskList); |
| | | ExcelUtil<ServiceSubtaskDiagname> util = new ExcelUtil<ServiceSubtaskDiagname>(ServiceSubtaskDiagname.class); |
| | | |
| | | if (active.equals("ls") || active.equals("druid")) { |
| | |
| | | util.exportExcel(response, serviceSubtaskDiagnameList, "随访统计导出"); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增或修改删除单一任务 |
| | |
| | | * 随访统计导出 |
| | | */ |
| | | //@PreAuthorize("@ss.hasPermi('system:taskcall:export')") |
| | | @Log(title = "随访统计导出)", businessType = BusinessType.EXPORT) |
| | | @Log(title = "随访统计导出", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/getSfStatisticsExport") |
| | | public void export(HttpServletResponse response, ServiceSubtaskCountReq serviceSubtaskCountReq) { |
| | | List<ServiceSubtaskStatistic> sfStatistics = serviceSubtaskService.getSfStatisticsExport(serviceSubtaskCountReq); |
| | |
| | | String taskId = rsaPublicKeyExample.encryptedData(ivrTask1.getTaskid().toString(), pub_key); |
| | | log.info("【sfHandlle】处理短信长期任务,患者ID:{}", serviceSubtask.getPatid()); |
| | | boolean dateToday = isDateToday(serviceSubtask.getVisitTime()); |
| | | //记录当前时间 如果失败记录当前时间 |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | if (dateToday) { |
| | | try { |
| | | String patid = rsaPublicKeyExample.encryptedData(serviceSubtask.getPatid().toString(), pub_key); |
| | |
| | | log.info("-----------map的值为:{}", msgInfo); |
| | | String token = LSHospTokenUtil.getToken(serviceSubtask.getOrgid(), msgInfo.get("tokenUrl")); |
| | | if (ObjectUtils.isNotEmpty(msgInfo) && StringUtils.isEmpty(msgInfo.get("address"))) { |
| | | setSuccessPreachForm(serviceSubtask, sendPreachform, "短信发送失败,该机构没有配置短信地址", "5"); |
| | | setSuccessPreachForm(serviceSubtask, sendPreachform, "短信发送失败,该机构没有配置短信地址, 时间:" + now , "5"); |
| | | return; |
| | | } |
| | | log.info("【sfHandlle】丽水短信发送,地址:{},参数:{},机构ID:{}", msgInfo.get("address"), sendMagParam, serviceSubtask.getOrgid()); |
| | |
| | | setSuccessPreachForm(serviceSubtask, sendPreachform, "短信发送成功", "2"); |
| | | } else { |
| | | serviceSubtask.setResult("error"); |
| | | serviceSubtask.setRemark("短信发送失败"); |
| | | setSuccessPreachForm(serviceSubtask, sendPreachform, "短信发送失败", "5"); |
| | | serviceSubtask.setRemark("短信发送失败" + now); |
| | | setSuccessPreachForm(serviceSubtask, sendPreachform, "短信发送失败" + now, "5"); |
| | | } |
| | | } catch (Exception e) { |
| | | String guid = UUID.randomUUID().toString(); |
| | | log.error("【sfHandlle】长期任务短信发送失败,原因:{},GUID:{}", e.getMessage(), guid); |
| | | setSuccessPreachForm(serviceSubtask, sendPreachform, "长期任务短信发送失败:系统错误", "5"); |
| | | log.error("【sfHandlle】长期任务短信发送失败,原因:{},GUID:{}, 时间: {}", e.getMessage(), guid, now); |
| | | setSuccessPreachForm(serviceSubtask, sendPreachform, "长期任务短信发送失败:系统错误, 时间: " + now, "5"); |
| | | } |
| | | } |
| | | |
| | |
| | | public class ServiceSubtaskDiagname implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | @ApiModelProperty(value = "服务名称") |
| | | @Excel(name = "任务名称") |
| | | @ApiModelProperty(value = "任务名称") |
| | | private String taskName; |
| | | |
| | | @ApiModelProperty(value = "患者姓名") |
| | | private String sendname; |
| | | |
| | | @ApiModelProperty(value = "电话") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "性别") |
| | | private String sex; |
| | | |
| | | |
| | | @ApiModelProperty(value = "疾病名称") |
| | | private String leavediagname; |
| | | |
| | | @ApiModelProperty(value = "随访状态") |
| | | // @Excel(name = " 发送状态 1 被领取(在任务中是新建,在服务中是被领取) 2 待发送 3 已发送 4 不执行 5 发送失败 6 已完成\") ") |
| | | @Excel(name = "任务状态", readConverterExp = "1=被领取,2=待发送,3=已发送,4=不执行,5=发送失败,6=已完成") |
| | | @ApiModelProperty(value = "任务状态") |
| | | private Long sendstate; |
| | | |
| | | @ApiModelProperty(value = "入院时间") |
| | | private Date starttime; |
| | | @Excel(name = "姓名") |
| | | @ApiModelProperty(value = "姓名") |
| | | private String sendname; |
| | | |
| | | @ApiModelProperty(value = "出院时间") |
| | | @Excel(name = "诊断名称") |
| | | @ApiModelProperty(value = "诊断名称") |
| | | private String leavediagname; |
| | | |
| | | @Excel(name = "处理意见") |
| | | @ApiModelProperty(value = "处理意见") |
| | | private String suggest; |
| | | |
| | | @Excel(name = "随访人员") |
| | | @ApiModelProperty(value = "随访人员") |
| | | private String operator; |
| | | |
| | | @Excel(name = "随访完成日期",dateFormat = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "随访完成日期") |
| | | private Date finishtime; |
| | | |
| | | @Excel(name = "应随访日期",dateFormat = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "应随访日期") |
| | | private Date longSendTime; |
| | | |
| | | @Excel(name = "出院日期",dateFormat = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "出院日期") |
| | | private Date endtime; |
| | | |
| | | @ApiModelProperty(value = "随访时间") |
| | | private Date visitTime; |
| | | @Excel(name = "出院天数", suffix = "天") |
| | | @ApiModelProperty(value = "出院天数") |
| | | private Integer endDay; |
| | | |
| | | @ApiModelProperty(value = "护士姓名") |
| | | @Excel(name = "身份证号码") |
| | | @ApiModelProperty(value = "身份证号码") |
| | | private String sfzh; |
| | | |
| | | @Excel(name = "联系电话") |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String phone; |
| | | |
| | | @Excel(name = "责任护士") |
| | | @ApiModelProperty("责任护士") |
| | | private String nurseName; |
| | | |
| | | @Excel(name = "主治医生") |
| | | @ApiModelProperty("主治医生") |
| | | private String drname; |
| | | |
| | | @Excel(name = "科室") |
| | | @ApiModelProperty(value = "科室") |
| | | private String deptname; |
| | | |
| | | @Excel(name = "病区") |
| | | @ApiModelProperty(value = "病区") |
| | | private String leavehospitaldistrictname; |
| | | |
| | | @Excel(name = "出院随访模板名称") |
| | | @ApiModelProperty(value = "出院随访模板名称") |
| | | private String templatename; |
| | | |
| | | @Excel(name = "任务执行方式", readConverterExp = "1=人工,2=纸质,3=电话,4=短信,5=微信公众号,6=微信小程序,7=支付宝,8=智能小程序,9=钉钉") |
| | | @ApiModelProperty(value = "任务执行方式") |
| | | private String preachform; |
| | | |
| | | @Excel(name = "任务结果说明", readConverterExp = "0=允许,1=禁止") |
| | | @ApiModelProperty(value = "任务结果说明") |
| | | private String result; |
| | | |
| | | |
| | | } |
| | |
| | | public List<ServiceStatisticsResponse> getServiceStatistics(ServiceStatisticsRequest request); |
| | | |
| | | public List<PatArchiveSrmVO> sendMsgTemplate(List<PatArchiveSrmVO> patArchiveSrmVOS); |
| | | } |
| | | |
| | | public List<ServiceSubtaskDiagname> convertToDiagnameList(List<ServiceSubtask> subtaskList) ; |
| | | } |
| | |
| | | |
| | | //封装serviceSubtask |
| | | private ServiceSubtask boxedServiceSubtask(ServiceTask serviceTask, PatMedInhosp patMedInhosp1, PatArchive patArchive, String config) { |
| | | //增加serviceTask判空 |
| | | // if(Objects.isNull(serviceTask)){ |
| | | // return null; |
| | | // } |
| | | ServiceSubtask serviceSubtask = DtoConversionUtils.sourceToTarget(serviceTask, ServiceSubtask.class); |
| | | serviceSubtask.setTaskid(serviceTask.getTaskid()); |
| | | if (StringUtils.isNotEmpty(serviceTask.getLibtemplateid())) |
| | |
| | | } |
| | | serviceSubtask.setLongSendTime(newDate); |
| | | serviceSubtask.setVisitTime(newDate); |
| | | |
| | | if (patMedInhosp1.getFudate() != null) serviceSubtask.setVisitTime(patMedInhosp1.getFudate()); |
| | | //如果是通知的话,需要提前几天将通过短信发出去(具体几天,这个可以配置在sys_conf表中) |
| | | if ("3".equals(serviceTask.getType())) { |
| | | serviceSubtask.setVisitTime(minusDay(newDate, StringUtils.isNotEmpty(config) ? Integer.parseInt(config) : 0)); |
| | | //判断是不是景宁 |
| | | if (patMedInhosp1.getOrgid().equals("47255004333112711A1001")) |
| | | serviceSubtask.setVisitTime(null); |
| | | |
| | | //如果该出院记录有随访时间,则用他自己的随访时间 |
| | | if (patMedInhosp1.getFudate() != null) |
| | | serviceSubtask.setVisitTime(minusDay(patMedInhosp1.getFudate(), StringUtils.isNotEmpty(config) ? Integer.parseInt(config) : 0)); |
| | |
| | | |
| | | return total; |
| | | } |
| | | |
| | | /** |
| | | * 历史随访记录导出类封装 |
| | | * ServiceSubtask 转换为 ServiceSubtaskDiagname |
| | | */ |
| | | public List<ServiceSubtaskDiagname> convertToDiagnameList(List<ServiceSubtask> subtaskList) { |
| | | if (CollectionUtils.isEmpty(subtaskList)) { |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | return subtaskList.stream().map(subtask -> { |
| | | ServiceSubtaskDiagname diagname = new ServiceSubtaskDiagname(); |
| | | |
| | | diagname.setTaskName(subtask.getTaskName()); |
| | | diagname.setSendstate(subtask.getSendstate()); |
| | | diagname.setSendname(subtask.getSendname()); |
| | | diagname.setLeavediagname(subtask.getLeavediagname()); |
| | | diagname.setSuggest(subtask.getSuggest()); |
| | | diagname.setOperator(subtask.getOperator()); |
| | | diagname.setFinishtime(subtask.getFinishtime()); |
| | | diagname.setLongSendTime(subtask.getLongSendTime()); |
| | | diagname.setEndtime(subtask.getEndtime()); |
| | | //计算出院天数 |
| | | if(!Objects.isNull(diagname.getEndtime())){ |
| | | Integer endDay = DateUtils.differentDaysByMillisecond(diagname.getEndtime(),new Date()); |
| | | diagname.setEndDay(endDay); |
| | | } |
| | | diagname.setSfzh(subtask.getSfzh()); |
| | | diagname.setPhone(subtask.getPhone()); |
| | | diagname.setNurseName(subtask.getNurseName()); |
| | | diagname.setDrname(subtask.getDrname()); |
| | | diagname.setDeptname(subtask.getDeptname()); |
| | | diagname.setLeavehospitaldistrictname(subtask.getLeavehospitaldistrictname()); |
| | | diagname.setTemplatename(subtask.getTemplatename()); |
| | | diagname.setPreachform(subtask.getPreachform()); |
| | | diagname.setResult(subtask.getResult()); |
| | | |
| | | return diagname; |
| | | }).collect(Collectors.toList()); |
| | | } |
| | | |
| | | } |