| | |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.DtoConversionUtils; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | 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.service.ISysConfigService; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.mapper.PatMedInhospMapper; |
| | | import com.smartor.mapper.PatMedOuthospMapper; |
| | |
| | | @Autowired |
| | | private IServiceSubtaskRecordService serviceSubtaskRecordService; |
| | | |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | |
| | | @Value("${spring.profiles.active}") |
| | | private String active; |
| | | |
| | |
| | | if (ObjectUtils.isNotEmpty(serviceTask)) serviceSubtask.setPreachform(serviceTask.getPreachform()); |
| | | } |
| | | |
| | | /** |
| | | * 代码优化 分离统计 |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("serviceSubtaskList", serviceSubtaskList); |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | list.add(map); |
| | | **/ |
| | | //Map<String, Object> map = serviceSubtaskService.patItemCount(serviceSubtaskVO); |
| | | //patItemCount 调用redisCache记录统计数据 |
| | | Map<String, Object> map = patItemCount(serviceSubtaskVO); |
| | | // patItemCount 调用redisCache记录统计数据 |
| | | // Map<String, Object> map = patItemCount(serviceSubtaskVO); |
| | | Map<String, Object> map = serviceSubtaskService.patItemCount(serviceSubtaskVO); |
| | | map.put("serviceSubtaskList", serviceSubtaskList); |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | list.add(map); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 统计随访数据 |
| | | * 统计随访数据 -- cache版 |
| | | */ |
| | | @ApiOperation("统计随访数据") |
| | | @PostMapping("/patItemCount") |
| | |
| | | Boolean redisFlag = false; |
| | | ServiceSubtaskVO oldCondition = null; |
| | | if(MapUtils.isNotEmpty(redisMap)){ |
| | | oldCondition = (ServiceSubtaskVO)redisMap.get(userId + "searchCondition"); |
| | | oldCondition = (ServiceSubtaskVO)redisMap.get("searchCondition"); |
| | | // 比较查询条件是否一致 |
| | | if(ObjectUtils.isNotEmpty(oldCondition) && |
| | | isSameCondition(oldCondition, serviceSubtaskVO)){ |
| | |
| | | // 如果没有缓存或者条件不一致,重新查询 |
| | | if(!redisFlag){ |
| | | map = serviceSubtaskService.patItemCount(serviceSubtaskVO); |
| | | map.put(userId + "searchCondition", serviceSubtaskVO); |
| | | map.put("searchCondition", serviceSubtaskVO); |
| | | redisCache.setCacheObject(userId + "patItemCount", map, 120, TimeUnit.MINUTES); |
| | | } |
| | | } |
| | |
| | | serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString()); |
| | | serviceSubtask.setServiceSubtaskRecordList(serviceSubtaskRecordService.selectServiceSubtaskRecordList(serviceSubtaskRecord)); |
| | | } |
| | | //todo 代码优化 |
| | | // patItemCount 调用redisCache记录统计数据 |
| | | // Map<String, Object> map = patItemCount(serviceSubtaskVO); |
| | | Map<String, Object> map = serviceSubtaskService.patItemCount(serviceSubtaskVO); |
| | | // Map<String, Object> map = patItemCount(serviceSubtaskVO); |
| | | |
| | | map.put("serviceSubtaskList", serviceSubtaskList); |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | list.add(map); |
| | |
| | | return success(serviceSubtaskService.getSfStatisticsJoydetails(serviceSubtaskCountReq)); |
| | | } |
| | | |
| | | @ApiOperation("获取随访分类统计明细") |
| | | @PostMapping("/getSfStatisticsCountDetails") |
| | | public AjaxResult getSfStatisticsCountDetails(@RequestBody ServiceSubtaskCountReq serviceSubtaskCountReq) { |
| | | if (serviceSubtaskCountReq.getLeavehospitaldistrictcodes().size() == 0 && serviceSubtaskCountReq.getDeptcodes().size() == 0) { |
| | | return error("科室或病区不能为空"); |
| | | } |
| | | //复诊统计 |
| | | String configKey = serviceSubtaskCountReq.getConfigKey(); |
| | | if(StringUtils.isNotEmpty(configKey)){ |
| | | String configValue = configService.selectConfigByKey(configKey); |
| | | if(StringUtils.isEmpty(configValue)){ |
| | | String logInfo = "getSfStatisticsCountDetails-参数 " + configKey + " 未配置, 请配置好后重试"; |
| | | log.error(logInfo); |
| | | return error(logInfo); |
| | | } |
| | | serviceSubtaskCountReq.setConfigValue(configValue); |
| | | }else { |
| | | String logInfo = "getSfStatisticsCountDetails-参数configKey未传入, 请配置好后重试"; |
| | | log.error(logInfo); |
| | | return error(logInfo); |
| | | } |
| | | |
| | | LoginUser loginUser = getLoginUser(); |
| | | String orgid = loginUser.getUser().getOrgid(); |
| | | serviceSubtaskCountReq.setOrgid(orgid); |
| | | return success(serviceSubtaskService.getSfStatisticsScriptDetails(serviceSubtaskCountReq)); |
| | | } |
| | | |
| | | /** |
| | | * 发送短信模板 |