| | |
| | | return isSuccess; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取随访及时率 |
| | | * |
| | | * @param serviceSubtask |
| | | * @return |
| | | */ |
| | | public Map<String, Object> selectTimelyRate(ServiceSubtask serviceSubtask) { |
| | | if (serviceSubtask.getEndtime() != null && new Date().before(serviceSubtask.getEndtime())) { |
| | | serviceSubtask.setEndtime(new Date()); |
| | | } |
| | | Double dob = serviceSubtaskMapper.selectTimelyRate(serviceSubtask); |
| | | // 1. 查询全部数据(SQL不分页) |
| | | List<ServiceSubtask> allList = serviceSubtaskMapper.selectTimelyRateDetail(serviceSubtask); |
| | | // 2. Java代码分页 |
| | | int pageNum = serviceSubtask.getPn() != null ? serviceSubtask.getPn() : 1; |
| | | int pageSize = serviceSubtask.getPs() != null ? serviceSubtask.getPs() : 10; |
| | | int fromIndex = (pageNum - 1) * pageSize; |
| | | int toIndex = Math.min(fromIndex + pageSize, allList.size()); |
| | | List<ServiceSubtask> pageList = new ArrayList<>(); |
| | | if (fromIndex < allList.size()) { |
| | | pageList = allList.subList(fromIndex, toIndex); |
| | | } |
| | | log.info("代码分页参数: pageNum={}, pageSize={}, fromIndex={}, toIndex={}, total={}", pageNum, pageSize, fromIndex, toIndex, allList.size()); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("rate", dob); |
| | | map.put("detail", pageList); |
| | | map.put("total", allList.size()); // 可选:返回总数 |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> getScriptInfoByCondition(Long taskid, Long patid, Boolean isFinish, String patfrom) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | ivrLibaTemplateScriptVO.setIvrLibaScriptTargetoptionList(ivrLibaTemplateTargetoptions); |
| | | } |
| | | } |
| | | Collections.sort(ivrLibaTemplateScriptVOS, Comparator.comparingInt(IvrLibaTemplateScriptVO::getSort)); |
| | | Collections.sort(ivrLibaTemplateScriptVOS, Comparator.comparingLong(IvrLibaTemplateScriptVO::getSort)); |
| | | |
| | | return ivrLibaTemplateScriptVOS; |
| | | } |