| | |
| | | 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); |