| | |
| | | import com.smartor.common.LSHospTokenUtil; |
| | | import com.smartor.common.LyraTokenUtil; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.domain.entity.ServiceSubtaskEntity; |
| | | import com.smartor.mapper.BaseOrganizationMapper; |
| | | import com.smartor.mapper.ServiceSubtaskMapper; |
| | | import com.smartor.service.IServiceTaskService; |
| | |
| | | iServiceTaskService.updateServiceTask(serviceTask2); |
| | | |
| | | //获取到该任务所有的服务,并从队列里删除 |
| | | ServiceSubtaskVO serviceSubtaskVO = new ServiceSubtaskVO(); |
| | | ServiceSubtaskEntity serviceSubtaskVO = new ServiceSubtaskEntity(); |
| | | serviceSubtaskVO.setTaskid(serviceTask2.getTaskid()); |
| | | serviceSubtaskVO.setSendstate(2L); |
| | | List<ServiceSubtask> serviceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskVO); |
| | |
| | | public ServiceTaskVO queryTaskByCondition(ServiceSubtask serviceSubtask) { |
| | | //定义患者与单一任务关联表集合 |
| | | List<PatTaskRelevance> patTaskRelevances = new ArrayList<>(); |
| | | ServiceSubtaskVO serviceSubtaskVO = new ServiceSubtaskVO(); |
| | | ServiceSubtaskEntity serviceSubtaskVO = new ServiceSubtaskEntity(); |
| | | serviceSubtaskVO.setTaskid(serviceSubtask.getTaskid()); |
| | | List<ServiceSubtask> selectServiceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskVO); |
| | | if (CollectionUtils.isEmpty(selectServiceSubtaskList) || selectServiceSubtaskList.size() == 0) { |
| | |
| | | serviceSubtask.setCreateTime(new Date()); |
| | | serviceSubtask.setLeavehospitaldistrictcode(serviceTaskVO.getDistrictcode()); |
| | | //先查询一遍,该taskGuid是否存在 |
| | | ServiceSubtaskVO serviceSubtaskVO = new ServiceSubtaskVO(); |
| | | ServiceSubtaskEntity serviceSubtaskVO = new ServiceSubtaskEntity(); |
| | | serviceSubtaskVO.setTaskGuid(serviceTaskVO.getTaskguid()); |
| | | List<ServiceSubtask> serviceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskVO); |
| | | if (CollectionUtils.isNotEmpty(serviceSubtaskList)) { |
| | |
| | | serviceSubtaskMapper.insertServiceSubtask(serviceSubtask); |
| | | } |
| | | Integer integer = serviceSubtask.getId().intValue(); |
| | | log.error("插入的ID是:{}", integer); |
| | | log.info("插入的ID是:{}", integer); |
| | | return integer; |
| | | } |
| | | |
| | |
| | | @Override |
| | | public Map query360PatInfo(ServiceQueryInfo serviceQueryInfo) { |
| | | if (ObjectUtils.isEmpty(serviceQueryInfo)) { |
| | | log.info("360查询条件为空"); |
| | | log.error("360查询条件为空"); |
| | | throw new BaseException("360查询条件为空"); |
| | | } |
| | | String token = LSHospTokenUtil.getToken(serviceQueryInfo.getXiaoXiTou().getFaSongJGID(),serviceQueryInfo.getUrl()); |
| | | // LyraTokenUtil lyraTokenUtil = null; |
| | | // if (serviceQueryInfo.getXiaoXiTou().getFaSongJGID().equals("47255004333112711A1001")) //景宁 |
| | | // lyraTokenUtil = LyraTokenUtil.createLyraTokenUtil("https://9.0.124.104:13021/mediinfo-lyra-authserver/connect/token", "zjhes.suifangxt", "OIjdJvx2ALjFVGZoCZO4I8O"); |
| | | // if (serviceQueryInfo.getXiaoXiTou().getFaSongJGID().equals("47231022633110211A2101")) //中医院 |
| | | // lyraTokenUtil = LyraTokenUtil.createLyraTokenUtil("https://9.0.124.104:13011/mediinfo-lyra-authserver/connect/token", "zjhes.suifangxt", "OIjdJvx2ALjFVGZoCZO4I8O"); |
| | | // |
| | | // try { |
| | | // token = lyraTokenUtil.getToken(); |
| | | // } catch (IOException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | |
| | | //用户信息,通过ZuZhiJGID去bse_organization中获取机构信息 |
| | | if (StringUtils.isBlank(serviceQueryInfo.getYeWuXX().getYongHuXX().getZuZhiJGID())) |
| | |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss"); |
| | | serviceQueryInfo.getXiaoXiTou().setFaSongSJ(simpleDateFormat.format(new Date())); |
| | | |
| | | log.error(new Gson().toJson(serviceQueryInfo)); |
| | | log.error("serviceQueryInfo的结果为:{}", serviceQueryInfo); |
| | | log.info("serviceQueryInfo的结果为:{}", serviceQueryInfo); |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | String result = null; |
| | | Map map = new HashMap(); |
| | | try { |
| | | String jsonString = objectMapper.writeValueAsString(serviceQueryInfo); |
| | | log.error("token的值为:{}", token); |
| | | log.info("token的值为:{}", token); |
| | | if (serviceQueryInfo.getXiaoXiTou().getFaSongJGID().equals("47255004333112711A1001")) { //景宁 |
| | | result = OkHttpExample.sendPostRequest("https://9.0.124.104:13021/mediinfo-grus-fuwuzxwg/api/esb/lyraSyncRun", jsonString, token); |
| | | }else if (serviceQueryInfo.getXiaoXiTou().getFaSongJGID().equals("47231022633110211A2101")) { //中医院 |