| | |
| | | package com.smartor.service.impl; |
| | | |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.enums.HospTypeEnum; |
| | | import com.ruoyi.common.enums.ServiceTaskTypeEnum; |
| | | import com.ruoyi.common.enums.TaskTypeEnum; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.*; |
| | | import com.ruoyi.common.utils.http.HttpEntity; |
| | | import com.ruoyi.common.utils.http.HttpUtils; |
| | | import com.smartor.common.LSHospTokenUtil; |
| | | import com.smartor.common.LyraTokenUtil; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.mapper.BaseOrganizationMapper; |
| | | import com.smartor.mapper.ServiceSubtaskMapper; |
| | | import com.smartor.service.IServiceTaskService; |
| | | import com.smartor.service.ISvyTaskSingleService; |
| | | import com.sun.org.apache.bcel.internal.generic.NEW; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import okhttp3.OkHttpClient; |
| | | import okhttp3.Request; |
| | | import okhttp3.Response; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | if (StringUtils.isNotEmpty(serviceTaskVO.getServicetype())) |
| | | type = ServiceTaskTypeEnum.getDescByCode(serviceTaskVO.getServicetype()); |
| | | serviceSubtask.setServiceType(type); |
| | | String tasktype = "-1"; |
| | | if (StringUtils.isNotEmpty(serviceTaskVO.getTasktype())) |
| | | tasktype = TaskTypeEnum.getDescByCode(serviceTaskVO.getTasktype()); |
| | | serviceSubtask.setType(tasktype); |
| | | //第三方传过来的,直接统一定为问卷 |
| | | serviceSubtask.setType("2"); |
| | | serviceSubtask.setLabelstatus(serviceTaskVO.getTaskstate()); |
| | | serviceSubtask.setTaskName(serviceTaskVO.getTaskname()); |
| | | serviceSubtask.setTaskDesc(serviceTaskVO.getTaskdesc()); |
| | | serviceSubtask.setPreachform(serviceTaskVO.getExemode()); |
| | | //第三方传过来的,直接统一定为"人工" |
| | | serviceSubtask.setPreachform("1"); |
| | | serviceSubtask.setCreateBy(serviceTaskVO.getCreateBy()); |
| | | serviceSubtask.setCreateTime(serviceTaskVO.getCreateTime()); |
| | | serviceSubtask.setOperatorNo(serviceTaskVO.getOperatorno()); |
| | |
| | | log.info("360查询条件为空"); |
| | | throw new BaseException("360查询条件为空"); |
| | | } |
| | | String token = null; |
| | | |
| | | LyraTokenUtil lyraTokenUtil = LyraTokenUtil.createLyraTokenUtil("https://9.0.124.104:13021/mediinfo-lyra-authserver/connect/token", "zjhes.suifangxt", "OIjdJvx2ALjFVGZoCZO4I8O"); |
| | | try { |
| | | token = lyraTokenUtil.getToken(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | String token = LSHospTokenUtil.getToken(serviceQueryInfo.getXiaoXiTou().getFaSongJGID()); |
| | | // 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())) |
| | |
| | | try { |
| | | String jsonString = objectMapper.writeValueAsString(serviceQueryInfo); |
| | | log.error("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); |
| | | if (serviceQueryInfo.getXiaoXiTou().getFaSongJGID().equals("47231022633110211A2101")) //中医院 |
| | | result = OkHttpExample.sendPostRequest("https://9.0.124.104:13011/mediinfo-grus-fuwuzxwg/api/esb/lyraSyncRun", jsonString, token); |
| | | map = objectMapper.readValue(result, Map.class); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |