| | |
| | | package com.ruoyi.web.controller.smartor; |
| | | |
| | | import com.github.pagehelper.ISelect; |
| | | import com.ruoyi.common.annotation.AddOrgId; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.constant.CacheConstants; |
| | | import com.ruoyi.common.constant.Constants; |
| | |
| | | * 统计随访数据 -- cache版 |
| | | */ |
| | | @ApiOperation("统计随访数据") |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/patItemCount") |
| | | public Map<String, Object> patItemCount(@RequestBody ServiceSubtaskVO serviceSubtaskVO) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | LoginUser loginUser = getLoginUser(); |
| | | SysUser user = null; |
| | | Long userId = null; |
| | | if(ObjectUtils.isNotEmpty(loginUser)){ |
| | | if (ObjectUtils.isNotEmpty(loginUser)) { |
| | | user = loginUser.getUser(); |
| | | if(ObjectUtils.isNotEmpty(user)){ |
| | | if (ObjectUtils.isNotEmpty(user)) { |
| | | userId = user.getUserId(); |
| | | } |
| | | } |
| | | if(ObjectUtils.isNotEmpty(userId)){ |
| | | if (ObjectUtils.isNotEmpty(userId)) { |
| | | redisMap = redisCache.getCacheObject(userId + "patItemCount"); |
| | | //记录是否有可用缓存 |
| | | Boolean redisFlag = false; |
| | | ServiceSubtaskVO oldCondition = null; |
| | | if(MapUtils.isNotEmpty(redisMap)){ |
| | | oldCondition = (ServiceSubtaskVO)redisMap.get("searchCondition"); |
| | | if (MapUtils.isNotEmpty(redisMap)) { |
| | | oldCondition = (ServiceSubtaskVO) redisMap.get("searchCondition"); |
| | | // 比较查询条件是否一致 |
| | | if(ObjectUtils.isNotEmpty(oldCondition) && |
| | | isSameCondition(oldCondition, serviceSubtaskVO)){ |
| | | if (ObjectUtils.isNotEmpty(oldCondition) && isSameCondition(oldCondition, serviceSubtaskVO)) { |
| | | // 条件一致,使用缓存 |
| | | redisFlag = true; |
| | | map = redisMap; |
| | |
| | | } |
| | | |
| | | // 如果没有缓存或者条件不一致,重新查询 |
| | | if(!redisFlag){ |
| | | if (!redisFlag) { |
| | | map = serviceSubtaskService.patItemCount(serviceSubtaskVO); |
| | | map.put("searchCondition", serviceSubtaskVO); |
| | | redisCache.setCacheObject(userId + "patItemCount", map, 120, TimeUnit.MINUTES); |
| | |
| | | */ |
| | | private boolean isSameCondition(ServiceSubtaskVO oldCondition, ServiceSubtaskVO newCondition) { |
| | | // 使用ReflectUtils的通用方法比较,排除分页参数等无关字段 |
| | | return ReflectUtils.equalsAllFields( |
| | | oldCondition, |
| | | newCondition, |
| | | return ReflectUtils.equalsAllFields(oldCondition, newCondition, |
| | | // 排除的字段:分页参数、序列化ID、时间戳等 |
| | | "pageNum", "pageSize", "serialVersionUID", |
| | | "createBy", "createTime", "updateBy", "updateTime", |
| | | "searchValue", "params" |
| | | ); |
| | | "pageNum", "pageSize", "serialVersionUID", "createBy", "createTime", "updateBy", "updateTime", "searchValue", "params"); |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | @ApiOperation("查询患者随访信息") |
| | | //@PreAuthorize("@ss.hasPermi('system:taskcall:list')") |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/patItemByCondition") |
| | | public TableDataInfo patItemByCondition(@RequestBody ServiceSubtaskVO serviceSubtaskVO) { |
| | | List<ServiceSubtask> serviceSubtaskList = null; |
| | |
| | | * 随访数据查询 |
| | | */ |
| | | @Log(title = "随访数据查询", businessType = BusinessType.EXPORT) |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/querySubtaskList") |
| | | public AjaxResult querySubtaskList(@RequestBody ServiceSubtaskVO serviceSubtaskVO) { |
| | | PageUtils.startPageByPost(serviceSubtaskVO.getPageNum(), serviceSubtaskVO.getPageSize()); |
| | |
| | | * 根据疾病模糊查询 |
| | | */ |
| | | //@PreAuthorize("@ss.hasPermi('system:taskcall:query')") |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping(value = "/getSubtaskByDiagname") |
| | | public Map<String, Object> getSubtaskByDiagname(@RequestBody ServiceSubtask serviceSubtask) { |
| | | LoginUser loginUser = getLoginUser(); |
| | |
| | | * 随访历史记录导出 |
| | | */ |
| | | @Log(title = "随访历史记录导出", businessType = BusinessType.EXPORT) |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/getSubtaskByDiagnameExport") |
| | | public void getSubtaskByDiagnameExport(HttpServletResponse response, ServiceSubtask serviceSubtask) { |
| | | LoginUser loginUser = getLoginUser(); |
| | |
| | | serviceSubtask.setPageNum(PageUtils.getOffset(serviceSubtask.getPageNum(), serviceSubtask.getPageSize())); |
| | | List<ServiceSubtask> subtaskList = serviceSubtaskService.selectServiceSubtaskByDiagname(serviceSubtask); |
| | | List<ServiceSubtaskDiagname> serviceSubtaskDiagnameList = new ArrayList<>(); |
| | | if (CollectionUtils.isNotEmpty(subtaskList)) serviceSubtaskDiagnameList = serviceSubtaskService.convertToDiagnameList(subtaskList); |
| | | if (CollectionUtils.isNotEmpty(subtaskList)) |
| | | serviceSubtaskDiagnameList = serviceSubtaskService.convertToDiagnameList(subtaskList); |
| | | ExcelUtil<ServiceSubtaskDiagname> util = new ExcelUtil<ServiceSubtaskDiagname>(ServiceSubtaskDiagname.class); |
| | | |
| | | if (active.equals("ls") || active.equals("druid")) { |
| | |
| | | @ApiOperation("新增或修改删除单一任务") |
| | | //@PreAuthorize("@ss.hasPermi('system:task:add')") |
| | | @Log(title = "单一任务(随访)", businessType = BusinessType.INSERT) |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/insertOrUpdateTask") |
| | | public AjaxResult insertOrUpdateHeTask(@RequestBody ServiceTaskVO ivrTaskVO) { |
| | | log.info("insertOrUpdateHeTask的入参为:{}", ivrTaskVO); |
| | |
| | | } |
| | | |
| | | @ApiOperation("修改子任务") |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/update") |
| | | public AjaxResult update(@RequestBody ServiceSubtask serviceSubtask) { |
| | | serviceSubtask.setUpdateBy(getLoginUser().getUser().getNickName()); |
| | |
| | | } |
| | | |
| | | @ApiOperation("新增子任务") |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/addSubTask") |
| | | public AjaxResult addSubTask(@RequestBody ServiceSubtask serviceSubtask) { |
| | | SysUser user = getLoginUser().getUser(); |
| | |
| | | } |
| | | |
| | | @ApiOperation("患者再次随访") |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/addSubTaskAgain") |
| | | public AjaxResult addSubTaskAgain(@RequestBody ServiceSubtask serviceSubtask) { |
| | | SysUser user = getLoginUser().getUser(); |
| | |
| | | * 根据条件查询任务信息 |
| | | */ |
| | | @ApiOperation("根据条件查询任务信息") |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/queryTaskByCondition") |
| | | public AjaxResult queryTaskByCondition(@RequestBody ServiceSubtaskVO ivrTaskcallVO) { |
| | | //根据入参查询信息 |
| | |
| | | * 获取每个月的随访、复诊量 |
| | | */ |
| | | @ApiOperation("获取每个月的随访、复诊量") |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/getSfFzInfoEveryMonth") |
| | | public TableDataInfo getSfFzInfoEveryMonth(@RequestBody ServiceSubtaskCountReq serviceSubtaskCountReq) { |
| | | return getDataTable(serviceSubtaskService.getSfFzInfoEveryMonth(serviceSubtaskCountReq)); |
| | |
| | | * 获取随访统计比例 |
| | | */ |
| | | @ApiOperation("获取随访统计比例") |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/getSfStatistics") |
| | | public AjaxResult getSfStatistics(@RequestBody ServiceSubtaskCountReq serviceSubtaskCountReq) { |
| | | if (CollectionUtils.isEmpty(serviceSubtaskCountReq.getServiceType())) { |
| | |
| | | * 获取随访统计比例 |
| | | */ |
| | | @ApiOperation("获取随访满意度统计") |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/getSfStatisticsJoy") |
| | | public Map<String, Object> getSfStatisticsJoy(@RequestBody ServiceSubtaskCountReq serviceSubtaskCountReq) { |
| | | if (CollectionUtils.isEmpty(serviceSubtaskCountReq.getServiceType())) { |
| | |
| | | * 随访统计导出 |
| | | */ |
| | | @ApiOperation("服务统计查询-按时间维度统计出院/门诊随访数据") |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/getServiceStatistics") |
| | | public AjaxResult getServiceStatistics(@RequestBody ServiceStatisticsRequest serviceStatisticsRequest) { |
| | | SysUser user = getLoginUser().getUser(); |
| | |
| | | * 获取随访统计比例 |
| | | */ |
| | | @ApiOperation("获取随访满意度明细") |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/getSfStatisticsJoydetails") |
| | | public AjaxResult getSfStatisticsJoydetails(@RequestBody ServiceSubtaskCountReq serviceSubtaskCountReq) { |
| | | if (serviceSubtaskCountReq.getLeavehospitaldistrictcodes().size() == 0 && serviceSubtaskCountReq.getDeptcodes().size() == 0) { |
| | |
| | | * 获取随访分类统计明细 |
| | | */ |
| | | @ApiOperation("获取随访分类统计明细") |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/getSfStatisticsCount") |
| | | public Map<String, Object> getSfStatisticsCount(@RequestBody ServiceSubtaskCountReq serviceSubtaskCountReq) { |
| | | if (CollectionUtils.isEmpty(serviceSubtaskCountReq.getServiceType())) { |
| | |
| | | PageUtils.startPageByPost(serviceSubtaskCountReq.getPageNum(), serviceSubtaskCountReq.getPageSize()); |
| | | |
| | | String configKey = serviceSubtaskCountReq.getConfigKey(); |
| | | if(StringUtils.isNotEmpty(configKey)){ |
| | | if (StringUtils.isNotEmpty(configKey)) { |
| | | String configValue = configService.selectConfigByKey(configKey); |
| | | serviceSubtaskCountReq.setConfigValue(configValue); |
| | | if(StringUtils.isEmpty(configValue)){ |
| | | String logInfo = "getSfStatisticsCount-参数 " + configKey + " 未配置, 请配置好后重试"; |
| | | if (StringUtils.isEmpty(configValue)) { |
| | | String logInfo = "getSfStatisticsCount-参数 " + configKey + " 未配置, 请配置好后重试"; |
| | | log.error(logInfo); |
| | | return error(logInfo); |
| | | } |
| | | }else { |
| | | String logInfo = "getSfStatisticsCount-参数configKey未传入, 请配置好后重试"; |
| | | } else { |
| | | String logInfo = "getSfStatisticsCount-参数configKey未传入, 请配置好后重试"; |
| | | log.error(logInfo); |
| | | return error(logInfo); |
| | | } |
| | |
| | | } |
| | | |
| | | @ApiOperation("获取随访分类统计明细详情") |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/getSfStatisticsCountDetails") |
| | | public AjaxResult getSfStatisticsCountDetails(@RequestBody ServiceSubtaskCountReq serviceSubtaskCountReq) { |
| | | if (serviceSubtaskCountReq.getLeavehospitaldistrictcodes().size() == 0 && serviceSubtaskCountReq.getDeptcodes().size() == 0) { |
| | |
| | | PageUtils.startPageByPost(serviceSubtaskCountReq.getPageNum(), serviceSubtaskCountReq.getPageSize()); |
| | | //复诊统计 |
| | | String configKey = serviceSubtaskCountReq.getConfigKey(); |
| | | if(StringUtils.isNotEmpty(configKey)){ |
| | | if (StringUtils.isNotEmpty(configKey)) { |
| | | String configValue = configService.selectConfigByKey(configKey); |
| | | if(StringUtils.isEmpty(configValue)){ |
| | | String logInfo = "getSfStatisticsCountDetails-参数 " + configKey + " 未配置, 请配置好后重试"; |
| | | if (StringUtils.isEmpty(configValue)) { |
| | | String logInfo = "getSfStatisticsCountDetails-参数 " + configKey + " 未配置, 请配置好后重试"; |
| | | log.error(logInfo); |
| | | return error(logInfo); |
| | | } |
| | | serviceSubtaskCountReq.setConfigValue(configValue); |
| | | }else { |
| | | String logInfo = "getSfStatisticsCountDetails-参数configKey未传入, 请配置好后重试"; |
| | | } else { |
| | | String logInfo = "getSfStatisticsCountDetails-参数configKey未传入, 请配置好后重试"; |
| | | log.error(logInfo); |
| | | return error(logInfo); |
| | | } |