| | |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.example.config.ConfigValue; |
| | | import com.example.constant.ApiParamsConstants; |
| | | import com.example.domain.DictCommonHisConfig; |
| | | import com.example.domain.HisSyncDict; |
| | | import com.example.domain.TjFlowingWaterHis; |
| | | import com.example.service.DictCommonHisConfigService; |
| | | import com.example.service.HisService; |
| | | import com.example.utils.AjaxResult; |
| | | import com.example.utils.FieldNameConverter; |
| | |
| | | // client_secret:05a192176c21edfcc9cf5fa26fc5a9e0c5b131ad |
| | | // http://oapi.xamjyy.com/OAPI |
| | | |
| | | @Autowired |
| | | public ShanQiHisService(ApplicationContext applicationContext, ConfigValue configValue) { |
| | | this.applicationContext = applicationContext; |
| | | this.configValue = configValue; |
| | | HIS_URL = configValue.getConfigValue("ShanXi_Qin_XiAn_Sqyy.his_api_url") + ":" + configValue.getConfigValue("ShanXi_Qin_XiAn_Sqyy.his_api_port") + configValue.getConfigValue("ShanXi_Qin_XiAn_Sqyy.hisapiappend"); |
| | | TJ_URL = configValue.getConfigValue("tjUrl"); |
| | | CZY = configValue.getConfigValue("ShanXi_Qin_XiAn_Sqyy.czy"); |
| | | } |
| | | // @Autowired |
| | | // public ShanQiHisService(ApplicationContext applicationContext, ConfigValue configValue) { |
| | | // this.applicationContext = applicationContext; |
| | | // this.configValue = configValue; |
| | | // HIS_URL = configValue.getConfigValue("ShanXi_Qin_XiAn_Sqyy.his_api_url") + ":" + configValue.getConfigValue("ShanXi_Qin_XiAn_Sqyy.his_api_port") + configValue.getConfigValue("ShanXi_Qin_XiAn_Sqyy.hisapiappend"); |
| | | // TJ_URL = configValue.getConfigValue("tjUrl"); |
| | | // CZY = configValue.getConfigValue("ShanXi_Qin_XiAn_Sqyy.czy"); |
| | | // } |
| | | |
| | | @Autowired |
| | | private RedisTemplate<Object ,Object> redisTemplate; |
| | | @Autowired |
| | | private DictCommonHisConfigService dictCommonHisConfigService; |
| | | |
| | | private final ApplicationContext applicationContext; |
| | | |
| | | private final String HIS_URL; |
| | | private final String TJ_URL; |
| | | private final String CZY; |
| | | // private final ApplicationContext applicationContext; |
| | | // |
| | | // private final String HIS_URL; |
| | | // private final String TJ_URL; |
| | | // private final String CZY; |
| | | |
| | | //获取token |
| | | private JSONObject getToken () { |
| | |
| | | map.put("client_secret", CLIENT_SECRET); |
| | | // map.put("scope",SCOP); |
| | | // String post = sendPostTokenFormUrlencoded (HIS_URL+"/oauth/token", map); |
| | | String post = HttpClientUtils.sendPostTokenFormUrlencoded(HIS_URL + "/oauth/token", map, null); |
| | | String post = HttpClientUtils.sendPostTokenFormUrlencoded(dictCommonHisConfigService.getConfigByHospital("sqyy").getHisUrl() + "/oauth/token", map, null); |
| | | if (StrUtil.isBlank(post)) return null; |
| | | return JSONUtil.parseObj(post); |
| | | } |
| | | |
| | | @Override |
| | | public String jianDang(Map<String, Object> params) { |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("sqyy"); |
| | | Map<String, Object> map = new HashMap<> (); |
| | | map.put ("jiuZhenKh", params.get(ApiParamsConstants.CARD_ID)); |
| | | map.put ("kaiLeiXing","4"); |
| | |
| | | map.put ("feiYongLb",""); |
| | | map.put ("feiYongXz",""); |
| | | map.put ("jiLuLy","3"); |
| | | map.put ("caoZuoYuan",CZY); |
| | | map.put ("caoZuoYuan",config.getCzyId()); |
| | | map.put ("chongZhiJe",""); |
| | | map.put ("yiBaoKh",""); |
| | | map.put ("geRenBh",""); |
| | |
| | | map.put ("minZuDm",""); |
| | | map.put ("minZuMc",""); |
| | | // 职业编码 |
| | | String post = sendPost(HIS_URL + "/menZhenJz/jianDang", map); |
| | | String post = sendPost(config.getHisUrl() + "/menZhenJz/jianDang", map); |
| | | JSONObject jsonObject = JSONUtil.parseObj(post); |
| | | if (jsonObject.getStr("returnCode").equals("1")) { |
| | | JSONObject obj = JSONUtil.createObj(); |
| | |
| | | |
| | | @Override |
| | | public String getBingRenXxByShengFenZheng(Map<String, Object> params) { |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("sqyy"); |
| | | Map<String, Object> map = new HashMap<> (); |
| | | map.put ("caoZuoYuan",CZY); |
| | | map.put ("caoZuoYuan",config.getCzyId()); |
| | | map.put ("shenFenZh", params.get(ApiParamsConstants.CUS_ID_CARD)); |
| | | map.put ("danWeiBh",params.get(ApiParamsConstants.COMP_ID)); |
| | | //职业编码 |
| | | String string = sendPostTokenFormUrlencoded(HIS_URL + "/menZhenJz/getBingRenXxByShengFenZheng", map); |
| | | String string = sendPostTokenFormUrlencoded(config.getHisUrl() + "/menZhenJz/getBingRenXxByShengFenZheng", map); |
| | | JSONObject object = JSONUtil.createObj(); |
| | | if (StrUtil.isBlank(string)){ |
| | | object.putOpt("code",500); |
| | |
| | | map.put ("feiYongLb",""); |
| | | map.put ("feiYongXz",""); |
| | | map.put ("jiLuLy","3"); |
| | | map.put ("caoZuoYuan",CZY); |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("sqyy"); |
| | | map.put ("caoZuoYuan",config.getCzyId()); |
| | | //职业编码 |
| | | String post = sendPost(HIS_URL + "/menZhenJz/saveBingRenXx", map); |
| | | String post = sendPost(config.getHisUrl() + "/menZhenJz/saveBingRenXx", map); |
| | | JSONObject jsonObject = JSONUtil.parseObj(post); |
| | | if (jsonObject.getStr("returnCode").equals("1")) { |
| | | JSONObject obj = JSONUtil.createObj(); |
| | |
| | | map.put ("jiuZhenKh",params.get(ApiParamsConstants.CARD_ID)); |
| | | map.put ("yuanQuId","1"); |
| | | //职业编码 |
| | | String post = sendPost(HIS_URL + "/shouFei/getListDaiShouFei", map); |
| | | String post = sendPost(dictCommonHisConfigService.getConfigByHospital("sqyy").getHisUrl() + "/shouFei/getListDaiShouFei", map); |
| | | JSONObject jsonObject = JSONUtil.parseObj(post); |
| | | if (jsonObject.getStr("returnCode").equals("1")) { |
| | | JSONObject data = jsonObject.getJSONObject("returnData"); |
| | |
| | | |
| | | @Override |
| | | public String createMenZhenFy(Map<String, Object> params) { |
| | | DictCommonHisConfig config = dictCommonHisConfigService.getConfigByHospital("sqyy"); |
| | | Map<String, Object> map = new HashMap<> (); |
| | | map.put ("bingRenId",params.get(ApiParamsConstants.PATIONID)); |
| | | map.put ("jiuZhenKh",params.get(ApiParamsConstants.CARD_ID)); |
| | | map.put ("caoZuoYuan",CZY); |
| | | map.put ("caoZuoYuan",config.getCzyId()); |
| | | map.put ("yuanQuId","1"); |
| | | map.put ("yingYongId","870101"); |
| | | map.put ("kaiDanKs",params.get(ApiParamsConstants.kaiDanKeShi)); |
| | | map.put ("kaiDanKs",config.getKdks()); |
| | | map.put ("dengJiLsh",params.get(ApiParamsConstants.Tj_NUM)); |
| | | map.put ("shouTuiBz",params.get(ApiParamsConstants.SHOU_TUI_STATUS)); |
| | | map.put ("feiYongMxList",params.get(ApiParamsConstants.FEI_YONG_INFO_LIST)); |
| | | //职业编码 |
| | | String post = sendPost(HIS_URL + "/shouFei/createMenZhenFy", map); |
| | | String post = sendPost(config.getHisUrl() + "/shouFei/createMenZhenFy", map); |
| | | JSONObject jsonObject = JSONUtil.parseObj(post); |
| | | if (jsonObject.getInt("returnCode") != 1) return AjaxResult.error(post); |
| | | JSONObject data = jsonObject.getJSONObject("returnData"); |
| | |
| | | }); |
| | | map.put ("feiYongIdList",ids); |
| | | //职业编码 |
| | | String post = sendPost(HIS_URL + "/shouFei/cheXiaoMzFy", map); |
| | | String post = sendPost(dictCommonHisConfigService.getConfigByHospital("sqyy").getHisUrl() + "/shouFei/cheXiaoMzFy", map); |
| | | JSONObject entries = JSONUtil.parseObj(post); |
| | | if (entries.getStr("returnCode").equals("1")) |
| | | return AjaxResult.success(); |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | return sendPost(HIS_URL+"/zhuShuJu/getKeShi", map); |
| | | return sendPost(dictCommonHisConfigService.getConfigByHospital("sqyy").getHisUrl()+"/zhuShuJu/getKeShi", map); |
| | | } |
| | | |
| | | @Override |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | return sendPost(HIS_URL+"/zhuShuJu/getListYiShengZd", map); |
| | | return sendPost(dictCommonHisConfigService.getConfigByHospital("sqyy").getHisUrl()+"/zhuShuJu/getListYiShengZd", map); |
| | | } |
| | | |
| | | @Override |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | return sendPost(HIS_URL+"/zhuShuJu/getShouFeiXm", map); |
| | | return sendPost(dictCommonHisConfigService.getConfigByHospital("sqyy").getHisUrl()+"/zhuShuJu/getShouFeiXm", map); |
| | | } |
| | | |
| | | @Override |
| | |
| | | map.put ("keShiIds",params.get(ApiParamsConstants.DEPT_IDS)); |
| | | map.put ("ifPlus",""); |
| | | //职业编码 |
| | | return sendPost(HIS_URL+"/zhuShuJu/getKeShiByConditions", map); |
| | | return sendPost(dictCommonHisConfigService.getConfigByHospital("sqyy").getHisUrl()+"/zhuShuJu/getKeShiByConditions", map); |
| | | } |
| | | |
| | | @Override |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | return sendPost(HIS_URL+"/zhuShuJu/getYangBen", map); |
| | | return sendPost(dictCommonHisConfigService.getConfigByHospital("sqyy").getHisUrl()+"/zhuShuJu/getYangBen", map); |
| | | } |
| | | |
| | | @Override |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | return sendPost(HIS_URL+"/zhuShuJu/getListBingQuZd", map); |
| | | return sendPost(dictCommonHisConfigService.getConfigByHospital("sqyy").getHisUrl()+"/zhuShuJu/getListBingQuZd", map); |
| | | } |
| | | |
| | | @Override |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | return sendPost(HIS_URL+"/zhuShuJu/getZhiGongPage", map); |
| | | return sendPost(dictCommonHisConfigService.getConfigByHospital("sqyy").getHisUrl()+"/zhuShuJu/getZhiGongPage", map); |
| | | } |
| | | |
| | | @Override |
| | |
| | | map.put ("pageIndex",params.get(ApiParamsConstants.PAGE_INDEX)); |
| | | map.put ("pageSize",params.get(ApiParamsConstants.PAGE_SIZE)); |
| | | //职业编码 |
| | | return sendPost(HIS_URL+"/zhuShuJu/getJianChaXm", map); |
| | | return sendPost(dictCommonHisConfigService.getConfigByHospital("sqyy").getHisUrl()+"/zhuShuJu/getJianChaXm", map); |
| | | } |
| | | |
| | | @Override |
| | |
| | | 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)); |
| | | return sendPost(HIS_URL+"/zhuShuJu/getJianYanXm", hashMap); |
| | | return sendPost(dictCommonHisConfigService.getConfigByHospital("sqyy").getHisUrl()+"/zhuShuJu/getJianYanXm", hashMap); |
| | | } |
| | | |
| | | @Override |
| | |
| | | HashMap<String, Object> hashMap = new HashMap<>(); |
| | | hashMap.put("shouFeiXmId",map.get(ApiParamsConstants.COMMON_QUERY_KEY)); |
| | | hashMap.put("jiaGeTx",map.get(ApiParamsConstants.COMMON_QUERY_KEY2)); |
| | | return sendPost(HIS_URL+"/zhuShuJu/getShouFeiXmJg", hashMap); |
| | | return sendPost(dictCommonHisConfigService.getConfigByHospital("sqyy").getHisUrl()+"/zhuShuJu/getShouFeiXmJg", hashMap); |
| | | } |
| | | |
| | | @Override |
| | |
| | | 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)); |
| | | return sendPost(HIS_URL+"/zhuShuJu/getRongQi", hashMap); |
| | | return sendPost(dictCommonHisConfigService.getConfigByHospital("sqyy").getHisUrl()+"/zhuShuJu/getRongQi", hashMap); |
| | | } |
| | | |
| | | @Override |
| | |
| | | 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)); |
| | | return sendPost(HIS_URL+"/zhuShuJu/getYangBen", hashMap); |
| | | return sendPost(dictCommonHisConfigService.getConfigByHospital("sqyy").getHisUrl()+"/zhuShuJu/getYangBen", hashMap); |
| | | } |
| | | |
| | | @Override |
| | |
| | | map.put("type","1"); |
| | | HashMap<String, Object> headers = new HashMap<>(); |
| | | headers.put("hospId","sqyy"); |
| | | String post = HttpClientUtils.sendPost(TJ_URL + "/callBack/pushZhiFuMsg", map,headers); |
| | | String post = HttpClientUtils.sendPost(dictCommonHisConfigService.getConfigByHospital("sqyy").getTjUrl() + "/callBack/pushZhiFuMsg", map,headers); |
| | | JSONObject jsonObject = JSONUtil.parseObj(post); |
| | | JSONObject obj = JSONUtil.createObj(); |
| | | if (jsonObject.getStr("code").equals("200")) { |
| | |
| | | map.put("hosp","shanxiqinsqyy"); |
| | | HashMap<String, Object> headers = new HashMap<>(); |
| | | headers.put("hospId","sqyy"); |
| | | String post = HttpClientUtils.sendPost(TJ_URL + "/callBack/getZdList", map,headers); |
| | | String post = HttpClientUtils.sendPost(dictCommonHisConfigService.getConfigByHospital("sqyy").getTjUrl() + "/callBack/getZdList", map,headers); |
| | | JSONArray jsonArray = JSONUtil.parseObj(post).getJSONArray("data"); |
| | | if (jsonArray != null && !jsonArray.isEmpty()) { |
| | | List<HisSyncDict> list = jsonArray.toList(HisSyncDict.class); |