| | |
| | | package com.ruoyi.web.controller.smartor; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.github.pagehelper.ISelect; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.ruoyi.common.annotation.AddOrgId; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.constant.HttpStatus; |
| | |
| | | import com.ruoyi.quartz.task.RyTask; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.ruoyi.system.service.ISysUserDeptService; |
| | | import com.smartor.common.QwenLLMUtil; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.domain.VO.HeLibraryCountVO; |
| | | import com.smartor.domain.VO.ServiceSubtaskCotinueCountVO; |
| | |
| | | |
| | | @Value("${spring.profiles.active}") |
| | | private String active; |
| | | |
| | | @Value("${isAdmin}") |
| | | private List<Long> isAdmin; |
| | | |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | |
| | | Integer offset = PageUtils.getOffset(serviceSubtaskCountReq.getPageNum(), serviceSubtaskCountReq.getPageSize()); |
| | | serviceSubtaskCountReq.setPageNum(offset); |
| | | |
| | | Integer statisticaltype = serviceSubtaskCountReq.getStatisticaltype(); |
| | | |
| | | if(ObjectUtils.isNotEmpty(statisticaltype)){ |
| | | SysUser user = getLoginUser().getUser(); |
| | | if(!isAdmin.contains(user.getUserId())){ |
| | | if(statisticaltype==1){ |
| | | if(CollectionUtils.isEmpty(serviceSubtaskCountReq.getLeavehospitaldistrictcodes())){ |
| | | //全部病区 |
| | | String deptInfo = user.getDeptInfo(); |
| | | List<String> leavehospitaldistrictcodes = JSON.parseArray(deptInfo) |
| | | .stream() |
| | | .map(item -> (String) ((List<?>) item).get(0)).collect(Collectors.toList()); |
| | | serviceSubtaskCountReq.setLeavehospitaldistrictcodes(leavehospitaldistrictcodes); |
| | | } |
| | | }else if(statisticaltype==2){ |
| | | if(CollectionUtils.isEmpty(serviceSubtaskCountReq.getDeptcodes())){ |
| | | //全部科室 |
| | | String hospInfo = user.getHospInfo(); |
| | | List<String> deptCodes = JSON.parseArray(hospInfo) |
| | | .stream() |
| | | .map(item -> (String) ((List<?>) item).get(0)).collect(Collectors.toList()); |
| | | serviceSubtaskCountReq.setDeptcodes(deptCodes); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | String followUpCountStyle = configService.selectConfigByKey("followUpCountStyle", serviceSubtaskCountReq.getOrgid()); |
| | | if (ObjectUtils.isNotEmpty(followUpCountStyle)) { |
| | | serviceSubtaskCountReq.setFollowUpCountStyle(followUpCountStyle); |
| | |
| | | serviceSubtaskCountReq.setPageSize(null); |
| | | List<ServiceSubtaskStatistic> sfStatistics = serviceSubtaskService.getSfStatistics(serviceSubtaskCountReq); |
| | | return getDataTable4(CollectionUtils.isEmpty(sfStatistics) ? sfStatistics.size() : 0, serviceSubtaskService.getSfStatistics(serviceSubtaskCountReq)); |
| | | } |
| | | |
| | | /** |
| | | * 获取专病随访统计比例 |
| | | */ |
| | | @ApiOperation("获取专病随访统计比例") |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/getSpecialSfStatistics") |
| | | public Map<String, Object> getSpecialSfStatistics(@RequestBody ServiceSubtaskCountReq serviceSubtaskCountReq) { |
| | | if (CollectionUtils.isEmpty(serviceSubtaskCountReq.getServiceType())) { |
| | | return error("服务类型不能为空"); |
| | | } |
| | | Integer offset = PageUtils.getOffset(serviceSubtaskCountReq.getPageNum(), serviceSubtaskCountReq.getPageSize()); |
| | | serviceSubtaskCountReq.setPageNum(offset); |
| | | |
| | | String followUpCountStyle = configService.selectConfigByKey("followUpCountStyle", serviceSubtaskCountReq.getOrgid()); |
| | | if (ObjectUtils.isNotEmpty(followUpCountStyle)) { |
| | | serviceSubtaskCountReq.setFollowUpCountStyle(followUpCountStyle); |
| | | } else { |
| | | serviceSubtaskCountReq.setFollowUpCountStyle("1"); |
| | | } |
| | | serviceSubtaskCountReq.setPageNum(null); |
| | | serviceSubtaskCountReq.setPageSize(null); |
| | | List<ServiceSubtaskStatistic> sfStatistics = serviceSubtaskService.getSpecialSfStatistics(serviceSubtaskCountReq); |
| | | return getDataTable4(CollectionUtils.isEmpty(sfStatistics) ? sfStatistics.size() : 0, serviceSubtaskService.getSpecialSfStatistics(serviceSubtaskCountReq)); |
| | | } |
| | | |
| | | /** |
| | |
| | | ryTask.dealOutHospInfo(); |
| | | } |
| | | |
| | | @PostMapping("/compensateTasktest") |
| | | public void compensateTasktest(@RequestParam("subId")Long subId) { |
| | | ryTask.compensateTaskTest(subId); |
| | | } |
| | | |
| | | @PostMapping("/longTaskSendtest") |
| | | public void longTaskSendtest(@RequestParam("subId")Long subId) { |
| | | ryTask.longTaskSendTest(subId); |
| | | } |
| | | |
| | | @PostMapping("/syncMedInhospForShiyi") |
| | | public void syncMedInhospForShiyi(@RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime) { |
| | | collectHISService.syncMedInhosp(startTime, endTime); |
| | | } |
| | | |
| | | @PostMapping("/syncMedOperForShiyi") |
| | | public void syncMedOperForShiyi(@RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime) { |
| | | collectHISService.syncOper(startTime, endTime); |
| | | } |
| | | |
| | | @PostMapping("/qwenLLMTest") |
| | | public int qwenLLMTest(@RequestParam("voiceText") String questionText, @RequestParam("voiceText") String voiceText, |
| | | @RequestParam("value") String value,@RequestParam("regexText") String regexText) { |
| | | int result = ryTask.qwenLLMTest(questionText, voiceText, value, regexText); |
| | | return result; |
| | | } |
| | | } |