ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java
@@ -49,6 +49,8 @@ private HisApiGetMethodService hisApiGetMethodService; @Resource private ISysConfigService configService; @Resource private ITbTransitionService transitionService; //将方法返回值解析成json格式 public JSONObject getJSONObject(String builder) { @@ -65,6 +67,7 @@ @Transactional public AjaxResult HisApiMethods(TjCustomer customer, Long orderId) { TjOrder tjOrder = orderService.getById(orderId); Date dates = new Date(); final String date = DateUtil.format(dates, "yyyy-MM-dd HH:mm:ss"); AjaxResult result = controller.Outpincreateapply(customer); @@ -78,8 +81,50 @@ String pationid = resultData.get("PationId").toString(); if (null != pationid) { customer.setPationId(pationid); // customerService.updateById(customer); /* OutpinregapplyDto outpinregapplyDto = new OutpinregapplyDto(); outpinregapplyDto.setPationid(pationid); outpinregapplyDto.setSqysbm(SecurityUtils.getUsername()); outpinregapplyDto.setMzksbm("0101"); outpinregapplyDto.setCzybm("00029"); outpinregapplyDto.setSfjz("0"); outpinregapplyDto.setGhzlbm("01"); outpinregapplyDto.setYwckbm("0001"); outpinregapplyDto.setSflstd("0"); outpinregapplyDto.setGhrq(date); //门诊挂号 AjaxResult ajaxResult = controller.Outpinregapply(outpinregapplyDto); String result2 = getAjaxResult(ajaxResult); JSONObject object1 = getJSONObject(result2); String code1 = object1.getStr("ResultCode"); if (code1.equals("0")) { JSONArray resultDatas = object1.getJSONArray("ResultData"); if (null != resultDatas && resultDatas.size() > 0) { Map<String, Object> resultDatasss = (Map<String, Object>) resultDatas.get(0); String hisRegistrationId = resultDatasss.get("his_registration_id").toString(); //门诊医生接诊 controller.Outpinconapply(hisRegistrationId, date, SecurityUtils.getUsername()); customer.setCardId(hisRegistrationId); customerService.updateById(customer); transitionService.updateCardIdByTjNumAndIdCard(customer.getCusIdcard(),hisRegistrationId); if(null !=tjOrder){ tjOrder.setCardId(hisRegistrationId); orderService.updateById(tjOrder); } } }*/ AjaxResult error = tijianshenqing(customer, date); if (error != null) return error; return AjaxResult.success(); } } } return AjaxResult.error(); } //体检对his申请单调用方法 private AjaxResult tijianshenqing(TjCustomer customer, String date) { //检验申请 OutpintestapplyDto dto = new OutpintestapplyDto(); dto.setHisRegistrationId(customer.getCardId()); @@ -245,11 +290,7 @@ return AjaxResult.error(); } } return AjaxResult.success(); } } } return AjaxResult.error(); return null; } ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java
@@ -501,9 +501,12 @@ if (null != resultData && resultData.size() > 0) { String pationid = resultData.get("PationId").toString(); if (null != pationid) { tjCustomer.setPationId(pationid); // tjCustomerService.updateById(tjCustomer); /* OutpinregapplyDto outpinregapplyDto = new OutpinregapplyDto(); outpinregapplyDto.setPationid(pationid); // outpinregapplyDto.setHisRegistrationId(pationid); outpinregapplyDto.setSqysbm(SecurityUtils.getUsername()); outpinregapplyDto.setMzksbm("0101"); outpinregapplyDto.setCzybm("00029"); @@ -537,7 +540,7 @@ } } } } }*/ } } ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java
@@ -851,14 +851,16 @@ wqq.eq(TjOrder::getUserId, tjOrder.getUserId()); wqq.eq(TjOrder::getCheckStatus, 0); wqq.isNull(TjOrder::getFinishTime); if (!tjCustomer.getCardId().equals("0")) { // if (!tjCustomer.getCardId().equals("0")) { wqq.eq(TjOrder::getCardId, tjCustomer.getCardId()); } // } TjOrder order = tjOrderService.getOne(wqq); if (null != order) { transitionService.deletedTbTransitionListByCusIdAndTjNum(tjCustomer.getCusIdcard(),tjCustomer.getCardId()); return AjaxResult.error("不可重复登记"); } LambdaQueryWrapper<TjReservation> wq1 = new LambdaQueryWrapper<>(); wq1.eq(TjReservation::getIdCard, tjCustomer.getCusIdcard()); wq1.eq(TjReservation::getIsExpire, 2); ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TbTransitionMapper.java
@@ -225,4 +225,14 @@ @Select("SELECT SUM(a.now_price) FROM tb_transition a WHERE a.cus_id=#{cusId} AND a.parent_pro_id=#{proId} and a.card_id=#{cardId} and a.pac_id=#{pacId}") BigDecimal getTbTransitionDxPriceByPac(@Param("cusId")String cusId,@Param("proId")Long proId,@Param("cardId")String cardId,@Param("pacId")Long pacId); @Update("UPDATE tb_transition a \n" + "SET \n" + "a.card_id=#{cardId}\n" + "WHERE\n" + "\ta.cus_id =#{idCard}\n" + "\tAND ISNULL(a.tj_num)") boolean updateCardIdByTjNumAndIdCard(@Param("idCard")String idCard,@Param("cardId")String cardId); } ltkj-hosp/src/main/java/com/ltkj/hosp/service/ITbTransitionService.java
@@ -114,4 +114,7 @@ BigDecimal getTbTransitionDxPriceByPac(String cusId,Long proId,String cardId,Long pacId); String selectPacIdByTbTransitionTjNumAndProId(String tjNum,String cardId); boolean updateCardIdByTjNumAndIdCard(String idCard,String cardId); } ltkj-hosp/src/main/java/com/ltkj/hosp/service/impl/TbTransitionServiceImpl.java
@@ -186,4 +186,9 @@ public String selectPacIdByTbTransitionTjNumAndProId(String tjNum,String cardId) { return tbTransitionMapper.selectPacIdByTbTransitionTjNumAndProId(tjNum,cardId); } @Override public boolean updateCardIdByTjNumAndIdCard(String idCard, String cardId) { return tbTransitionMapper.updateCardIdByTjNumAndIdCard(idCard,cardId); } }