| | |
| | | import com.ruoyi.common.enums.WxGZHEnum; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.HttpUtil; |
| | | import com.ruoyi.common.utils.OkHttpExample; |
| | | import com.ruoyi.common.utils.RSAPublicKeyExample; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.http.HttpUtils; |
| | | import com.smartor.common.LSHospTokenUtil; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.mapper.PatArchiveMapper; |
| | | import com.smartor.mapper.ServiceSubtaskMapper; |
| | |
| | | import org.springframework.data.redis.listener.RedisMessageListenerContainer; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.IOException; |
| | | import java.security.MessageDigest; |
| | | import java.util.*; |
| | | import java.util.concurrent.ExecutorService; |
| | |
| | | } else if (visitHosp == 2) { |
| | | //丽水ççä¿¡åéæ¹å¼ |
| | | String address = MsgLSEnum.getAddressByCode(serviceSubtask.getOrgid()); |
| | | String token = LSHospTokenUtil.getToken(serviceSubtask.getOrgid()); |
| | | log.error("-----------tokençå¼ä¸ºï¼{}",token); |
| | | if (StringUtils.isEmpty(address)) { |
| | | ServiceSubtask ss = new ServiceSubtask(); |
| | | ss.setResult("error"); |
| | |
| | | continue; |
| | | } |
| | | log.error("---------mq丽水çä¿¡åéå
¥åaddressï¼{}, sendMagParam:{}, orgid:{}-------", address, sendMagParam, serviceSubtask.getOrgid()); |
| | | String dxCode = getDXCode(address, sendMagParam.getPhone(), sendMagParam.getContent(), "", "", MsgLSEnum.getHeaderByCode(serviceSubtask.getOrgid())); |
| | | String dxCode = getDXCode(address, sendMagParam.getPhone(), sendMagParam.getContent(), "", "", MsgLSEnum.getHeaderByCode(serviceSubtask.getOrgid()),token); |
| | | log.error("---------丽水çä¿¡åéç»æï¼{}-------", dxCode); |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | Map<String, Object> textParam = objectMapper.readValue(dxCode, Map.class); |
| | |
| | | } |
| | | |
| | | |
| | | private String getDXCode(String address, String ShouJiHM, String FaSongNR, String FaSongRID, String FaSongRXM, Map<String, Object> headerMap) { |
| | | private String getDXCode(String address, String ShouJiHM, String FaSongNR, String FaSongRID, String FaSongRXM, Map<String, Object> headerMap,String token) { |
| | | Map<String, Object> map = new LinkedHashMap<>(); |
| | | |
| | | Map<String, Object> YeWuXX = new LinkedHashMap<>(); |
| | |
| | | |
| | | String body = new Gson().toJson(map); |
| | | |
| | | String result = HttpUtils.sendPost(address, body); |
| | | // String result = HttpUtils.sendPost(address, body); |
| | | String result = null; |
| | | try { |
| | | result = OkHttpExample.sendPostRequest(address, body, token); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | log.error("--------resultçå¼ä¸ºï¼{}-----", result); |
| | | |
| | | JSONObject jsonObject = JSONObject.parseObject(result); |
| | |
| | | import com.ruoyi.common.enums.WxGZHEnum; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.HttpUtil; |
| | | import com.ruoyi.common.utils.OkHttpExample; |
| | | import com.ruoyi.common.utils.RSAPublicKeyExample; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.http.HttpUtils; |
| | | import com.smartor.common.LSHospTokenUtil; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.mapper.ServiceSubtaskMapper; |
| | | import com.smartor.mapper.ServiceTaskMapper; |
| | |
| | | } else if (visitHosp == 2) { |
| | | //丽水ççä¿¡åéæ¹å¼ |
| | | String address = MsgLSEnum.getAddressByCode(serviceSubtask.getOrgid()); |
| | | String token = LSHospTokenUtil.getToken(serviceSubtask.getOrgid()); |
| | | if (StringUtils.isEmpty(address)) { |
| | | ServiceSubtask ss = new ServiceSubtask(); |
| | | ss.setResult("error"); |
| | |
| | | continue; |
| | | } |
| | | log.error("---------丽水çä¿¡åéå
¥åaddressï¼{}, sendMagParam:{}, orgid:{}-------", address,sendMagParam,serviceSubtask.getOrgid()); |
| | | String dxCode = getDXCode(address, sendMagParam.getPhone(), sendMagParam.getContent(), "", "", MsgLSEnum.getHeaderByCode(serviceSubtask.getOrgid())); |
| | | String dxCode = getDXCode(address, sendMagParam.getPhone(), sendMagParam.getContent(), "", "", MsgLSEnum.getHeaderByCode(serviceSubtask.getOrgid()),token); |
| | | log.error("---------丽水çä¿¡åéç»æï¼{}-------", dxCode); |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | Map<String, Object> textParam = objectMapper.readValue(dxCode, Map.class); |
| | |
| | | return key; |
| | | } |
| | | |
| | | private String getDXCode(String address, String ShouJiHM, String FaSongNR, String FaSongRID, String FaSongRXM, Map<String, Object> headerMap) { |
| | | private String getDXCode(String address, String ShouJiHM, String FaSongNR, String FaSongRID, String FaSongRXM, Map<String, Object> headerMap,String token) { |
| | | Map<String, Object> map = new LinkedHashMap<>(); |
| | | |
| | | Map<String, Object> YeWuXX = new LinkedHashMap<>(); |
| | |
| | | |
| | | String body = new Gson().toJson(map); |
| | | |
| | | String result = HttpUtils.sendPost(address, body); |
| | | // String result = HttpUtils.sendPost(address, body); |
| | | String result = null; |
| | | try { |
| | | result = OkHttpExample.sendPostRequest(address, body, token); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | log.error("--------resultçå¼ä¸ºï¼{}-----", result); |
| | | |
| | | JSONObject jsonObject = JSONObject.parseObject(result); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.common; |
| | | |
| | | import java.io.IOException; |
| | | |
| | | public class LSHospTokenUtil { |
| | | public static String getToken(String orgid) { |
| | | String token = null; |
| | | LyraTokenUtil lyraTokenUtil = null; |
| | | if (orgid.equals("47255004333112711A1001")) //æ¯å® |
| | | lyraTokenUtil = LyraTokenUtil.createLyraTokenUtil("https://9.0.124.104:13021/mediinfo-lyra-authserver/connect/token", "zjhes.suifangxt", "OIjdJvx2ALjFVGZoCZO4I8O"); |
| | | if (orgid.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(); |
| | | } |
| | | return token; |
| | | } |
| | | |
| | | } |
| | |
| | | log.error("selectPatQuesTionResultçå
¥å为ï¼{}", serviceSubTaskQueryReq); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | |
| | | //è·åæ¬æ¬¡çé®çç»æ |
| | | Map<String, Object> scriptInfoByCondition = serviceTaskService.getScriptInfoByCondition(serviceSubTaskQueryReq.getTaskid(), serviceSubTaskQueryReq.getPatid(), serviceSubTaskQueryReq.getIsFinish(), serviceSubTaskQueryReq.getPatfrom()); |
| | | map = getMap(scriptInfoByCondition, serviceSubTaskQueryReq.getSubId(), serviceSubTaskQueryReq.getPatid()); |
| | | |
| | | //è·å䏿¬¡çé®çç»æ |
| | | ServiceSubtask serviceSubtask = serviceSubtaskMapper.selectServiceSubtaskById(serviceSubTaskQueryReq.getSubId()); |
| | | if (ObjectUtils.isNotEmpty(serviceSubtask) && serviceSubtask.getUpid() != null) { |
| | | Map<String, Object> scriptInfoByCondition2 = serviceTaskService.getScriptInfoByCondition(serviceSubTaskQueryReq.getTaskid(), serviceSubTaskQueryReq.getPatid(), serviceSubTaskQueryReq.getIsFinish(), serviceSubTaskQueryReq.getPatfrom()); |
| | | Map<String, Object> map1 = getMap(scriptInfoByCondition2, Long.valueOf(serviceSubtask.getUpid()), serviceSubTaskQueryReq.getPatid()); |
| | | if (!map1.isEmpty()) { |
| | | map.put("upScriptResult", map1.get("scriptResult")); |
| | | map.put("upTaskName", map1.get("taskName")); |
| | | } |
| | | } |
| | | |
| | | return map; |
| | | } |
| | | |
| | | |
| | | private Map<String, Object> getMap(Map<String, Object> scriptInfoByCondition, Long subid, Long patid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if (ObjectUtils.isNotEmpty(scriptInfoByCondition) && ObjectUtils.isNotEmpty(scriptInfoByCondition.get("script"))) { |
| | | log.error("-----------scriptInfoByConditionçå¼ä¸ºï¼{}", scriptInfoByCondition); |
| | | if (scriptInfoByCondition.get("type").equals("1")) { |
| | | List<IvrLibaTemplateScriptVO> ivrLibaTemplateScriptVOList = (List) scriptInfoByCondition.get("script"); |
| | | for (IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO : ivrLibaTemplateScriptVOList) { |
| | | Map<String, String> scriptResult = getScriptResult(serviceSubTaskQueryReq.getSubId(), serviceSubTaskQueryReq.getPatid(), ivrLibaTemplateScriptVO.getId()); |
| | | Map<String, String> scriptResult = getScriptResult(subid, patid, ivrLibaTemplateScriptVO.getId()); |
| | | if (ObjectUtils.isNotEmpty(scriptResult)) { |
| | | ivrLibaTemplateScriptVO.setScriptResult(scriptResult.get("asrtext")); |
| | | ivrLibaTemplateScriptVO.setScriptResultId(scriptResult.get("asrtextId")); |
| | |
| | | } |
| | | map.put("scriptResult", ivrLibaTemplateScriptVOList); |
| | | map.put("taskName", scriptInfoByCondition.get("taskName")); |
| | | return map; |
| | | } else if (scriptInfoByCondition.get("type").equals("2")) { |
| | | List<SvyLibTemplateScriptVO> svyLibTemplateScriptVOList = (List) scriptInfoByCondition.get("script"); |
| | | for (SvyLibTemplateScriptVO svyLibTemplateScriptVO : svyLibTemplateScriptVOList) { |
| | | Map<String, String> scriptResult = getScriptResult(serviceSubTaskQueryReq.getSubId(), serviceSubTaskQueryReq.getPatid(), svyLibTemplateScriptVO.getId()); |
| | | Map<String, String> scriptResult = getScriptResult(subid, patid, svyLibTemplateScriptVO.getId()); |
| | | if (ObjectUtils.isNotEmpty(scriptResult)) { |
| | | if (StringUtils.isNotEmpty(scriptResult.get("asrtext"))) |
| | | svyLibTemplateScriptVO.setScriptResult(StringUtils.isNotEmpty(scriptResult.get("asrtext")) ? scriptResult.get("asrtext").replaceAll("^(\"|')(.*)\\1$", "$2") : ""); |
| | |
| | | } |
| | | map.put("scriptResult", svyLibTemplateScriptVOList); |
| | | map.put("taskName", scriptInfoByCondition.get("taskName")); |
| | | return map; |
| | | } else if (scriptInfoByCondition.get("type").equals("3")) { |
| | | //宣æä¸éè¦æ¥ç |
| | | List<HeLibrary> heLibraryList = (List) scriptInfoByCondition.get("script"); |
| | | map.put("scriptResult", heLibraryList); |
| | | map.put("taskName", scriptInfoByCondition.get("taskName")); |
| | | return map; |
| | | } |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | private Map<String, String> getScriptResult(Long subid, Long pid, Long sid) { |
| | | Map<String, String> map = new HashMap<>(); |
| | | ServiceSubtaskDetail serviceSubtaskDetail = new ServiceSubtaskDetail(); |
| | |
| | | //æ°å¢å次éè®¿ä»»å¡ |
| | | ServiceSubtask serviceSubtask2 = DtoConversionUtils.sourceToTarget(serviceSubtask, ServiceSubtask.class); |
| | | serviceSubtask2.setId(null); |
| | | serviceSubtask2.setUpid(serviceSubtask1.getUpid()); |
| | | serviceSubtask2.setUpid(serviceSubtask1.getId().intValue()); |
| | | serviceSubtask2.setVisitCount(serviceSubtask1.getVisitCount() + 1); |
| | | serviceSubtask2.setSendstate(2L); |
| | | serviceSubtask2.setCreateTime(new Date()); |
| | |
| | | map.put("type", serviceTask.getType()); |
| | | map.put("taskName", serviceTask.getTaskName()); |
| | | map.put("submit", "0"); |
| | | |
| | | return map; |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.enums.ServiceTaskTypeEnum; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.*; |
| | | import com.smartor.common.LSHospTokenUtil; |
| | | import com.smartor.common.LyraTokenUtil; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.mapper.BaseOrganizationMapper; |
| | |
| | | log.info("360æ¥è¯¢æ¡ä»¶ä¸ºç©º"); |
| | | throw new BaseException("360æ¥è¯¢æ¡ä»¶ä¸ºç©º"); |
| | | } |
| | | String token = null; |
| | | 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(); |
| | | } |
| | | 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())) |