| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | @Autowired |
| | | private IServiceSubtaskRecordService serviceSubtaskRecordService; |
| | | |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | |
| | | @Value("${spring.profiles.active}") |
| | | private String active; |
| | | |
| | |
| | | */ |
| | | @ApiOperation("查询患者随访信息") |
| | | //@PreAuthorize("@ss.hasPermi('system:taskcall:list')") |
| | | // @Cacheable(value = "patItem", key = "T(org.springframework.util.DigestUtils).md5DigestAsHex(#serviceSubtaskVO.toString().getBytes())", unless = "#result == null or #result.isEmpty()") |
| | | @PostMapping("/patItem") |
| | | public TableDataInfo patItem(@RequestBody ServiceSubtaskVO serviceSubtaskVO) { |
| | | PageUtils.startPageByPost(serviceSubtaskVO.getPageNum(), serviceSubtaskVO.getPageSize()); |
| | |
| | | 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") |
| | |
| | | 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); |
| | |
| | | ExcelUtil<ServiceSubtaskDiagname> util = new ExcelUtil<ServiceSubtaskDiagname>(ServiceSubtaskDiagname.class); |
| | | |
| | | if (active.equals("ls") || active.equals("druid")) { |
| | | util.exportExcel(response, serviceSubtaskDiagnameList, LocalDate.now().getMonthValue() + "随访统计导出"); |
| | | util.exportExcel(response, serviceSubtaskDiagnameList, LocalDate.now().getMonthValue() + "随访历史记录导出"); |
| | | } else { |
| | | util.exportExcel(response, serviceSubtaskDiagnameList, "随访统计导出"); |
| | | util.exportExcel(response, serviceSubtaskDiagnameList, "随访历史记录导出"); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 随访统计导出 |
| | | * 随访历史记录导出 |
| | | */ |
| | | //@PreAuthorize("@ss.hasPermi('system:taskcall:export')") |
| | | @Log(title = "随访统计导出", businessType = BusinessType.EXPORT) |
| | |
| | | return success(serviceSubtaskService.getSfStatisticsJoydetails(serviceSubtaskCountReq)); |
| | | } |
| | | |
| | | /** |
| | | * 获取随访分类统计明细 |
| | | */ |
| | | @ApiOperation("获取随访分类统计明细") |
| | | @PostMapping("/getSfStatisticsCount") |
| | | public Map<String, Object> getSfStatisticsCount(@RequestBody ServiceSubtaskCountReq serviceSubtaskCountReq) { |
| | | if (CollectionUtils.isEmpty(serviceSubtaskCountReq.getServiceType())) { |
| | | return error("服务类型不能为空"); |
| | | } |
| | | PageUtils.startPageByPost(serviceSubtaskCountReq.getPageNum(), serviceSubtaskCountReq.getPageSize()); |
| | | |
| | | String configKey = serviceSubtaskCountReq.getConfigKey(); |
| | | if(StringUtils.isNotEmpty(configKey)){ |
| | | String configValue = configService.selectConfigByKey(configKey); |
| | | serviceSubtaskCountReq.setConfigValue(configValue); |
| | | if(StringUtils.isEmpty(configValue)){ |
| | | String logInfo = "getSfStatisticsCount-参数 " + configKey + " 未配置, 请配置好后重试"; |
| | | log.error(logInfo); |
| | | return error(logInfo); |
| | | } |
| | | }else { |
| | | String logInfo = "getSfStatisticsCount-参数configKey未传入, 请配置好后重试"; |
| | | log.error(logInfo); |
| | | return error(logInfo); |
| | | } |
| | | return success(serviceSubtaskService.getSfStatisticsScript(serviceSubtaskCountReq)); |
| | | } |
| | | |
| | | @ApiOperation("获取随访分类统计明细详情") |
| | | @PostMapping("/getSfStatisticsCountDetails") |
| | | public AjaxResult getSfStatisticsCountDetails(@RequestBody ServiceSubtaskCountReq serviceSubtaskCountReq) { |
| | | if (serviceSubtaskCountReq.getLeavehospitaldistrictcodes().size() == 0 && serviceSubtaskCountReq.getDeptcodes().size() == 0) { |
| | | return error("科室或病区不能为空"); |
| | | } |
| | | PageUtils.startPageByPost(serviceSubtaskCountReq.getPageNum(), serviceSubtaskCountReq.getPageSize()); |
| | | //复诊统计 |
| | | 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)); |
| | | } |
| | | |
| | | /** |
| | | * 发送短信模板 |