| | |
| | | <project version="4"> |
| | | <component name="Encoding"> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-admin/src/main/java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedOuthospProvisionalController.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskPreachformController.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-admin/src/main/resources" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx/Hello.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx/HelloResponse.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx/I5GReply.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx/I5GReplyResponse.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx/I5GReport.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx/I5GReportResponse.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx/I5GSearchNumber.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx/I5GSearchNumberResponse.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx/I5GSend.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx/I5GSendResponse.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx/SMSGetNumberResponse.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx/SMSGetTemplateList.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx/SMSGetUserList.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx/SMSGetUserListResponse.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx/SMSSaveContent.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx/SMSSaveContentResponse.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx/SMSVerify.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx/SMSVerifyPrivate.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx/SMSVerifyPrivateResponse.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx/SMSVerifyResponse.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx/SmsServiceSoap.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx/MessageSend.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx2/Hello.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx2/HelloResponse.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx2/I5GReply.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx2/I5GReplyResponse.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx2/I5GReport.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx2/I5GReportResponse.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx2/I5GSearchNumber.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx2/I5GSearchNumberResponse.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx2/I5GSend.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx2/I5GSendResponse.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx2/SMSGetNumberResponse.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx2/SMSGetTemplateList.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx2/SMSGetUserList.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx2/SMSGetUserListResponse.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx2/SMSSaveContent.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx2/SMSSaveContentResponse.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx2/SMSVerify.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx2/SMSVerifyPrivate.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx2/SMSVerifyPrivateResponse.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx2/SMSVerifyResponse.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java/com/ruoyi/common/dx2/SmsServiceSoap.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-common/src/main/resources" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-framework/src/main/java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-framework/src/main/resources" charset="UTF-8" /> |
| | |
| | | <file url="file://$PROJECT_DIR$/ruoyi-system/src/main/java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/ruoyi-system/src/main/resources" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/smartor/src/main/java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/smartor/src/main/java/com/smartor/domain/PatMedOuthospProvisional.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/smartor/src/main/java/com/smartor/domain/ServiceSubtaskPreachform.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/smartor/src/main/java/com/smartor/mapper/PatMedOuthospProvisionalMapper.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/smartor/src/main/java/com/smartor/mapper/ServiceSubtaskPreachformMapper.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/smartor/src/main/java/com/smartor/service/IPatMedOuthospProvisionalService.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/smartor/src/main/java/com/smartor/service/IServiceSubtaskPreachformService.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/smartor/src/main/java/com/smartor/service/impl/PatMedOuthospProvisionalServiceImpl.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskPreachformServiceImpl.java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/smartor/src/main/resources" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/smartor/src/main/resources/mapper/smartor/PatMedOuthospProvisionalMapper.xml" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/smartor/src/main/resources/mapper/smartor/ServiceSubtaskPreachformMapper.xml" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" /> |
| | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.core.type.TypeReference; |
| | | import com.fasterxml.jackson.databind.JsonNode; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | |
| | | } else if (active.equals("sltd")) { |
| | | //省立同德的短信发送方式 |
| | | String data = MessageSend.sendMsg(sendMagParam.getContent(), "6", sendMagParam.getPhone(), LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); |
| | | if (StringUtils.isNotEmpty(data) && data.contains("result=0")) { |
| | | s = "true"; |
| | | if (StringUtils.isNotEmpty(data)) { |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | JsonNode root = mapper.readTree(data); |
| | | String status = root.get("result").get(0).get("status").asText(); |
| | | if (status.equals("00000")) { |
| | | s = "true"; |
| | | } else { |
| | | setFailPreachForm(serviceSubtask, sendPreachform, "短信发送失败: " + data, "5"); |
| | | throw new BaseException("短信发送失败"); |
| | | } |
| | | } else { |
| | | setFailPreachForm(serviceSubtask, sendPreachform, "短信发送失败: " + data, "5"); |
| | | throw new BaseException("短信发送失败"); |
| | |
| | | if (active.equals("hzszlyy")) { |
| | | wxCode = smsUtils.sendChat(url, patArchive.getTelcode(), serviceSubtask.getSfzh()); |
| | | log.info(wxCode); |
| | | }else { |
| | | } else { |
| | | wxCode = getWXCode(serviceSubtask.getSfzh(), url, serviceSubtask.getTaskName(), serviceSubtask.getTaskName(), patArchive.getTelcode(), patArchive.getName(), patArchive.getPatidHis(), wxqqxx); |
| | | log.error("wxCode的值为:{}", wxCode); |
| | | Map<String, Object> map = JSONObject.parseObject(wxCode, Map.class); |
| | |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | */ |
| | | @ApiOperation("查询患者随访信息") |
| | | //@PreAuthorize("@ss.hasPermi('system:taskcall:list')") |
| | | // @Cacheable(value = "patItem", key = "T(org.springframework.util.DigestUtils).md5DigestAsHex(#serviceSubtaskVO.toString().getBytes())", unless = "#result == null or #result.isEmpty()") |
| | | @PostMapping("/patItem") |
| | | public TableDataInfo patItem(@RequestBody ServiceSubtaskVO serviceSubtaskVO) { |
| | | PageUtils.startPageByPost(serviceSubtaskVO.getPageNum(), serviceSubtaskVO.getPageSize()); |
| | |
| | | ExcelUtil<ServiceSubtaskDiagname> util = new ExcelUtil<ServiceSubtaskDiagname>(ServiceSubtaskDiagname.class); |
| | | |
| | | if (active.equals("ls") || active.equals("druid")) { |
| | | util.exportExcel(response, serviceSubtaskDiagnameList, LocalDate.now().getMonthValue() + "随访统计导出"); |
| | | util.exportExcel(response, serviceSubtaskDiagnameList, LocalDate.now().getMonthValue() + "随访历史记录导出"); |
| | | } else { |
| | | util.exportExcel(response, serviceSubtaskDiagnameList, "随访统计导出"); |
| | | util.exportExcel(response, serviceSubtaskDiagnameList, "随访历史记录导出"); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 随访统计导出 |
| | | * 随访历史记录导出 |
| | | */ |
| | | //@PreAuthorize("@ss.hasPermi('system:taskcall:export')") |
| | | @Log(title = "随访统计导出", businessType = BusinessType.EXPORT) |
| | |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.smartor.domain.SvyTaskTemplateScript; |
| | | import com.smartor.domain.SvyTaskTemplateScriptVO; |
| | | import com.smartor.service.ISvyTaskTemplateScriptService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | public AjaxResult remove(@PathVariable Long[] IDs) { |
| | | return toAjax(svyTaskTemplateScriptService.deleteSvyTaskTemplateScriptByIDs(IDs)); |
| | | } |
| | | |
| | | /** |
| | | * 查询模板详情根据条件 |
| | | * |
| | | * @param svyTaskTemplateScriptVO |
| | | * @return |
| | | */ |
| | | @ApiOperation("查询模板详情根据条件") |
| | | @PostMapping("/selectInfoByCondition") |
| | | public AjaxResult selectInfoByCondition(@RequestBody SvyTaskTemplateScriptVO svyTaskTemplateScriptVO) { |
| | | return AjaxResult.success(svyTaskTemplateScriptService.selectInfoByCondition(svyTaskTemplateScriptVO)); |
| | | } |
| | | } |
| | |
| | | RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); |
| | | userName = rsaPublicKeyExample.decryptedData(userName, pri_key); |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(deptId)) deptId = "null"; |
| | | String token2 = loginService.loginByUserName(userName + "&" + orgid + "&" + deptId); |
| | | if (StringUtils.isEmpty(token2)) { |
| | | throw new BaseException("登陆失败"); |
| | |
| | | import com.ruoyi.common.enums.MsgLSEnum; |
| | | import com.ruoyi.common.enums.ServiceFromEnum; |
| | | import com.ruoyi.common.enums.WxGZHEnum; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.HttpUtil; |
| | | import com.ruoyi.common.utils.OkHttpExample; |
| | | import com.ruoyi.common.utils.RSAPublicKeyExample; |
| | |
| | | * 处理补偿任务 |
| | | */ |
| | | public void compensateTask() { |
| | | //获取到sendstate=3 并且 visit_time为今天的subtask |
| | | //获取到sendstate=3 并且 visit_time为小于等于今天的subtask |
| | | ServiceSubtaskVO serviceSubtaskVO = new ServiceSubtaskVO(); |
| | | serviceSubtaskVO.setSendstate(3L); |
| | | serviceSubtaskVO.setVisitTime(new Date()); |
| | | List<ServiceSubtask> serviceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskVO); |
| | | List<ServiceSubtask> serviceSubtaskList = serviceSubtaskMapper.getCompensateServiceSubtaskList(serviceSubtaskVO); |
| | | for (ServiceSubtask serviceSubtask : serviceSubtaskList) { |
| | | //根据当前的执行方式,获取下一种执行方式 |
| | | ServiceSubtaskPreachform serviceSubtaskPreachform = new ServiceSubtaskPreachform(); |
| | |
| | | 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, "短信发送失败,该机构没有配置短信地址, 时间:" + now , "5"); |
| | | setSuccessPreachForm(serviceSubtask, sendPreachform, "短信发送失败,该机构没有配置短信地址, 时间:" + now, "5"); |
| | | return; |
| | | } |
| | | log.info("【sfHandlle】丽水短信发送,地址:{},参数:{},机构ID:{}", msgInfo.get("address"), sendMagParam, serviceSubtask.getOrgid()); |
| | |
| | | log.info("sltd进来了吗?{} ,---sendMagParam.getContent()的参数为:{}", active, sendMagParam.getContent()); |
| | | //省立同德的短信发送方式 |
| | | String data = MessageSend.sendMsg(sendMagParam.getContent(), "6", sendMagParam.getPhone(), LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); |
| | | if (StringUtils.isNotEmpty(data) && data.contains("result=0")) { |
| | | isSuccess = "true"; |
| | | if (StringUtils.isNotEmpty(data)) { |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | JsonNode root = mapper.readTree(data); |
| | | String status = root.get("result").get(0).get("status").asText(); |
| | | if (status.equals("00000")) { |
| | | isSuccess = "true"; |
| | | } |
| | | } |
| | | } else if (active.equals("hzszlyy")) {//市一医院 |
| | | String content = sendMagParam.getContent().replace("【新华医院】", ""); |
| | |
| | | serviceSubtask.setSendstate(3L); |
| | | if (StringUtils.isNotEmpty(isSuccess) && isSuccess.equals("true")) { |
| | | serviceSubtask.setResult("success"); |
| | | serviceSubtask.setRemark("短信发送成功"); |
| | | serviceSubtask.setRemark(serviceSubtask.getRemark() + "," + "短信发送成功"); |
| | | setSuccessPreachForm(serviceSubtask, sendPreachform, "短信发送成功", "2"); |
| | | } else { |
| | | serviceSubtask.setResult("error"); |
| | | serviceSubtask.setRemark("短信发送失败" + now); |
| | | serviceSubtask.setRemark(serviceSubtask.getRemark() + "," +"短信发送失败" + now); |
| | | setSuccessPreachForm(serviceSubtask, sendPreachform, "短信发送失败" + now, "5"); |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | if (active.equals("hzszlyy")) { |
| | | //处理中文乱码问题 |
| | | /**String title = URLEncoder.encode("您好,邀请您填写出院调查表,请点击填写。", StandardCharsets.UTF_8.toString()); |
| | | String content = URLEncoder.encode("您好,邀请您填写出院调查表,请点击填写。", StandardCharsets.UTF_8.toString()); |
| | | String encodedUrl = URLEncoder.encode(url, StandardCharsets.UTF_8.toString()); |
| | | String urlTemp = "http://192.200.54.14:5003/sfjk/SendMessage?sfzh=" + serviceSubtask.getSfzh() + |
| | | "&title=" + title + |
| | | "&content=" + content + |
| | | "&phone=" + patArchive.getTelcode() + |
| | | "&url=" + encodedUrl + |
| | | "&key=ff76f8904f5f32b5ee1739e8ea46e60g"; |
| | | // HttpUtils.sendGet(urlTemp); |
| | | String sendMsg = ""; |
| | | sendMsg = HttpUtils.sendPost(urlTemp); |
| | | log.info(sendMsg); **/ |
| | | String content = URLEncoder.encode("您好,邀请您填写出院调查表,请点击填写。", StandardCharsets.UTF_8.toString()); |
| | | String encodedUrl = URLEncoder.encode(url, StandardCharsets.UTF_8.toString()); |
| | | String urlTemp = "http://192.200.54.14:5003/sfjk/SendMessage?sfzh=" + serviceSubtask.getSfzh() + |
| | | "&title=" + title + |
| | | "&content=" + content + |
| | | "&phone=" + patArchive.getTelcode() + |
| | | "&url=" + encodedUrl + |
| | | "&key=ff76f8904f5f32b5ee1739e8ea46e60g"; |
| | | // HttpUtils.sendGet(urlTemp); |
| | | String sendMsg = ""; |
| | | sendMsg = HttpUtils.sendPost(urlTemp); |
| | | log.info(sendMsg); **/ |
| | | |
| | | wxCode = smsUtils.sendChat(url, patArchive.getTelcode(), serviceSubtask.getSfzh()); |
| | | log.info(wxCode); |
| | |
| | | package com.smartor.domain; |
| | | |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | private Long scriptid; |
| | | |
| | | /** |
| | | * 模板ID |
| | | */ |
| | | @ApiModelProperty(name = "模板ID") |
| | | private Long templateid; |
| | | |
| | | /** |
| | | * 问题内容 |
| | | */ |
| | | @ApiModelProperty("问题内容") |
| | | private String scriptContent; |
| | | |
| | | /** |
| | | * 题目类型;枚举 1.单选 2多选 3填空 4其它 |
| | | */ |
| | | @ApiModelProperty(value = "题目类型;枚举 1.单选 2多选 3填空 4其它") |
| | | private String scriptType; |
| | | |
| | | /** |
| | | * 任务类型(门诊,住院,复诊…) |
| | | */ |
| | | @Excel(name = "任务类型:1,机器人语音(随访) 2,问卷;3,通知(宣教)") |
| | | @ApiModelProperty(value = "任务类型:1,机器人语音(随访) 2,问卷;3,宣教; 4.通知)") |
| | | private String subtaskType; |
| | | |
| | | /** |
| | | * 已填写数量 |
| | |
| | | @ApiModelProperty(value = "选择比例") |
| | | private String chosenPercentage; |
| | | |
| | | /** |
| | | * 问题选项集合,逗号分割 |
| | | */ |
| | | @ApiModelProperty(value = "问题选项集合") |
| | | private String options; |
| | | |
| | | /** |
| | | * 明细 |
| | |
| | | */ |
| | | public List<ServiceSubtask> selectServiceSubtaskList(ServiceSubtaskVO serviceSubtaskVO); |
| | | |
| | | /** |
| | | * 用于补偿查询 |
| | | * @param serviceSubtaskVO |
| | | * @return |
| | | */ |
| | | public List<ServiceSubtask> getCompensateServiceSubtaskList(ServiceSubtaskVO serviceSubtaskVO); |
| | | |
| | | public List<ServiceSubtask> selectServiceSubtaskByDiagname(ServiceSubtask serviceSubtask); |
| | | |
| | | public List<ServiceSubtask> queryServiceSubtaskList(ServiceSubtaskVO serviceSubtaskVO); |
| | |
| | | package com.smartor.service; |
| | | |
| | | import com.smartor.domain.SvyTaskTemplateScript; |
| | | import com.smartor.domain.SvyTaskTemplateScriptVO; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | public int deleteSvyTaskTemplateScriptByID(Long ID); |
| | | |
| | | /** |
| | | * 查询问卷任务模版问题话术库列表 |
| | | * |
| | | * @param svyTaskTemplateScriptVO |
| | | * @return 问卷任务模版问题话术库集合 |
| | | */ |
| | | public SvyTaskTemplateScriptVO selectInfoByCondition(SvyTaskTemplateScriptVO svyTaskTemplateScriptVO); |
| | | } |
| | |
| | | subtask.setSendstate(2L); |
| | | subtask.setTaskid(taskid); |
| | | List<ServiceSubtask> selectServiceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(subtask); |
| | | log.info("该患者待执行的任务:{}", CollectionUtils.isNotEmpty(selectServiceSubtaskList) ? selectServiceSubtaskList.size() : null); |
| | | // log.info("该患者待执行的任务:{}", CollectionUtils.isNotEmpty(selectServiceSubtaskList) ? selectServiceSubtaskList.size() : null); |
| | | if (CollectionUtils.isNotEmpty(selectServiceSubtaskList) && selectServiceSubtaskList.size() > 0) { |
| | | for (ServiceSubtask serviceSubtask1 : selectServiceSubtaskList) { |
| | | if (Objects.isNull(serviceSubtask1.getLongSendTime())) { |
| | |
| | | |
| | | 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; |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.collections4.ListUtils; |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | // return map; |
| | | // } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 统计任务各种状态的数量(已优化) |
| | | * 优化说明: |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | Map<String, ServiceSubtaskScriptCount> result = new HashMap<>(); |
| | | List<ServiceSubtaskScriptCount> allCounts = new ArrayList<>(); |
| | | List<ServiceSubtaskScriptCount> allItemCounts = new ArrayList<>(); |
| | | if(ObjectUtils.isEmpty(serviceSubtaskCountReq.getType())){ |
| | | String type = serviceSubtaskCountReq.getType(); |
| | | if(ObjectUtils.isEmpty(type)){ |
| | | //查询语音统计明细 |
| | | serviceSubtaskCountReq.setType("1"); |
| | | List<ServiceSubtaskScriptCount> ivyCounts = serviceSubtaskMapper.getSfStatisticsScriptDetails(serviceSubtaskCountReq); |
| | |
| | | allItemCounts = serviceSubtaskMapper.getSfStatisticsScriptItemDetails(serviceSubtaskCountReq); |
| | | } |
| | | |
| | | |
| | | for(ServiceSubtaskScriptCount count : allCounts){ |
| | | List<ServiceSubtaskScriptCount> itemCounts = new ArrayList<>(); |
| | | Map<String, ServiceSubtaskScriptCount> itemCountMap = new HashMap<>(); |
| | | //问卷加上空白选项 |
| | | if(ObjectUtils.isNotEmpty(count.getTemplateid()) |
| | | && ObjectUtils.isNotEmpty(count.getSubtaskType()) |
| | | && count.getSubtaskType().equals("2")){ |
| | | SvyTaskTemplateScriptVO svyTaskTemplateScriptVO = new SvyTaskTemplateScriptVO(); |
| | | svyTaskTemplateScriptVO.setId(count.getScriptid()); |
| | | SvyTaskTemplateScriptVO svyTaskTemplateScriptResultVo = svyTaskTemplateScriptService.selectInfoByCondition(svyTaskTemplateScriptVO); |
| | | if(ObjectUtils.isNotEmpty(svyTaskTemplateScriptResultVo)){ |
| | | List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions = svyTaskTemplateScriptResultVo.getSvyTaskTemplateTargetoptions(); |
| | | if(ObjectUtils.isNotEmpty(svyTaskTemplateTargetoptions)){ |
| | | //填入空白信息 |
| | | svyTaskTemplateTargetoptions.forEach(targetoption ->{ |
| | | ServiceSubtaskScriptCount emptyCount = new ServiceSubtaskScriptCount(); |
| | | emptyCount.setScriptid(count.getScriptid()); |
| | | emptyCount.setScriptContent(count.getScriptContent()); |
| | | emptyCount.setScriptType(count.getScriptType()); |
| | | emptyCount.setSubtaskType(count.getSubtaskType()); |
| | | emptyCount.setCompletedQuantity(count.getCompletedQuantity()); |
| | | emptyCount.setAllQuantity(count.getAllQuantity()); |
| | | emptyCount.setCompletedPercentage(count.getCompletedPercentage()); |
| | | emptyCount.setTemplateid(count.getTemplateid()); |
| | | emptyCount.setChosenQuantity(0); |
| | | emptyCount.setChosenPercentage("0.0"); |
| | | emptyCount.setOptionText(targetoption.getOptioncontent()); |
| | | itemCountMap.put(targetoption.getOptioncontent(),emptyCount); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | allItemCounts.forEach(itemCount ->{ |
| | | if(ObjectUtils.isNotEmpty(count.getScriptid()) && ObjectUtils.isNotEmpty(itemCount.getScriptid())){ |
| | | if(count.getScriptid().equals(itemCount.getScriptid())){ |
| | | //放入统计信息 |
| | | itemCount.setScriptContent(count.getScriptContent()); |
| | | itemCount.setScriptType(count.getScriptType()); |
| | | itemCount.setSubtaskType(count.getSubtaskType()); |
| | | itemCount.setCompletedQuantity(count.getCompletedQuantity()); |
| | | itemCount.setAllQuantity(count.getAllQuantity()); |
| | | itemCount.setCompletedPercentage(count.getCompletedPercentage()); |
| | | itemCount.setTemplateid(count.getTemplateid()); |
| | | //计算选择比例 |
| | | int chosenQuantity = ObjectUtils.isNotEmpty(itemCount.getChosenQuantity())?itemCount.getChosenQuantity():0; |
| | | int completedQuantity = itemCount.getCompletedQuantity(); |
| | |
| | | BigDecimal chosenPercentage = (new BigDecimal(chosenQuantity)).divide(new BigDecimal(completedQuantity), 2, RoundingMode.HALF_UP); |
| | | itemCount.setChosenPercentage(chosenPercentage.toString()); |
| | | } |
| | | itemCounts.add(itemCount); |
| | | itemCountMap.put(itemCount.getOptionText(), itemCount); |
| | | } |
| | | } |
| | | }); |
| | | List<ServiceSubtaskScriptCount> itemCounts = new ArrayList<>(itemCountMap.values()); |
| | | count.setDetails(itemCounts); |
| | | result.put(count.getScriptid().toString(),count); |
| | | } |
| | |
| | | package com.smartor.service.impl; |
| | | |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.DtoConversionUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.smartor.domain.IvrLibaTemplateScriptVO; |
| | | import com.smartor.domain.SvyTaskTemplateScript; |
| | | import com.smartor.domain.SvyTaskTemplateScriptVO; |
| | | import com.smartor.domain.SvyTaskTemplateTargetoption; |
| | | import com.smartor.mapper.SvyTaskTemplateScriptMapper; |
| | | import com.smartor.mapper.SvyTaskTemplateTargetoptionMapper; |
| | | import com.smartor.service.ISvyTaskTemplateScriptService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | { |
| | | @Autowired |
| | | private SvyTaskTemplateScriptMapper svyTaskTemplateScriptMapper; |
| | | |
| | | @Autowired |
| | | private SvyTaskTemplateTargetoptionMapper svyTaskTemplateTargetoptionMapper; |
| | | |
| | | /** |
| | | * 查询问卷任务模版问题话术库 |
| | |
| | | { |
| | | return svyTaskTemplateScriptMapper.deleteSvyTaskTemplateScriptByID(ID); |
| | | } |
| | | |
| | | @Override |
| | | public SvyTaskTemplateScriptVO selectInfoByCondition(SvyTaskTemplateScriptVO svyTaskTemplateScriptVO){ |
| | | |
| | | SvyTaskTemplateTargetoption svyTaskTemplateTargetoption = new SvyTaskTemplateTargetoption(); |
| | | svyTaskTemplateTargetoption.setScriptid(svyTaskTemplateScriptVO.getId()); |
| | | svyTaskTemplateTargetoption.setOrgid(svyTaskTemplateScriptVO.getOrgid()); |
| | | List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions = svyTaskTemplateTargetoptionMapper.selectSvyTaskTemplateTargetoptionList(svyTaskTemplateTargetoption); |
| | | for (SvyTaskTemplateTargetoption svyTaskTemplateTargetoption1 : svyTaskTemplateTargetoptions) { |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | if (!StringUtils.isEmpty(svyTaskTemplateTargetoption1.getDynamiccruxs())) { |
| | | try { |
| | | svyTaskTemplateTargetoption1.setDynamiccruxs(mapper.readValue(svyTaskTemplateTargetoption1.getDynamiccruxsJson(), List.class)); |
| | | } catch (JsonProcessingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | if (!StringUtils.isEmpty(svyTaskTemplateTargetoption1.getNodynamiccruxs())) { |
| | | try { |
| | | svyTaskTemplateTargetoption1.setNodynamiccruxs(mapper.readValue(svyTaskTemplateTargetoption1.getNodynamiccruxsJson(), List.class)); |
| | | } catch (JsonProcessingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | //根据序号进行排序 |
| | | // Collections.sort(svyTaskTemplateTargetoptions, Comparator.comparing(SvyTaskTemplateTargetoption::getId)); |
| | | |
| | | svyTaskTemplateScriptVO.setSvyTaskTemplateTargetoptions(svyTaskTemplateTargetoptions); |
| | | return svyTaskTemplateScriptVO; |
| | | } |
| | | } |
| | |
| | | |
| | | <resultMap type="com.smartor.domain.ServiceSubtaskScriptCount" id="ServiceSubtaskScriptCountResult"> |
| | | <result property="scriptid" column="scriptid"/> |
| | | <result property="templateid" column="templateid"/> |
| | | <result property="scriptType" column="script_type"/> |
| | | <result property="scriptContent" column="script_content"/> |
| | | <result property="subtaskType" column="subtask_type"/> |
| | | <result property="completedQuantity" column="completed_quantity"/> |
| | | <result property="allQuantity" column="all_quantity"/> |
| | | <result property="completedPercentage" column="completed_percentage"/> |
| | | <result property="optionText" column="option_text"/> |
| | | <result property="chosenQuantity" column="chosen_quantity"/> |
| | | <result property="chosenPercentage" column="chosen_percentage"/> |
| | | <result property="options" column="options"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectServiceSubtaskVo"> |
| | |
| | | <if test="taskGuid != null">and task_guid = #{taskGuid}</if> |
| | | <if test="isabnormal != null">and isabnormal = #{isabnormal}</if> |
| | | <if test="isVisitAgain != null">and is_visit_again = #{isVisitAgain}</if> |
| | | <!-- <if test="dateLimit != null and dateLimit = '1'"> and CURDATE() + 1 > long_send_time</if>--> |
| | | <!-- <if test="dateLimit != null and dateLimit = '1'"> and CURDATE() + 1 > long_send_time</if>--> |
| | | <!-- <if test="visitTime != null">and visit_time = #{visitTime}</if> --> |
| | | <!--<if test="visitDeptCode != null">and visit_dept_code = #{visitDeptCode}</if> |
| | | <if test="visitDeptName != null">and visit_dept_name = #{visitDeptName}</if>--> |
| | |
| | | <if test="sort != null and sort==8">order by visit_time desc</if> |
| | | |
| | | <!-- order by update_time desc,id desc --> |
| | | </select> |
| | | <select id="getCompensateServiceSubtaskList" parameterType="com.smartor.domain.ServiceSubtaskVO" |
| | | resultMap="ServiceSubtaskResult"> |
| | | <include refid="selectServiceSubtaskVo"/> |
| | | <where> |
| | | del_flag=0 |
| | | <if test="visitTime != null"> |
| | | AND date_format(visit_time,'%y%m%d') <= date_format(#{visitTime},'%y%m%d') |
| | | </if> |
| | | <if test="sendstate != null ">and sendstate = #{sendstate}</if> |
| | | |
| | | </where> |
| | | |
| | | </select> |
| | | |
| | | <select id="selectServiceSubtaskListByCreateTime" parameterType="com.smartor.domain.ServiceSubtaskVO" |
| | |
| | | resultMap="ServiceSubtaskScriptCountResult"> |
| | | SELECT |
| | | a.id as scriptid, |
| | | a.templateid as templateid, |
| | | a.script_type, |
| | | a.script_content, |
| | | b.subtask_type, |
| | | b.completed_quantity, |
| | | b.all_quantity, |
| | | ROUND(b.completed_quantity/b.all_quantity,2) as completed_percentage |
| | |
| | | INNER JOIN( |
| | | SELECT |
| | | ssd.scriptid AS scriptid, |
| | | ss.type as subtask_type, |
| | | SUM(CASE WHEN IFNULL(ssd.matchedtext,ssd.asrtext) IS NOT NULL |
| | | AND IFNULL(ssd.matchedtext,ssd.asrtext) != '' THEN 1 |
| | | ELSE 0 END) AS completed_quantity, |
| | |
| | | <!-- 优化的统计查询:直接在数据库层完成聚合计算 --> |
| | | <select id="countByCondition" parameterType="com.smartor.domain.ServiceSubtaskVO" resultType="map"> |
| | | SELECT |
| | | SUM(CASE WHEN sendstate = 4 THEN 1 ELSE 0 END) AS wzx, |
| | | SUM(CASE WHEN sendstate != 4 AND sendstate != 2 THEN 1 ELSE 0 END) AS ysf, |
| | | SUM(CASE WHEN sendstate = 5 THEN 1 ELSE 0 END) AS fssb, |
| | | SUM(CASE WHEN sendstate >= 3 OR sendstate = 1 THEN 1 ELSE 0 END) AS yfs, |
| | | SUM(CASE WHEN sendstate = 2 THEN 1 ELSE 0 END) AS dsf, |
| | | SUM(CASE WHEN sendstate = 1 THEN 1 ELSE 0 END) AS blq, |
| | | SUM(CASE WHEN excep IS NOT NULL AND excep != '0' THEN 1 ELSE 0 END) AS yc |
| | | SUM(CASE WHEN sendstate = 4 THEN 1 ELSE 0 END) AS wzx, |
| | | SUM(CASE WHEN sendstate != 4 AND sendstate != 2 THEN 1 ELSE 0 END) AS ysf, |
| | | SUM(CASE WHEN sendstate = 5 THEN 1 ELSE 0 END) AS fssb, |
| | | SUM(CASE WHEN sendstate >= 3 OR sendstate = 1 THEN 1 ELSE 0 END) AS yfs, |
| | | SUM(CASE WHEN sendstate = 2 THEN 1 ELSE 0 END) AS dsf, |
| | | SUM(CASE WHEN sendstate = 1 THEN 1 ELSE 0 END) AS blq, |
| | | SUM(CASE WHEN excep IS NOT NULL AND excep != '0' THEN 1 ELSE 0 END) AS yc |
| | | FROM service_subtask |
| | | <where> |
| | | del_flag = 0 |
| | |
| | | <if test="deptOrDistrict == 1"> |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> |
| | | AND leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," close=")"> |
| | | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" |
| | | separator="," close=")"> |
| | | #{leavehospitaldistrictcode} |
| | | </foreach> |
| | | </if> |