| | |
| | | //开启和his对接 |
| | | if(null !=sfkqdyhis && sfkqdyhis.equals("Y")){ |
| | | |
| | | String baoGaoDan = ltkjHybgdService.getJianYanBaoGaoDan(order.getCardId()); |
| | | if(null !=baoGaoDan){ |
| | | Date dates = new Date(); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("his_registration_id",order.getCardId()); |
| | | map.put("ksbm",""); |
| | | map.put("pationid",""); |
| | | map.put("ksrq",DateUtil.format(DateUtil.beginOfDay(dates), "yyyy-MM-dd HH:mm:ss")); |
| | | map.put("jsrq",DateUtil.format(DateUtil.endOfDay(dates), "yyyy-MM-dd HH:mm:ss")); |
| | | map.put("pagecount",10); |
| | | map.put("page",1); |
| | | AjaxResult result = controller.Getlabreportinfo(map); |
| | | String result1 = getAjaxResult(result); |
| | | JSONObject object = getJSONObject(result1); |
| | | String code = object.getStr("ResultCode"); |
| | | if(null ==code || !code.equals("0")){ |
| | | return AjaxResult.error("化验项目暂时无结果,请稍后同步!!!"); |
| | | } |
| | | JSONArray data = object.getJSONArray("ResultData"); |
| | | for (Object datum : data) { |
| | | JSONObject jsonObject = (JSONObject)datum; |
| | | LtkjHysqd jybgid = ltkjHysqdService.getLtkjHysqdByTjhAndTmh(order.getCardId(), jsonObject.getStr("JYBGID")); |
| | | if(null !=jybgid){ |
| | | continue; |
| | | List<String> baoGaoDans = ltkjHybgdService.getJianYanBaoGaoDan(order.getCardId()); |
| | | if(null !=baoGaoDans && baoGaoDans.size()>0){ |
| | | // for (String baoGaoDan : baoGaoDans) { |
| | | Date dates = new Date(); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("his_registration_id",order.getCardId()); |
| | | map.put("ksbm",""); |
| | | map.put("pationid",""); |
| | | map.put("ksrq",DateUtil.format(DateUtil.beginOfDay(dates), "yyyy-MM-dd HH:mm:ss")); |
| | | map.put("jsrq",DateUtil.format(DateUtil.endOfDay(dates), "yyyy-MM-dd HH:mm:ss")); |
| | | map.put("pagecount",10); |
| | | map.put("page",1); |
| | | AjaxResult result = controller.Getlabreportinfo(map); |
| | | String result1 = getAjaxResult(result); |
| | | JSONObject object = getJSONObject(result1); |
| | | String code = object.getStr("ResultCode"); |
| | | if(null ==code || !code.equals("0")){ |
| | | return AjaxResult.error("化验项目暂时无结果,请稍后同步!!!"); |
| | | } |
| | | LtkjHysqd hysqd=new LtkjHysqd(); |
| | | hysqd.setTjh(order.getCardId()); |
| | | hysqd.setTmh(jsonObject.getStr("JYBGID")); |
| | | hysqd.setBbbh(jsonObject.getStr("BBDM")); |
| | | hysqd.setBbmc(jsonObject.getStr("BBMC")); |
| | | hysqd.setXmid(jsonObject.getStr("JYXMDM")); |
| | | hysqd.setXmmc(jsonObject.getStr("JYXMMC")); |
| | | hysqd.setSqsj(jsonObject.getStr("SQRQ")); |
| | | hysqd.setSqys(jsonObject.getStr("SQRBH")); |
| | | hysqd.setJgsj(jsonObject.getStr("JYBGRQ")); |
| | | hysqd.setSqrxm(jsonObject.getStr("SQRXM")); |
| | | hysqd.setSqdh(jsonObject.getStr("SQDBH")); |
| | | if (ltkjHysqdService.save(hysqd)) { |
| | | Map<String,Object> hashMap=new HashMap<>(); |
| | | hashMap.put("jybgid",hysqd.getTmh()); |
| | | AjaxResult bgdres = controller.Getlabdetailinfo(hashMap); |
| | | String result2 = getAjaxResult(bgdres); |
| | | JSONObject object1 = getJSONObject(result2); |
| | | String code1 = object1.getStr("ResultCode"); |
| | | if(null ==code1 || !code1.equals("0")){ |
| | | return AjaxResult.error("化验项目暂时无结果,请稍后同步!!!"); |
| | | JSONArray data = object.getJSONArray("ResultData"); |
| | | for (Object datum : data) { |
| | | JSONObject jsonObject = (JSONObject)datum; |
| | | LtkjHysqd jybgid = ltkjHysqdService.getLtkjHysqdByTjhAndTmh(order.getCardId(), jsonObject.getStr("JYBGID")); |
| | | if(null !=jybgid){ |
| | | continue; |
| | | } |
| | | JSONArray datas = object1.getJSONArray("ResultData"); |
| | | for (Object o : datas) { |
| | | JSONObject js = (JSONObject)o; |
| | | LtkjHysqd hysqd=new LtkjHysqd(); |
| | | hysqd.setTjh(order.getCardId()); |
| | | hysqd.setTmh(jsonObject.getStr("JYBGID")); |
| | | hysqd.setBbbh(jsonObject.getStr("BBDM")); |
| | | hysqd.setBbmc(jsonObject.getStr("BBMC")); |
| | | hysqd.setXmid(jsonObject.getStr("JYXMDM")); |
| | | hysqd.setXmmc(jsonObject.getStr("JYXMMC")); |
| | | hysqd.setSqsj(jsonObject.getStr("SQRQ")); |
| | | hysqd.setSqys(jsonObject.getStr("SQRBH")); |
| | | hysqd.setJgsj(jsonObject.getStr("JYBGRQ")); |
| | | hysqd.setSqrxm(jsonObject.getStr("SQRXM")); |
| | | hysqd.setSqdh(jsonObject.getStr("SQDBH")); |
| | | if (ltkjHysqdService.save(hysqd)) { |
| | | Map<String,Object> hashMap=new HashMap<>(); |
| | | hashMap.put("jybgid",hysqd.getTmh()); |
| | | AjaxResult bgdres = controller.Getlabdetailinfo(hashMap); |
| | | String result2 = getAjaxResult(bgdres); |
| | | JSONObject object1 = getJSONObject(result2); |
| | | String code1 = object1.getStr("ResultCode"); |
| | | if(null ==code1 || !code1.equals("0")){ |
| | | return AjaxResult.error("化验项目暂时无结果,请稍后同步!!!"); |
| | | } |
| | | JSONArray datas = object1.getJSONArray("ResultData"); |
| | | for (Object o : datas) { |
| | | JSONObject js = (JSONObject)o; |
| | | // ltkjHybgdService.deletedLtkjHybgdByTjhAndTmh(jsonObject.getStr("JYBGID")); |
| | | LtkjHybgd bgd=new LtkjHybgd(); |
| | | bgd.setTmh(hysqd.getTmh()); |
| | | bgd.setJcxmid(js.getStr("JCZBDM")); |
| | | bgd.setJcxm(js.getStr("JCZBMC")); |
| | | bgd.setTdh(js.getStr("")); |
| | | bgd.setJyjg(js.getStr("JCZBJG")); |
| | | bgd.setJgdw(js.getStr("JLDW")); |
| | | bgd.setFwzdz(js.getStr("")); |
| | | bgd.setFwzgz(js.getStr("")); |
| | | bgd.setFwz(js.getStr("CKZFW")); |
| | | bgd.setJysj(js.getStr("BGRQ")); |
| | | bgd.setJyys(js.getStr("JCRBH")); |
| | | bgd.setShsj(js.getStr("BGRQ")); |
| | | bgd.setShsj(js.getStr("BGRQ")); |
| | | bgd.setShys(js.getStr("SHRBH")); |
| | | bgd.setYcbz(js.getStr("YCTS")); |
| | | LtkjHybgd bgd=new LtkjHybgd(); |
| | | bgd.setTmh(hysqd.getTmh()); |
| | | bgd.setJcxmid(js.getStr("JCZBDM")); |
| | | bgd.setJcxm(js.getStr("JCZBMC")); |
| | | bgd.setTdh(js.getStr("")); |
| | | bgd.setJyjg(js.getStr("JCZBJG")); |
| | | bgd.setJgdw(js.getStr("JLDW")); |
| | | bgd.setFwzdz(js.getStr("")); |
| | | bgd.setFwzgz(js.getStr("")); |
| | | bgd.setFwz(js.getStr("CKZFW")); |
| | | bgd.setJysj(js.getStr("BGRQ")); |
| | | bgd.setJyys(js.getStr("JCRBH")); |
| | | bgd.setShsj(js.getStr("BGRQ")); |
| | | bgd.setShsj(js.getStr("BGRQ")); |
| | | bgd.setShys(js.getStr("SHRBH")); |
| | | bgd.setYcbz(js.getStr("YCTS")); |
| | | // bgd.setTpurl(js.getStr("")); |
| | | ltkjHybgdService.save(bgd); |
| | | ltkjHybgdService.save(bgd); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // } |
| | | //同步化验项目 |
| | | testMapper.updateDetailByCall(order.getCardId(), String.valueOf(order.getOrderId()), order.getTjNumber(), UserHoder.getLoginUser().getUserId()); |
| | | //同步检查项目 |