1.新增省立同德延续随访统计
2.给数据库连接加超时时间
| | |
| | | package com.ruoyi.web.controller.smartor; |
| | | |
| | | import com.github.pagehelper.ISelect; |
| | | import com.github.pagehelper.Page; |
| | | import com.ruoyi.common.annotation.AddOrgId; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.constant.CacheConstants; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.constant.HttpStatus; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.utils.reflect.ReflectUtils; |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.ruoyi.system.service.ISysUserDeptService; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.domain.VO.ServiceSubtaskCotinueCountVO; |
| | | import com.smartor.domain.VO.ServiceSubtaskVO; |
| | | import com.smartor.domain.entity.ServiceSubtaskEntity; |
| | | import com.smartor.mapper.PatMedInhospMapper; |
| | | import com.smartor.mapper.PatMedOuthospMapper; |
| | | import com.smartor.service.IServiceSubtaskRecordService; |
| | | import com.smartor.service.IServiceSubtaskService; |
| | | import com.smartor.service.IServiceTaskService; |
| | | import com.smartor.service.impl.ServiceSubtaskServiceImpl; |
| | | import com.sun.org.apache.bcel.internal.generic.NEW; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import net.bytebuddy.implementation.bytecode.Throw; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.text.DecimalFormat; |
| | | import java.time.LocalDate; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | |
| | | @PostMapping("/getSfStatisticsExport") |
| | | public void export(HttpServletResponse response, ServiceSubtaskCountReq serviceSubtaskCountReq) { |
| | | List<ServiceSubtaskStatistic> sfStatistics = serviceSubtaskService.getSfStatisticsExport(serviceSubtaskCountReq); |
| | | |
| | | ExcelUtil<ServiceSubtaskStatistic> util = new ExcelUtil<ServiceSubtaskStatistic>(ServiceSubtaskStatistic.class); |
| | | |
| | | String sheetName = ""; |
| | | String fileName = ""; |
| | | if (active.equals("ls") || active.equals("druid")) { |
| | |
| | | } |
| | | return success(serviceSubtaskService.getSfStatisticsJoydetails(serviceSubtaskCountReq)); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * å»¶ç»æ¤çç»è®¡ |
| | | */ |
| | | @ApiOperation("å»¶ç»æ¤çç»è®¡") |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/getContinueNerseCount") |
| | | public AjaxResult getContinueNerseCount(@RequestBody ServiceSubtaskCotinueCountVO serviceSubtaskCotinueCountVO) { |
| | | SysUser user = getLoginUser().getUser(); |
| | | serviceSubtaskCotinueCountVO.setOrgid(user.getOrgid()); |
| | | serviceSubtaskCotinueCountVO.setCampusid(user.getCampusid()); |
| | | boolean hasDistrict = !CollectionUtils.isEmpty(serviceSubtaskCotinueCountVO.getLeavehospitaldistrictcodes()); |
| | | boolean hasDept = !CollectionUtils.isEmpty(serviceSubtaskCotinueCountVO.getDeptcodes()); |
| | | if (hasDistrict && hasDept) { |
| | | return error("ç
åºCodeéåä¸ç§å®¤Codeéåäºæ¥ï¼ä¸è½åæ¶ä¼ å
¥"); |
| | | } |
| | | return success(serviceSubtaskService.getContinueNurseCount(serviceSubtaskCotinueCountVO)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * è·åé访åç±»ç»è®¡æç» |
| | |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | # username: smartor |
| | | # password: Smartor.2023 |
| | | # driverClassName: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://9.209.1.5:2883/smartor-lisui?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | url: jdbc:mysql://9.209.1.5:2883/smartor-lisui?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&connectTimeout=60000&socketTimeout=120000 |
| | | username: root@sfxx#other_cluster02 |
| | | password: Y5oapyS8 |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | |
| | | # ä¸»åºæ°æ®æº |
| | | master: |
| | | # çç«åå¾· |
| | | url: jdbc:mysql://192.88.117.237:3306/smartor_sltd?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | url: jdbc:mysql://192.88.117.237:3306/smartor_sltd?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&connectTimeout=60000&socketTimeout=120000 |
| | | username: root |
| | | password: Smartor.2023 |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | |
| | | # ä¸»åºæ°æ®æº |
| | | master: |
| | | # æ°å |
| | | url: jdbc:mysql://192.168.191.181:3308/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | url: jdbc:mysql://192.168.191.181:3308/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&connectTimeout=60000&socketTimeout=120000 |
| | | username: smartor |
| | | password: Smartor.2023 |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | |
| | | //2夿ä¸ä¸ï¼å½åçsortæ¯ä¸æ¯çäºéè¦æ§è¡çæ»ä¸ªæ°ï¼å¦æçäºçè¯ï¼è¯´ææ¯æåä¸ä¸ªï¼ç´æ¥å°servuce_subtaskçç¶ææ¹æ5ï¼æ§è¡å¤±è´¥å°±è¡äº |
| | | Long cs = currentSort.get(); |
| | | if (cs.equals(serviceSubtaskPreachforms.size())) { |
| | | if(serviceSubtask.getPreachform().equals("1")){ |
| | | if (serviceSubtask.getPreachform().equals("1")) { |
| | | serviceSubtask.setSendstate(7L); |
| | | serviceSubtask.setRemark("å¤çè¡¥å¿ä»»å¡,å½åå¤çæåè¡¥å¿ äººå·¥è¶
æ¶"); |
| | | }else { |
| | | } else { |
| | | serviceSubtask.setSendstate(5L); |
| | | serviceSubtask.setRemark("å¤çè¡¥å¿ä»»å¡,å½åå¤çæåè¡¥å¿ï¼å
¨é¨æ§è¡å¤±è´¥"); |
| | | } |
| | | |
| | | serviceSubtaskMapper.updateServiceSubtask(serviceSubtask); |
| | | //ä¿®æ¹åéæ¹å¼çç¶æä¸ºå¤±è´¥ |
| | | if(serviceSubtaskPreachform.getPreachform().equals("1")){ |
| | | if (serviceSubtaskPreachform.getPreachform().equals("1")) { |
| | | serviceSubtaskPreachform.setSendstate("7"); |
| | | serviceSubtaskPreachform.setId(id.get()); |
| | | }else { |
| | | } else { |
| | | serviceSubtaskPreachform.setSendstate("5"); |
| | | serviceSubtaskPreachform.setId(id.get()); |
| | | } |
| | |
| | | log.error("getSendPreachformæ¹æ³ æ£æ¥æ¯å¦ææsendstateä¸çäº9, å
¨å¤±è´¥äº"); |
| | | serviceSubtask.setRemark("ææåéæ¹å¼åæªè·åç»æï¼ä»»å¡å¤±è´¥"); |
| | | //人工åéè¶
æ¶ |
| | | if(ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("1")){ |
| | | if (ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("1")) { |
| | | serviceSubtask.setSendstate(7L); |
| | | serviceSubtask.setRemark("人工åéè¶
æ¶"); |
| | | } |
| | |
| | | subtaskPreachform.setSendstate("5"); |
| | | subtaskPreachform.setId(id.get()); |
| | | //人工åéè¶
æ¶ |
| | | if(ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("1")){ |
| | | if (ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("1")) { |
| | | subtaskPreachform.setSendstate("7"); |
| | | subtaskPreachform.setRemark("人工åéè¶
æ¶"); |
| | | } |
| | |
| | | if (failSendstate.equals("2")) serviceSubtaskPreachform1.setSendstate("9"); |
| | | } |
| | | serviceSubtaskPreachform1.setRemark(remark); |
| | | if(ObjectUtils.isNotEmpty(preachform) && preachform.equals("1")){ |
| | | if (ObjectUtils.isNotEmpty(preachform) && preachform.equals("1")) { |
| | | serviceSubtaskPreachform1.setSendstate("7"); |
| | | serviceSubtaskPreachform1.setRemark("人工åéè¶
æ¶"); |
| | | } |
| | |
| | | |
| | | //妿å½åçpreachformå·²ç»æ¯æåä¸ä¸ªäºï¼é£ç´æ¥å°serviceSubtaskçsendstateç¶ææ¹æ5å°±è¡äº(å
¨å¤±è´¥äº) |
| | | if (serviceSubtaskPreachform1.getSort() == sspCount.size()) { |
| | | if(ObjectUtils.isNotEmpty(preachform) && preachform.equals("1")){ |
| | | if (ObjectUtils.isNotEmpty(preachform) && preachform.equals("1")) { |
| | | serviceSubtask.setCurrentPreachform(preachform); |
| | | serviceSubtask.setSendstate(7L); |
| | | serviceSubtask.setRemark("人工åéè¶
æ¶"); |
| | | serviceSubtaskMapper.updateServiceSubtask(serviceSubtask); |
| | | return true; |
| | | }else { |
| | | } else { |
| | | if (failSendstate.equals("4") || failSendstate.equals("5")) { |
| | | serviceSubtask.setCurrentPreachform(preachform); |
| | | serviceSubtask.setSendstate(5L); |
| | | log.error("setSuccessPreachFormæ¹æ³ï¼å½åçpreachformå·²ç»æ¯æåä¸ä¸ªäºï¼å
¨é¨æ§è¡å¤±è´¥"); |
| | | serviceSubtask.setRemark("ææåéæ¹å¼åæªè·åç»æï¼ä»»å¡å¤±è´¥"); |
| | | //serviceSubtask.setRemark("setSuccessPreachFormæ¹æ³ï¼å½åçpreachformå·²ç»æ¯æåä¸ä¸ªäºï¼å
¨é¨æ§è¡å¤±è´¥"); |
| | | serviceSubtaskMapper.updateServiceSubtask(serviceSubtask); |
| | | return true; |
| | |
| | | //å°ä¸ä¸æ¬¡çé访æ¶é´ä¸å½åæ§è¡æ¹å¼è®°å½ä¸ä¸ |
| | | serviceSubtask.setVisitTime(getNextVisitTime(serviceSubtask.getId(), serviceSubtask.getTaskid(), serviceSubtask.getVisitTime())); |
| | | serviceSubtask.setCurrentPreachform(preachform); |
| | | if(ObjectUtils.isNotEmpty(preachform) && preachform.equals("1")){ |
| | | if (ObjectUtils.isNotEmpty(preachform) && preachform.equals("1")) { |
| | | serviceSubtask.setSendstate(7L); |
| | | serviceSubtask.setRemark("人工åéè¶
æ¶"); |
| | | }else { |
| | | } else { |
| | | serviceSubtask.setSendstate(3L); |
| | | } |
| | | if (serviceSubtask.getType().equals("3") || serviceSubtask.getType().equals("4")) { |
| | |
| | | @ApiModelProperty(value = "å¼å¸¸é¢è¦ï¼0绿è²ï¼1红è²ï¼2é»è²; 3å·²å¤ç") |
| | | private Integer isabnormal; |
| | | |
| | | @ApiModelProperty(value = "ç»§ç»æ è¯") |
| | | @ApiModelProperty(value = "ç»§ç»æ è¯:1å¦ 2æ¯") |
| | | private Integer continueFlag; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.domain.VO; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å»¶ç»æ¤çç»è®¡è¯·æ± |
| | | * |
| | | * @author ls |
| | | * @date 2026-04-11 |
| | | */ |
| | | @ApiModel(value = "ServiceSubtaskCotinueCountVO", description = "å»¶ç»æ¤çç»è®¡è¯·æ±") |
| | | @Data |
| | | public class ServiceSubtaskCotinueCountVO { |
| | | |
| | | @ApiModelProperty(value = "ç
åºCodeéå") |
| | | private List<String> leavehospitaldistrictcodes; |
| | | |
| | | @ApiModelProperty(value = "ç§å®¤Codeéå") |
| | | private List<String> deptcodes; |
| | | |
| | | @ApiModelProperty("æºæç¼ç ") |
| | | private String orgid; |
| | | |
| | | @ApiModelProperty("é¢åºç¼ç ") |
| | | private String campusid; |
| | | |
| | | } |
| | |
| | | |
| | | import com.smartor.domain.*; |
| | | import com.smartor.domain.VO.PatSatisfactionReqVO; |
| | | import com.smartor.domain.VO.ServiceSubtaskCotinueCountVO; |
| | | import com.smartor.domain.entity.ServiceSubtaskEntity; |
| | | import com.smartor.domain.entity.ServiceSubtaskSatisfactionEntity; |
| | | import org.apache.ibatis.annotations.MapKey; |
| | |
| | | |
| | | List<Long> querySendCount(ServiceSubtaskSatisfactionEntity serviceSubtaskSatisfactionEntity); |
| | | |
| | | /** |
| | | * æç
åºåç»ç»è®¡å»¶ç»æ¤çæ°é |
| | | * |
| | | * @param vo æ¥è¯¢æ¡ä»¶ |
| | | * @return æ¯ä¸ªç
åºçç»è®¡ç»æ |
| | | */ |
| | | List<Map<String, Object>> getContinueNurseCount(ServiceSubtaskCotinueCountVO vo); |
| | | |
| | | /** |
| | | * æç§å®¤åç»ç»è®¡å»¶ç»æ¤çæ°é |
| | | * |
| | | * @param vo æ¥è¯¢æ¡ä»¶ |
| | | * @return æ¯ä¸ªç§å®¤çç»è®¡ç»æ |
| | | */ |
| | | List<Map<String, Object>> getContinueNurseCountByDept(ServiceSubtaskCotinueCountVO vo); |
| | | |
| | | } |
| | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.domain.ServiceSubtask; |
| | | import com.smartor.domain.VO.ServiceSubtaskCotinueCountVO; |
| | | import com.smartor.domain.entity.ServiceSubtaskEntity; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | |
| | | public List<ServiceSubtaskDiagname> convertToDiagnameList(List<ServiceSubtask> subtaskList) ; |
| | | |
| | | public Map<String, Object> getCurrentUserServiceSubtaskCount(ServiceSubtaskEntity entity); |
| | | |
| | | /** |
| | | * æç
åºæç§å®¤ç»è®¡å»¶ç»æ¤çæ°é |
| | | * é½ä¸ä¼ æ¶åæ¶æç
åºåç§å®¤åç»è®¡ä¸é |
| | | * |
| | | * @param vo æ¥è¯¢æ¡ä»¶ï¼leavehospitaldistrictcodes ä¸ deptcodes äºæ¥ï¼ |
| | | * @return noContinueCountãContinueCount å detail å表 |
| | | */ |
| | | Map<String, Object> getContinueNurseCount(ServiceSubtaskCotinueCountVO vo); |
| | | } |
| | |
| | | public PatMedRes selectPatMedInhospListCount(PatMedReq patMedReq) { |
| | | PatMedRes patMedRes = null; |
| | | // è·åå½åç»é人çé¨é¨æé |
| | | if (org.springframework.util.CollectionUtils.isEmpty(patMedReq.getDeptcodeList())) { |
| | | // Long userId = SecurityUtils.getUserId(); |
| | | // List<SysDept> sysDepts = sysUserDeptMapper.selectDeptListByUserId(userId); |
| | | // List<String> deptCode = new ArrayList<>(); |
| | | // for (SysDept sysDept : sysDepts) { |
| | | // deptCode.add(sysDept.getDeptId().toString()); |
| | | // } |
| | | // patMedReq.setDeptcodeList(deptCode); |
| | | // patMedRes = patMedInhospMapper.selectPatMedInhospCount(patMedReq); |
| | | } |
| | | patMedRes = patMedInhospMapper.selectPatMedInhospCount(patMedReq); |
| | | return patMedRes; |
| | | } |
| | |
| | | |
| | | /** |
| | | * å¤ç»´åº¦é访 |
| | | * |
| | | * @param config |
| | | * @return |
| | | */ |
| | |
| | | * æç»´åº¦æ¾å°ææå¹é
é¿æä»»å¡ï¼æ¹éçæ subtask |
| | | * type: 1=ç§å®¤, 2=ç
åº, 3=ç¾ç
|
| | | */ |
| | | private void processTasksByDimension(PatMedInhosp patMedInhosp1, |
| | | PatArchive patArchive, |
| | | String config, int type) { |
| | | private void processTasksByDimension(PatMedInhosp patMedInhosp1, PatArchive patArchive, String config, int type) { |
| | | List<Long> matchedTaskIds = findMatchingTaskIds(patMedInhosp1, type); |
| | | |
| | | if (CollectionUtils.isEmpty(matchedTaskIds)) { |
| | | String reason = getDimensionReason(type); |
| | | markFlagAsNoConfig(patMedInhosp1, type, reason); |
| | | String reason = getDimensionReason(type); |
| | | markFlagAsNoConfig(patMedInhosp1, type, reason); |
| | | return; |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | private String getDimensionReason(int type){ |
| | | private String getDimensionReason(int type) { |
| | | switch (type) { |
| | | case 1: { // ç§å®¤ |
| | | return "æªæ¾å°ç§å®¤å¹é
çé¿æä»»å¡"; |
| | | } |
| | | } |
| | | case 2: { // ç
åº |
| | | return "æªæ¾å°ç
åºå¹é
çé¿æä»»å¡"; |
| | | } |
| | |
| | | return "å¤ç»´é¿æä»»å¡-å¹é
ç±»å为空"; |
| | | } |
| | | |
| | | private void markFlagAsNoConfig(PatMedInhosp patMedInhosp, |
| | | int type, |
| | | String reason){ |
| | | private void markFlagAsNoConfig(PatMedInhosp patMedInhosp, int type, String reason) { |
| | | switch (type) { |
| | | case 1: { // ç§å®¤ |
| | | patMedInhosp.setDeptcheckFlag("2"); |
| | |
| | | |
| | | } |
| | | |
| | | private void markAllFlagsAsError(PatMedInhosp patMedInhosp, |
| | | String reason){ |
| | | private void markAllFlagsAsError(PatMedInhosp patMedInhosp, String reason) { |
| | | patMedInhosp.setDeptcheckFlag("2"); |
| | | patMedInhosp.setWardcheckFlag("2"); |
| | | patMedInhosp.setDiagcheckFlag("2"); |
| | | patMedInhosp.setRemark(reason); |
| | | patMedInhospMapper.updatePatMedInhosp(patMedInhosp); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç»´åº¦ç±»åæ¥è¯¢å¹é
çé¿æä»»å¡ ID å表 |
| | | */ |
| | |
| | | query.setDeptCode(patMedInhosp1.getLeaveldeptcode()); |
| | | query.setDeptType("1"); |
| | | query.setOrgid(patMedInhosp1.getOrgid()); |
| | | return serviceTaskdeptMapper.selectServiceTaskdeptList(query) |
| | | .stream().map(ServiceTaskdept::getTaskId).collect(Collectors.toList()); |
| | | return serviceTaskdeptMapper.selectServiceTaskdeptList(query).stream().map(ServiceTaskdept::getTaskId).collect(Collectors.toList()); |
| | | } |
| | | case 2: { // ç
åº |
| | | ServiceTaskdept query = new ServiceTaskdept(); |
| | |
| | | query.setDeptCode(patMedInhosp1.getLeavehospitaldistrictcode()); |
| | | query.setDeptType("2"); |
| | | query.setOrgid(patMedInhosp1.getOrgid()); |
| | | return serviceTaskdeptMapper.selectServiceTaskdeptList(query) |
| | | .stream().map(ServiceTaskdept::getTaskId).collect(Collectors.toList()); |
| | | return serviceTaskdeptMapper.selectServiceTaskdeptList(query).stream().map(ServiceTaskdept::getTaskId).collect(Collectors.toList()); |
| | | } |
| | | case 3: { // ç¾ç
|
| | | if (StringUtils.isEmpty(patMedInhosp1.getLeaveicd10code())) return Collections.emptyList(); |
| | |
| | | query.setLongtask(1L); |
| | | query.setIcd10code(patMedInhosp1.getLeaveicd10code()); |
| | | query.setOrgid(patMedInhosp1.getOrgid()); |
| | | return serviceTaskdiagMapper.selectServiceTaskdiagList(query) |
| | | .stream().map(ServiceTaskdiag::getTaskId).collect(Collectors.toList()); |
| | | return serviceTaskdiagMapper.selectServiceTaskdiagList(query).stream().map(ServiceTaskdiag::getTaskId).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | return Collections.emptyList(); |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param taskid ä»»å¡id |
| | | * @param check æ¯å¦éè¦æ ¡éª |
| | | * @param taskid ä»»å¡id |
| | | * @param check æ¯å¦éè¦æ ¡éª |
| | | * @param patMedInhosp1 ç
人åºå
¥é¢ä¿¡æ¯ |
| | | * @param patArchive ç
äººä¿¡æ¯ |
| | | * @param type é访类å(1-ç§å®¤ï¼2-ç
åºï¼3-ç¾ç
ï¼ |
| | | * @param config é
ç½®ä¿¡æ¯ visit.early.day |
| | | * @param patArchive ç
äººä¿¡æ¯ |
| | | * @param type é访类å(1-ç§å®¤ï¼2-ç
åºï¼3-ç¾ç
ï¼ |
| | | * @param config é
ç½®ä¿¡æ¯ visit.early.day |
| | | */ |
| | | //å°æ£è
æ¾å°subtaskä¸ |
| | | private void writeInSubTask(Long taskid, Boolean check, PatMedInhosp patMedInhosp1, PatArchive patArchive, Integer type, String config) { |
| | |
| | | } |
| | | //æ¯å® åºé¢é¦æ¬¡ï¼7天ï¼é访ä¸å®è¦å |
| | | boolean firstVisit = false; |
| | | if (serviceSubtask1.getOrgid().equals("47255004333112711A1001") |
| | | && serviceSubtask1.getVisitCount() != null && serviceSubtask1.getVisitCount() == 1) { |
| | | if (serviceSubtask1.getOrgid().equals("47255004333112711A1001") && serviceSubtask1.getVisitCount() != null && serviceSubtask1.getVisitCount() == 1) { |
| | | firstVisit = true; |
| | | } |
| | | if (!firstVisit) { |
| | |
| | | import com.smartor.common.FtpService; |
| | | import com.smartor.config.PhoneUtils; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.domain.VO.ServiceSubtaskCotinueCountVO; |
| | | import com.smartor.domain.entity.ServiceSubtaskEntity; |
| | | import com.smartor.mapper.*; |
| | | import com.smartor.service.*; |
| | |
| | | // if (existSize > 0) return pullTaskVOList; |
| | | int count = 0; |
| | | long size = listOps.size("cache-0"); |
| | | log.error("---------æçµè¯ä¹åç¼åä¸çæ°æ®éï¼{}", size); |
| | | log.info("---------æçµè¯ä¹åç¼åä¸çæ°æ®éï¼{}", size); |
| | | if (size > 0) { |
| | | //phoneCount() éè¿ç»åºçæ¯ä¸ªå°æ¶éè¦æåºççµè¯éï¼ç®åºå°æä¸8ç¹ä¸ç¹è½æåºå¤å°ä¸ªçµè¯ï¼è·åå°æ»é |
| | | //妿éè¦ç«å³æ§è¡çæ°æ®é大äºä¸å¤©è¦æ§è¡çä¸éï¼ååªåä¸éçæ°éï¼å
¶å®çåæ¾åredisä¸ |
| | |
| | | } |
| | | } |
| | | // if (existList.size() != 0) redisCache.setCacheListRight("cache-exist", existList); |
| | | log.error("-----------å®é
æåççµè¯æ°æ®éï¼{}", CollectionUtils.isNotEmpty(pullTaskVOList) ? pullTaskVOList.size() : null); |
| | | log.info("-----------å®é
æåççµè¯æ°æ®éï¼{}", CollectionUtils.isNotEmpty(pullTaskVOList) ? pullTaskVOList.size() : null); |
| | | return pullTaskVOList; |
| | | } |
| | | |
| | |
| | | if (serviceSubtaskPreachform1.getSort() == spSize.size() && failSendstate.equals("4")) { |
| | | serviceSubtask.setCurrentPreachform(preachform); |
| | | serviceSubtask.setSendstate(5L); |
| | | // serviceSubtask.setRemark("setFailPreachFormæ¹æ³ å½åçpreachformå·²ç»æ¯æåä¸ä¸ªäºï¼å
¨å¤±è´¥äº"); |
| | | serviceSubtask.setRemark("ææåéæ¹å¼åæªè·åç»æï¼ä»»å¡å¤±è´¥"); |
| | | serviceSubtaskMapper.updateServiceSubtask(serviceSubtask); |
| | | return true; |
| | | } |
| | |
| | | public Map<String, Object> getCurrentUserServiceSubtaskCount(ServiceSubtaskEntity entity) { |
| | | return serviceSubtaskMapper.getCurrentUserServiceSubtaskCount(entity); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> getContinueNurseCount(ServiceSubtaskCotinueCountVO vo) { |
| | | boolean hasDistrict = !CollectionUtils.isEmpty(vo.getLeavehospitaldistrictcodes()); |
| | | boolean hasDept = !CollectionUtils.isEmpty(vo.getDeptcodes()); |
| | | |
| | | List<Map<String, Object>> districtRows; |
| | | List<Map<String, Object>> deptRows; |
| | | |
| | | if (hasDistrict) { |
| | | // åªä¼ äºç
åºï¼ä»
æç
åºç»´åº¦ç»è®¡ |
| | | districtRows = serviceSubtaskMapper.getContinueNurseCount(vo); |
| | | deptRows = Collections.emptyList(); |
| | | } else if (hasDept) { |
| | | // åªä¼ äºç§å®¤ï¼ä»
æç§å®¤ç»´åº¦ç»è®¡ |
| | | districtRows = Collections.emptyList(); |
| | | deptRows = serviceSubtaskMapper.getContinueNurseCountByDept(vo); |
| | | } else { |
| | | // 齿ªä¼ ï¼ç
åºåç§å®¤åç»è®¡ä¸é |
| | | districtRows = serviceSubtaskMapper.getContinueNurseCount(vo); |
| | | deptRows = serviceSubtaskMapper.getContinueNurseCountByDept(vo); |
| | | } |
| | | |
| | | long totalNoContinue = 0L; |
| | | long totalContinue = 0L; |
| | | List<Map<String, Object>> detail = new ArrayList<>(); |
| | | |
| | | for (Map<String, Object> row : districtRows) { |
| | | String groupName = row.get("groupName") == null |
| | | ? (row.get("groupCode") == null ? "" : row.get("groupCode").toString()) |
| | | : row.get("groupName").toString(); |
| | | long noCnt = row.get("noContinueCnt") == null ? 0L : Long.parseLong(row.get("noContinueCnt").toString()); |
| | | long yesCnt = row.get("continueCnt") == null ? 0L : Long.parseLong(row.get("continueCnt").toString()); |
| | | totalNoContinue += noCnt; |
| | | totalContinue += yesCnt; |
| | | Map<String, Object> item = new LinkedHashMap<>(); |
| | | item.put("æªå»¶ç»_" + groupName, noCnt); |
| | | item.put("已延ç»_"+groupName, yesCnt); |
| | | detail.add(item); |
| | | } |
| | | |
| | | for (Map<String, Object> row : deptRows) { |
| | | String groupName = row.get("groupName") == null |
| | | ? (row.get("groupCode") == null ? "" : row.get("groupCode").toString()) |
| | | : row.get("groupName").toString(); |
| | | long noCnt = row.get("noContinueCnt") == null ? 0L : Long.parseLong(row.get("noContinueCnt").toString()); |
| | | long yesCnt = row.get("continueCnt") == null ? 0L : Long.parseLong(row.get("continueCnt").toString()); |
| | | totalNoContinue += noCnt; |
| | | totalContinue += yesCnt; |
| | | Map<String, Object> item = new LinkedHashMap<>(); |
| | | item.put("æªå»¶ç»_" + groupName, noCnt); |
| | | item.put("已延ç»_" + groupName, yesCnt); |
| | | detail.add(item); |
| | | } |
| | | |
| | | Map<String, Object> result = new LinkedHashMap<>(); |
| | | result.put("æªå»¶ç»æ»æ°é", totalNoContinue); |
| | | result.put("å·²å»¶ç»æ»æ°é", totalContinue); |
| | | result.put("详æ
", detail); |
| | | return result; |
| | | } |
| | | } |
| | |
| | | |
| | | <select id="selectPatMedInhospCount" parameterType="com.smartor.domain.PatMedReq" |
| | | resultType="com.smartor.domain.PatMedRes"> |
| | | SELECT SUM( rs ) AS rs, |
| | | SUM( rc ) AS rc, |
| | | SUM( scsf ) AS scsf, |
| | | SUM( zcsf ) AS zcsf, |
| | | SUM( zbsf ) AS zbsf |
| | | SELECT SUM(rc) AS rc, |
| | | SUM(rs) AS rs, |
| | | SUM(scsf) AS scsf, |
| | | SUM(zcsf) AS zcsf, |
| | | SUM(zbsf) AS zbsf |
| | | FROM ( |
| | | <!-- åºé¢äººæ¬¡--> |
| | | SELECT |
| | | COUNT(1) AS rc, |
| | | 0 AS rs, |
| | | 0 AS scsf, |
| | | 0 AS zcsf, |
| | | 0 AS zbsf |
| | | FROM |
| | | pat_med_inhosp |
| | | JOIN |
| | | pat_archive ON pat_archive.id = pat_med_inhosp.patid |
| | | where 1=1 |
| | | and pat_med_inhosp.del_flag=0 |
| | | <if test="orgid != null and orgid != ''"> |
| | | and pat_med_inhosp.orgid = #{orgid} |
| | | </if> |
| | | AND pat_archive.idcardno IS NOT NULL |
| | | <if test="zy != null"> |
| | | and pat_med_inhosp.inhospstate=0 |
| | | and date_format(pat_med_inhosp.starttime,'%y%m%d') >= date_format(#{startDate},'%y%m%d') |
| | | and date_format(pat_med_inhosp.starttime,'%y%m%d') <= date_format(#{endDate},'%y%m%d') |
| | | <if test="deptcodeList != null and deptcodeList.size() > 0"> |
| | | and pat_med_inhosp.deptcode in |
| | | <!-- åºé¢äººæ¬¡ï¼å»æ date_format å
è£
ï¼ä½¿æ¥æå段索å¼çæ --> |
| | | SELECT |
| | | COUNT(1) AS rc, |
| | | 0 AS rs, |
| | | 0 AS scsf, |
| | | 0 AS zcsf, |
| | | 0 AS zbsf |
| | | FROM pat_med_inhosp |
| | | JOIN pat_archive ON pat_archive.id = pat_med_inhosp.patid |
| | | WHERE pat_med_inhosp.del_flag = 0 |
| | | <if test="orgid != null and orgid != ''"> |
| | | AND pat_med_inhosp.orgid = #{orgid} |
| | | </if> |
| | | AND pat_archive.idcardno IS NOT NULL |
| | | <if test="zy != null"> |
| | | AND pat_med_inhosp.inhospstate = 0 |
| | | AND pat_med_inhosp.starttime >= #{startDate} |
| | | AND pat_med_inhosp.starttime < DATE_ADD(#{endDate}, INTERVAL 1 DAY) |
| | | <if test="deptcodeList != null and deptcodeList.size() > 0"> |
| | | AND pat_med_inhosp.deptcode IN |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | </if> |
| | | <if test="cy != null"> |
| | | AND pat_med_inhosp.inhospstate = 1 |
| | | AND pat_med_inhosp.endtime >= #{startDate} |
| | | AND pat_med_inhosp.endtime < DATE_ADD(#{endDate}, INTERVAL 1 DAY) |
| | | <if test="deptcodeList != null and deptcodeList.size() > 0"> |
| | | AND pat_med_inhosp.leaveldeptcode IN |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | </if> |
| | | UNION ALL |
| | | <!-- é访æå¡/馿¬¡/忬¡/ä¸ç
é访ï¼åå¹¶ä¸ºåæ¬¡æ«æï¼ç¨æ¡ä»¶èå代æ¿4个 UNION ALL --> |
| | | SELECT |
| | | 0 AS rc, |
| | | COUNT(1) AS rs, |
| | | SUM(CASE WHEN service_type = 2 AND visit_count = 1 THEN 1 ELSE 0 END) AS scsf, |
| | | SUM(CASE WHEN service_type = 2 AND visit_count > 1 THEN 1 ELSE 0 END) AS zcsf, |
| | | SUM(CASE WHEN service_type = 13 THEN 1 ELSE 0 END) AS zbsf |
| | | FROM service_subtask |
| | | WHERE del_flag = 0 |
| | | AND service_type IN (2, 13) |
| | | <if test="orgid != null and orgid != ''"> |
| | | AND orgid = #{orgid} |
| | | </if> |
| | | <if test="startDate != null"> |
| | | AND visit_time >= #{startDate} |
| | | </if> |
| | | <if test="endDate != null"> |
| | | AND visit_time < DATE_ADD(#{endDate}, INTERVAL 1 DAY) |
| | | </if> |
| | | <if test="deptcodeList != null and deptcodeList.size() > 0"> |
| | | AND deptcode IN |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | </if> |
| | | <if test="cy != null"> |
| | | and pat_med_inhosp.inhospstate=1 |
| | | and date_format(pat_med_inhosp.endtime,'%y%m%d') >= date_format(#{startDate},'%y%m%d') |
| | | and date_format(pat_med_inhosp.endtime,'%y%m%d') <= date_format(#{endDate},'%y%m%d') |
| | | <if test="deptcodeList != null and deptcodeList.size() > 0"> |
| | | and pat_med_inhosp.leaveldeptcode in |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | </if> |
| | | <!-- é访æå¡äººæ° --> |
| | | union all |
| | | select |
| | | 0 AS rc, |
| | | count(1) AS rs, |
| | | 0 AS scsf, |
| | | 0 AS zcsf, |
| | | 0 AS zbsf |
| | | FROM |
| | | service_subtask |
| | | where 1=1 |
| | | and del_flag = 0 |
| | | and service_type=2 |
| | | <if test="orgid != null and orgid != ''"> |
| | | and orgid = #{orgid} |
| | | </if> |
| | | <if test="startDate != null"> |
| | | AND date_format( visit_time, '%y%m%d' ) >= date_format( #{startDate}, '%y%m%d' ) |
| | | </if> |
| | | <if test="endDate != null"> |
| | | AND date_format( visit_time, '%y%m%d' ) <= date_format(#{endDate},'%y%m%d') |
| | | </if> |
| | | <if test="deptcodeList != null and deptcodeList.size() > 0"> |
| | | and deptcode in |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | <!-- 馿¬¡éè®¿äººæ° --> |
| | | union all |
| | | select |
| | | 0 AS rc, |
| | | 0 AS rs, |
| | | count(1) AS scsf, |
| | | 0 AS zcsf, |
| | | 0 AS zbsf |
| | | FROM |
| | | service_subtask |
| | | where 1=1 |
| | | and del_flag = 0 |
| | | and service_type=2 |
| | | and visit_count is not null |
| | | and visit_count = 1 |
| | | <if test="orgid != null and orgid != ''"> |
| | | and orgid = #{orgid} |
| | | </if> |
| | | <if test="startDate != null"> |
| | | AND date_format( visit_time, '%y%m%d' ) >= date_format( #{startDate}, '%y%m%d' ) |
| | | </if> |
| | | <if test="endDate != null"> |
| | | AND date_format( visit_time, '%y%m%d' ) <= date_format(#{endDate},'%y%m%d') |
| | | </if> |
| | | <if test="deptcodeList != null and deptcodeList.size() > 0"> |
| | | and deptcode in |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | <!-- 忬¡éè®¿äººæ° --> |
| | | union all |
| | | select |
| | | 0 AS rc, |
| | | 0 AS rs, |
| | | 0 AS scsf, |
| | | count(1) AS zcsf, |
| | | 0 AS zbsf |
| | | FROM |
| | | service_subtask |
| | | where 1=1 |
| | | and del_flag = 0 |
| | | and service_type=2 |
| | | and visit_count is not null |
| | | and visit_count > 1 |
| | | <if test="orgid != null and orgid != ''"> |
| | | and orgid = #{orgid} |
| | | </if> |
| | | <if test="startDate != null"> |
| | | AND date_format( visit_time, '%y%m%d' ) >= date_format( #{startDate}, '%y%m%d' ) |
| | | </if> |
| | | <if test="endDate != null"> |
| | | AND date_format( visit_time, '%y%m%d' ) <= date_format(#{endDate},'%y%m%d') |
| | | </if> |
| | | <if test="deptcodeList != null and deptcodeList.size() > 0"> |
| | | and deptcode in |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | <!-- ä¸ç
éè®¿äººæ° --> |
| | | union all |
| | | select |
| | | 0 AS rc, |
| | | 0 AS rs, |
| | | 0 AS scsf, |
| | | 0 AS zcsf, |
| | | count(1) AS zbsf |
| | | FROM |
| | | service_subtask |
| | | where 1=1 |
| | | and del_flag = 0 |
| | | and service_type=13 |
| | | <if test="orgid != null and orgid != ''"> |
| | | and orgid = #{orgid} |
| | | </if> |
| | | <if test="startDate != null"> |
| | | AND date_format( visit_time, '%y%m%d' ) >= date_format( #{startDate}, '%y%m%d' ) |
| | | </if> |
| | | <if test="endDate != null"> |
| | | AND date_format( visit_time, '%y%m%d' ) <= date_format(#{endDate},'%y%m%d') |
| | | </if> |
| | | <if test="deptcodeList != null and deptcodeList.size() > 0"> |
| | | and deptcode in |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | ) AS combined_data |
| | | </select> |
| | | |
| | |
| | | <select id="selectServiceSubtaskList" parameterType="com.smartor.domain.entity.ServiceSubtaskEntity" |
| | | resultMap="ServiceSubtaskResult"> |
| | | <include refid="selectServiceSubtaskVo"/> |
| | | where del_flag = 0 |
| | | where del_flag = 0 |
| | | <if test="continueFlag != null ">and continue_flag = #{continueFlag}</if> |
| | | <if test="continueTimeNow != null ">and continue_time_now = #{continueTimeNow,jdbcType=TIMESTAMP}</if> |
| | | <if test="continueCount != null ">and continue_count = #{continueCount}</if> |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <!-- |
| | | æç
åºæç§å®¤åç»ç»è®¡ continue_flag æ°é |
| | | ä¼ äº leavehospitaldistrictcodes â æç
åºç»´åº¦ |
| | | ä¼ äº deptcodes â æç§å®¤ç»´åº¦ |
| | | é½ä¸ä¼ â æç
åºç»´åº¦ç»è®¡å
¨é |
| | | --> |
| | | <!-- æç
åºåç»ç»è®¡å»¶ç»æ¤çæ°é --> |
| | | <select id="getContinueNurseCount" |
| | | parameterType="com.smartor.domain.VO.ServiceSubtaskCotinueCountVO" |
| | | resultType="java.util.Map"> |
| | | SELECT |
| | | leavehospitaldistrictcode AS groupCode, |
| | | leavehospitaldistrictname AS groupName, |
| | | SUM(CASE WHEN continue_flag = 1 THEN 1 ELSE 0 END) AS noContinueCnt, |
| | | SUM(CASE WHEN continue_flag = 2 THEN 1 ELSE 0 END) AS continueCnt |
| | | FROM service_subtask |
| | | WHERE del_flag = 0 |
| | | AND continue_flag IN (1, 2) |
| | | AND leavehospitaldistrictcode IS NOT NULL AND leavehospitaldistrictcode != '' |
| | | <if test="orgid != null and orgid != ''"> |
| | | AND orgid = #{orgid} |
| | | </if> |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> |
| | | AND leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="code" open="(" separator="," close=")"> |
| | | #{code} |
| | | </foreach> |
| | | </if> |
| | | GROUP BY leavehospitaldistrictcode, leavehospitaldistrictname |
| | | ORDER BY groupCode |
| | | </select> |
| | | |
| | | <!-- æç§å®¤åç»ç»è®¡å»¶ç»æ¤çæ°é --> |
| | | <select id="getContinueNurseCountByDept" |
| | | parameterType="com.smartor.domain.VO.ServiceSubtaskCotinueCountVO" |
| | | resultType="java.util.Map"> |
| | | SELECT |
| | | deptcode AS groupCode, |
| | | deptname AS groupName, |
| | | SUM(CASE WHEN continue_flag = 1 THEN 1 ELSE 0 END) AS noContinueCnt, |
| | | SUM(CASE WHEN continue_flag = 2 THEN 1 ELSE 0 END) AS continueCnt |
| | | FROM service_subtask |
| | | WHERE del_flag = 0 |
| | | AND continue_flag IN (1, 2) |
| | | AND deptcode IS NOT NULL AND deptcode != '' |
| | | <if test="orgid != null and orgid != ''"> |
| | | AND orgid = #{orgid} |
| | | </if> |
| | | <if test="deptcodes != null and deptcodes.size() > 0"> |
| | | AND deptcode IN |
| | | <foreach collection="deptcodes" item="code" open="(" separator="," close=")"> |
| | | #{code} |
| | | </foreach> |
| | | </if> |
| | | GROUP BY deptcode, deptname |
| | | ORDER BY groupCode |
| | | </select> |
| | | |
| | | </mapper> |