| | |
| | | package com.ruoyi.web.component; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.core.type.TypeReference; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | |
| | | import com.ruoyi.common.utils.RSAPublicKeyExample; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.http.HttpUtils; |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.smartor.common.LSHospTokenUtil; |
| | | import com.smartor.domain.*; |
| | |
| | | private RedisCache redisCache; |
| | | |
| | | @Autowired |
| | | private ServiceTaskMapper svyTaskMapper; |
| | | private ServiceTaskMapper serviceTaskMapper; |
| | | |
| | | @Autowired |
| | | private ServiceSubtaskMapper serviceSubtaskMapper; |
| | |
| | | if (commonTaskcallMQ.getUpdateSendstate() == null || commonTaskcallMQ.getUpdateSendstate() == 1) { |
| | | serviceTask.setSendState(5L); |
| | | serviceTask.setFail(1L); |
| | | svyTaskMapper.updateServiceTask(serviceTask); |
| | | serviceTaskMapper.updateServiceTask(serviceTask); |
| | | } |
| | | } catch (Exception e) { |
| | | Integer integer = redisCache.getCacheObject(commonTaskcallMQ.getTaskid().toString()); |
| | |
| | | ServiceTask serviceTask = new ServiceTask(); |
| | | serviceTask.setTaskid(Long.valueOf(commonTaskcallMQ.getTaskid().toString())); |
| | | serviceTask.setFail(0L); |
| | | svyTaskMapper.updateServiceTask(serviceTask); |
| | | serviceTaskMapper.updateServiceTask(serviceTask); |
| | | //å°æ¶æ¯ä»éåä¸å é¤ |
| | | } else if (integer == null) { |
| | | redisCache.setCacheObject(commonTaskcallMQ.getTaskid().toString(), 1, 120, TimeUnit.MINUTES); |
| | |
| | | } |
| | | } else if (heLibrary.getHetype().equals("2")) { |
| | | //éç¥ |
| | | String sc = getSC(serviceSubtask, heLibrary.getPreachcontent()); |
| | | sendMagParam.setPhone(serviceSubtask.getPhone()); |
| | | sendMagParam.setContent(heLibrary.getPreachcontent()); |
| | | sendMagParam.setContent(sc); |
| | | } |
| | | } |
| | | |
| | |
| | | Map<String, String> req = new HashMap<>(); |
| | | req.put("phone", sendMagParam.getPhone()); |
| | | req.put("content", sendMagParam.getContent()); |
| | | log.info("contentè¿åå¼çå
容æ¯ï¼{}", sendMagParam.getContent()); |
| | | s = HttpUtil.postJsonRequest(xhsmsPath, new Gson().toJson(req)); |
| | | } else if (active.equals("ls")) { |
| | | String url = configService.selectConfigByKey("token.360", serviceSubtask.getOrgid()); |
| | | log.info("-------00token.360çURL为ï¼{}", url); |
| | | // String url = configService.selectConfigByKey("token.360", serviceSubtask.getOrgid()); |
| | | // log.info("-------00token.360çURL为ï¼{}", url); |
| | | |
| | | //丽水ççä¿¡åéæ¹å¼ |
| | | Map<String, String> map = MsgLSEnum.getAddressByCode(serviceSubtask.getOrgid()); |
| | | log.info("-----------mapçå¼ä¸ºï¼{}", map); |
| | | String token = LSHospTokenUtil.getToken(serviceSubtask.getOrgid(), url); |
| | | log.info("-----------tokençå¼ä¸ºï¼{}", token); |
| | | if (ObjectUtils.isNotEmpty(map) && StringUtils.isEmpty(map.get("address"))) { |
| | | SysConfig config = new SysConfig(); |
| | | config.setConfigKey("ls.msg.info"); |
| | | config.setOrgid(serviceSubtask.getOrgid()); |
| | | List<SysConfig> sysConfigs = configService.selectConfigList(config); |
| | | Map<String, String> msgInfo = new HashMap<>(); |
| | | if (CollectionUtils.isNotEmpty(sysConfigs)) { |
| | | String configValue = sysConfigs.get(0).getConfigValue(); |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | if (StringUtils.isNotEmpty(configValue)) { |
| | | msgInfo = objectMapper.readValue(configValue, Map.class); |
| | | } |
| | | } |
| | | log.info("-----------mapçå¼ä¸ºï¼{}", msgInfo); |
| | | |
| | | if (ObjectUtils.isNotEmpty(msgInfo) && StringUtils.isEmpty(msgInfo.get("address"))) { |
| | | serviceSubtask.setCurrentPreachform(sendPreachform); |
| | | serviceSubtask.setVisitTime(getNextVisitTime(serviceSubtask.getId(), serviceSubtask.getTaskid(), serviceSubtask.getVisitTime(), serviceSubtask.getCurrentPreachform())); |
| | | setFailPreachForm(serviceSubtask, descByCode, "çä¿¡åé失败,è¯¥æºææ²¡æé
ç½®çä¿¡å°å", "5"); |
| | | serviceSubtaskMapper.updateServiceSubtask(serviceSubtask); |
| | | continue; |
| | | } |
| | | log.info("---------mq丽水çä¿¡åéå
¥åaddressï¼{}, sendMagParam:{}, orgid:{}-------", map.get("address"), sendMagParam, serviceSubtask.getOrgid()); |
| | | String dxCode = getDXCode(map.get("address"), sendMagParam.getPhone(), sendMagParam.getContent(), map.get("sendPersonId"), map.get("sendPersonName"), MsgLSEnum.getHeaderByCode(serviceSubtask.getOrgid()), token); |
| | | log.info("---------丽水çä¿¡åéç»æï¼{}-------", dxCode); |
| | | |
| | | String token = LSHospTokenUtil.getToken(serviceSubtask.getOrgid(), msgInfo.get("tokenUrl")); |
| | | String dxCode = getDXCode(msgInfo.get("address"), sendMagParam.getPhone(), sendMagParam.getContent(), msgInfo.get("sendPersonId"), msgInfo.get("sendPersonName"), MsgLSEnum.getHeaderByCode(msgInfo), token); |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | Map<String, Object> textParam = objectMapper.readValue(dxCode, Map.class); |
| | | log.info("---------丽水çä¿¡åéç»æ--textParamçå¼ä¸ºï¼{}-------", textParam); |
| | | String code = textParam.get("Code").toString(); |
| | | if (code.equals("0")) { |
| | | s = "true"; |
| | |
| | | throw new BaseException("çä¿¡åé失败"); |
| | | } |
| | | } else if (active.equals("sltd")) { |
| | | log.info("-------è¿æ¥äºä¸ï¼ï¼"); |
| | | //çç«åå¾·ççä¿¡åéæ¹å¼ |
| | | String data = MessageSend.sendMsg(sendMagParam.getContent(), "2", sendMagParam.getPhone(), LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); |
| | | 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"; |
| | | } else { |
| | |
| | | serviceOutPath.setRadix(format); |
| | | serviceOutPath.setUpdateTime(new Date()); |
| | | iServiceOutPathService.updateServiceOutPath(serviceOutPath); |
| | | |
| | | //éè¦éè¿æ¨¡æ¿IDå»å¤æè¦åçå
容æ¯å®£æè¿æ¯éç¥ |
| | | // HeLibrary heLibrary = heLibraryMapper.selectHeLibraryById(serviceSubtask.getLibtemplateid()); |
| | | // if (heLibrary.getHetype().equals("1")) { |
| | | // sendMagParam.setPhone(serviceSubtask.getPhone()); |
| | | // sendMagParam.setUrl(ip + ":" + req_path + "/xj?p=" + format); |
| | | // if (active.equals("ls") || active.equals("sltd")) { |
| | | // sendMagParam.setContent("æ¨å¥½ï¼é请æ¨å¡«ååºé¢å®£æè°æ¥è¡¨ï¼è¯·ç¹å»" + sendMagParam.getUrl() + "æ¥çãæè°¢æ¨é
åï¼"); |
| | | // } else if (active.equals("xh")) { |
| | | // sendMagParam.setContent("ãæ°åå»é¢ãæ¨å¥½ï¼é请æ¨å¡«ååºé¢å®£æè°æ¥è¡¨ï¼è¯·ç¹å»" + sendMagParam.getUrl() + "æ¥çãæè°¢æ¨é
åï¼"); |
| | | // } |
| | | // } else if (heLibrary.getHetype().equals("2")) { |
| | | // //éç¥ |
| | | // String sc = getSC(serviceSubtask, heLibrary.getPreachcontent()); |
| | | // sendMagParam.setPhone(serviceSubtask.getPhone()); |
| | | // sendMagParam.setContent(sc); |
| | | // } |
| | | |
| | | url = ip + ":" + req_path + "/xj?p=" + format; |
| | | } |
| | | if (StringUtils.isEmpty(patArchive.getPatidHis())) { |
| | |
| | | |
| | | } |
| | | |
| | | private String getSC(ServiceSubtask serviceSubtask, String scriptContent) { |
| | | Map<String, Map<String, String>> param = getParam(serviceSubtask.getTaskid()); |
| | | for (Map<String, String> map : param.values()) { |
| | | for (String key : map.keySet()) { |
| | | scriptContent = scriptContent.replace(key, org.apache.commons.lang3.StringUtils.isNotEmpty(map.get(key)) ? map.get(key) : ""); |
| | | } |
| | | } |
| | | scriptContent = scriptContent.replace("${name}", org.apache.commons.lang3.StringUtils.isNotEmpty(serviceSubtask.getSendname()) ? serviceSubtask.getSendname() : ""); |
| | | scriptContent = scriptContent.replace("${dzz}", org.apache.commons.lang3.StringUtils.isNotEmpty(serviceSubtask.getAddr()) ? serviceSubtask.getAddr() : ""); |
| | | scriptContent = scriptContent.replace("${phone}", org.apache.commons.lang3.StringUtils.isNotEmpty(serviceSubtask.getTelcode()) ? serviceSubtask.getTelcode() : ""); |
| | | |
| | | return scriptContent; |
| | | } |
| | | |
| | | private Map<String, Map<String, String>> getParam(Long taskId) { |
| | | ServiceTask serviceTask = serviceTaskMapper.selectServiceTaskByTaskid(taskId); |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | Map<String, Map<String, String>> serviceTaskMap = null; |
| | | try { |
| | | serviceTaskMap = objectMapper.readValue(serviceTask.getTextParam(), Map.class); |
| | | } catch (JsonProcessingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return serviceTaskMap; |
| | | } |
| | | |
| | | private Date getNextVisitTime(Long subid, Long taskid, Date visitTime, String currentPreachform) { |
| | | ServiceSubtaskPreachform serviceSubtaskPreachform = new ServiceSubtaskPreachform(); |
| | | serviceSubtaskPreachform.setSubid(subid); |
| | |
| | | private String getSendPreachform(ServiceSubtaskPreachform serviceSubtaskPreachform, ServiceSubtask serviceSubtask) { |
| | | log.info("-----getSendPreachformçserviceSubtaskPreachformå
¥åï¼{},------serviceSubtask:{}", serviceSubtaskPreachform, serviceSubtask); |
| | | List<ServiceSubtaskPreachform> serviceSubtaskPreachforms = serviceSubtaskPreachformMapper.selectServiceSubtaskPreachformList(serviceSubtaskPreachform); |
| | | if (CollectionUtils.isEmpty(serviceSubtaskPreachforms)) { |
| | | //妿serviceSubtaskPreachforms为空çè¯ï¼åéè¦è¿è¡æ°å¢ä¸ä¸ |
| | | List<ServiceSubtaskPreachform> serviceSubtaskPreachformList = addServiceSubtaskPreachform(serviceSubtask, "1"); |
| | | if (CollectionUtils.isEmpty(serviceSubtaskPreachformList)) { |
| | | log.error("åéæ¹å¼å¤±è´¥äºserviceSubtaskçå
¥å为ï¼{}", serviceSubtask); |
| | | return null; |
| | | } |
| | | serviceSubtaskPreachforms = serviceSubtaskPreachformList; |
| | | } |
| | | |
| | | |
| | | // æ
åµ1ï¼currentPreachform为空ï¼åsort为1çpreachform |
| | | if (StringUtils.isEmpty(serviceSubtask.getCurrentPreachform())) { |
| | |
| | | return null; |
| | | } |
| | | |
| | | private List<ServiceSubtaskPreachform> addServiceSubtaskPreachform(ServiceSubtask serviceSubtask, String sendstate) { |
| | | //å°preachformDescçjsonå¯¹è±¡ï¼æ¾å°listéåä¸ |
| | | ServiceTask serviceTask = serviceTaskMapper.selectServiceTaskByTaskid(serviceSubtask.getTaskid()); |
| | | String preachformDesc = serviceTask.getPreachformDesc(); |
| | | |
| | | List<ServiceSubtaskPreachform> sspl = null; |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | if (org.apache.commons.lang3.StringUtils.isNotEmpty(preachformDesc)) { |
| | | try { |
| | | sspl = objectMapper.readValue(preachformDesc, new TypeReference<List<ServiceSubtaskPreachform>>() { |
| | | }); |
| | | } catch (JsonProcessingException e) { |
| | | log.error("mq--preachform转List<ServiceSubtaskPreachform>æ¥éäºï¼{}", e.getMessage()); |
| | | } |
| | | for (ServiceSubtaskPreachform serviceSubtaskPreachform : sspl) { |
| | | serviceSubtaskPreachform.setTaskid(serviceSubtask.getTaskid()); |
| | | serviceSubtaskPreachform.setSubid(serviceSubtask.getId()); |
| | | //è¿ä¸ªsendstateéè¦å¨æ°æ®åºè®¾ç½®ä¸ä¸ªé»è®¤å¼ä¸ºâ1â |
| | | serviceSubtaskPreachform.setSendstate("1"); |
| | | if (StringUtils.isNotEmpty(sendstate)) serviceSubtaskPreachform.setSendstate(sendstate); |
| | | |
| | | serviceSubtaskPreachform.setOrgid(serviceSubtask.getOrgid()); |
| | | serviceSubtaskPreachformMapper.insertServiceSubtaskPreachform(serviceSubtaskPreachform); |
| | | } |
| | | |
| | | } |
| | | |
| | | return sspl; |
| | | } |
| | | |
| | | /** |
| | | * @param serviceSubtask |
| | |
| | | serviceSubtaskPreachform.setPreachform(preachform); |
| | | //1:æªåéç¶æ |
| | | serviceSubtaskPreachform.setSendstate("1"); |
| | | log.error("---serviceSubtaskPreachformå
¥å为ï¼{}", serviceSubtaskPreachform); |
| | | log.info("---serviceSubtaskPreachformå
¥å为ï¼{}", serviceSubtaskPreachform); |
| | | List<ServiceSubtaskPreachform> serviceSubtaskPreachforms = serviceSubtaskPreachformMapper.selectServiceSubtaskPreachformList(serviceSubtaskPreachform); |
| | | log.info("---serviceSubtaskPreachformè¿å为ï¼{}", serviceSubtaskPreachforms); |
| | | //çµè¯çæªåéç¶æï¼éè¦æ¥2ï¼å ä¸ºï¼æ°æ®å¯è½å¡å¨éåéäº(乿å¯è½æ²¡ææåï¼sendstate=1,æä»¥å¦ææ¯çµè¯ç¶æå¤æserviceSubtaskPreachformsæ¯ä¸æ¯ä¸ºç©º) |
| | | if (preachform.equals("3") && CollectionUtils.isEmpty(serviceSubtaskPreachforms)) { |
| | | serviceSubtaskPreachform.setSendstate("2"); |
| | |
| | | |
| | | String body = new Gson().toJson(map); |
| | | |
| | | // String result = HttpUtils.sendPost(address, body); |
| | | String result = null; |
| | | try { |
| | | result = OkHttpExample.sendPostRequest(address, body, token); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | log.error("--------resultçå¼ä¸ºï¼{}-----", result); |
| | | log.info("--------resultçå¼ä¸ºï¼{}-----", result); |
| | | |
| | | JSONObject jsonObject = JSONObject.parseObject(result); |
| | | String code = (String) jsonObject.toString(); |
| | |
| | | patArchiveReq.setPageNum(null); |
| | | List<PatArchiveOthreInfo> patientInfoQC = patArchiveService.getPatientInfoQC(patArchiveReq); |
| | | |
| | | // long count = PageUtils.count(new ISelect() { |
| | | // @Override |
| | | // public void doSelect() { |
| | | // patArchiveService.getPatientInfoQC(patArchiveReq); |
| | | // } |
| | | // }); |
| | | return getDataTable3(patientInfoQC.size(), patientInfo); |
| | | } |
| | | |
| | |
| | | |
| | | import java.lang.reflect.Array; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.ruoyi.common.constant.HttpStatus; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.smartor.domain.PatArchiveOthreInfo; |
| | | import com.smartor.domain.PatMedReq; |
| | | import com.smartor.domain.PatMedRes; |
| | | import io.netty.util.internal.ObjectUtil; |
| | |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.text.DecimalFormat; |
| | | import java.time.LocalDate; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | |
| | | @Autowired |
| | | private IServiceSubtaskRecordService serviceSubtaskRecordService; |
| | | |
| | | @Value("${spring.profiles.active}") |
| | | private String active; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ£è
éè®¿ä¿¡æ¯ |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç¾ç
æ¨¡ç³æ¥è¯¢ |
| | | */ |
| | | //@PreAuthorize("@ss.hasPermi('system:taskcall:query')") |
| | | @PostMapping(value = "/getSubtaskByDiagname") |
| | | public Map<String, Object> getSubtaskByDiagname(@RequestBody ServiceSubtask serviceSubtask) { |
| | | LoginUser loginUser = getLoginUser(); |
| | | SysUser user = loginUser.getUser(); |
| | | serviceSubtask.setOrgid(user.getOrgid()); |
| | | serviceSubtask.setPageNum(PageUtils.getOffset(serviceSubtask.getPageNum(), serviceSubtask.getPageSize())); |
| | | List<ServiceSubtask> serviceSubtaskList = serviceSubtaskService.selectServiceSubtaskByDiagname(serviceSubtask); |
| | | Map<String, Object> rspData = new HashMap(); |
| | | rspData.put("code", HttpStatus.SUCCESS); |
| | | rspData.put("msg", "æ¥è¯¢æå"); |
| | | rspData.put("rows", serviceSubtaskList); |
| | | |
| | | serviceSubtask.setPageNum(null); |
| | | serviceSubtask.setPageSize(null); |
| | | List<ServiceSubtask> total = serviceSubtaskService.selectServiceSubtaskByDiagname(serviceSubtask); |
| | | if (CollectionUtils.isNotEmpty(total)) rspData.put("total", total.size()); |
| | | else rspData.put("total", 0); |
| | | return rspData; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * é访ç»è®¡å¯¼åº |
| | | */ |
| | | //@PreAuthorize("@ss.hasPermi('system:taskcall:export')") |
| | | @Log(title = "é访ç»è®¡å¯¼åºï¼", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/getSubtaskByDiagnameExport") |
| | | public void getSubtaskByDiagnameExport(HttpServletResponse response, List<ServiceSubtaskDiagname> serviceSubtaskDiagnameList) { |
| | | ExcelUtil<ServiceSubtaskDiagname> util = new ExcelUtil<ServiceSubtaskDiagname>(ServiceSubtaskDiagname.class); |
| | | |
| | | if (active.equals("ls") || active.equals("druid")) { |
| | | util.exportExcel(response, serviceSubtaskDiagnameList, LocalDate.now().getMonthValue() + "é访ç»è®¡å¯¼åº"); |
| | | } else { |
| | | util.exportExcel(response, serviceSubtaskDiagnameList, "é访ç»è®¡å¯¼åº"); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ°å¢æä¿®æ¹å é¤åä¸ä»»å¡ |
| | | */ |
| | | @ApiOperation("æ°å¢æä¿®æ¹å é¤åä¸ä»»å¡") |
| | |
| | | */ |
| | | @ApiOperation("è·åé访满æåº¦ç»è®¡") |
| | | @PostMapping("/getSfStatisticsJoy") |
| | | public AjaxResult getSfStatisticsJoy(@RequestBody ServiceSubtaskCountReq serviceSubtaskCountReq) { |
| | | public Map<String, Object> getSfStatisticsJoy(@RequestBody ServiceSubtaskCountReq serviceSubtaskCountReq) { |
| | | if (CollectionUtils.isEmpty(serviceSubtaskCountReq.getServiceType())) { |
| | | return error("æå¡ç±»åä¸è½ä¸ºç©º"); |
| | | } |
| | |
| | | @Log(title = "é访ç»è®¡å¯¼åºï¼", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/getSfStatisticsExport") |
| | | public void export(HttpServletResponse response, ServiceSubtaskCountReq serviceSubtaskCountReq) { |
| | | List<ServiceSubtaskStatistic> sfStatistics = serviceSubtaskService.getSfStatistics(serviceSubtaskCountReq); |
| | | List<ServiceSubtaskStatistic> sfStatistics = serviceSubtaskService.getSfStatisticsExport(serviceSubtaskCountReq); |
| | | |
| | | ExcelUtil<ServiceSubtaskStatistic> util = new ExcelUtil<ServiceSubtaskStatistic>(ServiceSubtaskStatistic.class); |
| | | |
| | | if (active.equals("ls") || active.equals("druid")) { |
| | | util.exportExcel(response, sfStatistics, LocalDate.now().getMonthValue() + "æåºé¢é访ç»è®¡è¡¨"); |
| | | } else { |
| | | util.exportExcel(response, sfStatistics, "é访ç»è®¡å¯¼åº"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * é访ç»è®¡å¯¼åº |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | import com.ruoyi.system.service.ISysMenuService; |
| | | import com.smartor.mapper.SysUserDeptMapper; |
| | | import com.smartor.service.IServiceSLTDHealthcareRecordService; |
| | | import com.smartor.service.impl.ServiceSLTDHealthcareRecordServiceImpl; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | private ISysConfigService sysConfigService; |
| | | @Autowired |
| | | private IServiceSLTDHealthcareRecordService iServiceSLTDHealthcareRecordService; |
| | | |
| | | |
| | | @Value("${pri_key}") |
| | |
| | | return ajax; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ç»å½æ¹æ³ |
| | | * |
| | | * @param loginBody ç»å½ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @PostMapping("/test") |
| | | public void test(@RequestBody Map<String, Object> map) { |
| | | iServiceSLTDHealthcareRecordService.aa(map); |
| | | } |
| | | |
| | | /** |
| | | * åç¹ç»å½æ¹æ³(éè¦é
ç½®IPç½åå) |
| | | * éè¦å¨sys_config表çsys.ip.whitelisä¸ï¼å å
¥IPæè½è®¿é®è¯¥æ¹æ³ |
| | |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.smartor.mapper.SysUserDeptMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | user.setPageNum(null); |
| | | user.setPageSize(null); |
| | | List<SysUser> total = userService.getUserList(user); |
| | | rspData.put("total", total.size()); |
| | | |
| | | if (CollectionUtils.isNotEmpty(total)) rspData.put("total", total.size()); |
| | | else rspData.put("total", 0); |
| | | return rspData; |
| | | } |
| | | |
| | |
| | | @Test |
| | | public void cc() { |
| | | RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); |
| | | String s = rsaPublicKeyExample.encryptedData("20250815001094", "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALQzqW1EIXBKGMu+2oEYSB5gM7Ox/ihyYTeeoE0yPX1qtt4++5yNOeTBVd6EEM4iKzVEzWj6REIWVwaSNPn/SvUCAwEAAQ=="); |
| | | String s = rsaPublicKeyExample.encryptedData("865", "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALQzqW1EIXBKGMu+2oEYSB5gM7Ox/ihyYTeeoE0yPX1qtt4++5yNOeTBVd6EEM4iKzVEzWj6REIWVwaSNPn/SvUCAwEAAQ=="); |
| | | System.out.println("å å¯ç»æä¸ºï¼" + s); |
| | | String s1 = rsaPublicKeyExample.decryptedData(s, "MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEAtDOpbUQhcEoYy77agRhIHmAzs7H+KHJhN56gTTI9fWq23j77nI055MFV3oQQziIrNUTNaPpEQhZXBpI0+f9K9QIDAQABAkB3n0fcWfrcoMN/FU3VnrnZOEF6CzFNxkgU9P8y36QECWKZ9JhYQkNpKrMC9oXlN3VSaRigV7B+L/I/a0Rs1W+tAiEA4jx7xcXJ4y4BNwAmVHt6NNiEkzIwWnwC/0qsEu8NsOsCIQDL6MMn1D2uznC6OuOWpxDCkBh1JL1NzZTZeH2G+hj7nwIgKGAC9tjFnvWm4dn0/T7MIIJDpsFeP8fCAS2iZ/6hwuECIAS/eLvWr1EAsZNEh8QcQ8GkBU3E+ztyjAK8UX/xFt/VAiBf79/1tDErX4/DChecM8w3c3DhbBcjuE3fHZn7p6/UKg=="); |
| | | System.out.println("è§£å¯ç»æä¸ºï¼"+s1); |
| | | |
| | | String format = String.format("%03X", 202); |
| | | System.out.println("formatç»æä¸ºï¼"+format); |
| | | } |
| | | |
| | | public void aa(MultipartFile file) throws IOException { |
| | |
| | | # password: Hxerp2000 |
| | | # driverClassName: com.mysql.cj.jdbc.Driver |
| | | # å
¬å¸æ¬å° |
| | | url: jdbc:mysql://haiershi.a1.luyouxia.net:23844/smartor_xinhua?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | url: jdbc:mysql://haiershi.a1.luyouxia.net:23844/smartor_lishui?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | username: smartor |
| | | password: Smartor.2023 |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | |
| | | login-password: Lihu@1363419#$ |
| | | filter: |
| | | stat: |
| | | enabled: true |
| | | enabled: false |
| | | # æ
¢SQLè®°å½ |
| | | log-slow-sql: true |
| | | log-slow-sql: false |
| | | slow-sql-millis: 1000 |
| | | merge-sql: true |
| | | wall: |
| | |
| | | prefix: /api |
| | | readonly: false |
| | | sql-column-case: camel |
| | | show-sql: true #é
ç½®æå°SQL |
| | | show-sql: false #é
ç½®æå°SQL |
| | | page-config: |
| | | size: size |
| | | page: page |
| | |
| | | username: root@sfxx#other_cluster |
| | | password: Y5oapyS8 |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | # url: jdbc:mysql://cluster02.db.lsjky.cn:2883/smartor-lisui?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | # username: root@sfxx#other_cluster02 |
| | | # password: Y5oapyS8 |
| | | # driverClassName: com.mysql.cj.jdbc.Driver |
| | | |
| | | # # 髿¯æ°æ®åºé
ç½® |
| | | # url: jdbc:postgresql://127.0.0.1:5432/smartorlishui |
| | |
| | | login-password: Lihu@1363419#$ |
| | | filter: |
| | | stat: |
| | | enabled: true |
| | | enabled: false |
| | | # æ
¢SQLè®°å½ |
| | | log-slow-sql: true |
| | | log-slow-sql: false |
| | | slow-sql-millis: 1000 |
| | | merge-sql: true |
| | | wall: |
| | |
| | | login-password: Lihu@1363419#$ |
| | | filter: |
| | | stat: |
| | | enabled: true |
| | | enabled: false |
| | | # æ
¢SQLè®°å½ |
| | | log-slow-sql: true |
| | | log-slow-sql: false |
| | | slow-sql-millis: 1000 |
| | | merge-sql: true |
| | | wall: |
| | |
| | | default-size: 10 |
| | | |
| | | # PageHelperå页æä»¶ |
| | | pagehelper: |
| | | helperDialect: mysql |
| | | supportMethodsArguments: true |
| | | params: count=countSql |
| | | ##pagehelper: |
| | | # helperDialect: mysql |
| | | # supportMethodsArguments: true |
| | | # params: count=countSql |
| | | |
| | | #ééçå¯é¥ |
| | | dingAppid: dingn8iip5ubj7clrrsv |
| | |
| | | # å½é
åèµæºæä»¶è·¯å¾ |
| | | basename: i18n/messages |
| | | profiles: |
| | | active: sltd |
| | | active: ls |
| | | |
| | | # æä»¶ä¸ä¼ |
| | | servlet: |
| | | multipart: |
| | |
| | | <setting name="useGeneratedKeys" value="true"/> |
| | | <!-- é
ç½®é»è®¤çæ§è¡å¨.SIMPLEå°±æ¯æ®éæ§è¡å¨;REUSEæ§è¡å¨ä¼éç¨é¢å¤çè¯å¥(prepared statements);BATCHæ§è¡å¨å°éç¨è¯å¥å¹¶æ§è¡æ¹éæ´æ° --> |
| | | <setting name="defaultExecutorType" value="SIMPLE"/> |
| | | <!-- æå® MyBatis æç¨æ¥å¿çå
·ä½å®ç° --> |
| | | <!-- æå® MyBatis æç¨æ¥å¿çå
·ä½å®ç°(æ¯å¦æå°SQL) --> |
| | | <!-- <setting name="logImpl" value="STDOUT_LOGGING"/>--> |
| | | <!-- 使ç¨é©¼å³°å½åæ³è½¬æ¢å段 --> |
| | | <!-- <setting name="mapUnderscoreToCamelCase" value="true"/> --> |
| | |
| | | * XiaoXiLX FZ_PT_DuanXinFS |
| | | * XiaoXiMC çä¿¡åé |
| | | */ |
| | | public enum MsgLSEnum { |
| | | ZYY("47231022633110211A2101", "https://9.0.124.104:13011/mediinfo-grus-fuwuzxwg/api/esb/lyraAsyncRun", "1400360867068907520", "丽水å¸ä¸å»é¢", "2361", "éçæ
§"), |
| | | JN("47255004333112711A1001", null, "1400361376454545408", "æ¯å®ç²æèªæ²»å¿äººæ°å»é¢", "", ""); |
| | | |
| | | public class MsgLSEnum { |
| | | // ZYY("47231022633110211A2101", "https://9.0.124.104:13011/mediinfo-grus-fuwuzxwg/api/esb/lyraAsyncRun", "1400360867068907520", "丽水å¸ä¸å»é¢", "2361", "éçæ
§"), |
| | | // JN("47255004333112711A1001", "", "1400361376454545408", "æ¯å®ç²æèªæ²»å¿äººæ°å»é¢", "0073", "å¨ç¾åª"); |
| | | // |
| | | private String orgid; |
| | | private String address; |
| | | private String ZuHuID; |
| | |
| | | this.sendPersonName = sendPersonName; |
| | | } |
| | | |
| | | public static Map<String, Object> getHeaderByCode(String orgid) { |
| | | public static Map<String, Object> getHeaderByCode(Map<String, String> srmInfo) { |
| | | Map<String, Object> map = new LinkedHashMap<>(); |
| | | MsgLSEnum[] organEnums = values(); |
| | | for (int i = 0; i < organEnums.length; i++) { |
| | | MsgLSEnum organEnum = organEnums[i]; |
| | | |
| | | //è·åæ¶é´ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String formattedDate = sdf.format(new Date()); |
| | | if (organEnum.getOrgid().equals(orgid)) { |
| | | map.put("XiaoXiID", IdUtils.simpleUUID()); |
| | | map.put("FaSongSJ", formattedDate); |
| | | map.put("ZuHuID", organEnum.getZuHuID()); |
| | | map.put("ZuHuMC", organEnum.getZuHuMC()); |
| | | map.put("FaSongJGID", organEnum.getOrgid()); |
| | | map.put("FaSongJGMC", organEnum.getZuHuMC()); |
| | | map.put("ZuHuID", srmInfo.get("ZuHuID")); |
| | | map.put("ZuHuMC", srmInfo.get("ZuHuMC")); |
| | | map.put("FaSongJGID", srmInfo.get("orgid")); |
| | | map.put("FaSongJGMC", srmInfo.get("ZuHuMC")); |
| | | //map.put("FaSongXTJC", "é访系ç»"); |
| | | map.put("FaSongXTJC", "SUIFANGXT"); |
| | | map.put("FaSongXTMC", "é访系ç»"); |
| | |
| | | map.put("FaSongFCSJC", "ZJHES"); |
| | | map.put("XiaoXiLX", "FZ_PT_DuanXinFS"); |
| | | map.put("XiaoXiMC", "çä¿¡åé"); |
| | | } |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | public static Map<String, String> getAddressByCode(String orgid) { |
| | | MsgLSEnum[] organEnums = values(); |
| | | Map<String, String> map = new HashMap<>(); |
| | | for (int i = 0; i < organEnums.length; i++) { |
| | | MsgLSEnum organEnum = organEnums[i]; |
| | | if (organEnum.getOrgid().equals(orgid)) { |
| | | map.put("address", organEnum.getAddress()); |
| | | map.put("sendPersonId", organEnum.getSendPersonId()); |
| | | map.put("sendPersonName", organEnum.getSendPersonName()); |
| | | return map; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getOrgid() { |
| | |
| | | * 计ç®åç§»é |
| | | */ |
| | | public static Integer getOffset(Integer pageNum, Integer pageSize) { |
| | | if (pageNum == null) pageNum = 1; |
| | | if (pageNum == null || pageNum == 0) pageNum = 1; |
| | | if (pageSize == null) pageSize = 10; |
| | | return (pageNum - 1) * pageSize; |
| | | |
| | | } |
| | | } |
| | |
| | | import org.springframework.cache.annotation.EnableCaching; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.data.redis.cache.RedisCacheConfiguration; |
| | | import org.springframework.data.redis.cache.RedisCacheManager; |
| | | import org.springframework.data.redis.connection.RedisConnectionFactory; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.data.redis.core.script.DefaultRedisScript; |
| | | import org.springframework.data.redis.serializer.StringRedisSerializer; |
| | | |
| | | import java.time.Duration; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * redisé
ç½® |
| | |
| | | */ |
| | | @Configuration |
| | | @EnableCaching |
| | | public class RedisConfig extends CachingConfigurerSupport |
| | | { |
| | | public class RedisConfig extends CachingConfigurerSupport { |
| | | @Bean |
| | | @SuppressWarnings(value = { "unchecked", "rawtypes" }) |
| | | public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory connectionFactory) |
| | | { |
| | | public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory connectionFactory) { |
| | | RedisTemplate<Object, Object> template = new RedisTemplate<>(); |
| | | template.setConnectionFactory(connectionFactory); |
| | | |
| | |
| | | } |
| | | |
| | | @Bean |
| | | public DefaultRedisScript<Long> limitScript() |
| | | { |
| | | public RedisCacheManager cacheManager(RedisConnectionFactory connectionFactory) { |
| | | // é»è®¤ç¼åé
ç½®ï¼å
¶ä» cache 使ç¨ï¼ |
| | | RedisCacheConfiguration defaultConfig = RedisCacheConfiguration.defaultCacheConfig(); |
| | | // åç¬ä¸º sfStatistics 设置 20 åé TTL |
| | | Map<String, RedisCacheConfiguration> configMap = new HashMap<>(); |
| | | configMap.put("sfStatistics", defaultConfig.entryTtl(Duration.ofMinutes(20))); |
| | | configMap.put("sfStatisticsJoy", defaultConfig.entryTtl(Duration.ofMinutes(20))); |
| | | configMap.put("selectPatMedOuthospList", defaultConfig.entryTtl(Duration.ofMinutes(20))); |
| | | return RedisCacheManager.builder(connectionFactory).cacheDefaults(defaultConfig).withInitialCacheConfigurations(configMap).build(); |
| | | } |
| | | |
| | | @Bean |
| | | public DefaultRedisScript<Long> limitScript() { |
| | | DefaultRedisScript<Long> redisScript = new DefaultRedisScript<>(); |
| | | redisScript.setScriptText(limitScriptText()); |
| | | redisScript.setResultType(Long.class); |
| | |
| | | /** |
| | | * éæµèæ¬ |
| | | */ |
| | | private String limitScriptText() |
| | | { |
| | | return "local key = KEYS[1]\n" + |
| | | "local count = tonumber(ARGV[1])\n" + |
| | | "local time = tonumber(ARGV[2])\n" + |
| | | "local current = redis.call('get', key);\n" + |
| | | "if current and tonumber(current) > count then\n" + |
| | | " return tonumber(current);\n" + |
| | | "end\n" + |
| | | "current = redis.call('incr', key)\n" + |
| | | "if tonumber(current) == 1 then\n" + |
| | | " redis.call('expire', key, time)\n" + |
| | | "end\n" + |
| | | "return tonumber(current);"; |
| | | private String limitScriptText() { |
| | | return "local key = KEYS[1]\n" + "local count = tonumber(ARGV[1])\n" + "local time = tonumber(ARGV[2])\n" + "local current = redis.call('get', key);\n" + "if current and tonumber(current) > count then\n" + " return tonumber(current);\n" + "end\n" + "current = redis.call('incr', key)\n" + "if tonumber(current) == 1 then\n" + " redis.call('expire', key, time)\n" + "end\n" + "return tonumber(current);"; |
| | | } |
| | | } |
| | |
| | | // è¿æ»¤è¯·æ± |
| | | .authorizeRequests() |
| | | // 对äºç»å½login 注åregister éªè¯ç captchaImage å
许å¿åè®¿é® |
| | | .antMatchers("/login", "/register", "/captchaImage", "/qrcode/generateStaticHtml", "/qrcode/getQRcode", "/qrcode/getFormDate", "/chat", "/system/file/admin/uploadFile", "/smartor/dingtalk/sendNotification", "/patient/read/patientInfo", "/socket", "/API_ESB_Service", "/API_ESB_Service/Run", "/magic/web/**", "/smartor/serviceSubtask/phoneCallBack", "/smartor/serviceSubtask/taskPull", "/smartor/serviceSubtask/phoneCallBackYQ", "/smartor/robot/callstatus", "/smartor/robot/aidialog", "/smartor/robot/cdrinfo", "/getToken", "/smartor/subtaskAnswer/getQuestionCache", "/smartor/subtaskAnswer/saveQuestionCache", "/smartor/servicetask/getScriptInfoByCondition", "/smartor/subtaskAnswer/saveQuestionAnswer", "/smartor/import/download", "/smartor/serviceSubtask/recordAccept", "/smartor/outPath/getInfoByParam", "/smartor/serviceExternal/addDeptInfo", "/smartor/serviceExternal/**", "/sso/**","/smartor/sltdHealthcareRecord/**","/smartor/servicetask/getScriptByCondition","/smartor/subtaskAnswer/saveMYDQuestionAnswer").permitAll() |
| | | .antMatchers("/login","/test", "/register", "/captchaImage", "/qrcode/generateStaticHtml", "/qrcode/getQRcode", "/qrcode/getFormDate", "/chat", "/system/file/admin/uploadFile", "/smartor/dingtalk/sendNotification", "/patient/read/patientInfo", "/socket", "/API_ESB_Service", "/API_ESB_Service/Run", "/magic/web/**", "/smartor/serviceSubtask/phoneCallBack", "/smartor/serviceSubtask/taskPull", "/smartor/serviceSubtask/phoneCallBackYQ", "/smartor/robot/callstatus", "/smartor/robot/aidialog", "/smartor/robot/cdrinfo", "/getToken", "/smartor/subtaskAnswer/getQuestionCache", "/smartor/subtaskAnswer/saveQuestionCache", "/smartor/servicetask/getScriptInfoByCondition", "/smartor/subtaskAnswer/saveQuestionAnswer", "/smartor/import/download", "/smartor/serviceSubtask/recordAccept", "/smartor/outPath/getInfoByParam", "/smartor/serviceExternal/addDeptInfo", "/smartor/serviceExternal/**", "/sso/**","/smartor/sltdHealthcareRecord/**","/smartor/servicetask/getScriptByCondition","/smartor/subtaskAnswer/saveMYDQuestionAnswer").permitAll() |
| | | // éæèµæºï¼å¯å¿åè®¿é® |
| | | .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**","/getDept/*","/SSOLogin/**").permitAll().antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() |
| | | .antMatchers("/smartor/organization/list").permitAll() |
| | |
| | | package com.ruoyi.quartz.task; |
| | | |
| | | 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 java.nio.file.Files; |
| | | import java.nio.file.Paths; |
| | | import java.security.MessageDigest; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | |
| | | } |
| | | |
| | | public void analysisData() { |
| | | System.out.println("---------------------------"); |
| | | //æ°æ®è§£æ |
| | | ServiceThirdData serviceThirdData = new ServiceThirdData(); |
| | | serviceThirdData.setDataType("ADT^A03"); |
| | | serviceThirdData.setIsDeal(0); |
| | | serviceThirdData.setCreateTime(new Date()); |
| | | iServiceThirdDataService.queryList(serviceThirdData); |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | // çç«åå¾·æ°æ®éé |
| | | for (Long cid : campusidList) { |
| | | log.info("ãdealHisDataãçç«åå¾·âå
¥é¢âå¼å§ééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | log.debug("ãdealHisDataãçç«åå¾·âé¢å
¥é¢âå¼å§ééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | String yesterday = LocalDate.now().minusDays(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
| | | String nowTime = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
| | | ServiceSLTDInhospReqVO serviceSLTDInhospReqVO = new ServiceSLTDInhospReqVO(); |
| | | serviceSLTDInhospReqVO.setOrgId("20001001"); |
| | | serviceSLTDInhospReqVO.setCampusId(cid); |
| | | serviceSLTDInhospReqVO.setEncounterTimeStart(nowTime); |
| | | serviceSLTDInhospReqVO.setEncounterTimeEnd(nowTime); |
| | | List<String> list = new ArrayList<>(); |
| | | // list.add("FH0108.02"); |
| | | list.add("FH0109.22"); |
| | | list.add("FH0109.23"); |
| | | list.add("FH0109.53"); |
| | | serviceSLTDInhospReqVO.setStatusList(list); |
| | | log.debug("ãdealHisDataãçç«åå¾·âé¢å
¥é¢âééæ°æ®å
¥åï¼{}", serviceSLTDInhospReqVO); |
| | | serviceSLTDHealthcareRecordService.queryHealthcareRecordList(serviceSLTDInhospReqVO); |
| | | log.debug("ãdealHisDataãçç«åå¾·âé¢å
¥é¢âçµæééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | |
| | | log.debug("ãdealHisDataãçç«åå¾·âå
¥é¢âå¼å§ééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | serviceSLTDInhospReqVO.setOrgId("20001001"); |
| | | serviceSLTDInhospReqVO.setCampusId(cid); |
| | | serviceSLTDInhospReqVO.setEncounterTimeStart(null); |
| | | serviceSLTDInhospReqVO.setEncounterTimeEnd(null); |
| | | serviceSLTDInhospReqVO.setStartHeadTime(nowTime); |
| | | serviceSLTDInhospReqVO.setStartTailTime(nowTime); |
| | | List<String> list = new ArrayList<>(); |
| | | list.add("FH0108.02"); |
| | | serviceSLTDInhospReqVO.setHealthcareRecordTypeList(list); |
| | | log.info("ãdealHisDataãçç«åå¾·âå
¥é¢âééæ°æ®å
¥åï¼{}", serviceSLTDInhospReqVO); |
| | | List<String> listStr = new ArrayList<>(); |
| | | // list.add("FH0108.02"); |
| | | listStr.add("FH0109.26"); |
| | | serviceSLTDInhospReqVO.setStatusList(listStr); |
| | | log.debug("ãdealHisDataãçç«åå¾·âå
¥é¢âééæ°æ®å
¥åï¼{}", serviceSLTDInhospReqVO); |
| | | serviceSLTDHealthcareRecordService.queryHealthcareRecordList(serviceSLTDInhospReqVO); |
| | | log.info("ãdealHisDataãçç«åå¾·âå
¥é¢âçµæééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | log.debug("ãdealHisDataãçç«åå¾·âå
¥é¢âçµæééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | |
| | | log.info("ãdealHisDataãçç«åå¾·â鍿¥è¯âå¼å§ééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | log.debug("ãdealHisDataãçç«åå¾·â鍿¥è¯âå¼å§ééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | serviceSLTDInhospReqVO.setStartHeadTime(null); |
| | | serviceSLTDInhospReqVO.setStartTailTime(null); |
| | | serviceSLTDInhospReqVO.setEncounterTimeStart(nowTime); |
| | | serviceSLTDInhospReqVO.setEncounterTimeEnd(nowTime); |
| | | serviceSLTDInhospReqVO.setStatusList(null); |
| | | List<String> list1 = new ArrayList<>(); |
| | | list1.add("FH0108.01"); |
| | | list1.add("FH0108.03"); |
| | | serviceSLTDInhospReqVO.setHealthcareRecordTypeList(list1); |
| | | log.info("ãdealHisDataãçç«åå¾·â鍿¥è¯âééæ°æ®å
¥åï¼{}", serviceSLTDInhospReqVO); |
| | | log.debug("ãdealHisDataãçç«åå¾·â鍿¥è¯âééæ°æ®å
¥åï¼{}", serviceSLTDInhospReqVO); |
| | | serviceSLTDHealthcareRecordService.queryHealthcareRecordList(serviceSLTDInhospReqVO); |
| | | log.info("ãdealHisDataãçç«åå¾·â鍿¥è¯âæééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | log.debug("ãdealHisDataãçç«åå¾·â鍿¥è¯âæééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | |
| | | log.info("ãdealHisDataãçç«åå¾·âåºé¢âå¼å§ééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | log.debug("ãdealHisDataãçç«åå¾·âåºé¢âå¼å§ééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | serviceSLTDInhospReqVO.setStartHeadTime(null); |
| | | serviceSLTDInhospReqVO.setStartTailTime(null); |
| | | serviceSLTDInhospReqVO.setEncounterTimeStart(null); |
| | | serviceSLTDInhospReqVO.setEncounterTimeEnd(null); |
| | | serviceSLTDInhospReqVO.setPreOutHospitalHeadDate(nowTime); |
| | | serviceSLTDInhospReqVO.setPreOutHospitalTailDate(nowTime); |
| | | serviceSLTDInhospReqVO.setHealthcareRecordTypeList(null); |
| | | List<String> list2 = new ArrayList<>(); |
| | | list2.add("FH0108.02"); |
| | | serviceSLTDInhospReqVO.setHealthcareRecordTypeList(list2); |
| | | log.info("ãdealHisDataãçç«åå¾·âåºé¢âééæ°æ®å
¥åï¼{}", serviceSLTDInhospReqVO); |
| | | // list2.add("FH0108.02"); |
| | | list2.add("FH0109.27"); |
| | | serviceSLTDInhospReqVO.setStatusList(list2); |
| | | log.debug("ãdealHisDataãçç«åå¾·âåºé¢âééæ°æ®å
¥åï¼{}", serviceSLTDInhospReqVO); |
| | | serviceSLTDHealthcareRecordService.queryHealthcareRecordList(serviceSLTDInhospReqVO); |
| | | log.info("ãdealHisDataãçç«åå¾·âåºé¢âæééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | log.debug("ãdealHisDataãçç«åå¾·âåºé¢âæééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | } |
| | | // SysConfig sysConfig = sysConfigs.get(0); |
| | | // sysConfig.setConfigValue(nowTime); |
| | |
| | | * å¤çæ£è
ä¿¡æ¯ï¼è¿å
¥åä»»å¡è¡¨ |
| | | */ |
| | | public void dealOutHospInfo() { |
| | | String config = configService.selectConfigByKey("visit.early.day"); |
| | | if (port.equals("8095")) { |
| | | //åºé¢è¡¨ |
| | | iPatMedInhospService.dealOutHospInfo(); |
| | | //é¨è¯è¡¨ |
| | | if (active.equals("xh")) { |
| | | iPatMedInhospService.dealOutHospInfo(config); |
| | | //é¨è¯è¡¨(æ°åçææ¶ä¸åé¨è¯é访) |
| | | if (!active.equals("xh")) { |
| | | iPatMedOuthospService.dealOutpatientInfo(); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * é¿æä»»å¡æ§è¡ |
| | | * |
| | | */ |
| | | public void longTaskSend() { |
| | | //è·åä»»å¡ä¿¡æ¯ |
| | |
| | | req.put("content", sendMagParam.getContent()); |
| | | isSuccess = HttpUtil.postJsonRequest(xhsmsPath, new Gson().toJson(req)); |
| | | } else if (active.equals("ls")) { |
| | | String url = configService.selectConfigByKey("token.360", serviceSubtask.getOrgid()); |
| | | //丽水ççä¿¡åéæ¹å¼ |
| | | Map<String, String> map = MsgLSEnum.getAddressByCode(serviceSubtask.getOrgid()); |
| | | String token = LSHospTokenUtil.getToken(serviceSubtask.getOrgid(), url); |
| | | if (ObjectUtils.isNotEmpty(map) && StringUtils.isEmpty(map.get("address"))) { |
| | | // String url = configService.selectConfigByKey("token.360", serviceSubtask.getOrgid()); |
| | | // //丽水ççä¿¡åéæ¹å¼ |
| | | // Map<String, String> map = MsgLSEnum.getAddressByCode(serviceSubtask.getOrgid()); |
| | | SysConfig config = new SysConfig(); |
| | | config.setConfigKey("ls.msg.info"); |
| | | config.setOrgid(serviceSubtask.getOrgid()); |
| | | List<SysConfig> sysConfigs = configService.selectConfigList(config); |
| | | Map<String, String> msgInfo = new HashMap<>(); |
| | | if (CollectionUtils.isNotEmpty(sysConfigs)) { |
| | | String configValue = sysConfigs.get(0).getConfigValue(); |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | if (StringUtils.isNotEmpty(configValue)) { |
| | | msgInfo = objectMapper.readValue(configValue, Map.class); |
| | | } |
| | | } |
| | | 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"); |
| | | return; |
| | | } |
| | | log.info("ãsfHandlleã丽水çä¿¡åéï¼å°åï¼{}ï¼åæ°ï¼{}ï¼æºæIDï¼{}", map.get("address"), sendMagParam, serviceSubtask.getOrgid()); |
| | | String dxCode = getDXCode(map.get("address"), sendMagParam.getPhone(), sendMagParam.getContent(), map.get("sendPersonId"), map.get("sendPersonName"), MsgLSEnum.getHeaderByCode(serviceSubtask.getOrgid()), token); |
| | | log.info("ãsfHandlleã丽水çä¿¡åéï¼å°åï¼{}ï¼åæ°ï¼{}ï¼æºæIDï¼{}", msgInfo.get("address"), sendMagParam, serviceSubtask.getOrgid()); |
| | | String dxCode = getDXCode(msgInfo.get("address"), sendMagParam.getPhone(), sendMagParam.getContent(), msgInfo.get("sendPersonId"), msgInfo.get("sendPersonName"), MsgLSEnum.getHeaderByCode(msgInfo), token); |
| | | log.info("ãsfHandlleã丽水çä¿¡åéç»æï¼{}", dxCode); |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | Map<String, Object> textParam = objectMapper.readValue(dxCode, Map.class); |
| | |
| | | } else if (active.equals("sltd")) { |
| | | log.info("sltdè¿æ¥äºåï¼{} ,---sendMagParam.getContent()çåæ°ä¸ºï¼{}", active, sendMagParam.getContent()); |
| | | //çç«åå¾·ççä¿¡åéæ¹å¼ |
| | | String data = MessageSend.sendMsg(sendMagParam.getContent(), "2", sendMagParam.getPhone(), LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); |
| | | 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"; |
| | | } |
| | |
| | | private String getSendPreachform(ServiceSubtaskPreachform serviceSubtaskPreachform, ServiceSubtask serviceSubtask) { |
| | | List<ServiceSubtaskPreachform> serviceSubtaskPreachforms = serviceSubtaskPreachformMapper.selectServiceSubtaskPreachformList(serviceSubtaskPreachform); |
| | | |
| | | if (CollectionUtils.isEmpty(serviceSubtaskPreachforms)) { |
| | | //妿serviceSubtaskPreachforms为空çè¯ï¼åéè¦è¿è¡æ°å¢ä¸ä¸ |
| | | List<ServiceSubtaskPreachform> serviceSubtaskPreachformList = addServiceSubtaskPreachform(serviceSubtask, "1"); |
| | | if (CollectionUtils.isEmpty(serviceSubtaskPreachformList)) { |
| | | log.error("ryTask--åéæ¹å¼å¤±è´¥äºserviceSubtaskçå
¥å为ï¼{}", serviceSubtask); |
| | | return null; |
| | | } |
| | | serviceSubtaskPreachforms = serviceSubtaskPreachformList; |
| | | } |
| | | |
| | | // æ
åµ1ï¼currentPreachform为空ï¼åsort为1çpreachform |
| | | if (StringUtils.isEmpty(serviceSubtask.getCurrentPreachform())) { |
| | | return serviceSubtaskPreachforms.stream().filter(item -> item.getSort() == 1L).map(ServiceSubtaskPreachform::getPreachform).findFirst().orElse(null); |
| | |
| | | return null; |
| | | } |
| | | |
| | | private List<ServiceSubtaskPreachform> addServiceSubtaskPreachform(ServiceSubtask serviceSubtask, String sendstate) { |
| | | //å°preachformDescçjsonå¯¹è±¡ï¼æ¾å°listéåä¸ |
| | | ServiceTask serviceTask = serviceTaskMapper.selectServiceTaskByTaskid(serviceSubtask.getTaskid()); |
| | | String preachformDesc = serviceTask.getPreachformDesc(); |
| | | |
| | | List<ServiceSubtaskPreachform> sspl = null; |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | if (org.apache.commons.lang3.StringUtils.isNotEmpty(preachformDesc)) { |
| | | try { |
| | | sspl = objectMapper.readValue(preachformDesc, new TypeReference<List<ServiceSubtaskPreachform>>() { |
| | | }); |
| | | } catch (JsonProcessingException e) { |
| | | log.error("ryTask--preachform转List<ServiceSubtaskPreachform>æ¥éäºï¼{}", e.getMessage()); |
| | | } |
| | | for (ServiceSubtaskPreachform serviceSubtaskPreachform : sspl) { |
| | | serviceSubtaskPreachform.setTaskid(serviceSubtask.getTaskid()); |
| | | serviceSubtaskPreachform.setSubid(serviceSubtask.getId()); |
| | | //è¿ä¸ªsendstateéè¦å¨æ°æ®åºè®¾ç½®ä¸ä¸ªé»è®¤å¼ä¸ºâ1â |
| | | serviceSubtaskPreachform.setSendstate("1"); |
| | | if (StringUtils.isNotEmpty(sendstate)) serviceSubtaskPreachform.setSendstate(sendstate); |
| | | serviceSubtaskPreachform.setOrgid(serviceSubtask.getOrgid()); |
| | | serviceSubtaskPreachformMapper.insertServiceSubtaskPreachform(serviceSubtaskPreachform); |
| | | } |
| | | |
| | | } |
| | | |
| | | return sspl; |
| | | } |
| | | |
| | | private Integer setFail(List<ServiceSubtaskPreachform> serviceSubtaskPreachforms, ServiceSubtask serviceSubtask) { |
| | | Optional<Long> id = serviceSubtaskPreachforms.stream().filter(item -> serviceSubtask.getCurrentPreachform().equals(item.getPreachform())).map(ServiceSubtaskPreachform::getId).findFirst(); |
| | | if (id.isPresent()) { |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.quartz.mapper.SysJobLogMapper"> |
| | | |
| | | <resultMap type="SysJobLog" id="SysJobLogResult"> |
| | | <resultMap type="com.ruoyi.quartz.domain.SysJobLog" id="SysJobLogResult"> |
| | | <id property="jobLogId" column="job_log_id" /> |
| | | <result property="jobName" column="job_name" /> |
| | | <result property="jobGroup" column="job_group" /> |
| | |
| | | from sys_job_log |
| | | </sql> |
| | | |
| | | <select id="selectJobLogList" parameterType="SysJobLog" resultMap="SysJobLogResult"> |
| | | <select id="selectJobLogList" parameterType="com.ruoyi.quartz.domain.SysJobLog" resultMap="SysJobLogResult"> |
| | | <include refid="selectJobLogVo"/> |
| | | <where> |
| | | <if test="jobName != null and jobName != ''"> |
| | |
| | | truncate table sys_job_log |
| | | </update> |
| | | |
| | | <insert id="insertJobLog" parameterType="SysJobLog"> |
| | | <insert id="insertJobLog" parameterType="com.ruoyi.quartz.domain.SysJobLog"> |
| | | insert into sys_job_log( |
| | | <if test="jobLogId != null and jobLogId != 0">job_log_id,</if> |
| | | <if test="jobName != null and jobName != ''">job_name,</if> |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.ruoyi.system.domain.SmsRecords; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @author smartor |
| | | * @date 2023-03-06 |
| | | */ |
| | | public interface SmsRecordsMapper |
| | | { |
| | | @Mapper |
| | | public interface SmsRecordsMapper { |
| | | /** |
| | | * æ¥è¯¢çä¿¡è®°å½ |
| | | * |
| | |
| | | import java.io.IOException; |
| | | import java.sql.Date; |
| | | import java.time.LocalDate; |
| | | import java.util.Arrays; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.OkHttpExample; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.smartor.common.LSHospTokenUtil; |
| | | import com.smartor.domain.ServiceSubtask; |
| | | import com.smartor.mapper.ServiceSubtaskMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | //丽水ççä¿¡åéæ¹å¼ |
| | | Boolean isSuccess = false; |
| | | try { |
| | | String url = configService.selectConfigByKey("token.360",orgid); |
| | | Map<String, String> map = MsgLSEnum.getAddressByCode(orgid); |
| | | String token = LSHospTokenUtil.getToken(orgid,url); |
| | | log.info("ãsfHandlleã丽水çä¿¡åéï¼å°åï¼{}ï¼åæ°ï¼{}ï¼æºæIDï¼{}", map.get("address"), orgid); |
| | | String dxCode = getDXCode(map.get("address"), phone, content, map.get("sendPersonId"), map.get("sendPersonName"), MsgLSEnum.getHeaderByCode(orgid), token); |
| | | SysConfig config = new SysConfig(); |
| | | config.setConfigKey("ls.msg.info"); |
| | | config.setOrgid(orgid); |
| | | List<SysConfig> sysConfigs = configService.selectConfigList(config); |
| | | Map<String, String> msgInfo = new HashMap<>(); |
| | | if (CollectionUtils.isNotEmpty(sysConfigs)) { |
| | | String configValue = sysConfigs.get(0).getConfigValue(); |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | if (StringUtils.isNotEmpty(configValue)) { |
| | | msgInfo = objectMapper.readValue(configValue, Map.class); |
| | | } |
| | | } |
| | | log.info("-----------mapçå¼ä¸ºï¼{}", msgInfo); |
| | | // |
| | | // String url = configService.selectConfigByKey("token.360",orgid); |
| | | // Map<String, String> map = MsgLSEnum.getAddressByCode(orgid); |
| | | String token = LSHospTokenUtil.getToken(orgid,msgInfo.get("tokenUrl")); |
| | | log.info("ãsfHandlleã丽水çä¿¡åéï¼å°åï¼{}ï¼åæ°ï¼{}ï¼æºæIDï¼{}", msgInfo.get("address"), orgid); |
| | | String dxCode = getDXCode(msgInfo.get("address"), phone, content, msgInfo.get("sendPersonId"), msgInfo.get("sendPersonName"), MsgLSEnum.getHeaderByCode(msgInfo), token); |
| | | log.info("ãsfHandlleã丽水çä¿¡åéç»æï¼{}", dxCode); |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | Map<String, Object> textParam = null; |
| | |
| | | <if test="configKey != null and configKey != ''"> |
| | | AND config_key like concat('%', #{configKey}, '%') |
| | | </if> |
| | | <if test="orgid != null and orgid != ''"> |
| | | AND orgid = #{orgid} |
| | | </if> |
| | | <if test="params.beginTime != null and params.beginTime != ''"><!-- å¼å§æ¶é´æ£ç´¢ --> |
| | | and date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') |
| | | </if> |
| | |
| | | if(ObjectUtils.isNotEmpty(url)){ |
| | | lyraTokenUtil = LyraTokenUtil.createLyraTokenUtil(url, "zjhes.suifangxt", "OIjdJvx2ALjFVGZoCZO4I8O"); |
| | | log.info("token.360è°ç¨ç»æ"+url+";æºæä»£ç ï¼"+orgid+""); |
| | | }else { |
| | | if (orgid.equals("47255004333112711A1001")) //æ¯å® |
| | | lyraTokenUtil = LyraTokenUtil.createLyraTokenUtil("https://9.0.124.104:13021/mediinfo-lyra-authserver/connect/token", "zjhes.suifangxt", "OIjdJvx2ALjFVGZoCZO4I8O"); |
| | | if (orgid.equals("47231022633110211A2101")) //ä¸å»é¢ |
| | | lyraTokenUtil = LyraTokenUtil.createLyraTokenUtil("https://9.0.124.104:13011/mediinfo-lyra-authserver/connect/token", "zjhes.suifangxt", "OIjdJvx2ALjFVGZoCZO4I8O"); |
| | | } |
| | | // else { |
| | | // if (orgid.equals("47255004333112711A1001")) //æ¯å®+ |
| | | // lyraTokenUtil = LyraTokenUtil.createLyraTokenUtil("https://9.0.124.104:13021/mediinfo-lyra-authserver/connect/token", "zjhes.suifangxt", "OIjdJvx2ALjFVGZoCZO4I8O"); |
| | | // if (orgid.equals("47231022633110211A2101")) //ä¸å»é¢ |
| | | // lyraTokenUtil = LyraTokenUtil.createLyraTokenUtil("https://9.0.124.104:13011/mediinfo-lyra-authserver/connect/token", "zjhes.suifangxt", "OIjdJvx2ALjFVGZoCZO4I8O"); |
| | | // } |
| | | try { |
| | | token = lyraTokenUtil.getToken(); |
| | | } catch (IOException e) { |
| | |
| | | private Long scriptno; |
| | | |
| | | /** |
| | | * ç±»å«ID |
| | | */ |
| | | @Excel(name = "ç±»å«ID") |
| | | @ApiModelProperty(value = "ç±»å«ID") |
| | | private Long assortid; |
| | | |
| | | /** |
| | | * é项忝æ è¯(0:æ 忝1:æåæ¯) |
| | | */ |
| | | @Excel(name = "é项忝æ è¯(0:æ 忝1:æåæ¯)") |
| | |
| | | @ApiModelProperty(value = "模æ¿è¯æ¯ç¼å·") |
| | | private Long scriptno; |
| | | |
| | | |
| | | /** |
| | | * 模æ¿ID |
| | | */ |
| | |
| | | @ApiModelProperty(value = "ç±»å«å") |
| | | private String categoryName; |
| | | |
| | | /** |
| | | * ç±»å«ID |
| | | */ |
| | | @Excel(name = "ç±»å«ID") |
| | | @ApiModelProperty(value = "ç±»å«ID") |
| | | private Long assortid; |
| | | |
| | | // /** |
| | | // * ææ é项 |
| | | // */ |
| | |
| | | private String categoryName; |
| | | |
| | | /** |
| | | * ç±»å«ID |
| | | */ |
| | | @Excel(name = "ç±»å«ID") |
| | | @ApiModelProperty(value = "ç±»å«ID") |
| | | private Long assortid; |
| | | |
| | | /** |
| | | * ææ é项 |
| | | */ |
| | | @Excel(name = "ææ é项") |
| | |
| | | private String categoryName; |
| | | |
| | | /** |
| | | * ç±»å«ID |
| | | */ |
| | | @Excel(name = "ç±»å«ID") |
| | | @ApiModelProperty(value = "ç±»å«ID") |
| | | private Long assortid; |
| | | /** |
| | | * ææ é项 |
| | | */ |
| | | @Excel(name = "ææ é项") |
| | |
| | | /** |
| | | * ä½é¢æ è¯ï¼ 0ï¼å¨é¢ 1ï¼åºé¢ 2ï¼è½¬ç§ |
| | | */ |
| | | @ApiModelProperty(value = "ä½é¢æ è¯ï¼ 0ï¼å¨é¢ 1ï¼åºé¢ 2ï¼è½¬ç§") |
| | | @ApiModelProperty(value = "ä½é¢æ è¯ï¼ 0ï¼å¨é¢ 1ï¼åºé¢ 2ï¼è½¬ç§ 3å¾
å
¥é¢") |
| | | private String inhospstate; |
| | | |
| | | /** |
| | |
| | | @ApiModelProperty(value = "ç¾ç
é¿æä»»å¡ï¼æ¯å¦å¤çï¼0æªå¤ç 1å¤çæå 2å¤ç失败 ") |
| | | private String diagcheckFlag; |
| | | |
| | | /** |
| | | * é¨é¨é¿æä»»å¡ï¼æ¯å¦å¤çï¼0æªå¤ç 1å¤ç |
| | | */ |
| | | @ApiModelProperty(value = "é¨é¨é¿æä»»å¡ï¼æ¯å¦å¤çï¼0æªå¤ç 1å¤çæå 2å¤ç失败 ") |
| | | private String deptcheckFlag; |
| | | |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = " ", width = 30, dateFormat = "yyyy-MM-dd") |
| | |
| | | @ApiModelProperty("å°±è¯ç±»åï¼1é¨è¯ 2åºé¢ï¼") |
| | | private String hospType; |
| | | |
| | | /** |
| | | * å°±è¯ç±»åï¼1é¨è¯ 2åºé¢ï¼ |
| | | */ |
| | | @Excel(name = "å°±è¯idï¼1é¨è¯ 2åºé¢ï¼") |
| | | @ApiModelProperty("å°±è¯idï¼1é¨è¯ 2åºé¢ï¼") |
| | | private Long hospid; |
| | | |
| | | |
| | | /** |
| | | * æ¥æ¶æ¶é´ |
| | |
| | | @ApiModelProperty(value = "ç»ç®¡å»ç") |
| | | private String managementDoctor; |
| | | |
| | | @ApiModelProperty(value = "é访æ
åµ:1æ£å¸¸è¯é³,2æ£è
ææ¥ææè®¿,3é¢è®¿æè
æ¥è¯,4微信é访,5é访çµè¯ä¸æ£ç¡®,6å
¶ä»") |
| | | @ApiModelProperty(value = "é访æ
åµ:1æ£å¸¸è¯é³,2æ£è
ææ¥ææè®¿,3é¢è®¿æè
æ¥è¯,4微信é访,5é访çµè¯ä¸æ£ç¡®,6è¢«è¿æ»¤,7å
¶å®") |
| | | private Integer taskSituation; |
| | | |
| | | @ApiModelProperty(value = "å¼å¸¸é¢è¦ï¼0绿è²ï¼1红è²ï¼2é»è²") |
| | | @ApiModelProperty(value = "å¼å¸¸é¢è¦ï¼0绿è²ï¼1红è²ï¼2é»è²; 3å·²å¤ç") |
| | | private Integer isabnormal; |
| | | } |
| | |
| | | @ApiModelProperty(value = "å»çç¼ç ") |
| | | private String drcode; |
| | | |
| | | @ApiModelProperty(value = "è¯é³åç±»ç¼ç ") |
| | | private Long ivrCategoryid; |
| | | |
| | | @ApiModelProperty(value = "é®å·åç±»ç¼ç ") |
| | | private Long svyCategoryid; |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "ç±»å«") |
| | | private String categoryname; |
| | | |
| | | /** |
| | | * ç±»å«ID |
| | | */ |
| | | @Excel(name = "ç±»å«ID") |
| | | @ApiModelProperty(value = "ç±»å«ID") |
| | | private Long categoryid; |
| | | |
| | | |
| | | @ApiModelProperty(value = "ææ ID(ä»é®é¢ä¸è·å)") |
| | | private Integer targetid; |
| | |
| | | |
| | | @ApiModelProperty(value = "æ£è
ID") |
| | | private Long patid; |
| | | /** |
| | | * ç±»å«ID |
| | | */ |
| | | @Excel(name = "ç±»å«ID") |
| | | @ApiModelProperty(value = "ç±»å«ID") |
| | | private Long categoryid; |
| | | |
| | | private List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.domain; |
| | | |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * ç¾ç
è·åæ£è
ä¿¡æ¯ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-12-11 |
| | | */ |
| | | @ApiModel(value = "ServiceSubtaskDiagname", description = "") |
| | | @Data |
| | | public class ServiceSubtaskDiagname implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | @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 = "éè®¿ç¶æ") |
| | | private Long sendstate; |
| | | |
| | | @ApiModelProperty(value = "å
¥é¢æ¶é´") |
| | | private Date starttime; |
| | | |
| | | @ApiModelProperty(value = "åºé¢æ¶é´") |
| | | private Date endtime; |
| | | |
| | | @ApiModelProperty(value = "é访æ¶é´") |
| | | private Date visitTime; |
| | | |
| | | @ApiModelProperty(value = "æ¤å£«å§å") |
| | | private String nurseName; |
| | | |
| | | |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * åç
åºé访ç»è®¡æ¯ä¾ |
| | | * |
| | |
| | | */ |
| | | @ApiModel(value = "ServiceSubtaskStatistic", description = "åç
åºé访ç»è®¡æ¯ä¾") |
| | | @Data |
| | | public class ServiceSubtaskStatistic { |
| | | public class ServiceSubtaskStatistic implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "æå¡æ»é") |
| | |
| | | @ApiModelProperty(value = "æ éé访人次") |
| | | @Excel(name = " æ éé访人次 ") |
| | | private Long nonFollowUp = 0L; |
| | | |
| | | @ApiModelProperty(value = "è¿æ»¤æ£è
") |
| | | @Excel(name = " è¿æ»¤æ£è
") |
| | | private Long filterCount = 0L; |
| | | |
| | | @ApiModelProperty(value = "åºé访人次") |
| | | @Excel(name = " åºé访人次 ") |
| | |
| | | private Integer joyAllCount=0; |
| | | |
| | | @ApiModelProperty(value = "满æåº¦æ¯ä¾") |
| | | private String joyTotal=""; |
| | | private Double joyTotal = 0.00; |
| | | |
| | | @ApiModelProperty(value = "é访æ
åµ:1æ£å¸¸è¯é³") |
| | | private Integer taskSituation1 = 0; |
| | |
| | | @ApiModelProperty(value = "é访æ
åµ:5é访çµè¯ä¸æ£ç¡®") |
| | | private Integer taskSituation5 = 0; |
| | | |
| | | @ApiModelProperty(value = "é访æ
åµ:6å
¶ä»") |
| | | @ApiModelProperty(value = "é访æ
åµ:7å
¶ä»") |
| | | private Integer taskSituation6 = 0; |
| | | |
| | | @ApiModelProperty(value = "è¿æ»¤æ£è
详æ
") |
| | | private List<ServiceSubtask> filterCountList; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "é访é¨é¨åç§°") |
| | | private String visitDeptName; |
| | | |
| | | @ApiModelProperty(value = "å¼å¸¸é¢è¦ï¼0绿è²ï¼1红è²ï¼2é»è²") |
| | | @ApiModelProperty(value = "å¼å¸¸é¢è¦ï¼0绿è²ï¼1红è²ï¼2é»è²;3å·²å¤ç") |
| | | private Integer isabnormal; |
| | | |
| | | @ApiModelProperty(value = "é访é¨é¨ç¼ç éå") |
| | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 模æ¿ç§å®¤å
³è对象 service_taskdiag |
| | | * 模æ¿ç¾ç
å
³è对象 service_taskdiag |
| | | * |
| | | * @author lihu |
| | | * @date 2025-02-24 |
| | | */ |
| | | @Data |
| | | @ApiModel("模æ¿ç§å®¤å
³è") |
| | | @ApiModel("模æ¿ç¾ç
å
³è") |
| | | public class ServiceTaskdiag extends BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 模æ¿åºåç§å®¤å
³èid |
| | | */ |
| | | @ApiModelProperty("模æ¿åºåç§å®¤å
³èid") |
| | | @ApiModelProperty("模æ¿åºåç¾ç
å
³èid") |
| | | //æ°æ®åºèªå¢æ¹æ@TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | |
| | | @Excel(name = "åç±»id") |
| | | @ApiModelProperty("åç±»id") |
| | | private Long categoryid; |
| | | |
| | | /** |
| | | * é¢ç®å
容 |
| | | */ |
| | |
| | | private String categoryName; |
| | | |
| | | /** |
| | | * ç±»å«ID |
| | | */ |
| | | @Excel(name = "ç±»å«ID") |
| | | @ApiModelProperty(value = "ç±»å«ID") |
| | | private Long categoryid; |
| | | /** |
| | | * è¯æ¯å
容 |
| | | */ |
| | | @ApiModelProperty(value = "è¯æ¯å
容") |
| | |
| | | public int batchPatMedOuthosp(List<PatMedOuthosp> patMedOuthosps); |
| | | |
| | | /** |
| | | * æ¹éæå
¥ï¼å¿½ç¥éå¤ï¼INSERT IGNOREï¼ |
| | | * |
| | | * @param patMedOuthosps 鍿¥è¯è®°å½å表 |
| | | * @return å®é
æå
¥æ°é |
| | | */ |
| | | public int batchInsertIgnore(List<PatMedOuthosp> patMedOuthosps); |
| | | |
| | | /** |
| | | * ä¿®æ¹æ£è
é¨è¯è®°å½ |
| | | * |
| | | * @param patMedOuthosp æ£è
é¨è¯è®°å½ |
| | |
| | | */ |
| | | public List<ServiceSubtask> selectServiceSubtaskList(ServiceSubtaskVO serviceSubtaskVO); |
| | | |
| | | public List<ServiceSubtask> selectServiceSubtaskByDiagname(ServiceSubtask serviceSubtask); |
| | | |
| | | public List<ServiceSubtask> queryServiceSubtaskList(ServiceSubtaskVO serviceSubtaskVO); |
| | | |
| | | public List<ServiceSubtask> selectServiceSubtaskBySendstate(ServiceSubtaskVO serviceSubtaskVO); |
| | |
| | | * @param |
| | | * @return ç»æ |
| | | */ |
| | | public int dealOutHospInfo(); |
| | | public int dealOutHospInfo(String config); |
| | | |
| | | /** |
| | | * è·ååºé¢ï¼ä½é¢ï¼é¨è¯æå¡äººæ¬¡ |
| | |
| | | package com.smartor.service; |
| | | |
| | | import afu.org.checkerframework.checker.oigj.qual.O; |
| | | import com.smartor.domain.ServiceSLTDDeptReqVO; |
| | | import com.smartor.domain.ServiceSLTDInhospReqVO; |
| | | import com.smartor.domain.ServiceSLTDInhospResDTO; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * çç«åå¾·å¥åº·è®°å½æ¥è¯¢Serviceæ¥å£ |
| | |
| | | */ |
| | | Boolean queryDeptWardAreaInfoList(ServiceSLTDDeptReqVO serviceSLTDDeptReqVO); |
| | | |
| | | public void aa(Map<String, Object> map); |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | public ServiceSubtask selectServiceSubtaskById(Long id); |
| | | |
| | | public List<ServiceSubtask> selectServiceSubtaskByDiagname(ServiceSubtask serviceSubtask); |
| | | |
| | | /** |
| | | * æ¥è¯¢åä¸ä»»å¡ï¼é访ï¼å表 |
| | | * |
| | |
| | | public List<ServiceSubtaskCount> getSfFzInfoEveryMonth(ServiceSubtaskCountReq serviceSubtaskCountReq); |
| | | |
| | | public List<ServiceSubtaskStatistic> getSfStatistics(ServiceSubtaskCountReq serviceSubtaskCountReq); |
| | | //导åºé访 |
| | | public List<ServiceSubtaskStatistic> getSfStatisticsExport(ServiceSubtaskCountReq serviceSubtaskCountReq); |
| | | |
| | | public List<ServiceSubtaskStatistic> getSfStatisticsJoy(ServiceSubtaskCountReq serviceSubtaskCountReq); |
| | | |
| | |
| | | package com.smartor.service; |
| | | |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.smartor.domain.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ²³åé鿣è
ä¿¡æ¯æ¥å£ |
| | |
| | | |
| | | //对模æ¿è¯æ¯åé项è¿è¡å¤çï¼è¯æ¯è¡¨ä¸ææ 表è¿è¡åå¹¶äºï¼ï¼ |
| | | if (CollectionUtils.isNotEmpty(ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList())) { |
| | | log.error("ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList()æ¯å¦ææ°æ®åï¼{}", ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList()); |
| | | // log.error("ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList()æ¯å¦ææ°æ®åï¼{}", ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList()); |
| | | for (IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO : ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList()) { |
| | | ivrTaskTemplateScriptVO.setGuid(ivrTaskTemplateVO.getGuid()); |
| | | ivrTaskTemplateScriptVO.setOrgid(ivrTaskTemplateVO.getOrgid()); |
| | |
| | | } else if (patArchiveReq.getAllhosp() != null && patArchiveReq.getAllhosp() == 4) { |
| | | // æ¥çä½é¢ 1 æ¥çé¨è¯ 2 æ¥ç使£ 3 æ¥çåºé¢ 4 |
| | | patArchiveReq.setCry(1); |
| | | log.warn("--------æ¥çåºé¢çå
¥åå¼ä¸ºï¼{}", patArchiveReq); |
| | | log.info("--------æ¥çåºé¢çå
¥åå¼ä¸ºï¼{}", patArchiveReq); |
| | | List<PatArchiveOthreInfo> patArchives1 = patArchiveMapper.selectPatArchiveInfoByInhospQC(patArchiveReq); |
| | | log.warn("--------æ¥çåºé¢çè¿åå¼ä¸ºï¼{}", patArchives1.size()); |
| | | log.info("--------æ¥çåºé¢çè¿åå¼ä¸ºï¼{}", patArchives1.size()); |
| | | if (CollectionUtils.isNotEmpty(patArchives1)) { |
| | | patArchiveList.addAll(patArchives1); |
| | | } |
| | |
| | | public class PatMedInhospServiceImpl implements IPatMedInhospService { |
| | | @Autowired |
| | | private PatMedInhospMapper patMedInhospMapper; |
| | | |
| | | @Autowired |
| | | private ServiceTaskdeptMapper serviceTaskdeptMapper; |
| | | |
| | | @Autowired |
| | | private ServiceTaskdiagMapper serviceTaskdiagMapper; |
| | | |
| | | @Autowired |
| | | private PatArchiveMapper patArchiveMapper; |
| | | @Autowired |
| | |
| | | private ServiceSubtaskMapper serviceSubtaskMapper; |
| | | @Autowired |
| | | private ServiceSubtaskPreachformMapper serviceSubtaskPreachformMapper; |
| | | |
| | | @Value("${spring.profiles.active}") |
| | | private String active; |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public int dealOutHospInfo() { |
| | | public int dealOutHospInfo(String config) { |
| | | |
| | | PatMedInhosp pmks = new PatMedInhosp(); |
| | | //è·åéè¦åºé¢é¨é¨éè®¿ï¼æªå¤ççæ°æ® |
| | |
| | | patMedInhospMapper.updatePatMedInhosp(patMedInhosp1); |
| | | } else { |
| | | for (ServiceTaskdept serviceTaskdept1 : serviceTaskdepts) { |
| | | writeInSubTask(serviceTaskdept1.getTaskId(), true, patMedInhosp1, patArchive, 1); |
| | | writeInSubTask(serviceTaskdept1.getTaskId(), true, patMedInhosp1, patArchive, 1, config); |
| | | } |
| | | patMedInhosp1.setDeptcheckFlag("1"); |
| | | patMedInhospMapper.updatePatMedInhosp(patMedInhosp1); |
| | |
| | | patMedInhospMapper.updatePatMedInhosp(pmiBQ1); |
| | | } else { |
| | | for (ServiceTaskdept serviceTaskdept1 : serviceTaskdeptList) { |
| | | writeInSubTask(serviceTaskdept1.getTaskId(), true, pmiBQ1, patArchive, 2); |
| | | writeInSubTask(serviceTaskdept1.getTaskId(), true, pmiBQ1, patArchive, 2, config); |
| | | } |
| | | pmiBQ1.setWardcheckFlag("1"); |
| | | patMedInhospMapper.updatePatMedInhosp(pmiBQ1); |
| | |
| | | patMedInhospMapper.updatePatMedInhosp(pmiJB); |
| | | } else { |
| | | for (ServiceTaskdiag serviceTaskdept1 : serviceTaskdiags) { |
| | | writeInSubTask(serviceTaskdept1.getTaskId(), true, pmiJB, patArchive, 3); |
| | | writeInSubTask(serviceTaskdept1.getTaskId(), true, pmiJB, patArchive, 3, config); |
| | | } |
| | | pmiJB.setDiagcheckFlag("1"); |
| | | patMedInhospMapper.updatePatMedInhosp(pmiJB); |
| | |
| | | } |
| | | |
| | | //å°æ£è
æ¾å°subtaskä¸ |
| | | private void writeInSubTask(Long taskid, Boolean check, PatMedInhosp patMedInhosp1, PatArchive patArchive, Integer type) { |
| | | private void writeInSubTask(Long taskid, Boolean check, PatMedInhosp patMedInhosp1, PatArchive patArchive, Integer type, String config) { |
| | | String longTaskReason = patMedInhosp1.getLongTaskReason(); |
| | | if (StringUtils.isEmpty(longTaskReason)) longTaskReason = ""; |
| | | ServiceTask st = new ServiceTask(); |
| | |
| | | return; |
| | | } |
| | | //å°è£
serviceSubtask |
| | | ServiceSubtask serviceSubtask = boxedServiceSubtask(serviceTask, patMedInhosp1, patArchive); |
| | | ServiceSubtask serviceSubtask = boxedServiceSubtask(serviceTask, patMedInhosp1, patArchive, config); |
| | | if (type != 2) { |
| | | //ç§å®¤åç¾ç
é½ç¨ ç§å®¤å¡«å
|
| | | serviceSubtask.setVisitDeptCode(patMedInhosp1.getLeaveldeptcode()); |
| | |
| | | |
| | | Integer i = 0; |
| | | //å
夿ä¸ä¸ï¼æ¯å¦éè¦æ ¡éª |
| | | if (check) { |
| | | if (check && serviceSubtask.getTaskSituation() != 6) { |
| | | //卿°å¢ä¹åï¼å
éè¿æ£è
IDï¼sendstate=2æ¥è¯¢ä¸ä¸ï¼å¨ææé¿æä»»å¡ä¸ï¼æ¯ä¸æ¯è¿æè¯¥æ£è
å¾
æ§è¡çä»»å¡ï¼æçè¯,æ¯è¾ä¹åçendtimeæ¯å¦å°äºå½åçendtaime,妿ä¹åçå°äºç°å¨çï¼åç´æ¥å°ä¹åçåæï¼åå åå
¥é¢ï¼ |
| | | ServiceSubtaskVO subtask = new ServiceSubtaskVO(); |
| | | subtask.setPatid(patArchive.getId()); |
| | |
| | | if (serviceSubtask1.getEndtime().before(serviceSubtask.getEndtime()) && serviceSubtask1.getServiceType().equals("2")) { |
| | | //妿å½å循ç¯çåä»»å¡çåºé¢æ¶é´å¨âå夿°å¢çåä»»å¡âçåºé¢æ¶é´ä¹åï¼åå°å¾ªç¯çåä»»å¡åæ |
| | | serviceSubtask1.setSendstate(4L); |
| | | serviceSubtask1.setRemark("æ£è
åå
¥é¢"); |
| | | if (StringUtils.isNotEmpty(serviceSubtask.getRemark())) |
| | | serviceSubtask.setRemark(serviceSubtask.getRemark() + ",ç¾ç
æ£è
åå
¥é¢"); |
| | | else serviceSubtask.setRemark("ç¾ç
æ£è
åå
¥é¢"); |
| | | serviceSubtask1.setResult("error"); |
| | | // serviceSubtask1.setFinishtime(new Date()); |
| | | serviceSubtask1.setUpdateBy(serviceTask.getUpdateBy()); |
| | |
| | | serviceSubtask.setResult("error"); |
| | | // serviceSubtask.setFinishtime(new Date()); |
| | | serviceSubtask.setSendstate(4L); |
| | | serviceSubtask.setRemark("å½åæ£è
åºé¢æ¶é´åæå¾
æ§è¡çåºé¢éè®¿é¿æä»»å¡"); |
| | | if (StringUtils.isNotEmpty(serviceSubtask.getRemark())) |
| | | serviceSubtask.setRemark(serviceSubtask.getRemark() + ",å½åæ£è
åºé¢æ¶é´åæå¾
æ§è¡çåºé¢éè®¿é¿æä»»å¡"); |
| | | else serviceSubtask.setRemark("å½åæ£è
åºé¢æ¶é´åæå¾
æ§è¡çåºé¢éè®¿é¿æä»»å¡"); |
| | | serviceSubtask.setCreateBy(serviceTask.getCreateBy()); |
| | | serviceSubtask.setCreateTime(new Date()); |
| | | i = serviceSubtaskMapper.insertServiceSubtask(serviceSubtask); |
| | |
| | | //type=3 表示ç¾ç
|
| | | //å°ä¹åçåæ |
| | | serviceSubtask1.setSendstate(4L); |
| | | serviceSubtask1.setRemark("ç¾ç
æ£è
åå
¥é¢"); |
| | | if (StringUtils.isNotEmpty(serviceSubtask.getRemark())) |
| | | serviceSubtask.setRemark(serviceSubtask.getRemark() + ",ç¾ç
æ£è
åå
¥é¢"); |
| | | else serviceSubtask.setRemark("ç¾ç
æ£è
åå
¥é¢"); |
| | | serviceSubtask1.setResult("error"); |
| | | // serviceSubtask1.setFinishtime(new Date()); |
| | | serviceSubtask1.setUpdateBy(serviceTask.getUpdateBy()); |
| | |
| | | } |
| | | } else { |
| | | if (StringUtils.isEmpty(serviceSubtask.getPhone())) { |
| | | serviceSubtask.setRemark("ææºå·ä¸ºç©º"); |
| | | if (StringUtils.isNotEmpty(serviceSubtask.getRemark())) |
| | | serviceSubtask.setRemark(serviceSubtask.getRemark() + ",ææºå·ä¸ºç©º"); |
| | | else serviceSubtask.setRemark("ææºå·ä¸ºç©º"); |
| | | serviceSubtask.setSendstate(4L); |
| | | serviceSubtask.setResult("error"); |
| | | } |
| | |
| | | i = serviceSubtaskMapper.insertServiceSubtask(serviceSubtask); |
| | | addServiceSubtaskPreachform(serviceSubtask, null); |
| | | } |
| | | } else if (serviceSubtask.getTaskSituation() == 6) { |
| | | //说æè¯¥æ£è
æ¯è¢«è¿æ»¤çï¼ä¸ç¨åæ§è¡äº |
| | | serviceSubtask.setCreateBy(serviceTask.getCreateBy()); |
| | | serviceSubtask.setCreateTime(new Date()); |
| | | i = serviceSubtaskMapper.insertServiceSubtask(serviceSubtask); |
| | | } else { |
| | | if (StringUtils.isEmpty(serviceSubtask.getPhone())) { |
| | | serviceSubtask.setRemark("ææºå·ä¸ºç©º"); |
| | | if (StringUtils.isNotEmpty(serviceSubtask.getRemark())) |
| | | serviceSubtask.setRemark(serviceSubtask.getRemark() + ",ææºå·ä¸ºç©º"); |
| | | else serviceSubtask.setRemark("ææºå·ä¸ºç©º"); |
| | | serviceSubtask.setSendstate(4L); |
| | | serviceSubtask.setResult("error"); |
| | | } |
| | |
| | | for (ServiceSubtaskPreachform serviceSubtaskPreachform : serviceSubtaskPreachformList) { |
| | | serviceSubtaskPreachform.setTaskid(serviceSubtask.getTaskid()); |
| | | serviceSubtaskPreachform.setSubid(serviceSubtask.getId()); |
| | | |
| | | //å
æ¥è¯¢ä¸ä¸ï¼æ¯å¦åå¨ï¼å¦æå·²ç»åå¨ï¼å°±ä¸æ°å¢äº |
| | | List<ServiceSubtaskPreachform> serviceSubtaskPreachformList1 = serviceSubtaskPreachformMapper.selectServiceSubtaskPreachformList(serviceSubtaskPreachform); |
| | | if (CollectionUtils.isNotEmpty(serviceSubtaskPreachformList1)) continue; |
| | | |
| | | //è¿ä¸ªsendstateéè¦å¨æ°æ®åºè®¾ç½®ä¸ä¸ªé»è®¤å¼ä¸ºâ1â |
| | | serviceSubtaskPreachform.setSendstate("1"); |
| | | if (StringUtils.isNotEmpty(sendstate)) serviceSubtaskPreachform.setSendstate(sendstate); |
| | |
| | | |
| | | |
| | | //å°è£
serviceSubtask |
| | | private ServiceSubtask boxedServiceSubtask(ServiceTask serviceTask, PatMedInhosp patMedInhosp1, PatArchive patArchive) { |
| | | private ServiceSubtask boxedServiceSubtask(ServiceTask serviceTask, PatMedInhosp patMedInhosp1, PatArchive patArchive, String config) { |
| | | 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, 2)); |
| | | serviceSubtask.setVisitTime(minusDay(newDate, StringUtils.isNotEmpty(config) ? Integer.parseInt(config) : 0)); |
| | | //å¦æè¯¥åºé¢è®°å½æé访æ¶é´ï¼åç¨ä»èªå·±çé访æ¶é´ |
| | | if (patMedInhosp1.getFudate() != null) |
| | | serviceSubtask.setVisitTime(minusDay(patMedInhosp1.getFudate(), StringUtils.isNotEmpty(config) ? Integer.parseInt(config) : 0)); |
| | | } |
| | | |
| | | |
| | | //æ£è
åéæ¶é´ |
| | | if (StringUtils.isNotEmpty(patArchive.getNotrequiredFlag()) && patArchive.getNotrequiredFlag().equals("1")) { |
| | | String remark = patArchive.getNotrequiredreason(); |
| | | serviceSubtask.setRemark(remark); |
| | | serviceSubtask.setResult("error"); |
| | | serviceSubtask.setTaskSituation(6); |
| | | //䏿§è¡ |
| | | serviceSubtask.setSendstate(4L); |
| | | } |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.stereotype.Service; |
| | | import com.smartor.service.IPatMedOuthospService; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | private ServiceTaskdiagMapper serviceTaskdiagMapper; |
| | | |
| | | @Autowired |
| | | private ServiceTaskdeptMapper serviceTaskdeptMapper; |
| | | |
| | | @Autowired |
| | | private PatArchiveMapper patArchiveMapper; |
| | | |
| | | |
| | |
| | | * @return æ£è
é¨è¯è®°å½ |
| | | */ |
| | | @Override |
| | | @Cacheable(value = "selectPatMedOuthospList", key = "T(org.springframework.util.DigestUtils).md5DigestAsHex(#patMedOuthosp.toString().getBytes())", unless = "#result == null or #result.isEmpty()") |
| | | public List<PatMedOuthosp> selectPatMedOuthospList(PatMedOuthosp patMedOuthosp) { |
| | | List<PatMedOuthosp> patMedOuthosps = patMedOuthospMapper.selectPatMedOuthospList(patMedOuthosp); |
| | | for (PatMedOuthosp patMedOuthosp1 : patMedOuthosps) { |
| | |
| | | patMedOuthosp1.setTelcode(patArchive.getTelcode()); |
| | | patMedOuthosp1.setIdcardno(patArchive.getIdcardno()); |
| | | } |
| | | ServiceSubtaskVO serviceSubtaskVO = new ServiceSubtaskVO(); |
| | | serviceSubtaskVO.setPatid(patMedOuthosp1.getPatid()); |
| | | List<Long> sendstates = new ArrayList<>(); |
| | | sendstates.add(1L); |
| | | sendstates.add(2L); |
| | | sendstates.add(3L); |
| | | serviceSubtaskVO.setSendstates(sendstates); |
| | | serviceSubtaskVO.setServiceType("3"); |
| | | List<ServiceSubtask> serviceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskBySendstate(serviceSubtaskVO); |
| | | if (!CollectionUtils.isEmpty(serviceSubtaskList)) patMedOuthosp1.setServerState("1"); |
| | | } |
| | | return patMedOuthosps; |
| | | } |
| | |
| | | for (PatMedOuthosp patMedOuthosp1 : patMedOuthosps) { |
| | | PatArchive patArchive = patArchiveMapper.selectPatArchiveByPatid(patMedOuthosp1.getPatid()); |
| | | |
| | | //该æ£è
æå¯è½æåæ¥å¤è¯äºï¼é£ä»åé¢çæ¬ç§å®¤çéç¥å°±å¯ä»¥ä¸ç¨ååçä¿¡äº |
| | | ServiceSubtaskVO serviceSubtaskVO = new ServiceSubtaskVO(); |
| | | if (StringUtils.isNotEmpty(patMedOuthosp1.getDeptcode())) { |
| | | serviceSubtaskVO.setDeptcode(patMedOuthosp1.getDeptcode()); |
| | | serviceSubtaskVO.setSfzh(patArchive.getIdcardno()); |
| | | serviceSubtaskVO.setType("3"); |
| | | serviceSubtaskVO.setSendstate(2L); |
| | | serviceSubtaskVO.setPreachform("4"); |
| | | List<ServiceSubtask> serviceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskVO); |
| | | if (!CollectionUtils.isEmpty(serviceSubtaskList)) { |
| | | for (ServiceSubtask serviceSubtask : serviceSubtaskList) { |
| | | serviceSubtask.setSendstate(6L); |
| | | serviceSubtask.setRemark("已忥å¤è¯ï¼æ éåè¿è¡çä¿¡éç¥"); |
| | | serviceSubtaskMapper.updateServiceSubtask(serviceSubtask); |
| | | } |
| | | //æ ¹æ®æ£è
ç§å®¤ï¼è·å该ç¾ç
çé¿æä»»å¡ |
| | | ServiceTaskdept serviceTaskdept = new ServiceTaskdept(); |
| | | serviceTaskdept.setLongtask(1L); |
| | | serviceTaskdept.setDeptCode(patMedOuthosp1.getDeptcode()); |
| | | serviceTaskdept.setServiceType("3"); |
| | | List<ServiceTaskdept> serviceTaskdeptList = serviceTaskdeptMapper.selectServiceTaskdeptList(serviceTaskdept); |
| | | if (org.apache.commons.collections4.CollectionUtils.isEmpty(serviceTaskdeptList) || serviceTaskdeptList.size() == 0) { |
| | | patMedOuthosp1.setDeptcheckFlag("2"); |
| | | patMedOuthosp1.setRemark("éè¿é¨é¨,æ²¡ææ¾å°é¨è¯é访任å¡ID"); |
| | | patMedOuthospMapper.updatePatMedOuthosp(patMedOuthosp1); |
| | | } else { |
| | | for (ServiceTaskdept serviceTaskdept1 : serviceTaskdeptList) { |
| | | writeInSubTask(serviceTaskdept1.getTaskId(), true, patMedOuthosp1, patArchive, 1); |
| | | } |
| | | } |
| | | |
| | |
| | | //妿é¨é¨æ¨¡æ¿ä¸ºç©ºï¼å°deptIsNull设置为trueï¼ |
| | | if (org.apache.commons.collections4.CollectionUtils.isEmpty(serviceTaskdiags) || serviceTaskdiags.size() == 0) { |
| | | patMedOuthosp1.setDiagcheckFlag("2"); |
| | | patMedOuthosp1.setRemark("éè¿icd10,æ²¡ææ¾å°é访任å¡ID"); |
| | | patMedOuthosp1.setRemark("éè¿icd10,æ²¡ææ¾å°é¨è¯é访任å¡ID"); |
| | | patMedOuthospMapper.updatePatMedOuthosp(patMedOuthosp1); |
| | | } else { |
| | | for (ServiceTaskdiag serviceTaskdept1 : serviceTaskdiags) { |
| | | writeInSubTask(serviceTaskdept1.getTaskId(), true, patMedOuthosp1, patArchive); |
| | | writeInSubTask(serviceTaskdept1.getTaskId(), true, patMedOuthosp1, patArchive, 2); |
| | | } |
| | | } |
| | | |
| | |
| | | return 1; |
| | | } |
| | | |
| | | private void writeInSubTask(Long taskid, Boolean check, PatMedOuthosp patMedOuthosp, PatArchive patArchive) { |
| | | /** |
| | | * @param taskid |
| | | * @param check |
| | | * @param patMedOuthosp |
| | | * @param patArchive |
| | | * @param type 1 ç§å®¤ 2 ç¾ç
|
| | | */ |
| | | private void writeInSubTask(Long taskid, Boolean check, PatMedOuthosp patMedOuthosp, PatArchive patArchive, Integer type) { |
| | | |
| | | ServiceTask st = new ServiceTask(); |
| | | st.setTaskid(taskid); |
| | | st.setSendState(2L); |
| | | List<ServiceTask> serviceTasks = serviceTaskMapper.selectServiceTaskList(st); |
| | | if (org.apache.commons.collections4.CollectionUtils.isEmpty(serviceTasks)) { |
| | | log.error("该æ£è
ç¾ç
éè®¿é¿æä»»å¡ä¸åå¨,ä»»å¡ID为ï¼{}", taskid); |
| | | patMedOuthosp.setDiagcheckFlag("2"); |
| | | patMedOuthosp.setRemark("该æ£è
ç¾ç
éè®¿é¿æä»»å¡ä¸åå¨,ä»»å¡ID为:" + taskid); |
| | | log.info("该æ£è
ç¾ç
éè®¿é¿æä»»å¡ä¸åå¨,ä»»å¡ID为ï¼{}", taskid); |
| | | if (type == 1) patMedOuthosp.setDiagcheckFlag("2"); |
| | | if (type == 2) patMedOuthosp.setDeptcheckFlag("2"); |
| | | patMedOuthosp.setRemark("该æ£è
é¨è¯éè®¿é¿æä»»å¡ä¸åå¨,ä»»å¡ID为:" + taskid); |
| | | patMedOuthospMapper.updatePatMedOuthosp(patMedOuthosp); |
| | | return; |
| | | } |
| | |
| | | subtask.setSendstate(2L); |
| | | subtask.setTaskid(taskid); |
| | | List<ServiceSubtask> selectServiceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(subtask); |
| | | log.error("该æ£è
å¾
æ§è¡çä»»å¡:{}", CollectionUtils.isEmpty(selectServiceSubtaskList) ? null : selectServiceSubtaskList.size()); |
| | | log.info("该æ£è
å¾
æ§è¡çä»»å¡:{}", CollectionUtils.isEmpty(selectServiceSubtaskList) ? null : selectServiceSubtaskList.size()); |
| | | if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(selectServiceSubtaskList) && selectServiceSubtaskList.size() > 0) { |
| | | for (ServiceSubtask serviceSubtask1 : selectServiceSubtaskList) { |
| | | if (Objects.isNull(serviceSubtask1.getLongSendTime())) { |
| | |
| | | } |
| | | |
| | | //å°ä¹åçåæ |
| | | serviceSubtask1.setSendstate(4L); |
| | | serviceSubtask1.setRemark("ç¾ç
æ£è
åå
¥é¢"); |
| | | serviceSubtask1.setResult("error"); |
| | | // serviceSubtask1.setFinishtime(new Date()); |
| | | serviceSubtask1.setSendstate(6L); |
| | | serviceSubtask1.setRemark("æ£è
å·²ç»åé¢å¤è¯"); |
| | | serviceSubtask1.setResult("success"); |
| | | serviceSubtask1.setFinishtime(new Date()); |
| | | serviceSubtask1.setUpdateBy(serviceTask.getUpdateBy()); |
| | | serviceSubtaskMapper.updateServiceSubtask(serviceSubtask1); |
| | | //éæ°æ°å¢åä»»å¡ |
| | | i = serviceSubtaskMapper.insertServiceSubtask(serviceSubtask); |
| | | |
| | | } |
| | | } else { |
| | | if (StringUtils.isEmpty(serviceSubtask.getPhone())) { |
| | |
| | | //å°check_flagæ¹æ1ï¼å·²å¤çï¼ |
| | | PatMedOuthosp patMedOuthosp1 = new PatMedOuthosp(); |
| | | patMedOuthosp1.setId(patMedOuthosp.getId()); |
| | | patMedOuthosp1.setDiagcheckFlag("1"); |
| | | if (type == 1) patMedOuthosp1.setDiagcheckFlag("2"); |
| | | if (type == 2) patMedOuthosp1.setDeptcheckFlag("2"); |
| | | patMedOuthospMapper.updatePatMedOuthosp(patMedOuthosp1); |
| | | } else { |
| | | //çæåä»»å¡å¤±è´¥ï¼ |
| | | log.error("çæåä»»å¡å¤±è´¥serviceSubtaskçtaskid为ï¼{},patid为ï¼{}", serviceSubtask.getTaskid(), serviceSubtask.getPatid()); |
| | | log.info("çæåä»»å¡å¤±è´¥serviceSubtaskçtaskid为ï¼{},patid为ï¼{}", serviceSubtask.getTaskid(), serviceSubtask.getPatid()); |
| | | PatMedOuthosp pmo = new PatMedOuthosp(); |
| | | pmo.setId(patMedOuthosp.getId()); |
| | | pmo.setDiagcheckFlag("2"); |
| | | if (type == 1) pmo.setDiagcheckFlag("2"); |
| | | if (type == 2) pmo.setDeptcheckFlag("2"); |
| | | pmo.setRemark("çæåä»»å¡å¤±è´¥"); |
| | | patMedOuthospMapper.updatePatMedOuthosp(pmo); |
| | | } |
| | |
| | | serviceSubtask.setDrcode(patMedOuthosp.getDrcode()); |
| | | serviceSubtask.setDrname(patMedOuthosp.getDrname()); |
| | | serviceSubtask.setDeptcode(patMedOuthosp.getDeptcode()); |
| | | serviceSubtask.setInhospid(patMedOuthosp.getId()); |
| | | serviceSubtask.setHospno(patMedOuthosp.getOuthospno()); |
| | | serviceSubtask.setDeptname(patMedOuthosp.getDeptname()); |
| | | serviceSubtask.setTemplateid(serviceTask.getTemplateid()); |
| | | serviceSubtask.setTemplatename(serviceTask.getTemplatename()); |
| | |
| | | package com.smartor.service.impl; |
| | | |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.entity.SysUserDept; |
| | | import com.ruoyi.common.core.domain.entity.SysUserRole; |
| | | import com.ruoyi.common.utils.DtoConversionUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.http.HttpUtils; |
| | | import com.smartor.domain.*; |
| | |
| | | import com.smartor.service.IPatArchiveService; |
| | | import com.smartor.service.IPatMedInhospService; |
| | | import com.smartor.service.IServiceSLTDHealthcareRecordService; |
| | | import com.sun.org.apache.bcel.internal.generic.NEW; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.lang.reflect.Array; |
| | | import java.lang.reflect.Type; |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | @Slf4j |
| | | @Service |
| | |
| | | @Autowired |
| | | private SysUserRole2Mapper sysUserRoleMapper; |
| | | |
| | | @Autowired |
| | | private RedisTemplate<String, String> redisTemplate; |
| | | |
| | | @Value("${sltd_pub_path}") |
| | | private String sltdPubPath; |
| | | |
| | |
| | | @Override |
| | | public List<ServiceSLTDInhospResDTO> queryHealthcareRecordList(ServiceSLTDInhospReqVO reqVO) { |
| | | try { |
| | | log.info("ãqueryHealthcareRecordListãå¼å§è°ç¨çç«åå¾·å¥åº·è®°å½æ¥è¯¢æ¥å£ï¼è¯·æ±åæ°ï¼{}", reqVO); |
| | | Map<String, Object> requestParams = buildRequestParams(reqVO); |
| | | Map<String, String> headers = buildRequestHeaders(); |
| | | |
| | | String result = HttpUtils.sendPostByHeader(sltdPubPath + "osj/hbos-thirdparty-integration/standard/common/healthcareRecord/dtcQueryHealthcareRecordList", new Gson().toJson(requestParams), headers); |
| | | log.info("ãqueryHealthcareRecordListãæ¥å£ååºç»æï¼{}", result); |
| | | |
| | | String cry = determineCry(reqVO); |
| | | return parseResponseData(result, reqVO.getHealthcareRecordTypeList(), cry, reqVO.getCampusId()); |
| | | log.info("cryçå¼ä¸ºï¼{}", cry); |
| | | List<ServiceSLTDInhospResDTO> serviceSLTDInhospResDTOS = parseResponseData(result, CollectionUtils.isNotEmpty(reqVO.getStatusList()) ? reqVO.getStatusList() : reqVO.getHealthcareRecordTypeList(), cry, reqVO.getCampusId() != null ? reqVO.getCampusId().toString() : null); |
| | | log.info("serviceSLTDInhospResDTOSæ¯å¦è¿åçæå¼ï¼{}", CollectionUtils.isNotEmpty(serviceSLTDInhospResDTOS) ? "æ" : "没æ"); |
| | | return serviceSLTDInhospResDTOS; |
| | | } catch (Exception e) { |
| | | log.error("ãqueryHealthcareRecordListãè°ç¨çç«åå¾·å¥åº·è®°å½æ¥è¯¢æ¥å£å¼å¸¸ï¼è¯·æ±åæ°ï¼{}", reqVO, e); |
| | | throw new RuntimeException("è°ç¨çç«åå¾·å¥åº·è®°å½æ¥è¯¢æ¥å£å¤±è´¥", e); |
| | |
| | | |
| | | Map<String, String> headers = buildRequestHeaders(); |
| | | String result = HttpUtils.sendPostByHeader(sltdPubPath + "/osj/hbos-thirdparty-integration/standard/common/dept/queryDeptList", new Gson().toJson(params), headers); |
| | | log.info("ãqueryDeptWardAreaInfoListãæ¥å£ååºç»æï¼{}", result); |
| | | log.info("ãqueryDeptWardAreaInfoListãæ¥å£ååºç»æï¼{}", StringUtils.isEmpty(result) ? "空ç" : "ä¸ç©º"); |
| | | List<Map<String, Object>> dataList = getDataList(result); |
| | | log.info("-----------dataListæ¥å£ååºç»æï¼{}", dataList.size()); |
| | | for (Map<String, Object> dataItem : dataList) { |
| | |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public void aa(Map<String, Object> map) { |
| | | List<String> types = new ArrayList<>(); |
| | | types.add("FH0109.27"); |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | try { |
| | | String jsonString = objectMapper.writeValueAsString(map); |
| | | parseResponseData(jsonString, types, "1", "20001001"); |
| | | } catch (JsonProcessingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ééå»é¢ç¨æ·ä¿¡æ¯ |
| | |
| | | Map<String, Object> requestParams = buildRequestParams(reqVO); |
| | | Map<String, String> headers = buildRequestHeaders(); |
| | | String result = HttpUtils.sendPostByHeader(sltdPubPath + "/osj/hbos-thirdparty-integration/standard/common/staff/queryStaffList", new Gson().toJson(requestParams), headers); |
| | | log.info("ãqueryHealthcareRecordListãæ¥å£ååºç»æï¼{}", result); |
| | | log.info("ãqueryHealthcareRecordListãæ¥å£ååºç»ææ¯å¦æå¼ï¼{}", StringUtils.isEmpty(result) ? "没å¼" : "æå¼"); |
| | | List<Map<String, Object>> dataList = getDataList(result); |
| | | for (Map<String, Object> dataItem : dataList) { |
| | | SysUser sysUser = new SysUser(); |
| | |
| | | } |
| | | |
| | | private String determineCry(ServiceSLTDInhospReqVO reqVO) { |
| | | if (reqVO.getHealthcareRecordTypeList().contains("FH0108.02")) { |
| | | if (reqVO.getStartHeadTime() != null && reqVO.getStartTailTime() != null) { |
| | | if (CollectionUtils.isEmpty(reqVO.getStatusList())) return null; |
| | | |
| | | if (reqVO.getStatusList().contains("FH0109.26")) { |
| | | //å
¥é¢ |
| | | return "0"; |
| | | } else if (StringUtils.isNotEmpty(reqVO.getPreOutHospitalHeadDate()) && StringUtils.isNotEmpty(reqVO.getPreOutHospitalTailDate())) { |
| | | } else if (reqVO.getStatusList().contains("FH0109.27")) { |
| | | //åºé¢ |
| | | return "1"; |
| | | } |
| | | } else if (reqVO.getStatusList().contains("FH0109.22") || reqVO.getStatusList().contains("FH0109.23") || reqVO.getStatusList().contains("FH0109.53")) { |
| | | //é¢å
¥é¢ |
| | | return "3"; |
| | | } |
| | | return null; |
| | | } |
| | |
| | | if (reqVO.getHealthcareRecordTypeList() != null && !reqVO.getHealthcareRecordTypeList().isEmpty()) { |
| | | params.put("healthcareRecordTypeList", reqVO.getHealthcareRecordTypeList()); |
| | | } |
| | | if (reqVO.getStatusList() != null && !reqVO.getStatusList().isEmpty()) { |
| | | params.put("statusList", reqVO.getStatusList()); |
| | | } |
| | | params.put("subjectCode", reqVO.getPatientName()); |
| | | params.put("healthcareRecordNo", reqVO.getHealthcareRecordNo()); |
| | | params.put("orgSubjectCode", reqVO.getIdCardNo()); |
| | |
| | | } |
| | | params.put("serviceScopes", null); |
| | | params.put("inpatientArea", null); |
| | | params.put("status", reqVO.getStatusList() != null && !reqVO.getStatusList().isEmpty() ? reqVO.getStatusList().get(0) : null); |
| | | // params.put("status", reqVO.getStatusList() != null && !reqVO.getStatusList().isEmpty() ? reqVO.getStatusList().get(0) : null); |
| | | params.put("status", null); |
| | | return params; |
| | | } |
| | | |
| | |
| | | return headers; |
| | | } |
| | | |
| | | private List<ServiceSLTDInhospResDTO> parseResponseData(String result, List<String> types, String cry, Long orgid) { |
| | | private List<ServiceSLTDInhospResDTO> parseResponseData(String result, List<String> types, String cry, String campusId) { |
| | | try { |
| | | |
| | | List<Map<String, Object>> dataList = getDataList(result); |
| | | List<ServiceSLTDInhospResDTO> resultList = new ArrayList<>(); |
| | | for (Map<String, Object> dataItem : dataList) { |
| | |
| | | } |
| | | log.info("ãparseResponseDataãæåè§£æ{}æ¡å¥åº·è®°å½æ°æ®", resultList.size()); |
| | | |
| | | processResultList(resultList, types, cry, orgid); |
| | | processResultList(resultList, types, cry, campusId); |
| | | return resultList; |
| | | } catch (Exception e) { |
| | | log.error("ãparseResponseDataãè§£æååºæ°æ®å¼å¸¸ï¼ååºå
容ï¼{}", result, e); |
| | |
| | | Type listType = new TypeToken<List<Map<String, Object>>>() { |
| | | }.getType(); |
| | | List<Map<String, Object>> dataList = gson.fromJson(dataJson, listType); |
| | | |
| | | // ä½¿ç¨ Set å»éï¼ç¡®ä¿æ²¡æéå¤çæ°æ® |
| | | Set<Map<String, Object>> uniqueDataSet = new HashSet<>(dataList); |
| | | dataList = new ArrayList<>(uniqueDataSet); |
| | | return dataList; |
| | | } |
| | | |
| | | private void processResultList(List<ServiceSLTDInhospResDTO> resultList, List<String> types, String cry, Long orgid) { |
| | | private void processResultList(List<ServiceSLTDInhospResDTO> resultList, List<String> types, String cry, String campusId) { |
| | | for (String type : types) |
| | | switch (type) { |
| | | case "FH0108.01": |
| | | log.info("ãparseResponseDataãè§£æé¨è¯æ°æ®"); |
| | | outHospitalDate(resultList, orgid); |
| | | outHospitalDate(resultList); |
| | | break; |
| | | case "FH0108.02": |
| | | case "FH0109.26": |
| | | log.info("ãparseResponseDataãè§£æä½é¢æ°æ®"); |
| | | inHospitalDate(resultList, cry, orgid); |
| | | inHospitalDate(resultList, cry); |
| | | break; |
| | | case "FH0108.03": |
| | | log.info("ãparseResponseDataãè§£ææ¥è¯æ°æ®"); |
| | | outHospitalDate(resultList, orgid); |
| | | case "FH0109.22": |
| | | log.info("ãparseResponseDataãè§£æé¢ä½é¢æ°æ®"); |
| | | inHospitalDate(resultList, cry); |
| | | break; |
| | | case "FH0109.23": |
| | | log.info("ãparseResponseDataãè§£æé¢ä½é¢ï¼å¾
å®åºï¼æ°æ®"); |
| | | inHospitalDate(resultList, cry); |
| | | break; |
| | | case "FH0109.27": |
| | | log.info("ãparseResponseDataãè§£æåºé¢æ°æ®"); |
| | | inHospitalDate(resultList, cry); |
| | | break; |
| | | case "FH0109.53": |
| | | log.info("ãparseResponseDataãè§£æé¢ä½é¢ï¼å
¶ä»ï¼æ°æ®"); |
| | | inHospitalDate(resultList, cry); |
| | | break; |
| | | // case "FH0108.03": |
| | | // log.info("ãparseResponseDataãè§£ææ¥è¯æ°æ®"); |
| | | // outHospitalDate(resultList); |
| | | // break; |
| | | default: |
| | | log.warn("ãparseResponseDataãæªç¥çæ°æ®ç±»åï¼{}", type); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | private Boolean outHospitalDate(List<ServiceSLTDInhospResDTO> resultList, Long orgid) { |
| | | for (ServiceSLTDInhospResDTO dto : resultList) { |
| | | if (Objects.isNull(dto)) continue; |
| | | PatArchive patArchive = processPatientArchive(dto, orgid); |
| | | PatMedOuthosp patMedOuthosp = buildPatMedOuthosp(dto, patArchive, orgid); |
| | | // //æ¥è¯¢å½åæ°å¢ç鍿¥è¯æ°æ®ï¼æ¯å¦å¨è¿æ¸¡è¡¨ä¸æ¯å¦åå¨ï¼å¦æåå¨ï¼å°±ä¸å¾é¨æ¥è¯è¡¨éæ°å¢äº(è¿ä¸ªå
ä¸åäºï¼æ½ç©ºäºåå) |
| | | // PatMedOuthospProvisional pmop = DtoConversionUtils.sourceToTarget(patMedOuthosp, PatMedOuthospProvisional.class); |
| | | private Boolean outHospitalDate(List<ServiceSLTDInhospResDTO> resultList) { |
| | | List<PatMedOuthosp> batchList = new ArrayList<>(); |
| | | |
| | | //å
æ¥è¯¢ä¸ä¸ï¼æ¯ä¸æ¯å·²ç»åå¨è¯¥æµæ°´å·äºï¼å¦æåå¨ï¼å°±ä¸æ°å¢äº |
| | | PatMedOuthosp pmo2 = new PatMedOuthosp(); |
| | | pmo2.setSerialnum(patMedOuthosp.getSerialnum()); |
| | | List<PatMedOuthosp> patMedOuthosps = patMedOuthospMapper.selectPatMedOuthospList(pmo2); |
| | | if (CollectionUtils.isEmpty(patMedOuthosps)) patMedOuthospMapper.insertPatMedOuthosp(patMedOuthosp); |
| | | for (ServiceSLTDInhospResDTO dto : resultList) { |
| | | if (Objects.isNull(dto)) { |
| | | continue; |
| | | } |
| | | PatArchive patArchive = processPatientArchive(dto); |
| | | PatMedOuthosp patMedOuthosp = buildPatMedOuthosp(dto, patArchive); |
| | | batchList.add(patMedOuthosp); |
| | | } |
| | | |
| | | // æ¹éæå
¥ï¼èªå¨å¿½ç¥éå¤ |
| | | if (CollectionUtils.isNotEmpty(batchList)) { |
| | | try { |
| | | int insertCount = patMedOuthospMapper.batchInsertIgnore(batchList); |
| | | log.info("æ¹éæå
¥é¨æ¥è¯è®°å½ï¼æ»æ°ï¼{}, å®é
æå
¥ï¼{}", batchList.size(), insertCount); |
| | | } catch (Exception e) { |
| | | log.error("æ¹éæå
¥é¨æ¥è¯è®°å½å¤±è´¥", e); |
| | | // éçº§ä¸ºéæ¡æå
¥ |
| | | for (PatMedOuthosp patMedOuthosp : batchList) { |
| | | try { |
| | | patMedOuthospMapper.insertPatMedOuthosp(patMedOuthosp); |
| | | } catch (Exception ex) { |
| | | log.warn("åæ¡æå
¥å¤±è´¥ï¼serialnum={}", patMedOuthosp.getSerialnum()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | private PatMedOuthosp buildPatMedOuthosp(ServiceSLTDInhospResDTO dto, PatArchive patArchive, Long orgid) { |
| | | private PatMedOuthosp buildPatMedOuthosp(ServiceSLTDInhospResDTO dto, PatArchive patArchive) { |
| | | PatMedOuthosp patMedOuthosp = new PatMedOuthosp(); |
| | | patMedOuthosp.setOuthospno(dto.getHealthcareRecordNo()); |
| | | patMedOuthosp.setSerialnum(dto.getHealthcareRecordNo()); |
| | |
| | | } |
| | | } |
| | | |
| | | private Boolean inHospitalDate(List<ServiceSLTDInhospResDTO> resultList, String cry, Long orgid) { |
| | | private Boolean inHospitalDate(List<ServiceSLTDInhospResDTO> resultList, String cry) { |
| | | for (ServiceSLTDInhospResDTO dto : resultList) { |
| | | if (Objects.isNull(dto)) continue; |
| | | PatArchive patArchive = processPatientArchive(dto, orgid); |
| | | processPatientInhospInfo(dto, patArchive, cry, orgid); |
| | | PatArchive patArchive = processPatientArchive(dto); |
| | | processPatientInhospInfo(dto, patArchive, cry); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | private void processPatientInhospInfo(ServiceSLTDInhospResDTO dto, PatArchive patArchive, String cry, Long orgid) { |
| | | PatMedInhosp patMedInhosp = buildPatientInhospInfo(dto, patArchive, cry, orgid); |
| | | private void processPatientInhospInfo(ServiceSLTDInhospResDTO dto, PatArchive patArchive, String cry) { |
| | | PatMedInhosp patMedInhosp = buildPatientInhospInfo(dto, patArchive, cry); |
| | | PatMedInhosp queryInhosp = new PatMedInhosp(); |
| | | queryInhosp.setPatno(patArchive.getPatientno()); |
| | | queryInhosp.setSerialnum(patMedInhosp.getSerialnum()); |
| | | queryInhosp.setOrgid(dto.getOrgId()); |
| | | queryInhosp.setCampusid(dto.getCampusId()); |
| | | queryInhosp.setPatno(StringUtils.trim(patArchive.getPatientno())); |
| | | queryInhosp.setSerialnum(StringUtils.trim(patMedInhosp.getSerialnum())); |
| | | queryInhosp.setOrgid(StringUtils.trim(dto.getOrgId())); |
| | | queryInhosp.setInhospstate(cry); |
| | | log.info("----------------è¿éçå
¥å为ï¼{}", queryInhosp); |
| | | log.info("----------------è¿éçå
¥å为ï¼{},{}", queryInhosp.getPatno(), queryInhosp.getSerialnum()); |
| | | List<PatMedInhosp> existingInhosps = patMedInhospService.selectPatMedInhosp(queryInhosp); |
| | | |
| | | if (cry.equals("0") && CollectionUtils.isNotEmpty(existingInhosps)) { |
| | | //æ°å¢è¿çå
¥é¢æ°æ®ï¼ä¸åå¤ç |
| | | return; |
| | | } else if (cry.equals("1") && CollectionUtils.isNotEmpty(existingInhosps)) { |
| | | //æ°å¢è¿çåºé¢æ°æ®ï¼ä¹ä¸åå¤ç |
| | | return; |
| | | } |
| | | |
| | | log.info("----------------è¿éçè¿å为ï¼{}", existingInhosps); |
| | | if (CollectionUtils.isNotEmpty(existingInhosps)) { |
| | | patMedInhosp.setInhospid(existingInhosps.get(0).getInhospid()); |
| | | if (cry.equals("0")) { |
| | | //å
¥é¢æ°æ®å¤ç |
| | | if (CollectionUtils.isEmpty(existingInhosps)) { |
| | | //å¦æä¸ºç©ºï¼è¦å
夿ï¼é¢å
¥é¢æ¯å¦æå¼ï¼æå¼çè¯åæ´æ° |
| | | queryInhosp.setInhospstate("3"); |
| | | List<PatMedInhosp> patMedInhospList = patMedInhospService.selectPatMedInhosp(queryInhosp); |
| | | if (CollectionUtils.isNotEmpty(patMedInhospList)) { |
| | | //妿é¢å
¥é¢ä¸ä¸ºç©ºï¼åè¿è¡ä¿®æ¹ |
| | | patMedInhospService.updatePatMedInhosp(patMedInhosp); |
| | | log.debug("ãprocessPatientInhospInfoãæ´æ°ä½é¢ä¿¡æ¯ï¼æ£è
ç¼å·ï¼{}ï¼æµæ°´å·ï¼{}", patArchive.getPatientno(), patMedInhosp.getSerialnum()); |
| | | } else { |
| | | patMedInhospService.insertPatMedInhosp(patMedInhosp); |
| | | log.debug("ãprocessPatientInhospInfoãæ°å¢ä½é¢ä¿¡æ¯ï¼æ£è
ç¼å·ï¼{}ï¼æµæ°´å·ï¼{}", patArchive.getPatientno(), patMedInhosp.getSerialnum()); |
| | | //妿åºé¢ä¸ä¸ºç©ºï¼åä¸è¿è¡å¤ç |
| | | queryInhosp.setInhospstate("1"); |
| | | patMedInhospList = patMedInhospService.selectPatMedInhosp(queryInhosp); |
| | | if (CollectionUtils.isNotEmpty(patMedInhospList)) { |
| | | return; |
| | | } |
| | | } |
| | | |
| | | private PatMedInhosp buildPatientInhospInfo(ServiceSLTDInhospResDTO dto, PatArchive patArchive, String cry, Long orgid) { |
| | | //妿é½ä¸ºç©ºï¼åè¿è¡æ°å¢ |
| | | if (CollectionUtils.isEmpty(patMedInhospList)) { |
| | | try { |
| | | patMedInhospService.insertPatMedInhosp(patMedInhosp); |
| | | } catch (org.springframework.dao.DuplicateKeyException e) { |
| | | log.warn("å
¥é¢è®°å½å·²åå¨ï¼è·³è¿ï¼serialnum={}, orgid={}, state={}", patMedInhosp.getSerialnum(), patMedInhosp.getOrgid(), patMedInhosp.getInhospstate()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } else if (cry.equals("1")) { |
| | | // åºé¢æ°æ®å¤ç |
| | | if (CollectionUtils.isEmpty(existingInhosps)) { |
| | | //å¦æä¸ºç©ºï¼è¦å
夿ï¼é¢å
¥é¢æ¯å¦æå¼ï¼æå¼çè¯åæ´æ° |
| | | queryInhosp.setInhospstate("3"); |
| | | log.info("-----patMedInhospListè¿æ¥äºä¸ï¼å
¥å为ï¼{}", queryInhosp); |
| | | List<PatMedInhosp> patMedInhospList = patMedInhospService.selectPatMedInhosp(queryInhosp); |
| | | log.info("----patMedInhospListè¿æ¥äºä¸ï¼è¿å为ï¼{}", CollectionUtils.isEmpty(patMedInhospList) ? null : patMedInhospList.get(0).getSerialnum()); |
| | | if (CollectionUtils.isNotEmpty(patMedInhospList)) { |
| | | //妿é¢å
¥é¢ä¸ä¸ºç©ºï¼åè¿è¡ä¿®æ¹ |
| | | patMedInhospService.updatePatMedInhosp(patMedInhosp); |
| | | } else { |
| | | //妿å
¥é¢ä¸ä¸ºç©ºï¼åè¿è¡ä¿®æ¹ |
| | | queryInhosp.setInhospstate("0"); |
| | | patMedInhospList = patMedInhospService.selectPatMedInhosp(queryInhosp); |
| | | if (CollectionUtils.isNotEmpty(patMedInhospList)) { |
| | | patMedInhospService.updatePatMedInhosp(patMedInhosp); |
| | | } |
| | | } |
| | | |
| | | //妿é½ä¸ºç©ºï¼åè¿è¡æ°å¢ |
| | | if (CollectionUtils.isEmpty(patMedInhospList)) { |
| | | //妿å
¥é¢ä¸ä¸ºç©ºï¼åè¿è¡ä¿®æ¹ |
| | | queryInhosp.setInhospstate("0"); |
| | | log.debug("åºé¢queryInhospå
¥å为ï¼{}", queryInhosp); |
| | | List<PatMedInhosp> patMedInhosps = patMedInhospService.selectPatMedInhosp(queryInhosp); |
| | | log.debug("åºé¢patMedInhospListè¿å为ï¼{}", CollectionUtils.isEmpty(patMedInhosps) ? null : patMedInhosps.size()); |
| | | if (CollectionUtils.isNotEmpty(patMedInhosps)) { |
| | | patMedInhospService.updatePatMedInhosp(patMedInhosp); |
| | | } else { |
| | | try { |
| | | patMedInhospService.insertPatMedInhosp(patMedInhosp); |
| | | } catch (org.springframework.dao.DuplicateKeyException e) { |
| | | log.warn("åºé¢è®°å½å·²åå¨ï¼è·³è¿ï¼serialnum={}, orgid={}, state={}", patMedInhosp.getSerialnum(), patMedInhosp.getOrgid(), patMedInhosp.getInhospstate()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } else if ("3".equals(cry)) { |
| | | //é¢å
¥é¢æ°æ®å¤çï¼ä»»ä¸ç¶æåå¨å䏿°å¢ï¼é½ä¸å卿æ°å¢ |
| | | String serialnum = patMedInhosp.getSerialnum() == null ? "" : patMedInhosp.getSerialnum().trim(); |
| | | String orgid = patMedInhosp.getOrgid() == null ? "" : patMedInhosp.getOrgid().trim(); |
| | | String state = patMedInhosp.getInhospstate() == null ? "" : patMedInhosp.getInhospstate(); |
| | | String lockKey = "inhosp:lock:" + serialnum + ":" + orgid + ":" + state; |
| | | |
| | | Boolean locked = false; |
| | | try { |
| | | locked = redisTemplate.opsForValue().setIfAbsent(lockKey, "1", 10, TimeUnit.SECONDS); |
| | | } catch (Exception e) { |
| | | log.warn("Rediséè·å失败ï¼éçº§ä¸ºç´æ¥æå
¥ï¼{}", e.getMessage()); |
| | | locked = null; // æ è®°Redisä¸å¯ç¨ |
| | | } |
| | | |
| | | if (locked == null || Boolean.TRUE.equals(locked)) { |
| | | try { |
| | | queryInhosp.setInhospstate(null); |
| | | List<PatMedInhosp> patMedInhospList3 = patMedInhospService.selectPatMedInhosp(queryInhosp); |
| | | if (CollectionUtils.isEmpty(patMedInhospList3)) { |
| | | try { |
| | | patMedInhospService.insertPatMedInhosp(patMedInhosp); |
| | | log.debug("æåæå
¥é¢å
¥é¢è®°å½ï¼serialnum={}", patMedInhosp.getSerialnum()); |
| | | } catch (Exception e) { |
| | | log.warn("é¢å
¥é¢è®°å½æå
¥å¤±è´¥ï¼å¯è½å·²åå¨ï¼ï¼serialnum={}, orgid={}, state={}, é误ï¼{}", patMedInhosp.getSerialnum(), patMedInhosp.getOrgid(), patMedInhosp.getInhospstate(), e.getMessage()); |
| | | } |
| | | } |
| | | } finally { |
| | | if (Boolean.TRUE.equals(locked)) { |
| | | try { |
| | | redisTemplate.delete(lockKey); |
| | | } catch (Exception e) { |
| | | log.warn("Redisééæ¾å¤±è´¥ï¼{}", e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | log.debug("é¢å
¥é¢è®°å½æ£å¨è¢«å
¶ä»çº¿ç¨å¤çï¼è·³è¿ï¼serialnum={}", patMedInhosp.getSerialnum()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private PatMedInhosp buildPatientInhospInfo(ServiceSLTDInhospResDTO dto, PatArchive patArchive, String cry) { |
| | | log.info("----------------buildPatientInhospInfoè¿éè¿æ¥äºåï¼{}", cry); |
| | | PatMedInhosp patMedInhosp = new PatMedInhosp(); |
| | | patMedInhosp.setPatid(patArchive.getId()); |
| | |
| | | patMedInhosp.setFuflag("1"); |
| | | if ("0".equals(cry)) patMedInhosp.setInhospstate("0"); |
| | | if ("1".equals(cry)) patMedInhosp.setInhospstate("1"); |
| | | if ("3".equals(cry)) patMedInhosp.setInhospstate("3"); |
| | | patMedInhosp.setHospitalcode(dto.getOrgId()); |
| | | patMedInhosp.setBedNo(dto.getBedNumber()); |
| | | patMedInhosp.setStarttime(parseDate(dto.getStartTime())); |
| | |
| | | patMedInhosp.setHospitaldistrictname(dto.getAreaName()); |
| | | } |
| | | |
| | | private PatArchive processPatientArchive(ServiceSLTDInhospResDTO dto, Long orgid) { |
| | | private PatArchive processPatientArchive(ServiceSLTDInhospResDTO dto) { |
| | | PatArchive queryArchive = new PatArchive(); |
| | | queryArchive.setIdcardno(StringUtils.isEmpty(dto.getIdCardNo()) ? "" + dto.getMedicalCardId() : dto.getIdCardNo().trim()); |
| | | List<PatArchive> existingArchives = patArchiveService.selectPatArchiveList(queryArchive); |
| | | |
| | | PatArchive patArchive = buildPatientArchive(dto, orgid); |
| | | PatArchive patArchive = buildPatientArchive(dto); |
| | | |
| | | if (CollectionUtils.isEmpty(existingArchives)) { |
| | | patArchiveService.insertPatArchive(patArchive); |
| | |
| | | return patArchive; |
| | | } |
| | | |
| | | private PatArchive buildPatientArchive(ServiceSLTDInhospResDTO dto, Long orgid) { |
| | | private PatArchive buildPatientArchive(ServiceSLTDInhospResDTO dto) { |
| | | PatArchive patArchive = new PatArchive(); |
| | | patArchive.setPatientno("" + dto.getPatientId()); |
| | | patArchive.setIdcardno(StringUtils.isEmpty(dto.getIdCardNo()) ? "" + dto.getMedicalCardId() : dto.getIdCardNo().trim()); |
| | |
| | | if (key.contains("-WJscriptCache")) { |
| | | List<SvyTaskTemplateScriptVO> cacheList = redisCache.getCacheList(key); |
| | | cacheList.sort(Comparator.comparingLong(SvyTaskTemplateScriptVO::getSort)); |
| | | log.error("é®å·åçç»æï¼{}", cacheList); |
| | | log.info("é®å·åçç»æï¼{}", cacheList); |
| | | for (int i = 0; i < cacheList.size(); i++) { |
| | | if (i == 0) { |
| | | //è¿ä¸ªæ¶é´è¦æ¾å°ç¬¬ä¸é¢ |
| | |
| | | } |
| | | ServiceTask serviceTask = serviceTaskService.selectServiceTaskByTaskid(taskid); |
| | | serviceSubtaskDetailVO.setQuestiontext(svyTaskTemplateScriptVO.getScriptContent()); |
| | | serviceSubtaskDetailVO.setCategoryid(svyTaskTemplateScriptVO.getCategoryid()); |
| | | serviceSubtaskDetailVO.setTaskid(Long.valueOf(taskid)); |
| | | serviceSubtaskDetailVO.setTargetid(svyTaskTemplateScriptVO.getTargetid() != null ? svyTaskTemplateScriptVO.getTargetid().intValue() : null); |
| | | serviceSubtaskDetailVO.setPatid(Long.valueOf(patid)); |
| | |
| | | private Boolean sendTaskIds(List<Integer> sendTaskids, ServiceSubtask serviceSubtask) { |
| | | for (Integer taskId : sendTaskids) { |
| | | ServiceTask serviceTask = serviceTaskService.selectServiceTaskByTaskid(Long.valueOf(taskId)); |
| | | if (Objects.isNull(serviceTask)) return false; |
| | | |
| | | String content = sendMQContent(serviceTask, null); |
| | | //å
æ¥è¯¢ä¸ä¸ï¼è¯¥æ£è
å¨è¯¥service_taskä¸ï¼æ¯å¦å·²ç»åå¨,妿已ç»åå¨ï¼åä¸ç¨åä¿åäº |
| | | ServiceSubtask ss = new ServiceSubtask(); |
| | |
| | | package com.smartor.service.impl; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.google.gson.Gson; |
| | |
| | | import com.smartor.domain.*; |
| | | import com.smartor.mapper.*; |
| | | import com.smartor.service.*; |
| | | import com.sun.org.apache.bcel.internal.generic.NEW; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | 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.data.redis.core.ListOperations; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.DecimalFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.*; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.time.ZoneId; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | |
| | | |
| | | @Autowired |
| | | private IvrLibaExtemplatescriptMapper ivrLibaExtemplatescriptMapper; |
| | | |
| | | @Autowired |
| | | private ISvyTaskTemplateScriptService svyTaskTemplateScriptService; |
| | | |
| | | @Autowired |
| | | private IIvrTaskTemplateService ivrTaskTemplateService; |
| | |
| | | @Override |
| | | public ServiceSubtask selectServiceSubtaskById(Long id) { |
| | | return serviceSubtaskMapper.selectServiceSubtaskById(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<ServiceSubtask> selectServiceSubtaskByDiagname(ServiceSubtask serviceSubtask) { |
| | | return serviceSubtaskMapper.selectServiceSubtaskByDiagname(serviceSubtask); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | if (patMedInhospList.size() > 0) { |
| | | serviceSubtask1.setIsVisitAgain(2); |
| | | serviceSubtask1.setRemark(serviceSubtask1.getRemark()+";æ£è
åå
¥é¢äº"); |
| | | serviceSubtaskMapper.updateServiceSubtask(serviceSubtask1); |
| | | return "æ é忬¡éè®¿ï¼æ£è
åå
¥é¢äº"; |
| | | } else if (serviceSubtask1.getSendstate() == 4L) { |
| | | serviceSubtask1.setIsVisitAgain(2); |
| | | serviceSubtask1.setRemark(serviceSubtask1.getRemark()+";æ é忬¡é访ï¼ä»»å¡è¢«æ è®°ä¸å¨æ§è¡"); |
| | | serviceSubtaskMapper.updateServiceSubtask(serviceSubtask1); |
| | | return "æ é忬¡é访ï¼ä»»å¡è¢«æ è®°ä¸å¨æ§è¡"; |
| | | } else if (StringUtils.isNotEmpty(patArchive.getNotrequiredFlag()) && patArchive.getNotrequiredFlag().equals("1")) { |
| | | serviceSubtask1.setIsVisitAgain(2); |
| | | serviceSubtaskMapper.updateServiceSubtask(serviceSubtask1); |
| | | serviceSubtask1.setRemark(serviceSubtask1.getRemark()+";æ é忬¡éè®¿ï¼æ£è
被æ è®°ä¸éè¦è¢«æå¡"); |
| | | return "æ é忬¡éè®¿ï¼æ£è
被æ è®°ä¸éè¦è¢«æå¡"; |
| | | } else if (ObjectUtils.isNotEmpty(serviceSubtask1.getIsVisitAgain()) && serviceSubtask1.getIsVisitAgain() == 2) { |
| | | return "æ é忬¡é访ï¼è¯¥ä»»å¡å·²ç»å次é访è¿äº"; |
| | |
| | | serviceSubtask.setAddr(patTaskRelevance.getAddr()); |
| | | serviceSubtask.setPatid(patTaskRelevance.getPatid()); |
| | | serviceSubtask.setCreateTime(DateUtils.getNowDate()); |
| | | serviceSubtask.setInhospid(patTaskRelevance.getHospid()); |
| | | serviceSubtask.setSendstate(1L); |
| | | if (serviceTaskVO.getLongTask() != null && serviceTaskVO.getLongTask() == 1) |
| | | serviceSubtask.setSendstate(2L); |
| | |
| | | for (ServiceSubtask serviceSubtask : serviceSubtaskList) { |
| | | log.error("sfSendéè¦ç§»é¤çsubId为ï¼{}", serviceSubtask.getId().toString()); |
| | | serviceSubtaskMapper.deleteServiceSubtaskById(serviceSubtask.getId()); |
| | | redisCache.removeElementFromList("cache-exist", serviceSubtask.getId().toString()); |
| | | // redisCache.removeElementFromList("cache-exist", serviceSubtask.getId().toString()); |
| | | redisCache.removeElementFromList("cache-0", serviceSubtask.getId().toString()); |
| | | redisCache.removeElementFromList("cache-1", serviceSubtask.getId().toString()); |
| | | redisCache.removeElementFromList("cache-2", serviceSubtask.getId().toString()); |
| | |
| | | @Override |
| | | public PhoneCallBackYQVO phoneCallBackYQ(PhoneCallReqYQVO phoneCallReqYQVO) { |
| | | //å
æè¯¥subIdä»cache_existä¸åé¤ï¼åªè¦æåè°å°±åé¤ï¼ç®çæ¯ï¼å°½å¿«è®©cache-exist为空ï¼å»ç¼åä¸ä¸æ¹è¦æççµè¯;è¿éåé¤ä¸å½±åçµè¯çæ£å¸¸ä¸å¡ï¼ |
| | | redisCache.removeElementFromList("cache-exist", phoneCallReqYQVO.getTaskid()); |
| | | // redisCache.removeElementFromList("cache-exist", phoneCallReqYQVO.getTaskid()); |
| | | |
| | | //夿æ¯å¦ææº |
| | | String hangupState = redisCache.getCacheObject(phoneCallReqYQVO.getUuid() + "- hangup"); |
| | |
| | | List<String> cacheList = new ArrayList<>(); |
| | | ListOperations<String, String> listOps = redisTemplate.opsForList(); |
| | | //å¿
é¡»çache-existå
¨é¨æå®æè½æåä¸ä¸æ¹ï¼ä¸»è¦æ¯æææçæ°æ®é½å å¨çµè¯çç¼åéï¼å¨è§å®çæ¶é´æä¸å®ï¼ |
| | | long existSize = listOps.size("cache-exist"); |
| | | if (existSize > 0) return pullTaskVOList; |
| | | // long existSize = listOps.size("cache-exist"); |
| | | // if (existSize > 0) return pullTaskVOList; |
| | | int count = 0; |
| | | long size = listOps.size("cache-0"); |
| | | log.error("---------æçµè¯ä¹åç¼åä¸çæ°æ®éï¼{}", size); |
| | |
| | | count = Math.min(phoneCount(), (int) size); |
| | | if (count != 0) { |
| | | cacheList = listOps.range("cache-0", 0, count - 1); |
| | | } else { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | log.error("任塿åcache-0ç弿¯å¤å°ï¼{}", cacheList); |
| | | log.info("任塿åcache-0ç弿¯å¤å°ï¼{}", cacheList); |
| | | // cache-0为ç«å³åèµ·ç,å
¶å®çå
æ¨è¿ |
| | | if (!CollectionUtils.isEmpty(cacheList)) { |
| | | pullTaskVOList = getPullTaskList(cacheList, "cache-0"); |
| | | // å é¤å·²å¤ççæ°æ® |
| | | listOps.trim("cache-0", count, -1); |
| | | log.error("æçµè¯ä¹åç¼åä¸çæ°æ®é---------ï¼{}", listOps.size("cache-0")); |
| | | log.info("æçµè¯ä¹åç¼åä¸çæ°æ®é---------ï¼{}", listOps.size("cache-0")); |
| | | } else { |
| | | for (int i = 1; i < 6; i++) { |
| | | //ååºä»cache-1 å° cache-5ç第ä¸ä¸ªåä»»å¡ä¿¡æ¯ |
| | |
| | | } |
| | | } |
| | | //existListç¨æ¥è®°å½æ¥ä¸æ¥éè¦æ§è¡çåä»»å¡ID |
| | | List<String> existList = new ArrayList<>(); |
| | | // List<String> existList = new ArrayList<>(); |
| | | if (CollectionUtils.isNotEmpty(pullTaskVOList)) { |
| | | //ç»åè°åæ°èµå¼ |
| | | for (PullTaskVO pullTaskVO : pullTaskVOList) { |
| | | existList.add(pullTaskVO.getTaskid()); |
| | | // existList.add(pullTaskVO.getTaskid()); |
| | | pullTaskVO.setAsrcallback(ASRCallBackPath); |
| | | } |
| | | } |
| | | if (existList.size() != 0) redisCache.setCacheListRight("cache-exist", existList); |
| | | // if (existList.size() != 0) redisCache.setCacheListRight("cache-exist", existList); |
| | | log.error("-----------å®é
æåççµè¯æ°æ®éï¼{}", CollectionUtils.isNotEmpty(pullTaskVOList) ? pullTaskVOList.size() : null); |
| | | return pullTaskVOList; |
| | | } |
| | |
| | | } |
| | | //é访 |
| | | for (ServiceSubtaskDetail serviceSubtaskDetail : serviceSubTaskDetailReq.getServiceSubtaskDetailList()) { |
| | | if (serviceSubtaskDetail.getScriptid() != null) { |
| | | //设置ä¸ä¸é®é¢åç±» |
| | | IvrTaskTemplateScript ivrTaskTemplateScript = iIvrTaskTemplateScriptService.selectIvrTaskTemplateScriptByID(serviceSubtaskDetail.getScriptid()); |
| | | if (ivrTaskTemplateScript != null) |
| | | serviceSubtaskDetail.setCategoryid(ivrTaskTemplateScript.getAssortid()); |
| | | } |
| | | |
| | | serviceSubtaskDetail.setSubId(selectServiceSubtaskList.get(0).getId()); |
| | | // serviceSubtaskDetail.setId(UUID.randomUUID().toString()); |
| | | serviceSubtaskDetail.setCreateTime(new Date()); |
| | |
| | | } else { |
| | | if (serviceSubTaskDetailReq != null && CollectionUtils.isNotEmpty(serviceSubTaskDetailReq.getServiceSubtaskDetailList())) { |
| | | for (ServiceSubtaskDetail serviceSubtaskDetail : serviceSubTaskDetailReq.getServiceSubtaskDetailList()) { |
| | | if (serviceSubtaskDetail.getScriptid() != null) { |
| | | //设置ä¸ä¸é®é¢åç±» |
| | | IvrTaskTemplateScript ivrTaskTemplateScript = iIvrTaskTemplateScriptService.selectIvrTaskTemplateScriptByID(serviceSubtaskDetail.getScriptid()); |
| | | if (ivrTaskTemplateScript != null) |
| | | serviceSubtaskDetail.setCategoryid(ivrTaskTemplateScript.getAssortid()); |
| | | } |
| | | serviceSubtaskDetail.setCreateTime(new Date()); |
| | | serviceSubtaskDetail.setGuid(serviceSubTaskDetailReq.getGuid()); |
| | | serviceSubtaskDetail.setOrgid(serviceSubTaskDetailReq.getOrgid()); |
| | |
| | | //è¿è¡çä¿¡è¡¥å¿ |
| | | // getSmsCompensate(Long.valueOf(phoneCallRecordVO.getTaskid())); |
| | | redisCache.deleteObject(phoneCallRecordVO.getTaskid() + "recordAccept-hungup"); |
| | | redisCache.removeElementFromList("cache-exist", phoneCallRecordVO.getTaskid()); |
| | | // redisCache.removeElementFromList("cache-exist", phoneCallRecordVO.getTaskid()); |
| | | } else if (ObjectUtils.isNotEmpty(cacheObject) && String.valueOf(cacheObject).equals("2")) { |
| | | // if (phoneCallRecordVO.getAnswered() != null && phoneCallRecordVO.getAnswered() == true) { |
| | | log.error("æäººæ¥çµè¯äºï¼å¹¶ä¸å®äº"); |
| | |
| | | } else { |
| | | //æ£è
æç»é访 |
| | | //å
æè¯¥subIdä»cache_existä¸åé¤ï¼åªè¦æåè°å°±åé¤ï¼ç®çæ¯ï¼å°½å¿«è®©cache-exist为空ï¼å»ç¼åä¸ä¸æ¹è¦æççµè¯;è¿éåé¤ä¸å½±åçµè¯çæ£å¸¸ä¸å¡ï¼ |
| | | redisCache.removeElementFromList("cache-exist", phoneCallRecordVO.getTaskid()); |
| | | // redisCache.removeElementFromList("cache-exist", phoneCallRecordVO.getTaskid()); |
| | | ServiceSubtask serviceSubtask = new ServiceSubtask(); |
| | | serviceSubtask.setRemark("çµè¯æ¥éæåï¼æ£è
æç»é访"); |
| | | serviceSubtask.setId(Long.valueOf(phoneCallRecordVO.getTaskid())); |
| | |
| | | stringBuilder.append(timestamp + "ä¹åæºå¸¦å»ä¿å¡æçµåå»ä¿å¡èº«ä»½è¯åæ¤æ¡çä¿¡å°1å·æ¥¼3楼åå
¥é¢åå¤ä¸å¿å
¥é¢ç»è®°çªå£ï¼åçæ£å¼ä½é¢æç»ï¼å®æåé¡¹æ£æ¥ååå°ç¸åºç
åºæ¤å£«ç«æ¥å°ã"); |
| | | stringBuilder.append("å
¥é¢åå¤ä¸å¿çµè¯ï¼89975977ãå
¥é¢åçé¡»ç¥:https://mp.weixin.qq.com/s/OCkotuRyQ8Ld2owFF0YErw"); |
| | | |
| | | String data = MessageSend.sendMsg(stringBuilder.toString(), "2", patArchiveSrmVO.getPhone(), LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); |
| | | 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); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Cacheable(value = "sfStatistics", key = "T(org.springframework.util.DigestUtils).md5DigestAsHex(#serviceSubtaskCountReq.toString().getBytes())", unless = "#result == null or #result.isEmpty()") |
| | | public List<ServiceSubtaskStatistic> getSfStatistics(ServiceSubtaskCountReq serviceSubtaskCountReq) { |
| | | log.error("getSfStatisticsçå
¥å为ï¼{}", serviceSubtaskCountReq); |
| | | log.info("getSfStatisticsçå
¥å为ï¼{}", serviceSubtaskCountReq); |
| | | List<ServiceSubtaskStatistic> serviceSubtaskStatistics = new ArrayList<>(); |
| | | // List<ServiceSubtask> rawData = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq); |
| | | |
| | |
| | | return serviceSubtaskStatistics; |
| | | } |
| | | |
| | | @Override |
| | | public List<ServiceSubtaskStatistic> getSfStatisticsExport(ServiceSubtaskCountReq serviceSubtaskCountReq) { |
| | | List<ServiceSubtaskStatistic> sfStatistics = getSfStatistics(serviceSubtaskCountReq); |
| | | // æ·»å æ»è®¡è¡ |
| | | if (CollectionUtils.isNotEmpty(sfStatistics)) { |
| | | ServiceSubtaskStatistic totalRow = calculateTotalRow(sfStatistics); |
| | | totalRow.setLeavehospitaldistrictname("æ»è®¡"); |
| | | totalRow.setDeptname("æ»è®¡"); |
| | | sfStatistics.add(totalRow); |
| | | } |
| | | |
| | | return sfStatistics; |
| | | } |
| | | |
| | | /** |
| | | * è·åé访ç»è®¡æ¯ä¾ |
| | | * |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Cacheable(value = "sfStatisticsJoy", key = "T(org.springframework.util.DigestUtils).md5DigestAsHex(#serviceSubtaskCountReq.toString().getBytes())", unless = "#result == null or #result.isEmpty()") |
| | | public List<ServiceSubtaskStatistic> getSfStatisticsJoy(ServiceSubtaskCountReq serviceSubtaskCountReq) { |
| | | log.error("getSfStatisticsçå
¥å为ï¼{}", serviceSubtaskCountReq); |
| | | List<ServiceSubtaskStatistic> serviceSubtaskStatistics = new ArrayList<>(); |
| | | |
| | | // æ ¹æ®æ¡ä»¶è¿è¡åç» |
| | | Map<String, List<ServiceSubtask>> collect = new HashMap<>(); |
| | | String orgid = null; |
| | | |
| | | if (serviceSubtaskCountReq.getLeavehospitaldistrictcodes() != null && serviceSubtaskCountReq.getLeavehospitaldistrictcodes().size() > 0) { |
| | | if (serviceSubtaskCountReq.getDrcode() != null && !serviceSubtaskCountReq.getDrcode().isEmpty()) { |
| | |
| | | continue; |
| | | } |
| | | ServiceSubtaskStatistic statistic = getStatisticJoy(serviceSubtaskList, joySubCount); |
| | | if (statistic.getJoyCount() != 0 && statistic.getJoyAllCount() != 0) { |
| | | Double joyTotal = Double.parseDouble(statistic.getJoyCount() + "") / Double.parseDouble(statistic.getJoyAllCount() + "") * 100; |
| | | statistic.setJoyTotal(String.format("%.2f", joyTotal) + "%"); |
| | | } |
| | | //åæ¶ç |
| | | ServiceSubtask ss = new ServiceSubtask(); |
| | | ss.setOrgid(serviceSubtaskList.get(0).getOrgid()); |
| | | orgid = serviceSubtaskList.get(0).getOrgid(); |
| | | ss.setOrgid(orgid); |
| | | |
| | | // 妿æå»çç¼ç ï¼è®¾ç½®å»çç¼ç ç¨äºåæ¶çæ¥è¯¢ |
| | | if (serviceSubtaskCountReq.getDrcode() != null && !serviceSubtaskCountReq.getDrcode().isEmpty()) { |
| | |
| | | } |
| | | Double jsRate = serviceSubtaskMapper.selectTimelyRate(ss); |
| | | statistic.setRate(jsRate); |
| | | |
| | | if (ObjectUtils.isNotEmpty(statistic)) { |
| | | serviceSubtaskStatistics.add(statistic); |
| | | } |
| | | } |
| | | if (CollectionUtils.isNotEmpty(serviceSubtaskStatistics)) { |
| | | for (ServiceSubtaskStatistic serviceSubtaskStatistic : serviceSubtaskStatistics) { |
| | | //æææ»¡æåº¦æ°é |
| | | if (CollectionUtils.isNotEmpty(serviceSubtaskCountReq.getDeptcodes())) { |
| | | Map<String, Object> satisfactionIndex = getSatisfactionIndex("1", serviceSubtaskStatistic.getDeptcode(), orgid, serviceSubtaskCountReq.getIvrCategoryid(), serviceSubtaskCountReq.getSvyCategoryid()); |
| | | serviceSubtaskStatistic.setJoyAllCount(satisfactionIndex.get("mydtmzl") != null ? (Integer) satisfactionIndex.get("mydtmzl") : 0); |
| | | serviceSubtaskStatistic.setJoyCount(satisfactionIndex.get("mydtbl") != null ? (Integer) satisfactionIndex.get("mydtbl") : 0); |
| | | serviceSubtaskStatistic.setJoyTotal((Double) satisfactionIndex.get("wcbl")); |
| | | } else if (CollectionUtils.isNotEmpty(serviceSubtaskCountReq.getLeavehospitaldistrictcodes())) { |
| | | Map<String, Object> satisfactionIndex = getSatisfactionIndex("2", serviceSubtaskStatistic.getLeavehospitaldistrictcode(), orgid, serviceSubtaskCountReq.getIvrCategoryid(), serviceSubtaskCountReq.getSvyCategoryid()); |
| | | serviceSubtaskStatistic.setJoyAllCount(satisfactionIndex.get("mydtmzl") != null ? (Integer) satisfactionIndex.get("mydtmzl") : 0); |
| | | serviceSubtaskStatistic.setJoyCount(satisfactionIndex.get("mydtbl") != null ? (Integer) satisfactionIndex.get("mydtbl") : 0); |
| | | serviceSubtaskStatistic.setJoyTotal((Double) satisfactionIndex.get("wcbl")); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return serviceSubtaskStatistics; |
| | | } |
| | | |
| | | /** |
| | | * è·å满æåº¦é¢ç®æ»é |
| | | * type : 1-ç§å®¤ 2ç
åº |
| | | * code: ç§å®¤æç
åºcode |
| | | * |
| | | * @return |
| | | */ |
| | | private Map<String, Object> getSatisfactionIndex(String type, String code, String orgid, Long ivrCategoryid, Long svyCategoryid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<ServiceTask> serviceTasks = null; |
| | | if (type.equals("1")) { |
| | | ServiceTask serviceTask = new ServiceTask(); |
| | | serviceTask.setDeptcode(code); |
| | | serviceTask.setOrgid(orgid); |
| | | serviceTasks = serviceTaskService.selectServiceTaskList(serviceTask); |
| | | } else if (type.equals("2")) { |
| | | ServiceTask serviceTask = new ServiceTask(); |
| | | serviceTask.setLeavehospitaldistrictcode(code); |
| | | serviceTask.setOrgid(orgid); |
| | | serviceTasks = serviceTaskService.selectServiceTaskList(serviceTask); |
| | | } |
| | | |
| | | //è·å满æåº¦é¢ç®æ»é |
| | | BigDecimal mydtmzlsum = new BigDecimal(0); |
| | | //è·å满æåº¦é¢ç®å¡«æ¥é |
| | | BigDecimal mydtblsum = new BigDecimal(0); |
| | | if (CollectionUtils.isNotEmpty(serviceTasks)) { |
| | | //è·å满æåº¦é¢ç®æ»é |
| | | for (ServiceTask serviceTask : serviceTasks) { |
| | | if (serviceTask.getType().equals("1")) { |
| | | //è¯é³ |
| | | Long templateid = serviceTask.getTemplateid(); |
| | | IvrTaskTemplateScript ivrTaskTemplateScript = new IvrTaskTemplateScript(); |
| | | ivrTaskTemplateScript.setTemplateID(templateid); |
| | | ivrTaskTemplateScript.setOrgid(serviceTask.getOrgid()); |
| | | //å
é»è®¤ä¸º1å§ï¼assortid=1 ä»£è¡¨æ¯æ»¡æåº¦ |
| | | ivrTaskTemplateScript.setAssortid(ivrCategoryid); |
| | | List<IvrTaskTemplateScript> ivrTaskTemplateScripts = iIvrTaskTemplateScriptService.selectIvrTaskTemplateScriptList(ivrTaskTemplateScript); |
| | | if (CollectionUtils.isNotEmpty(ivrTaskTemplateScripts)) { |
| | | //éè¦å
计ç®åºåééï¼åä¹ä»¥å个é®å¸æ»¡æåº¦é¢ç®æ°éï¼å¾å°æ»¡æåº¦é¢ç®æ»éï¼å
å«äºæªåçï¼ |
| | | ServiceSubtaskVO serviceSubtaskVO = new ServiceSubtaskVO(); |
| | | serviceSubtaskVO.setTaskid(serviceTask.getTaskid()); |
| | | List<Long> sendstates = new ArrayList<>(Arrays.asList(3L, 5L, 6L)); |
| | | serviceSubtaskVO.setSendstates(sendstates); |
| | | List<ServiceSubtask> serviceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskBySendstate(serviceSubtaskVO); |
| | | if (CollectionUtils.isNotEmpty(serviceSubtaskList)) { |
| | | int mydtmzlCount = ivrTaskTemplateScripts.size() * serviceSubtaskList.size(); |
| | | mydtmzlsum.add(new BigDecimal(mydtmzlCount)); |
| | | } |
| | | |
| | | } |
| | | } else if (serviceTask.getType().equals("2")) { |
| | | //é®å· |
| | | SvyTaskTemplateScript svyTaskTemplateScript = new SvyTaskTemplateScript(); |
| | | svyTaskTemplateScript.setTemplateID(serviceTask.getTemplateid()); |
| | | svyTaskTemplateScript.setOrgid(serviceTask.getOrgid()); |
| | | svyTaskTemplateScript.setCategoryid(svyCategoryid); |
| | | List<SvyTaskTemplateScript> svyTaskTemplateScriptList = svyTaskTemplateScriptService.selectSvyTaskTemplateScriptList(svyTaskTemplateScript); |
| | | if (CollectionUtils.isNotEmpty(svyTaskTemplateScriptList)) { |
| | | ServiceSubtaskVO serviceSubtaskVO = new ServiceSubtaskVO(); |
| | | serviceSubtaskVO.setTaskid(serviceTask.getTaskid()); |
| | | List<Long> sendstates = new ArrayList<>(Arrays.asList(3L, 5L, 6L)); |
| | | serviceSubtaskVO.setSendstates(sendstates); |
| | | List<ServiceSubtask> serviceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskBySendstate(serviceSubtaskVO); |
| | | if (CollectionUtils.isNotEmpty(serviceSubtaskList)) { |
| | | int mydtmzlCount = svyTaskTemplateScriptList.size() * serviceSubtaskList.size(); |
| | | mydtmzlsum.add(new BigDecimal(mydtmzlCount)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //è·å满æåº¦é¢ç®å¡«æ¥é |
| | | ServiceSubtaskDetail serviceSubtaskDetail = new ServiceSubtaskDetail(); |
| | | serviceSubtaskDetail.setTaskid(serviceTask.getTaskid()); |
| | | if (serviceTask.getType().equals("1")) serviceSubtaskDetail.setCategoryid(ivrCategoryid); |
| | | if (serviceTask.getType().equals("2")) serviceSubtaskDetail.setCategoryid(svyCategoryid); |
| | | serviceSubtaskDetail.setOrgid(serviceTask.getOrgid()); |
| | | List<ServiceSubtaskDetail> serviceSubtaskDetails = serviceSubtaskDetailMapper.selectServiceSubtaskDetailList(serviceSubtaskDetail); |
| | | if (CollectionUtils.isNotEmpty(serviceSubtaskDetails)) |
| | | mydtblsum.add(new BigDecimal(serviceSubtaskDetails.size())); |
| | | } |
| | | |
| | | |
| | | } |
| | | //满æåº¦é¢ç®æ»é |
| | | map.put("mydtmzl", mydtmzlsum.intValue()); |
| | | map.put("mydtbl", mydtblsum.intValue()); |
| | | map.put("wcbl", 0.0); |
| | | if (mydtmzlsum.intValue() != 0) { |
| | | map.put("wcbl", mydtblsum.divide(mydtmzlsum, 2, RoundingMode.HALF_UP).doubleValue()); |
| | | } |
| | | |
| | | return map; |
| | | } |
| | | |
| | | |
| | | private ServiceSubtaskStatistic getStatistic(List<ServiceSubtask> serviceSubtaskList) { |
| | | ServiceSubtaskStatistic serviceSubtaskStatistic = new ServiceSubtaskStatistic(); |
| | |
| | | serviceSubtaskStatistic.setDrname(serviceSubtaskList.get(0).getDrname()); |
| | | //åºé¢äººæ¬¡ |
| | | serviceSubtaskStatistic.setDischargeCount(serviceSubtaskList.size()); |
| | | //è®°å½è¿æ»¤æ£è
详æ
|
| | | List<ServiceSubtask> filterServiceSubtasks = new ArrayList<>(); |
| | | for (ServiceSubtask serviceSubtask : serviceSubtaskList) { |
| | | //æ éé访人次 |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 4) { |
| | | serviceSubtaskStatistic.setNonFollowUp(serviceSubtaskStatistic.getNonFollowUp() + 1L); |
| | | if (serviceSubtask.getTaskSituation() !=null && serviceSubtask.getTaskSituation() == 6) { |
| | | serviceSubtaskStatistic.setFilterCount(serviceSubtaskStatistic.getFilterCount() + 1L); |
| | | filterServiceSubtasks.add(serviceSubtask); |
| | | } |
| | | } |
| | | //åºé访人次 |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() != 4) { |
| | |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 5) { |
| | | serviceSubtaskStatistic.setTaskSituation5(serviceSubtaskStatistic.getTaskSituation5() + 1); |
| | | } |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 6) { |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 7) { |
| | | serviceSubtaskStatistic.setTaskSituation6(serviceSubtaskStatistic.getTaskSituation6() + 1); |
| | | } |
| | | } |
| | | |
| | | serviceSubtaskStatistic.setFilterCountList(filterServiceSubtasks); |
| | | |
| | | return serviceSubtaskStatistic; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | return serviceSubtaskStatistic; |
| | | } |
| | |
| | | serviceSubtaskDetail.setAssigntime(System.currentTimeMillis()); |
| | | serviceSubtaskDetail.setStarttime(System.currentTimeMillis()); |
| | | serviceSubtaskDetail.setAnswertime(System.currentTimeMillis()); |
| | | serviceSubtaskDetail.setCategoryid(ivrTaskTemplateScriptVO.getAssortid()); |
| | | serviceSubtaskDetail.setAsrtext("æ åºç"); |
| | | if (StringUtils.isNotEmpty(phoneCallReqYQVO.getAsrtext())) |
| | | serviceSubtaskDetail.setAsrtext(phoneCallReqYQVO.getAsrtext()); |
| | |
| | | LocalTime currentTime = LocalTime.now(); |
| | | // ç®æ æ¶é´ï¼æä¸ 8 ç¹ï¼ |
| | | LocalTime targetTime = LocalTime.of(phoneEndHour, 0); |
| | | // 计ç®å½åæ¶é´å°ç®æ æ¶é´çæ¶é¿ |
| | | Duration duration = Duration.between(currentTime, targetTime); |
| | | // è·åå©ä½æ¶é´çå°æ¶æ° |
| | | long remainingHours = 0; |
| | | long remainingMinutes = duration.toMinutes(); |
| | | //妿è¶
è¿8ç¹,就设置为0 |
| | | //è·ç¦»ç»ææ¶é´å°äº20åéï¼å°±ä¸æåäº |
| | | if (remainingMinutes < 20) remainingHours = 0; |
| | | else if (remainingMinutes < 60 && remainingMinutes > 20) remainingHours = 1; |
| | | else if (remainingMinutes > 60) remainingHours = remainingMinutes / 60; |
| | | // 计ç®å©ä½å¯ä»¥æççµè¯æ° |
| | | int remainingCalls = (int) (remainingHours * phoneUpEveryHour); |
| | | return remainingCalls; |
| | | // // 计ç®å½åæ¶é´å°ç®æ æ¶é´çæ¶é¿ |
| | | // Duration duration = Duration.between(currentTime, targetTime); |
| | | // // è·åå©ä½æ¶é´çå°æ¶æ° |
| | | // long remainingHours = 0; |
| | | // long remainingMinutes = duration.toMinutes(); |
| | | // //妿è¶
è¿8ç¹,就设置为0 |
| | | // //è·ç¦»ç»ææ¶é´å°äº20åéï¼å°±ä¸æåäº |
| | | // if (remainingMinutes < 20) remainingHours = 0; |
| | | // else if (remainingMinutes < 60 && remainingMinutes > 20) remainingHours = 1; |
| | | // else if (remainingMinutes > 60) remainingHours = remainingMinutes / 60; |
| | | // // 计ç®å©ä½å¯ä»¥æççµè¯æ° |
| | | // int remainingCalls = (int) (remainingHours * phoneUpEveryHour); |
| | | // return remainingCalls; |
| | | if (currentTime.isBefore(targetTime)) { |
| | | //妿å½åæ¶é´è¿å¨æªæ¢æ¶é´å
ï¼åç»§ç»å |
| | | return phoneUpEveryHour; |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | public List<ServiceSubtaskCount> getSfStatisticsJoydetails(ServiceSubtaskCountReq serviceSubtaskCountReq) { |
| | |
| | | } |
| | | return visitTime; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * è®¡ç®æ»è®¡è¡ |
| | | * @param statistics ç»è®¡æ°æ®å表 |
| | | * @return æ»è®¡è¡æ°æ® |
| | | */ |
| | | private ServiceSubtaskStatistic calculateTotalRow(List<ServiceSubtaskStatistic> statistics) { |
| | | ServiceSubtaskStatistic total = new ServiceSubtaskStatistic(); |
| | | |
| | | // åå§åæ°å¼å段 |
| | | total.setDischargeCount(0); |
| | | total.setNonFollowUp(0L); |
| | | total.setFilterCount(0L); |
| | | total.setFollowUpNeeded(0L); |
| | | total.setNeedFollowUp(0L); |
| | | total.setPendingFollowUp(0L); |
| | | total.setFollowUpSuccess(0L); |
| | | total.setFollowUpFail(0L); |
| | | total.setManual(0L); |
| | | total.setSms(0L); |
| | | total.setWeChat(0L); |
| | | total.setAbnormal(0L); |
| | | total.setNeedFollowUpAgain(0L); |
| | | total.setPendingFollowUpAgain(0L); |
| | | total.setFollowUpSuccessAgain(0L); |
| | | total.setFollowUpFailAgain(0L); |
| | | total.setManualAgain(0L); |
| | | total.setSmsAgain(0L); |
| | | total.setWeChatAgain(0L); |
| | | total.setAbnormalAgain(0L); |
| | | total.setTaskSituation1(0); |
| | | total.setTaskSituation2(0); |
| | | total.setTaskSituation3(0); |
| | | total.setTaskSituation4(0); |
| | | total.setTaskSituation5(0); |
| | | total.setTaskSituation6(0); |
| | | |
| | | // ç´¯å åä¸ªåæ®µçå¼ |
| | | for (ServiceSubtaskStatistic stat : statistics) { |
| | | if (stat.getDischargeCount() != null) { |
| | | total.setDischargeCount(total.getDischargeCount() + stat.getDischargeCount()); |
| | | } |
| | | total.setNonFollowUp(total.getNonFollowUp() + (stat.getNonFollowUp() != null ? stat.getNonFollowUp() : 0L)); |
| | | total.setFilterCount(total.getFilterCount() + (stat.getFilterCount() != null ? stat.getFilterCount() : 0L)); |
| | | total.setFollowUpNeeded(total.getFollowUpNeeded() + (stat.getFollowUpNeeded() != null ? stat.getFollowUpNeeded() : 0L)); |
| | | total.setNeedFollowUp(total.getNeedFollowUp() + (stat.getNeedFollowUp() != null ? stat.getNeedFollowUp() : 0L)); |
| | | total.setPendingFollowUp(total.getPendingFollowUp() + (stat.getPendingFollowUp() != null ? stat.getPendingFollowUp() : 0L)); |
| | | total.setFollowUpSuccess(total.getFollowUpSuccess() + (stat.getFollowUpSuccess() != null ? stat.getFollowUpSuccess() : 0L)); |
| | | total.setFollowUpFail(total.getFollowUpFail() + (stat.getFollowUpFail() != null ? stat.getFollowUpFail() : 0L)); |
| | | total.setManual(total.getManual() + (stat.getManual() != null ? stat.getManual() : 0L)); |
| | | total.setSms(total.getSms() + (stat.getSms() != null ? stat.getSms() : 0L)); |
| | | total.setWeChat(total.getWeChat() + (stat.getWeChat() != null ? stat.getWeChat() : 0L)); |
| | | total.setAbnormal(total.getAbnormal() + (stat.getAbnormal() != null ? stat.getAbnormal() : 0L)); |
| | | total.setNeedFollowUpAgain(total.getNeedFollowUpAgain() + (stat.getNeedFollowUpAgain() != null ? stat.getNeedFollowUpAgain() : 0L)); |
| | | total.setPendingFollowUpAgain(total.getPendingFollowUpAgain() + (stat.getPendingFollowUpAgain() != null ? stat.getPendingFollowUpAgain() : 0L)); |
| | | total.setFollowUpSuccessAgain(total.getFollowUpSuccessAgain() + (stat.getFollowUpSuccessAgain() != null ? stat.getFollowUpSuccessAgain() : 0L)); |
| | | total.setFollowUpFailAgain(total.getFollowUpFailAgain() + (stat.getFollowUpFailAgain() != null ? stat.getFollowUpFailAgain() : 0L)); |
| | | total.setManualAgain(total.getManualAgain() + (stat.getManualAgain() != null ? stat.getManualAgain() : 0L)); |
| | | total.setSmsAgain(total.getSmsAgain() + (stat.getSmsAgain() != null ? stat.getSmsAgain() : 0L)); |
| | | total.setWeChatAgain(total.getWeChatAgain() + (stat.getWeChatAgain() != null ? stat.getWeChatAgain() : 0L)); |
| | | total.setAbnormalAgain(total.getAbnormalAgain() + (stat.getAbnormalAgain() != null ? stat.getAbnormalAgain() : 0L)); |
| | | total.setTaskSituation1(total.getTaskSituation1() + (stat.getTaskSituation1() != null ? stat.getTaskSituation1() : 0)); |
| | | total.setTaskSituation2(total.getTaskSituation2() + (stat.getTaskSituation2() != null ? stat.getTaskSituation2() : 0)); |
| | | total.setTaskSituation3(total.getTaskSituation3() + (stat.getTaskSituation3() != null ? stat.getTaskSituation3() : 0)); |
| | | total.setTaskSituation4(total.getTaskSituation4() + (stat.getTaskSituation4() != null ? stat.getTaskSituation4() : 0)); |
| | | total.setTaskSituation5(total.getTaskSituation5() + (stat.getTaskSituation5() != null ? stat.getTaskSituation5() : 0)); |
| | | total.setTaskSituation6(total.getTaskSituation6() + (stat.getTaskSituation6() != null ? stat.getTaskSituation6() : 0)); |
| | | } |
| | | |
| | | // è®¡ç®æ»è®¡è¡çæ¯çåæ®µ |
| | | DecimalFormat percentFormat = new DecimalFormat("##.##%"); |
| | | if (total.getNeedFollowUp() > 0) { |
| | | double rate = (double) (total.getFollowUpSuccess() + total.getFollowUpFail()) / total.getNeedFollowUp(); |
| | | total.setFollowUpRate(percentFormat.format(rate)); |
| | | } else { |
| | | total.setFollowUpRate("0.00%"); |
| | | } |
| | | |
| | | if (total.getNeedFollowUpAgain() > 0) { |
| | | double rateAgain = (double) (total.getFollowUpSuccessAgain() + total.getFollowUpFailAgain()) / total.getNeedFollowUpAgain(); |
| | | total.setFollowUpRateAgain(percentFormat.format(rateAgain)); |
| | | } else { |
| | | total.setFollowUpRateAgain("0.00%"); |
| | | } |
| | | |
| | | return total; |
| | | } |
| | | } |
| | |
| | | serviceSubtaskMapper.insertServiceSubtask(serviceSubtask); |
| | | } |
| | | Integer integer = serviceSubtask.getId().intValue(); |
| | | log.error("æå
¥çIDæ¯ï¼{}", integer); |
| | | log.info("æå
¥çIDæ¯ï¼{}", integer); |
| | | return integer; |
| | | } |
| | | |
| | |
| | | @Override |
| | | public Map query360PatInfo(ServiceQueryInfo serviceQueryInfo) { |
| | | if (ObjectUtils.isEmpty(serviceQueryInfo)) { |
| | | log.info("360æ¥è¯¢æ¡ä»¶ä¸ºç©º"); |
| | | log.error("360æ¥è¯¢æ¡ä»¶ä¸ºç©º"); |
| | | throw new BaseException("360æ¥è¯¢æ¡ä»¶ä¸ºç©º"); |
| | | } |
| | | String token = LSHospTokenUtil.getToken(serviceQueryInfo.getXiaoXiTou().getFaSongJGID(),serviceQueryInfo.getUrl()); |
| | | // LyraTokenUtil lyraTokenUtil = null; |
| | | // if (serviceQueryInfo.getXiaoXiTou().getFaSongJGID().equals("47255004333112711A1001")) //æ¯å® |
| | | // lyraTokenUtil = LyraTokenUtil.createLyraTokenUtil("https://9.0.124.104:13021/mediinfo-lyra-authserver/connect/token", "zjhes.suifangxt", "OIjdJvx2ALjFVGZoCZO4I8O"); |
| | | // if (serviceQueryInfo.getXiaoXiTou().getFaSongJGID().equals("47231022633110211A2101")) //ä¸å»é¢ |
| | | // lyraTokenUtil = LyraTokenUtil.createLyraTokenUtil("https://9.0.124.104:13011/mediinfo-lyra-authserver/connect/token", "zjhes.suifangxt", "OIjdJvx2ALjFVGZoCZO4I8O"); |
| | | // |
| | | // try { |
| | | // token = lyraTokenUtil.getToken(); |
| | | // } catch (IOException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | |
| | | //ç¨æ·ä¿¡æ¯ï¼éè¿ZuZhiJGIDå»bse_organizationä¸è·åæºæä¿¡æ¯ |
| | | if (StringUtils.isBlank(serviceQueryInfo.getYeWuXX().getYongHuXX().getZuZhiJGID())) |
| | |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss"); |
| | | serviceQueryInfo.getXiaoXiTou().setFaSongSJ(simpleDateFormat.format(new Date())); |
| | | |
| | | log.error(new Gson().toJson(serviceQueryInfo)); |
| | | log.error("serviceQueryInfoçç»æä¸ºï¼{}", serviceQueryInfo); |
| | | log.info("serviceQueryInfoçç»æä¸ºï¼{}", serviceQueryInfo); |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | String result = null; |
| | | Map map = new HashMap(); |
| | | try { |
| | | String jsonString = objectMapper.writeValueAsString(serviceQueryInfo); |
| | | log.error("tokençå¼ä¸ºï¼{}", token); |
| | | log.info("tokençå¼ä¸ºï¼{}", token); |
| | | if (serviceQueryInfo.getXiaoXiTou().getFaSongJGID().equals("47255004333112711A1001")) { //æ¯å® |
| | | result = OkHttpExample.sendPostRequest("https://9.0.124.104:13021/mediinfo-grus-fuwuzxwg/api/esb/lyraSyncRun", jsonString, token); |
| | | }else if (serviceQueryInfo.getXiaoXiTou().getFaSongJGID().equals("47231022633110211A2101")) { //ä¸å»é¢ |
| | |
| | | |
| | | //对模æ¿è¯æ¯åé项è¿è¡å¤çï¼è¯æ¯è¡¨ä¸ææ 表è¿è¡åå¹¶äºï¼ï¼ |
| | | if (CollectionUtils.isNotEmpty(svyTaskTemplateVO.getSvyTaskTemplateScriptVOS())) { |
| | | log.error("ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList()æ¯å¦ææ°æ®åï¼{}", svyTaskTemplateVO.getSvyTaskTemplateScriptVOS()); |
| | | // log.error("ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList()æ¯å¦ææ°æ®åï¼{}", svyTaskTemplateVO.getSvyTaskTemplateScriptVOS()); |
| | | for (SvyTaskTemplateScriptVO svyTaskTemplateScriptVO : svyTaskTemplateVO.getSvyTaskTemplateScriptVOS()) { |
| | | svyTaskTemplateScriptVO.setGuid(svyTaskTemplateVO.getGuid()); |
| | | svyTaskTemplateScriptVO.setOrgid(svyTaskTemplateVO.getOrgid()); |
| | |
| | | log.info("svyLibaTemplateScriptVOç主é®id为ï¼{}", svyTaskTemplateScriptVO.getId()); |
| | | 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(); |
| | |
| | | } |
| | | svyTaskTemplateScriptVO.setSvyTaskTemplateTargetoptions(svyTaskTemplateTargetoptions); |
| | | } |
| | | Collections.sort(svyTaskTemplateScriptVOS, Comparator.comparing(SvyTaskTemplateScriptVO::getTargetid)); |
| | | // Collections.sort(svyTaskTemplateScriptVOS, Comparator.comparing(SvyTaskTemplateScriptVO::getTargetid)); |
| | | //æ°æ®ç»è£
|
| | | templateVO.setSvyTaskTemplateScriptVOS(svyTaskTemplateScriptVOS); |
| | | return templateVO; |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.smartor.mapper.IvrLibScriptMapper"> |
| | | |
| | | <resultMap type="IvrLibScript" id="IvrLibScriptResult"> |
| | | <resultMap type="com.smartor.domain.IvrLibScript" id="IvrLibScriptResult"> |
| | | <result property="scriptid" column="scriptid" /> |
| | | <result property="orgid" column="orgid" /> |
| | | <result property="categoryid" column="categoryid" /> |
| | |
| | | |
| | | <resultMap type="com.smartor.domain.IvrLibaScript" id="IvrLibaScriptResult"> |
| | | <result property="id" column="id"/> |
| | | <result property="assortid" column="assortid"/> |
| | | <result property="scriptTopic" column="script_topic"/> |
| | | <result property="scriptContent" column="script_content"/> |
| | | <result property="ivrVoice" column="ivr_voice"/> |
| | |
| | | <sql id="selectIvrLibaScriptVo"> |
| | | select id, |
| | | suitway, |
| | | assortid, |
| | | targetdesc, |
| | | campus, |
| | | deptNames, |
| | |
| | | <result property="sort" column="sort"/> |
| | | <result property="score" column="score"/> |
| | | <result property="groupName" column="group_name"/> |
| | | <result property="assortid" column="assortid"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectIvrLibaTemplateScriptVo"> |
| | | select id, |
| | | scriptno, |
| | | sort, |
| | | assortid, |
| | | group_name, |
| | | branch_flag, |
| | | branch_nextscriptno, |
| | |
| | | <where> |
| | | del_flag=0 |
| | | <if test="scriptno != null ">and scriptno = #{scriptno}</if> |
| | | <if test="assortid != null ">and assortid = #{assortid}</if> |
| | | <if test="groupName != null ">and group_name = #{groupName}</if> |
| | | <if test="scriptDesc != null ">and script_desc = #{scriptDesc}</if> |
| | | <if test="templateid != null ">and templateid = #{templateid}</if> |
| | |
| | | <if test="score != null ">score,</if> |
| | | <if test="ivrtext != null ">ivrtext,</if> |
| | | <if test="groupName != null ">group_name,</if> |
| | | <if test="assortid != null ">assortid,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="scriptno != null">#{scriptno},</if> |
| | |
| | | <if test="score != null ">#{score},</if> |
| | | <if test="ivrtext != null ">#{ivrtext},</if> |
| | | <if test="groupName != null ">#{groupName},</if> |
| | | <if test="assortid != null ">#{assortid},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <if test="branchFlag != null and branchFlag != ''">branch_flag = #{branchFlag},</if> |
| | | <if test="score != null ">score = #{score},</if> |
| | | <if test="groupName != null ">group_name = #{groupName},</if> |
| | | <if test="assortid != null ">assortid = #{assortid},</if> |
| | | <if test="branchNextscriptno != null and branchNextscriptno != ''">branch_nextscriptno = |
| | | #{branchNextscriptno}, |
| | | </if> |
| | |
| | | <result property="ivrtext" column="ivrtext"/> |
| | | <result property="groupName" column="group_name"/> |
| | | <result property="scriptTopic" column="script_topic"/> |
| | | <result property="assortid" column="assortid"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectIvrTaskTemplateScriptVo"> |
| | | select id, |
| | | taskid, |
| | | assortid, |
| | | sort, |
| | | ivrtext, |
| | | script_type, |
| | |
| | | <where> |
| | | del_flag=0 |
| | | <if test="taskid != null ">and taskid = #{taskid}</if> |
| | | <if test="assortid != null ">and assortid = #{assortid}</if> |
| | | <if test="score != null ">and score = #{score}</if> |
| | | <if test="scriptTopic != null ">and script_topic = #{scriptTopic}</if> |
| | | <if test="ivrtext != null ">and ivrtext = #{ivrtext}</if> |
| | |
| | | <if test="score != null ">score,</if> |
| | | <if test="ivrtext != null ">ivrtext,</if> |
| | | <if test="scriptTopic != null ">script_topic,</if> |
| | | <if test="assortid != null ">assortid,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="taskid != null">#{taskid},</if> |
| | |
| | | <if test="score != null ">#{score},</if> |
| | | <if test="ivrtext != null ">#{ivrtext},</if> |
| | | <if test="scriptTopic != null ">#{scriptTopic},</if> |
| | | <if test="assortid != null ">#{assortid},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <if test="score != null">score = #{score},</if> |
| | | <if test="ivrtext != null">ivrtext = #{ivrtext},</if> |
| | | <if test="scriptTopic != null ">script_topic = #{scriptTopic},</if> |
| | | <if test="assortid != null ">assortid = #{assortid},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | <select id="selectPatMedInhosp" parameterType="Long" resultMap="PatMedInhospResult"> |
| | | <include refid="selectPatMedInhospVo"/> |
| | | where del_flag=0 |
| | | <if test="cry != null and cry == 0 ">and endtime is null</if> |
| | | <if test="cry != null and cry == 0 ">and inhospstate=0</if> |
| | | <if test="cry != null and cry == 1 ">and inhospstate=1</if> |
| | | <if test="cry != null and cry == 3 ">and inhospstate=3</if> |
| | | <if test="serialnum != null">and serialnum = #{serialnum}</if> |
| | | <if test="hospitalname != null">and hospitalname = #{hospitalname}</if> |
| | | <if test="hospitalcode != null">and hospitalcode = #{hospitalcode}</if> |
| | |
| | | <result property="idcardno" column="idcardno"/> |
| | | <result property="remark" column="remark"/> |
| | | <result property="fudate" column="fudate"/> |
| | | <result property="serverState" column="server_state"/> |
| | | <result property="campusid" column="campusid"/> |
| | | </resultMap> |
| | | |
| | |
| | | select id, |
| | | outhospno, |
| | | campusid, |
| | | server_state, |
| | | diagcheck_flag, |
| | | patno, |
| | | remark, |
| | |
| | | pmo.campusid, |
| | | pmo.remark, |
| | | pmo.fudate, |
| | | pmo.server_state, |
| | | pmo.outhospno, |
| | | pmo.diagcheck_flag, |
| | | pmo.patno, |
| | |
| | | <where> |
| | | pmo.del_flag=0 |
| | | <if test="orgid != null ">and pmo.orgid = #{orgid}</if> |
| | | <if test="serialnum != null ">and pmo.serialnum = #{serialnum}</if> |
| | | <if test="serverState != null ">and pmo.server_state = #{serverState}</if> |
| | | <if test="hospitalname != null and hospitalname != ''">and pmo.hospitalname like concat('%', |
| | | #{hospitalname}, |
| | | '%') |
| | |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | |
| | | |
| | | <if test="deptname != null and deptname != ''">and pmo.deptname like concat('%', #{deptname}, '%')</if> |
| | | <if test="drname != null and drname != ''">and pmo.drname like concat('%', #{drname}, '%')</if> |
| | | <if test="patname != null and patname != ''">and pmo.patname like concat('%', #{patname}, '%')</if> |
| | |
| | | <if test="fuflag != null">fuflag,</if> |
| | | <if test="fudate != null">fudate,</if> |
| | | <if test="campusid != null">campusid,</if> |
| | | <if test="serverState != null">server_state,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="serialnum != null">#{serialnum},</if> |
| | |
| | | <if test="fuflag != null">#{fuflag},</if> |
| | | <if test="fudate != null">#{fudate},</if> |
| | | <if test="campusid != null">#{campusid},</if> |
| | | <if test="serverState != null">#{serverState},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | fuflag, |
| | | fudate, |
| | | campusid, |
| | | server_state, |
| | | remark) |
| | | values |
| | | <foreach collection="list" item="item" separator=","> |
| | |
| | | #{item.fuflag}, |
| | | #{item.fudate}, |
| | | #{item.campusid}, |
| | | #{item.serverState}, |
| | | #{item.remark} |
| | | ) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <insert id="batchInsertIgnore"> |
| | | insert ignore into pat_med_outhosp |
| | | ( |
| | | serialnum, |
| | | patid, |
| | | hospitalname, |
| | | hospitalcode, |
| | | icd10code, |
| | | diagname, |
| | | deptcode, |
| | | deptname, |
| | | drcode, |
| | | drname, |
| | | admitdate, |
| | | orgid, |
| | | del_flag, |
| | | update_by, |
| | | update_time, |
| | | create_by, |
| | | create_time, |
| | | isupload, |
| | | upload_time, |
| | | schemestatus, |
| | | deptid, |
| | | schemetime, |
| | | hpi, |
| | | mainsuit, |
| | | outhospno, |
| | | patname, |
| | | guid, |
| | | patno, |
| | | diagcheck_flag, |
| | | fuflag, |
| | | fudate, |
| | | campusid, |
| | | server_state, |
| | | remark) |
| | | values |
| | | <foreach collection="list" item="item" separator=","> |
| | | ( |
| | | #{item.serialnum}, |
| | | #{item.patid}, |
| | | #{item.hospitalname}, |
| | | #{item.hospitalcode}, |
| | | #{item.icd10code}, |
| | | #{item.diagname}, |
| | | #{item.deptcode}, |
| | | #{item.deptname}, |
| | | #{item.drcode}, |
| | | #{item.drname}, |
| | | #{item.admitdate}, |
| | | #{item.orgid}, |
| | | #{item.delFlag}, |
| | | #{item.updateBy}, |
| | | #{item.updateTime}, |
| | | #{item.createBy}, |
| | | #{item.createTime}, |
| | | #{item.isupload}, |
| | | #{item.uploadTime}, |
| | | #{item.schemestatus}, |
| | | #{item.deptid}, |
| | | #{item.schemetime}, |
| | | #{item.hpi}, |
| | | #{item.mainsuit}, |
| | | #{item.outhospno}, |
| | | #{item.patname}, |
| | | #{item.guid}, |
| | | #{item.patno}, |
| | | #{item.diagcheckFlag}, |
| | | #{item.fuflag}, |
| | | #{item.fudate}, |
| | | #{item.campusid}, |
| | | #{item.serverState}, |
| | | #{item.remark} |
| | | ) |
| | | </foreach> |
| | |
| | | <if test="fuflag != null">fuflag = #{fuflag},</if> |
| | | <if test="fudate != null">fudate = #{fudate},</if> |
| | | <if test="campusid != null">campusid = #{campusid},</if> |
| | | <if test="serverState != null">server_state = #{serverState},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | FROM pat_med_outhosp |
| | | <where> |
| | | del_flag=0 |
| | | <if test="inhospstate != inhospstate"> |
| | | <if test="inhospstate != null"> |
| | | and inhospstate= #{inhospstate} |
| | | </if> |
| | | <if test="serverState != null"> |
| | | and server_state= #{inhospstate} |
| | | </if> |
| | | <if test="deptcodeList != null and deptcodeList.size()>0"> |
| | | and deptcode in |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | |
| | | <result property="questiontext" column="questiontext"/> |
| | | <result property="questionvoice" column="questionvoice"/> |
| | | <result property="categoryname" column="categoryname"/> |
| | | <result property="categoryid" column="categoryid"/> |
| | | <result property="targetoptions" column="targetoptions"/> |
| | | <result property="targetvalue" column="targetvalue"/> |
| | | <result property="matchedtext" column="matchedtext"/> |
| | |
| | | questiontext, |
| | | questionvoice, |
| | | categoryname, |
| | | categoryid, |
| | | targetoptions, |
| | | targetvalue, |
| | | matchedtext, |
| | |
| | | <if test="templateid != null and templateid != ''">and templateid = #{templateid}</if> |
| | | <if test="templatequestionnum != null ">and templatequestionnum = #{templatequestionnum}</if> |
| | | <if test="switchid != null ">and switchid = #{switchid}</if> |
| | | <if test="categoryid != null ">and categoryid = #{categoryid}</if> |
| | | <if test="questiontext != null and questiontext != ''">and questiontext = #{questiontext}</if> |
| | | <if test="questionvoice != null and questionvoice != ''">and questionvoice = #{questionvoice}</if> |
| | | <if test="categoryname != null and categoryname != ''">and categoryname like concat('%', #{categoryname}, |
| | |
| | | <if test=" patid != null">patid,</if> |
| | | <if test=" extemplateText != null">extemplate_text,</if> |
| | | <if test=" guid != null">guid,</if> |
| | | <if test=" categoryid != null">categoryid,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | |
| | | <if test="patid != null">#{patid},</if> |
| | | <if test="extemplateText != null">#{extemplateText},</if> |
| | | <if test="guid != null">#{guid},</if> |
| | | <if test="categoryid != null">#{categoryid},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <if test=" patid != null">patid = #{patid},</if> |
| | | <if test=" extemplateText != null">extemplate_text = #{extemplateText},</if> |
| | | <if test=" guid != null">guid = #{guid},</if> |
| | | <if test=" categoryid != null">categoryid = #{categoryid},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | <if test=" patid != null">patid = #{patid},</if> |
| | | <if test=" extemplateText != null">extemplate_text = #{extemplateText},</if> |
| | | <if test=" guid != null">guid = #{guid},</if> |
| | | <if test=" categoryid != null">categoryid = #{categoryid},</if> |
| | | </trim> |
| | | where patid = #{patid} and scriptid = #{scriptid} and sub_id = #{subId} |
| | | </update> |
| | |
| | | <include refid="selectServiceSubtaskVo"/> |
| | | <where> |
| | | del_flag=0 |
| | | and taskid = #{taskid} |
| | | <if test="taskid != null ">and taskid = #{taskid}</if> |
| | | <if test="serviceType != null ">and service_type = #{serviceType}</if> |
| | | <if test="patid != null ">and patid = #{patid}</if> |
| | | <if test="sendstates!=null"> |
| | | AND sendstate IN |
| | | <foreach collection="sendstates" item="sendstate" open="(" separator="," |
| | | close=")"> |
| | | #{sendstate} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <select id="selectServiceSubtaskByDiagname" parameterType="com.smartor.domain.ServiceSubtask" |
| | | resultMap="ServiceSubtaskResult"> |
| | | select sendstate,starttime,endtime,nurse_name,phone,sex,task_name,sendname,leavediagname,visit_time FROM |
| | | service_subtask WHERE del_flag=0 |
| | | <if test="leavediagname != null">and leavediagname like concat('%',#{leavediagname}, '%')</if> |
| | | <if test="sendname != null">and sendname like concat('%',#{sendname}, '%')</if> |
| | | <if test="taskName != null">and task_name like concat('%',#{taskName}, '%')</if> |
| | | <if test="sendstate != null">and sendstate = #{sendstate}</if> |
| | | <if test="orgid != null">and orgid =#{orgid}</if> |
| | | GROUP BY sendname,sendstate,starttime,endtime,nurse_name,phone,sex,task_name,leavediagname,visit_time ORDER BY |
| | | visit_time |
| | | <if test="pageSize != null and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if> |
| | | </select> |
| | | |
| | | <insert id="insertServiceSubtask" parameterType="com.smartor.domain.ServiceSubtask" useGeneratedKeys="true" |
| | | keyProperty="id"> |
| | | insert into service_subtask |
| | |
| | | </if> |
| | | <if test="endTime != null ">and date_format(update_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d') |
| | | </if> |
| | | |
| | | <if test="deptcode != null and deptcode != ''">and deptcode = #{deptcode}</if> |
| | | <if test="deptcode != null and deptcode != ''"> |
| | | and deptcode REGEXP CONCAT('(^|,)', #{deptcode}, '(,|$)') |
| | | </if> |
| | | <if test="deptname != null and deptname != ''">and deptname = #{deptname}</if> |
| | | <if test="isupload != null ">and isupload = #{isupload}</if> |
| | | <if test="uploadTime != null ">and upload_time = #{uploadTime}</if> |
| | |
| | | <if test="leavehospitaldistrictname != null ">and leavehospitaldistrictname = |
| | | #{leavehospitaldistrictname} |
| | | </if> |
| | | <if test="leavehospitaldistrictcode != null ">and leavehospitaldistrictcode = |
| | | #{leavehospitaldistrictcode} |
| | | <if test="leavehospitaldistrictcode != null and leavehospitaldistrictcode != ''"> |
| | | and leavehospitaldistrictcode REGEXP CONCAT('(^|,)', #{leavehospitaldistrictcode}, '(,|$)') |
| | | </if> |
| | | |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size()>0"> |
| | | AND leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," |
| | |
| | | <where> |
| | | del_flag=0 |
| | | <if test="templateid != null ">and templateid = #{templateid}</if> |
| | | <if test="id != null ">and id = #{id}</if> |
| | | <if test="categoryid != null ">and categoryid = #{categoryid}</if> |
| | | <if test="svycode != null and svycode != ''">and svycode = #{svycode}</if> |
| | | <if test="svyname != null and svyname != ''">and svyname like concat('%', #{svyname}, '%')</if> |
| | |
| | | <result property="score" column="score"/> |
| | | <result property="prompt" column="prompt"/> |
| | | <result property="groupName" column="group_name"/> |
| | | <result property="categoryid" column="categoryid"/> |
| | | |
| | | </resultMap> |
| | | |
| | |
| | | sort, |
| | | ishide, |
| | | prompt, |
| | | categoryid, |
| | | group_name, |
| | | branch_flag, |
| | | branch_nextscriptno, |
| | |
| | | <include refid="selectSvyTaskTemplateScriptVo"/> |
| | | <where> |
| | | <if test="taskid != null ">and taskid = #{taskid}</if> |
| | | <if test="categoryid != null ">and categoryid = #{categoryid}</if> |
| | | <if test="ishide != null ">and ishide = #{ishide}</if> |
| | | <if test="scriptno != null ">and scriptno = #{scriptno}</if> |
| | | <if test="templateID != null ">and templateID = #{templateID}</if> |
| | |
| | | <if test="prompt != null ">prompt,</if> |
| | | <if test="groupName != null ">group_name,</if> |
| | | <if test="ishide != null ">ishide,</if> |
| | | <if test="categoryid != null ">categoryid,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="taskid != null">#{taskid},</if> |
| | |
| | | <if test="prompt != null ">#{prompt},</if> |
| | | <if test="groupName != null ">#{groupName},</if> |
| | | <if test="ishide != null ">#{ishide},</if> |
| | | <if test="categoryid != null ">#{categoryid},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <if test="prompt != null">prompt = #{prompt},</if> |
| | | <if test="groupName != null ">group_name = #{groupName},</if> |
| | | <if test="ishide != null ">ishide = #{ishide},</if> |
| | | <if test="categoryid != null ">categoryid = #{categoryid},</if> |
| | | </trim> |
| | | where id = #{d} |
| | | </update> |
| | |
| | | resultMap="SvyTaskTemplateTargetoptionResult"> |
| | | <include refid="selectSvyTaskTemplateTargetoptionVo"/> |
| | | <where> |
| | | del_flag=0 |
| | | <if test="taskid != null ">and taskid = #{taskid}</if> |
| | | <if test="score != null ">and score = #{score}</if> |
| | | <if test="prompt != null ">and prompt = #{prompt}</if> |
| | |
| | | <if test="pid != null ">and pid = #{pid}</if> |
| | | <if test="guid != null and guid != ''">and guid = #{guid}</if> |
| | | <if test="scriptid != null ">and scriptid = #{scriptid}</if> |
| | | <if test="nodynamiccruxs != null ">and nodynamiccruxs = #{nodynamiccruxsJson}</if> |
| | | <if test="dynamiccruxs != null ">and dynamiccruxs = #{dynamiccruxsJson}</if> |
| | | <!-- <if test="nodynamiccruxs != null ">and nodynamiccruxs = #{nodynamiccruxsJson}</if>--> |
| | | <!-- <if test="dynamiccruxs != null ">and dynamiccruxs = #{dynamiccruxsJson}</if>--> |
| | | <if test="nextQuestion != null ">and next_question = #{nextQuestion}</if> |
| | | <if test="picturePath != null and picturePath != ''">and picture_path = #{picturePath}</if> |
| | | <if test="optionCode != null">and option_code = #{optionCode}</if> |