| | |
| | | return "ShanXiQinBaoJiBjxjyy"; |
| | | case "shanxiqinbjfhyy": |
| | | return "ShanXiQinBaoJiBjfhyy"; |
| | | case "shanxiqinbjsqyy": |
| | | return "ShanXiQinBaoJiBjsqyy"; |
| | | case "shanxiqinssyjyy": |
| | | return "ShanXiQinBaoJiSsyjyy"; |
| | | default: |
| | | throw new RuntimeException("找不到对应的医院服务配置:" + hospName); |
| | | } |
| | |
| | | import com.example.utils.AjaxResult; |
| | | import com.example.utils.FieldNameConverter; |
| | | import com.example.utils.HttpClientUtils; |
| | | import com.example.utils.synczd.shanjianyi.DictionaryUtilShanXiWeiNanBjfhyy; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | |
| | | @Service("ShanXiQinBaoJiBjfhyy") |
| | | public class BjfhyyHisService implements HisService { |
| | | @Autowired |
| | | private DictionaryUtilShanXiWeiNanBjfhyy syncZd; |
| | | private DictionaryUtilShanXiBaoJiBjfhyy syncZd; |
| | | @Autowired |
| | | private ConfigValue configValue; |
| | | |
| | |
| | | @Autowired |
| | | private DictCommonHisConfigService dictCommonHisConfigService; |
| | | |
| | | private static final String HOSP_ID = "bjfhyy"; |
| | | |
| | | private static final String TJ_HOSP_ID = "shanxiqinbjfhyy"; |
| | | |
| | | //获取token |
| | | private JSONObject getToken () { |
| | | String GRANT_TYPE = "client_credentials"; |
| | |
| | | map.put("client_secret", CLIENT_SECRET); |
| | | // map.put("scope",SCOP); |
| | | // String post = sendPostTokenFormUrlencoded (HIS_URL+"/oauth/token", map); |
| | | String his_url = dictCommonHisConfigService.getConfigValByHospitalAndKey("bjfhyy", "HIS_URL"); |
| | | String his_url = dictCommonHisConfigService.getConfigValByHospitalAndKey(HOSP_ID, "HIS_URL"); |
| | | String post = HttpClientUtils.sendPostTokenFormUrlencoded(his_url + "/oauth/token", map, null); |
| | | if (StrUtil.isBlank(post)) return null; |
| | | return JSONUtil.parseObj(post); |
| | |
| | | map.put ("feiYongLb",""); |
| | | map.put ("feiYongXz",""); |
| | | map.put ("jiLuLy","3"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjfhyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | map.put ("caoZuoYuan",config.getCzyId()); |
| | | map.put ("chongZhiJe",""); |
| | | map.put ("yiBaoKh",""); |
| | |
| | | @Override |
| | | public String getBingRenXxByShengFenZheng(Map<String, Object> params) { |
| | | Map<String, Object> map = new HashMap<> (); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjfhyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | map.put ("caoZuoYuan",config.getCzyId()); |
| | | map.put ("shenFenZh", params.get(ApiParamsConstants.CUS_ID_CARD)); |
| | | map.put ("danWeiBh",params.get(ApiParamsConstants.COMP_ID)); |
| | |
| | | map.put ("feiYongLb",""); |
| | | map.put ("feiYongXz",""); |
| | | map.put ("jiLuLy","3"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjfhyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | map.put ("caoZuoYuan",config.getCzyId()); |
| | | //职业编码 |
| | | String post = sendPost(config.getHisUrl() + "/menZhenJz/saveBingRenXx", map); |
| | |
| | | map.put ("jiuZhenKh",params.get(ApiParamsConstants.CARD_ID)); |
| | | map.put ("yuanQuId","1"); |
| | | //职业编码 |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjfhyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | String post = sendPost(config.getHisUrl() + "/shouFei/getListDaiShouFei", map); |
| | | JSONObject jsonObject = JSONUtil.parseObj(post); |
| | | if (jsonObject.getStr("returnCode").equals("1")) { |
| | |
| | | |
| | | @Override |
| | | public String createMenZhenFy(Map<String, Object> params) { |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjfhyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | Map<String, Object> map = new HashMap<> (); |
| | | map.put ("bingRenId",params.get(ApiParamsConstants.PATIONID)); |
| | | map.put ("jiuZhenKh",params.get(ApiParamsConstants.CARD_ID)); |
| | |
| | | ids.add(object); |
| | | }); |
| | | map.put ("feiYongIdList",ids); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjfhyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | //职业编码 |
| | | String post = sendPost(config.getHisUrl() + "/shouFei/cheXiaoMzFy", map); |
| | | JSONObject entries = JSONUtil.parseObj(post); |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjfhyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getKeShi", map); |
| | | } |
| | | |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjfhyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getListYiShengZd", map); |
| | | } |
| | | |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjfhyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getShouFeiXm", map); |
| | | } |
| | | |
| | |
| | | map.put ("keShiIds",params.get(ApiParamsConstants.DEPT_IDS)); |
| | | map.put ("ifPlus",""); |
| | | //职业编码 |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjfhyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getKeShiByConditions", map); |
| | | } |
| | | |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjfhyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getYangBen", map); |
| | | } |
| | | |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjfhyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getListBingQuZd", map); |
| | | } |
| | | |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjfhyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getZhiGongPage", map); |
| | | } |
| | | |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjfhyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getJianChaXm", map); |
| | | } |
| | | |
| | |
| | | hashMap.put("queryCode",map.get(ApiParamsConstants.COMMON_QUERY_KEY)); |
| | | hashMap.put("page",map.get(ApiParamsConstants.PAGE_INDEX)); |
| | | hashMap.put("size",map.get(ApiParamsConstants.PAGE_SIZE)); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjfhyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getJianYanXm", hashMap); |
| | | } |
| | | |
| | |
| | | HashMap<String, Object> hashMap = new HashMap<>(); |
| | | hashMap.put("shouFeiXmId",map.get(ApiParamsConstants.COMMON_QUERY_KEY)); |
| | | hashMap.put("jiaGeTx",map.get(ApiParamsConstants.COMMON_QUERY_KEY2)); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjfhyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getShouFeiXmJg", hashMap); |
| | | } |
| | | |
| | |
| | | hashMap.put("queryString",map.get(ApiParamsConstants.COMMON_QUERY_KEY)); |
| | | hashMap.put("pageIndex",map.get(ApiParamsConstants.PAGE_INDEX)); |
| | | hashMap.put("pageSize",map.get(ApiParamsConstants.PAGE_SIZE)); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjfhyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getRongQi", hashMap); |
| | | } |
| | | |
| | |
| | | hashMap.put("queryString",map.get(ApiParamsConstants.COMMON_QUERY_KEY)); |
| | | hashMap.put("pageIndex",map.get(ApiParamsConstants.PAGE_INDEX)); |
| | | hashMap.put("pageSize",map.get(ApiParamsConstants.PAGE_SIZE)); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjfhyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getYangBen", hashMap); |
| | | } |
| | | |
| | |
| | | // 参数类型区分 |
| | | map.put("type","1"); |
| | | HashMap<String, Object> headers = new HashMap<>(); |
| | | headers.put("hospId","bjfhyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjfhyy"); |
| | | headers.put("hospId",HOSP_ID); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | String post = HttpClientUtils.sendPost(config.getTjUrl() + "/callBack/pushZhiFuMsg", map,headers); |
| | | JSONObject jsonObject = JSONUtil.parseObj(post); |
| | | JSONObject obj = JSONUtil.createObj(); |
| | |
| | | |
| | | |
| | | private String sendPost(String url, Map<String, Object> hashMap){ |
| | | Map<Object, Object> entries = redisTemplate.opsForHash().entries("token:his:shanxiqinbjfhyy"); |
| | | Map<Object, Object> entries = redisTemplate.opsForHash().entries("token:his:"+TJ_HOSP_ID); |
| | | if (entries != null && !entries.isEmpty()) { |
| | | String timeStr = entries.get("time").toString(); |
| | | String expiresInStr = entries.get("expires_in").toString(); |
| | |
| | | } |
| | | |
| | | private String sendPostTokenFormUrlencoded(String url, Map<String, Object> hashMap){ |
| | | Map<Object, Object> entries = redisTemplate.opsForHash().entries("token:his:shanxiqinbjfhyy"); |
| | | Map<Object, Object> entries = redisTemplate.opsForHash().entries("token:his:"+TJ_HOSP_ID); |
| | | if (!entries.isEmpty()) { |
| | | String timeStr = entries.get("time").toString(); |
| | | String expiresInStr = entries.get("expires_in").toString(); |
| | |
| | | } |
| | | |
| | | private String sendPostTokenFormData(String url, Map<String, Object> hashMap){ |
| | | Map<Object, Object> entries = redisTemplate.opsForHash().entries("token:his:shanxiqinbjfhyy"); |
| | | Map<Object, Object> entries = redisTemplate.opsForHash().entries("token:his:"+TJ_HOSP_ID); |
| | | if (entries != null && !entries.isEmpty()) { |
| | | String timeStr = entries.get("time").toString(); |
| | | String expiresInStr = entries.get("expires_in").toString(); |
| | |
| | | Integer expiresIn = parseObj.getInt("expires_in"); |
| | | if (expiresIn != null) { |
| | | parseObj.putOpt("time", Instant.now().getEpochSecond()); |
| | | redisTemplate.opsForHash().putAll("token:his:shanxiqinbjfhyy", parseObj); |
| | | redisTemplate.expire("token:his:shanxiqinbjfhyy", expiresIn - 10, TimeUnit.SECONDS); |
| | | redisTemplate.opsForHash().putAll("token:his:"+TJ_HOSP_ID, parseObj); |
| | | redisTemplate.expire("token:his:"+TJ_HOSP_ID, expiresIn - 10, TimeUnit.SECONDS); |
| | | |
| | | String accessToken = parseObj.getStr("access_token"); |
| | | String tokenType = parseObj.getStr("token_type"); |
| | |
| | | @Override |
| | | public void syncDict(String hospName) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("hosp","shanxiqinbjfhyy"); |
| | | map.put("hosp",TJ_HOSP_ID); |
| | | HashMap<String, Object> headers = new HashMap<>(); |
| | | headers.put("hospId","bjfhyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjfhyy"); |
| | | headers.put("hospId",HOSP_ID); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | String post = HttpClientUtils.sendPost(config.getTjUrl() + "/callBack/getZdList", map,headers); |
| | | JSONArray jsonArray = JSONUtil.parseObj(post).getJSONArray("data"); |
| | | if (jsonArray != null && !jsonArray.isEmpty()) { |
| | | List<HisSyncDict> list = jsonArray.toList(HisSyncDict.class); |
| | | String token = ""; |
| | | Map<Object, Object> entries = redisTemplate.opsForHash().entries("token:his:shanxiqinbjfhyy"); |
| | | Map<Object, Object> entries = redisTemplate.opsForHash().entries("token:his:"+TJ_HOSP_ID); |
| | | if (!entries.isEmpty()) { |
| | | String timeStr = entries.get("time").toString(); |
| | | String expiresInStr = entries.get("expires_in").toString(); |
| | |
| | | expiresIn = parseObj.getLong("expires_in"); |
| | | if (expiresIn != null) { |
| | | parseObj.putOpt("time", Instant.now().getEpochSecond()); |
| | | redisTemplate.opsForHash().putAll("token:his:shanxiqinbjfhyy", parseObj); |
| | | redisTemplate.expire("token:his:shanxiqinbjfhyy", expiresIn - 10, TimeUnit.SECONDS); |
| | | redisTemplate.opsForHash().putAll("token:his:"+TJ_HOSP_ID, parseObj); |
| | | redisTemplate.expire("token:his:"+TJ_HOSP_ID, expiresIn - 10, TimeUnit.SECONDS); |
| | | String accessToken = parseObj.getStr("access_token"); |
| | | String tokenType = parseObj.getStr("token_type"); |
| | | token = tokenType + " " + accessToken; |
| | |
| | | Integer expiresIn = parseObj.getInt("expires_in"); |
| | | if (expiresIn != null) { |
| | | parseObj.putOpt("time", Instant.now().getEpochSecond()); |
| | | redisTemplate.opsForHash().putAll("token:his:shanxiqinbjfhyy", parseObj); |
| | | redisTemplate.expire("token:his:shanxiqinbjfhyy", expiresIn - 10, TimeUnit.SECONDS); |
| | | redisTemplate.opsForHash().putAll("token:his:"+TJ_HOSP_ID, parseObj); |
| | | redisTemplate.expire("token:his:"+TJ_HOSP_ID, expiresIn - 10, TimeUnit.SECONDS); |
| | | String accessToken = parseObj.getStr("access_token"); |
| | | String tokenType = parseObj.getStr("token_type"); |
| | | token = tokenType + " " + accessToken; |
File was renamed from src/main/java/com/example/utils/synczd/shanjianyi/DictionaryUtilShanXiWeiNanBjfhyy.java |
| | |
| | | package com.example.utils.synczd.shanjianyi; |
| | | package com.example.service.shanjianyi.shanxiqin.baoji.bjfhyy; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.json.JSONArray; |
| | |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class DictionaryUtilShanXiWeiNanBjfhyy { |
| | | public class DictionaryUtilShanXiBaoJiBjfhyy { |
| | | |
| | | // @Autowired |
| | | // private ConfigValue configValue; |
| | | @Autowired |
| | | private HisSyncDictMapper hisSyncDictMapper; |
| | | @Autowired |
| | | private DictCommonHisConfigService dictCommonHisConfigService; |
| | | |
| | | // private static String CONFIG_PATH; |
| | | // private static String BASE_API_URL = ""; |
| | | private static final int SIZE = 100; |
| | | // private static String USER = ""; |
| | | // private static String PASSWORD = ""; |
| | | // private static String URL = ""; |
| | | // private static String NAME = ""; |
| | | // @Value("${config.path}") |
| | | // public void setConfigPath(String configPath) { |
| | | // CONFIG_PATH = configPath; |
| | | // NAME = configValue.getConfigValue("ShanXi_Qin_BaoJi_Bjxjyy.name"); |
| | | // URL = "jdbc:mysql://" + configValue.getConfigValue("ShanXi_Qin_BaoJi_Bjxjyy.ip") |
| | | // + ":" + configValue.getConfigValue("ShanXi_Qin_BaoJi_Bjxjyy.prot") + "/" + NAME + |
| | | // "?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8"; |
| | | // USER = configValue.getConfigValue("ShanXi_Qin_BaoJi_Bjxjyy.username"); |
| | | // PASSWORD = configValue.getConfigValue("ShanXi_Qin_BaoJi_Bjxjyy.password"); |
| | | // String apiUrl = configValue.getConfigValue("ShanXi_Qin_BaoJi_Bjxjyy.his_api_url"); |
| | | // String apiPort = configValue.getConfigValue("ShanXi_Qin_BaoJi_Bjxjyy.his_api_port"); |
| | | // BASE_API_URL = apiUrl+":"+apiPort+configValue.getConfigValue("ShanXi_Qin_BaoJi_Bjxjyy.hisapiappend"); |
| | | // } |
| | | |
| | | |
| | | /** |
| | | * 暂时不做 |
| | | * 1.90 门诊明细计费及组合计费项目 MZJFZHMXXM |
| | | * |
| | | */ |
| | | |
| | | // 分页每次1000条 |
| | | static { |
| | |
| | | connection.setRequestProperty("Authorization", token); |
| | | log.info("请求接口 ->{}", hisSyncDict.getUrl()); |
| | | if (hisSyncDict.getUrl().equals("/zhuShuJu/getListYiShengZd") || hisSyncDict.getUrl().equals("/zhuShuJu/getZhiGongPage") || hisSyncDict.getUrl().equals("/zhuShuJu/getJianChaXm")){ |
| | | connection.setRequestProperty("dangQianYhId","1001"); |
| | | connection.setRequestProperty("dangQianYhId","1323"); |
| | | if (hisSyncDict.getUrl().equals("/zhuShuJu/getJianChaXm")) |
| | | connection.setRequestProperty("yuanQuId","1"); |
| | | } |
| | |
| | | import com.example.utils.AjaxResult; |
| | | import com.example.utils.FieldNameConverter; |
| | | import com.example.utils.HttpClientUtils; |
| | | import com.example.utils.synczd.shanjianyi.DictionaryUtilShanXiWeiNanBjxjyy; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | |
| | | @Service("ShanXiQinBaoJiBjsqyy") |
| | | public class BjsqyyHisService implements HisService { |
| | | @Autowired |
| | | private DictionaryUtilShanXiWeiNanBjxjyy syncZd; |
| | | private DictionaryUtilShanXiBaoJiBjsqyy syncZd; |
| | | @Autowired |
| | | private ConfigValue configValue; |
| | | |
| | |
| | | @Autowired |
| | | private DictCommonHisConfigService dictCommonHisConfigService; |
| | | |
| | | private static final String HOSP_ID = "bjsqyy"; |
| | | |
| | | private static final String TJ_HOSP_ID = "shanxiqinbjsqyy"; |
| | | |
| | | //获取token |
| | | private JSONObject getToken () { |
| | | String GRANT_TYPE = "client_credentials"; |
| | |
| | | map.put("client_secret", CLIENT_SECRET); |
| | | // map.put("scope",SCOP); |
| | | // String post = sendPostTokenFormUrlencoded (HIS_URL+"/oauth/token", map); |
| | | String his_url = dictCommonHisConfigService.getConfigValByHospitalAndKey("bjsqyy", "HIS_URL"); |
| | | String his_url = dictCommonHisConfigService.getConfigValByHospitalAndKey(HOSP_ID, "HIS_URL"); |
| | | String post = HttpClientUtils.sendPostTokenFormUrlencoded(his_url + "/oauth/token", map, null); |
| | | if (StrUtil.isBlank(post)) return null; |
| | | return JSONUtil.parseObj(post); |
| | |
| | | map.put ("feiYongLb",""); |
| | | map.put ("feiYongXz",""); |
| | | map.put ("jiLuLy","3"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjsqyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | map.put ("caoZuoYuan",config.getCzyId()); |
| | | map.put ("chongZhiJe",""); |
| | | map.put ("yiBaoKh",""); |
| | |
| | | @Override |
| | | public String getBingRenXxByShengFenZheng(Map<String, Object> params) { |
| | | Map<String, Object> map = new HashMap<> (); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjsqyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | map.put ("caoZuoYuan",config.getCzyId()); |
| | | map.put ("shenFenZh", params.get(ApiParamsConstants.CUS_ID_CARD)); |
| | | map.put ("danWeiBh",params.get(ApiParamsConstants.COMP_ID)); |
| | |
| | | map.put ("feiYongLb",""); |
| | | map.put ("feiYongXz",""); |
| | | map.put ("jiLuLy","3"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjsqyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | map.put ("caoZuoYuan",config.getCzyId()); |
| | | //职业编码 |
| | | String post = sendPost(config.getHisUrl() + "/menZhenJz/saveBingRenXx", map); |
| | |
| | | map.put ("jiuZhenKh",params.get(ApiParamsConstants.CARD_ID)); |
| | | map.put ("yuanQuId","1"); |
| | | //职业编码 |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjsqyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | String post = sendPost(config.getHisUrl() + "/shouFei/getListDaiShouFei", map); |
| | | JSONObject jsonObject = JSONUtil.parseObj(post); |
| | | if (jsonObject.getStr("returnCode").equals("1")) { |
| | |
| | | |
| | | @Override |
| | | public String createMenZhenFy(Map<String, Object> params) { |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjsqyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | Map<String, Object> map = new HashMap<> (); |
| | | map.put ("bingRenId",params.get(ApiParamsConstants.PATIONID)); |
| | | map.put ("jiuZhenKh",params.get(ApiParamsConstants.CARD_ID)); |
| | |
| | | ids.add(object); |
| | | }); |
| | | map.put ("feiYongIdList",ids); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjsqyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | //职业编码 |
| | | String post = sendPost(config.getHisUrl() + "/shouFei/cheXiaoMzFy", map); |
| | | JSONObject entries = JSONUtil.parseObj(post); |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjsqyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getKeShi", map); |
| | | } |
| | | |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjsqyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getListYiShengZd", map); |
| | | } |
| | | |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjsqyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getShouFeiXm", map); |
| | | } |
| | | |
| | |
| | | map.put ("keShiIds",params.get(ApiParamsConstants.DEPT_IDS)); |
| | | map.put ("ifPlus",""); |
| | | //职业编码 |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjsqyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getKeShiByConditions", map); |
| | | } |
| | | |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjsqyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getYangBen", map); |
| | | } |
| | | |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjsqyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getListBingQuZd", map); |
| | | } |
| | | |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjsqyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getZhiGongPage", map); |
| | | } |
| | | |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjsqyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getJianChaXm", map); |
| | | } |
| | | |
| | |
| | | hashMap.put("queryCode",map.get(ApiParamsConstants.COMMON_QUERY_KEY)); |
| | | hashMap.put("page",map.get(ApiParamsConstants.PAGE_INDEX)); |
| | | hashMap.put("size",map.get(ApiParamsConstants.PAGE_SIZE)); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjsqyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getJianYanXm", hashMap); |
| | | } |
| | | |
| | |
| | | HashMap<String, Object> hashMap = new HashMap<>(); |
| | | hashMap.put("shouFeiXmId",map.get(ApiParamsConstants.COMMON_QUERY_KEY)); |
| | | hashMap.put("jiaGeTx",map.get(ApiParamsConstants.COMMON_QUERY_KEY2)); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjsqyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getShouFeiXmJg", hashMap); |
| | | } |
| | | |
| | |
| | | hashMap.put("queryString",map.get(ApiParamsConstants.COMMON_QUERY_KEY)); |
| | | hashMap.put("pageIndex",map.get(ApiParamsConstants.PAGE_INDEX)); |
| | | hashMap.put("pageSize",map.get(ApiParamsConstants.PAGE_SIZE)); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjsqyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getRongQi", hashMap); |
| | | } |
| | | |
| | |
| | | hashMap.put("queryString",map.get(ApiParamsConstants.COMMON_QUERY_KEY)); |
| | | hashMap.put("pageIndex",map.get(ApiParamsConstants.PAGE_INDEX)); |
| | | hashMap.put("pageSize",map.get(ApiParamsConstants.PAGE_SIZE)); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjsqyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getYangBen", hashMap); |
| | | } |
| | | |
| | |
| | | // 参数类型区分 |
| | | map.put("type","1"); |
| | | HashMap<String, Object> headers = new HashMap<>(); |
| | | headers.put("hospId","bjsqyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjsqyy"); |
| | | headers.put("hospId",HOSP_ID); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | String post = HttpClientUtils.sendPost(config.getTjUrl() + "/callBack/pushZhiFuMsg", map,headers); |
| | | JSONObject jsonObject = JSONUtil.parseObj(post); |
| | | JSONObject obj = JSONUtil.createObj(); |
| | |
| | | |
| | | |
| | | private String sendPost(String url, Map<String, Object> hashMap){ |
| | | Map<Object, Object> entries = redisTemplate.opsForHash().entries("token:his:shanxiqinbjsqyy"); |
| | | Map<Object, Object> entries = redisTemplate.opsForHash().entries("token:his:"+TJ_HOSP_ID); |
| | | if (entries != null && !entries.isEmpty()) { |
| | | String timeStr = entries.get("time").toString(); |
| | | String expiresInStr = entries.get("expires_in").toString(); |
| | |
| | | } |
| | | |
| | | private String sendPostTokenFormUrlencoded(String url, Map<String, Object> hashMap){ |
| | | Map<Object, Object> entries = redisTemplate.opsForHash().entries("token:his:shanxiqinbjsqyy"); |
| | | Map<Object, Object> entries = redisTemplate.opsForHash().entries("token:his:"+TJ_HOSP_ID); |
| | | if (!entries.isEmpty()) { |
| | | String timeStr = entries.get("time").toString(); |
| | | String expiresInStr = entries.get("expires_in").toString(); |
| | |
| | | } |
| | | |
| | | private String sendPostTokenFormData(String url, Map<String, Object> hashMap){ |
| | | Map<Object, Object> entries = redisTemplate.opsForHash().entries("token:his:shanxiqinbjsqyy"); |
| | | Map<Object, Object> entries = redisTemplate.opsForHash().entries("token:his:"+TJ_HOSP_ID); |
| | | if (entries != null && !entries.isEmpty()) { |
| | | String timeStr = entries.get("time").toString(); |
| | | String expiresInStr = entries.get("expires_in").toString(); |
| | |
| | | Integer expiresIn = parseObj.getInt("expires_in"); |
| | | if (expiresIn != null) { |
| | | parseObj.putOpt("time", Instant.now().getEpochSecond()); |
| | | redisTemplate.opsForHash().putAll("token:his:shanxiqinbjsqyy", parseObj); |
| | | redisTemplate.expire("token:his:shanxiqinbjsqyy", expiresIn - 10, TimeUnit.SECONDS); |
| | | redisTemplate.opsForHash().putAll("token:his:"+TJ_HOSP_ID, parseObj); |
| | | redisTemplate.expire("token:his:"+TJ_HOSP_ID, expiresIn - 10, TimeUnit.SECONDS); |
| | | |
| | | String accessToken = parseObj.getStr("access_token"); |
| | | String tokenType = parseObj.getStr("token_type"); |
| | |
| | | @Override |
| | | public void syncDict(String hospName) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("hosp","shanxiqinbjsqyy"); |
| | | map.put("hosp",TJ_HOSP_ID); |
| | | HashMap<String, Object> headers = new HashMap<>(); |
| | | headers.put("hospId","bjsqyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjsqyy"); |
| | | headers.put("hospId",HOSP_ID); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | String post = HttpClientUtils.sendPost(config.getTjUrl() + "/callBack/getZdList", map,headers); |
| | | JSONArray jsonArray = JSONUtil.parseObj(post).getJSONArray("data"); |
| | | if (jsonArray != null && !jsonArray.isEmpty()) { |
| | | List<HisSyncDict> list = jsonArray.toList(HisSyncDict.class); |
| | | String token = ""; |
| | | Map<Object, Object> entries = redisTemplate.opsForHash().entries("token:his:shanxiqinbjsqyy"); |
| | | Map<Object, Object> entries = redisTemplate.opsForHash().entries("token:his:"+TJ_HOSP_ID); |
| | | if (!entries.isEmpty()) { |
| | | String timeStr = entries.get("time").toString(); |
| | | String expiresInStr = entries.get("expires_in").toString(); |
| | |
| | | expiresIn = parseObj.getLong("expires_in"); |
| | | if (expiresIn != null) { |
| | | parseObj.putOpt("time", Instant.now().getEpochSecond()); |
| | | redisTemplate.opsForHash().putAll("token:his:shanxiqinbjsqyy", parseObj); |
| | | redisTemplate.expire("token:his:shanxiqinbjsqyy", expiresIn - 10, TimeUnit.SECONDS); |
| | | redisTemplate.opsForHash().putAll("token:his:"+TJ_HOSP_ID, parseObj); |
| | | redisTemplate.expire("token:his:"+TJ_HOSP_ID, expiresIn - 10, TimeUnit.SECONDS); |
| | | String accessToken = parseObj.getStr("access_token"); |
| | | String tokenType = parseObj.getStr("token_type"); |
| | | token = tokenType + " " + accessToken; |
| | |
| | | Integer expiresIn = parseObj.getInt("expires_in"); |
| | | if (expiresIn != null) { |
| | | parseObj.putOpt("time", Instant.now().getEpochSecond()); |
| | | redisTemplate.opsForHash().putAll("token:his:shanxiqinbjsqyy", parseObj); |
| | | redisTemplate.expire("token:his:shanxiqinbjsqyy", expiresIn - 10, TimeUnit.SECONDS); |
| | | redisTemplate.opsForHash().putAll("token:his:"+TJ_HOSP_ID, parseObj); |
| | | redisTemplate.expire("token:his:"+TJ_HOSP_ID, expiresIn - 10, TimeUnit.SECONDS); |
| | | String accessToken = parseObj.getStr("access_token"); |
| | | String tokenType = parseObj.getStr("token_type"); |
| | | token = tokenType + " " + accessToken; |
copy from src/main/java/com/example/utils/synczd/shanjianyi/DictionaryUtilShanXiWeiNanBjfhyy.java
copy to src/main/java/com/example/service/shanjianyi/shanxiqin/baoji/bjsqyy/DictionaryUtilShanXiBaoJiBjsqyy.java
File was copied from src/main/java/com/example/utils/synczd/shanjianyi/DictionaryUtilShanXiWeiNanBjfhyy.java |
| | |
| | | package com.example.utils.synczd.shanjianyi; |
| | | package com.example.service.shanjianyi.shanxiqin.baoji.bjsqyy; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.json.JSONArray; |
| | |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class DictionaryUtilShanXiWeiNanBjfhyy { |
| | | public class DictionaryUtilShanXiBaoJiBjsqyy { |
| | | |
| | | // @Autowired |
| | | // private ConfigValue configValue; |
| | | @Autowired |
| | | private HisSyncDictMapper hisSyncDictMapper; |
| | | @Autowired |
| | | private DictCommonHisConfigService dictCommonHisConfigService; |
| | | |
| | | // private static String CONFIG_PATH; |
| | | // private static String BASE_API_URL = ""; |
| | | private static final int SIZE = 100; |
| | | // private static String USER = ""; |
| | | // private static String PASSWORD = ""; |
| | | // private static String URL = ""; |
| | | // private static String NAME = ""; |
| | | // @Value("${config.path}") |
| | | // public void setConfigPath(String configPath) { |
| | | // CONFIG_PATH = configPath; |
| | | // NAME = configValue.getConfigValue("ShanXi_Qin_BaoJi_Bjxjyy.name"); |
| | | // URL = "jdbc:mysql://" + configValue.getConfigValue("ShanXi_Qin_BaoJi_Bjxjyy.ip") |
| | | // + ":" + configValue.getConfigValue("ShanXi_Qin_BaoJi_Bjxjyy.prot") + "/" + NAME + |
| | | // "?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8"; |
| | | // USER = configValue.getConfigValue("ShanXi_Qin_BaoJi_Bjxjyy.username"); |
| | | // PASSWORD = configValue.getConfigValue("ShanXi_Qin_BaoJi_Bjxjyy.password"); |
| | | // String apiUrl = configValue.getConfigValue("ShanXi_Qin_BaoJi_Bjxjyy.his_api_url"); |
| | | // String apiPort = configValue.getConfigValue("ShanXi_Qin_BaoJi_Bjxjyy.his_api_port"); |
| | | // BASE_API_URL = apiUrl+":"+apiPort+configValue.getConfigValue("ShanXi_Qin_BaoJi_Bjxjyy.hisapiappend"); |
| | | // } |
| | | |
| | | |
| | | /** |
| | | * 暂时不做 |
| | | * 1.90 门诊明细计费及组合计费项目 MZJFZHMXXM |
| | | * |
| | | */ |
| | | |
| | | // 分页每次1000条 |
| | | static { |
| | |
| | | * 进行同步 |
| | | */ |
| | | public void exec(List<HisSyncDict> hisSyncDicts, String token){ |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjfhyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjsqyy"); |
| | | log.info("开始执行同步"); |
| | | Connection connection = getConnection(config); |
| | | if (connection == null) |
copy from src/main/java/com/example/utils/synczd/shanjianyi/DictionaryUtilShanXiWeiNanBjfhyy.java
copy to src/main/java/com/example/service/shanjianyi/shanxiqin/baoji/ssyjyy/DictionaryUtilShanXiBaoJiSsyjyy.java
File was copied from src/main/java/com/example/utils/synczd/shanjianyi/DictionaryUtilShanXiWeiNanBjfhyy.java |
| | |
| | | package com.example.utils.synczd.shanjianyi; |
| | | package com.example.service.shanjianyi.shanxiqin.baoji.ssyjyy; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.json.JSONArray; |
| | |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class DictionaryUtilShanXiWeiNanBjfhyy { |
| | | public class DictionaryUtilShanXiBaoJiSsyjyy { |
| | | |
| | | // @Autowired |
| | | // private ConfigValue configValue; |
| | | @Autowired |
| | | private HisSyncDictMapper hisSyncDictMapper; |
| | | @Autowired |
| | | private DictCommonHisConfigService dictCommonHisConfigService; |
| | | |
| | | // private static String CONFIG_PATH; |
| | | // private static String BASE_API_URL = ""; |
| | | private static final int SIZE = 100; |
| | | // private static String USER = ""; |
| | | // private static String PASSWORD = ""; |
| | | // private static String URL = ""; |
| | | // private static String NAME = ""; |
| | | // @Value("${config.path}") |
| | | // public void setConfigPath(String configPath) { |
| | | // CONFIG_PATH = configPath; |
| | | // NAME = configValue.getConfigValue("ShanXi_Qin_BaoJi_Bjxjyy.name"); |
| | | // URL = "jdbc:mysql://" + configValue.getConfigValue("ShanXi_Qin_BaoJi_Bjxjyy.ip") |
| | | // + ":" + configValue.getConfigValue("ShanXi_Qin_BaoJi_Bjxjyy.prot") + "/" + NAME + |
| | | // "?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8"; |
| | | // USER = configValue.getConfigValue("ShanXi_Qin_BaoJi_Bjxjyy.username"); |
| | | // PASSWORD = configValue.getConfigValue("ShanXi_Qin_BaoJi_Bjxjyy.password"); |
| | | // String apiUrl = configValue.getConfigValue("ShanXi_Qin_BaoJi_Bjxjyy.his_api_url"); |
| | | // String apiPort = configValue.getConfigValue("ShanXi_Qin_BaoJi_Bjxjyy.his_api_port"); |
| | | // BASE_API_URL = apiUrl+":"+apiPort+configValue.getConfigValue("ShanXi_Qin_BaoJi_Bjxjyy.hisapiappend"); |
| | | // } |
| | | |
| | | |
| | | /** |
| | | * 暂时不做 |
| | | * 1.90 门诊明细计费及组合计费项目 MZJFZHMXXM |
| | | * |
| | | */ |
| | | |
| | | // 分页每次1000条 |
| | | static { |
| | |
| | | * 进行同步 |
| | | */ |
| | | public void exec(List<HisSyncDict> hisSyncDicts, String token){ |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("bjfhyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("ssyjyy"); |
| | | log.info("开始执行同步"); |
| | | Connection connection = getConnection(config); |
| | | if (connection == null) |
| | |
| | | connection.setRequestProperty("Authorization", token); |
| | | log.info("请求接口 ->{}", hisSyncDict.getUrl()); |
| | | if (hisSyncDict.getUrl().equals("/zhuShuJu/getListYiShengZd") || hisSyncDict.getUrl().equals("/zhuShuJu/getZhiGongPage") || hisSyncDict.getUrl().equals("/zhuShuJu/getJianChaXm")){ |
| | | connection.setRequestProperty("dangQianYhId","1001"); |
| | | connection.setRequestProperty("dangQianYhId","1025"); |
| | | if (hisSyncDict.getUrl().equals("/zhuShuJu/getJianChaXm")) |
| | | connection.setRequestProperty("yuanQuId","1"); |
| | | } |
| | |
| | | import com.example.utils.AjaxResult; |
| | | import com.example.utils.FieldNameConverter; |
| | | import com.example.utils.HttpClientUtils; |
| | | import com.example.utils.synczd.shanjianyi.DictionaryUtilShanXiWeiNanBjxjyy; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | |
| | | @Service("ShanXiQinBaoJiSsyjyy") |
| | | public class SsyjyyHisService implements HisService { |
| | | @Autowired |
| | | private DictionaryUtilShanXiWeiNanBjxjyy syncZd; |
| | | private DictionaryUtilShanXiBaoJiSsyjyy syncZd; |
| | | @Autowired |
| | | private ConfigValue configValue; |
| | | |
| | |
| | | @Autowired |
| | | private DictCommonHisConfigService dictCommonHisConfigService; |
| | | |
| | | |
| | | private static final String HOSP_ID = "ssyjyy"; |
| | | |
| | | private static final String TJ_HOSP_ID = "shanxiqinssyjyy"; |
| | | |
| | | //获取token |
| | | private JSONObject getToken () { |
| | | String GRANT_TYPE = "client_credentials"; |
| | |
| | | map.put("client_secret", CLIENT_SECRET); |
| | | // map.put("scope",SCOP); |
| | | // String post = sendPostTokenFormUrlencoded (HIS_URL+"/oauth/token", map); |
| | | String his_url = dictCommonHisConfigService.getConfigValByHospitalAndKey("ssyjyy", "HIS_URL"); |
| | | String his_url = dictCommonHisConfigService.getConfigValByHospitalAndKey(HOSP_ID, "HIS_URL"); |
| | | String post = HttpClientUtils.sendPostTokenFormUrlencoded(his_url + "/oauth/token", map, null); |
| | | if (StrUtil.isBlank(post)) return null; |
| | | return JSONUtil.parseObj(post); |
| | |
| | | map.put ("feiYongLb",""); |
| | | map.put ("feiYongXz",""); |
| | | map.put ("jiLuLy","3"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("ssyjyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | map.put ("caoZuoYuan",config.getCzyId()); |
| | | map.put ("chongZhiJe",""); |
| | | map.put ("yiBaoKh",""); |
| | |
| | | @Override |
| | | public String getBingRenXxByShengFenZheng(Map<String, Object> params) { |
| | | Map<String, Object> map = new HashMap<> (); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("ssyjyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | map.put ("caoZuoYuan",config.getCzyId()); |
| | | map.put ("shenFenZh", params.get(ApiParamsConstants.CUS_ID_CARD)); |
| | | map.put ("danWeiBh",params.get(ApiParamsConstants.COMP_ID)); |
| | |
| | | map.put ("feiYongLb",""); |
| | | map.put ("feiYongXz",""); |
| | | map.put ("jiLuLy","3"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("ssyjyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | map.put ("caoZuoYuan",config.getCzyId()); |
| | | //职业编码 |
| | | String post = sendPost(config.getHisUrl() + "/menZhenJz/saveBingRenXx", map); |
| | |
| | | map.put ("jiuZhenKh",params.get(ApiParamsConstants.CARD_ID)); |
| | | map.put ("yuanQuId","1"); |
| | | //职业编码 |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("ssyjyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | String post = sendPost(config.getHisUrl() + "/shouFei/getListDaiShouFei", map); |
| | | JSONObject jsonObject = JSONUtil.parseObj(post); |
| | | if (jsonObject.getStr("returnCode").equals("1")) { |
| | |
| | | |
| | | @Override |
| | | public String createMenZhenFy(Map<String, Object> params) { |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("ssyjyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | Map<String, Object> map = new HashMap<> (); |
| | | map.put ("bingRenId",params.get(ApiParamsConstants.PATIONID)); |
| | | map.put ("jiuZhenKh",params.get(ApiParamsConstants.CARD_ID)); |
| | |
| | | ids.add(object); |
| | | }); |
| | | map.put ("feiYongIdList",ids); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("ssyjyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | //职业编码 |
| | | String post = sendPost(config.getHisUrl() + "/shouFei/cheXiaoMzFy", map); |
| | | JSONObject entries = JSONUtil.parseObj(post); |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("ssyjyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getKeShi", map); |
| | | } |
| | | |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("ssyjyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getListYiShengZd", map); |
| | | } |
| | | |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("ssyjyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getShouFeiXm", map); |
| | | } |
| | | |
| | |
| | | map.put ("keShiIds",params.get(ApiParamsConstants.DEPT_IDS)); |
| | | map.put ("ifPlus",""); |
| | | //职业编码 |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("ssyjyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getKeShiByConditions", map); |
| | | } |
| | | |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("ssyjyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getYangBen", map); |
| | | } |
| | | |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("ssyjyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getListBingQuZd", map); |
| | | } |
| | | |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("ssyjyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getZhiGongPage", map); |
| | | } |
| | | |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("ssyjyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getJianChaXm", map); |
| | | } |
| | | |
| | |
| | | hashMap.put("queryCode",map.get(ApiParamsConstants.COMMON_QUERY_KEY)); |
| | | hashMap.put("page",map.get(ApiParamsConstants.PAGE_INDEX)); |
| | | hashMap.put("size",map.get(ApiParamsConstants.PAGE_SIZE)); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("ssyjyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getJianYanXm", hashMap); |
| | | } |
| | | |
| | |
| | | HashMap<String, Object> hashMap = new HashMap<>(); |
| | | hashMap.put("shouFeiXmId",map.get(ApiParamsConstants.COMMON_QUERY_KEY)); |
| | | hashMap.put("jiaGeTx",map.get(ApiParamsConstants.COMMON_QUERY_KEY2)); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("ssyjyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getShouFeiXmJg", hashMap); |
| | | } |
| | | |
| | |
| | | hashMap.put("queryString",map.get(ApiParamsConstants.COMMON_QUERY_KEY)); |
| | | hashMap.put("pageIndex",map.get(ApiParamsConstants.PAGE_INDEX)); |
| | | hashMap.put("pageSize",map.get(ApiParamsConstants.PAGE_SIZE)); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("ssyjyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getRongQi", hashMap); |
| | | } |
| | | |
| | |
| | | hashMap.put("queryString",map.get(ApiParamsConstants.COMMON_QUERY_KEY)); |
| | | hashMap.put("pageIndex",map.get(ApiParamsConstants.PAGE_INDEX)); |
| | | hashMap.put("pageSize",map.get(ApiParamsConstants.PAGE_SIZE)); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("ssyjyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | return sendPost(config.getHisUrl()+"/zhuShuJu/getYangBen", hashMap); |
| | | } |
| | | |
| | |
| | | // 参数类型区分 |
| | | map.put("type","1"); |
| | | HashMap<String, Object> headers = new HashMap<>(); |
| | | headers.put("hospId","ssyjyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("ssyjyy"); |
| | | headers.put("hospId",HOSP_ID); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | String post = HttpClientUtils.sendPost(config.getTjUrl() + "/callBack/pushZhiFuMsg", map,headers); |
| | | JSONObject jsonObject = JSONUtil.parseObj(post); |
| | | JSONObject obj = JSONUtil.createObj(); |
| | |
| | | |
| | | |
| | | private String sendPost(String url, Map<String, Object> hashMap){ |
| | | Map<Object, Object> entries = redisTemplate.opsForHash().entries("token:his:shanxiqinssyjyy"); |
| | | Map<Object, Object> entries = redisTemplate.opsForHash().entries("token:his:"+TJ_HOSP_ID); |
| | | if (entries != null && !entries.isEmpty()) { |
| | | String timeStr = entries.get("time").toString(); |
| | | String expiresInStr = entries.get("expires_in").toString(); |
| | |
| | | } |
| | | |
| | | private String sendPostTokenFormUrlencoded(String url, Map<String, Object> hashMap){ |
| | | Map<Object, Object> entries = redisTemplate.opsForHash().entries("token:his:shanxiqinssyjyy"); |
| | | Map<Object, Object> entries = redisTemplate.opsForHash().entries("token:his:"+TJ_HOSP_ID); |
| | | if (!entries.isEmpty()) { |
| | | String timeStr = entries.get("time").toString(); |
| | | String expiresInStr = entries.get("expires_in").toString(); |
| | |
| | | } |
| | | |
| | | private String sendPostTokenFormData(String url, Map<String, Object> hashMap){ |
| | | Map<Object, Object> entries = redisTemplate.opsForHash().entries("token:his:shanxiqinssyjyy"); |
| | | Map<Object, Object> entries = redisTemplate.opsForHash().entries("token:his:"+TJ_HOSP_ID); |
| | | if (entries != null && !entries.isEmpty()) { |
| | | String timeStr = entries.get("time").toString(); |
| | | String expiresInStr = entries.get("expires_in").toString(); |
| | |
| | | Integer expiresIn = parseObj.getInt("expires_in"); |
| | | if (expiresIn != null) { |
| | | parseObj.putOpt("time", Instant.now().getEpochSecond()); |
| | | redisTemplate.opsForHash().putAll("token:his:shanxiqinssyjyy", parseObj); |
| | | redisTemplate.expire("token:his:shanxiqinssyjyy", expiresIn - 10, TimeUnit.SECONDS); |
| | | redisTemplate.opsForHash().putAll("token:his:"+TJ_HOSP_ID, parseObj); |
| | | redisTemplate.expire("token:his:"+TJ_HOSP_ID, expiresIn - 10, TimeUnit.SECONDS); |
| | | |
| | | String accessToken = parseObj.getStr("access_token"); |
| | | String tokenType = parseObj.getStr("token_type"); |
| | |
| | | @Override |
| | | public void syncDict(String hospName) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("hosp","shanxiqinssyjyy"); |
| | | map.put("hosp",TJ_HOSP_ID); |
| | | HashMap<String, Object> headers = new HashMap<>(); |
| | | headers.put("hospId","ssyjyy"); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("ssyjyy"); |
| | | headers.put("hospId",HOSP_ID); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital(HOSP_ID); |
| | | String post = HttpClientUtils.sendPost(config.getTjUrl() + "/callBack/getZdList", map,headers); |
| | | JSONArray jsonArray = JSONUtil.parseObj(post).getJSONArray("data"); |
| | | if (jsonArray != null && !jsonArray.isEmpty()) { |
| | | List<HisSyncDict> list = jsonArray.toList(HisSyncDict.class); |
| | | String token = ""; |
| | | Map<Object, Object> entries = redisTemplate.opsForHash().entries("token:his:shanxiqinssyjyy"); |
| | | Map<Object, Object> entries = redisTemplate.opsForHash().entries("token:his:"+TJ_HOSP_ID); |
| | | if (!entries.isEmpty()) { |
| | | String timeStr = entries.get("time").toString(); |
| | | String expiresInStr = entries.get("expires_in").toString(); |
| | |
| | | expiresIn = parseObj.getLong("expires_in"); |
| | | if (expiresIn != null) { |
| | | parseObj.putOpt("time", Instant.now().getEpochSecond()); |
| | | redisTemplate.opsForHash().putAll("token:his:shanxiqinssyjyy", parseObj); |
| | | redisTemplate.expire("token:his:shanxiqinssyjyy", expiresIn - 10, TimeUnit.SECONDS); |
| | | redisTemplate.opsForHash().putAll("token:his:"+TJ_HOSP_ID, parseObj); |
| | | redisTemplate.expire("token:his:"+TJ_HOSP_ID, expiresIn - 10, TimeUnit.SECONDS); |
| | | String accessToken = parseObj.getStr("access_token"); |
| | | String tokenType = parseObj.getStr("token_type"); |
| | | token = tokenType + " " + accessToken; |
| | |
| | | Integer expiresIn = parseObj.getInt("expires_in"); |
| | | if (expiresIn != null) { |
| | | parseObj.putOpt("time", Instant.now().getEpochSecond()); |
| | | redisTemplate.opsForHash().putAll("token:his:shanxiqinssyjyy", parseObj); |
| | | redisTemplate.expire("token:his:shanxiqinssyjyy", expiresIn - 10, TimeUnit.SECONDS); |
| | | redisTemplate.opsForHash().putAll("token:his:"+TJ_HOSP_ID, parseObj); |
| | | redisTemplate.expire("token:his:"+TJ_HOSP_ID, expiresIn - 10, TimeUnit.SECONDS); |
| | | String accessToken = parseObj.getStr("access_token"); |
| | | String tokenType = parseObj.getStr("token_type"); |
| | | token = tokenType + " " + accessToken; |