| | |
| | | package com.ruoyi.web.controller.smartor; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.fasterxml.jackson.databind.JsonNode; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.github.pagehelper.ISelect; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.reflect.TypeToken; |
| | |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.dx.MessageSend; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.enums.MsgLSEnum; |
| | | import com.ruoyi.common.enums.PreachFormEnum; |
| | | import com.ruoyi.common.enums.SendStateEnum; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.DtoConversionUtils; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.*; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.utils.reflect.ReflectUtils; |
| | | import com.ruoyi.quartz.service.ICollectHISService; |
| | | import com.ruoyi.quartz.task.RyTask; |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.ruoyi.system.service.ISysUserDeptService; |
| | | import com.smartor.common.LSHospTokenUtil; |
| | | import com.smartor.common.QwenLLMUtil; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.domain.VO.HeLibraryCountVO; |
| | | import com.smartor.domain.VO.ServiceSubtaskCotinueCountVO; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | |
| | | |
| | | @Value("${spring.profiles.active}") |
| | | private String active; |
| | | |
| | | @Value("${isAdmin}") |
| | | private List<Long> isAdmin; |
| | | |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | |
| | | for (ServiceSubtaskExport serviceSubtaskExport : serviceSubtaskExports) { |
| | | String pf = PreachFormEnum.getDescByCode(serviceSubtaskExport.getPreachform()); |
| | | serviceSubtaskExport.setPreachform(pf); |
| | | if(serviceSubtaskExport.getSendstate() != null) { |
| | | if (serviceSubtaskExport.getSendstate() != null) { |
| | | String stName = SendStateEnum.getDescByCode("" + serviceSubtaskExport.getSendstate()); |
| | | serviceSubtaskExport.setStName(stName); |
| | | } |
| | |
| | | |
| | | Integer statisticaltype = serviceSubtaskCountReq.getStatisticaltype(); |
| | | |
| | | if(ObjectUtils.isNotEmpty(statisticaltype)){ |
| | | if (ObjectUtils.isNotEmpty(statisticaltype)) { |
| | | SysUser user = getLoginUser().getUser(); |
| | | if(statisticaltype==1){ |
| | | if(CollectionUtils.isEmpty(serviceSubtaskCountReq.getLeavehospitaldistrictcodes())){ |
| | | //全部病区 |
| | | String deptInfo = user.getDeptInfo(); |
| | | Gson gson = new Gson(); |
| | | // 3. 定义 List 类型(核心) |
| | | TypeToken<List<String>> typeToken = new TypeToken<List<String>>() {}; |
| | | List<String> leavehospitaldistrictcodes = gson.fromJson(deptInfo, typeToken.getType()); |
| | | serviceSubtaskCountReq.setLeavehospitaldistrictcodes(leavehospitaldistrictcodes); |
| | | } |
| | | }else if(statisticaltype==2){ |
| | | if(CollectionUtils.isEmpty(serviceSubtaskCountReq.getDeptcodes())){ |
| | | //全部科室 |
| | | String hospInfo = user.getHospInfo(); |
| | | Gson gson = new Gson(); |
| | | // 3. 定义 List 类型(核心) |
| | | TypeToken<List<String>> typeToken = new TypeToken<List<String>>() {}; |
| | | List<String> deptCodes = gson.fromJson(hospInfo, typeToken.getType()); |
| | | serviceSubtaskCountReq.setDeptcodes(deptCodes); |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | return serviceSubtaskService.getHeLibraryCount(heLibraryCountVO); |
| | | } |
| | | |
| | | /** |
| | | * 手动发送问卷模板的短信功能 |
| | | * |
| | | * @param subid |
| | | * @return |
| | | */ |
| | | @GetMapping(value = "/smsSubTask/{subid}") |
| | | public Map<String, Object> smsSubTask(@PathVariable("subid") Long subid) { |
| | | return serviceSubtaskService.smsSubTask(subid); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/test") |
| | | public void test() { |
| | | 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 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; |
| | | } |
| | | } |