| | |
| | | import com.ltkj.framework.config.MatchUtils; |
| | | import com.ltkj.hosp.domain.*; |
| | | import com.ltkj.hosp.hisDto.*; |
| | | import com.ltkj.hosp.mapper.TjOrderDetailMapper; |
| | | import com.ltkj.hosp.mapper.TjOrderRemarkMapper; |
| | | import com.ltkj.hosp.mapper.TjSamplingMapper; |
| | | import com.ltkj.hosp.pacsDto.SavePacsApply; |
| | | import com.ltkj.hosp.service.*; |
| | |
| | | private ITjRulesService rulesService; |
| | | @Autowired |
| | | private ITjProAdvicerulesService tjProAdvicerulesService; |
| | | |
| | | @Autowired |
| | | private TjOrderDetailMapper detailMapper; |
| | | |
| | | @Autowired |
| | | private TjOrderRemarkMapper remarkMapper; |
| | | |
| | | |
| | | |
| | |
| | | //如果该项目存在 则 不保存 |
| | | |
| | | TjOrderDetail orderDetail = tjOrderDetailService.getTjOrderDetailByOrderId(String.valueOf(tjFlowingWater.getOrderId()), tjProId); |
| | | if(null !=orderDetail) continue; |
| | | // if(null !=orderDetail) continue; |
| | | if(null !=orderDetail) { |
| | | detailMapper.updateTjOrderDetailDel(orderDetail.getOrderDetailId().toString()); |
| | | } |
| | | |
| | | TjProject projects = projectService.selectTjProjectByProId(Long.valueOf(tjProId)); |
| | | if (null != projects) { |
| | |
| | | if(!projectList.isEmpty()){ |
| | | List<TjProject> list = projectList.stream().distinct().collect(Collectors.toList()); |
| | | for (TjProject project : list) { |
| | | |
| | | TjOrderRemark orderRemark = orderRemarkService.getTjOrderRemarkByTjNumAndProParentId(order.getTjNumber(), String.valueOf(project.getProId())); |
| | | if(null !=orderRemark){ |
| | | remarkMapper.updateTjOrderRemarkdel(orderRemark.getRemarkId().toString()); |
| | | } |
| | | |
| | | TjOrderRemark tjOrderRemark = new TjOrderRemark(); |
| | | tjOrderRemark.setProId(project.getProId()); |
| | | tjOrderRemark.setProName(project.getProName()); |
| | |
| | | tjOrderRemark.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | tjOrderRemark.setJxbz(jxbz); |
| | | orderRemarkService.save(tjOrderRemark); |
| | | |
| | | |
| | | TjOrderDetail orderDetail = tjOrderDetailService.getTjOrderDetailByOrderId(String.valueOf(tjFlowingWater.getOrderId()), project.getProId().toString()); |
| | | if(null !=orderDetail) { |
| | | detailMapper.updateTjOrderDetailDel(orderDetail.getOrderDetailId().toString()); |
| | | } |
| | | |
| | | TjOrderDetail detail1 = new TjOrderDetail(); |
| | | detail1.setTjStatus(0L); |
| | |
| | | List<TjOrderDetail> detailLists = tjOrderDetailService.getCaiYangDengJiJxbz(order.getOrderId(), jxbz); |
| | | addCaiYangDengJi(detailLists, !detailLists.isEmpty(), order, sysUser, jxbz); |
| | | // } |
| | | AjaxResult result = tijianbulushenqing(customer, date, order.getCardId(), jxbz, jianChaProjects, tjFlowingWater.getPayType() == 6L); |
| | | if (!result.get("code").toString().equals("200")) |
| | | return false; |
| | | String isUseMx = configService.selectConfigByKey("jcxhis_is_use_mx"); |
| | | AjaxResult result; |
| | | if (isUseMx.equalsIgnoreCase("Y")) |
| | | result = tijianbulushenqing(customer, date, order.getCardId(), jxbz, jianChaProjects, tjFlowingWater.getPayType() == 6L); |
| | | else result = tijianbulushenqingJinchuanNew (customer, date, order.getCardId(), jxbz, jianChaProjects, tjFlowingWater.getPayType() == 6L); |
| | | return result.get("code").toString().equals("200"); |
| | | }else { |
| | | List<TjOrderDetail> detailLists = tjOrderDetailService.getCaiYangDengJiJxbz(order.getOrderId(), jxbz); |
| | | addCaiYangDengJiByDiaoYongShiTu(detailLists, !detailLists.isEmpty(), order, sysUser, jxbz); |
| | |
| | | } |
| | | } |
| | | |
| | | private static List<String> mapJinchuan=null; |
| | | public AjaxResult tijianbulushenqingJinchuanNew(TjCustomer customer, String date,String cardId,String jxbz,ArrayList<TjProject> jianChaProjects,Boolean isTuanTiPiao) { |
| | | mapJinchuan=new ArrayList<>(); |
| | | tijianbulushenqingOld( customer,date, cardId, jxbz, jianChaProjects, isTuanTiPiao); |
| | | |
| | | |
| | | //体检对his申请单调用方法 |
| | | // public AjaxResult tijianbulushenqing(TjCustomer customer, String date,String cardId,String jxbz,ArrayList<TjProject> jianChaProjects,Boolean isTuanTiPiao) { |
| | | // TjOrder order = orderService.getOrderByCardId(cardId); |
| | | // if(null !=order){ |
| | | // String dept = configService.selectConfigByKey("request_default_dept"); |
| | | // String ysbm = configService.selectConfigByKey("request_default_ysbm"); |
| | | // String ysmc = configService.selectConfigByKey("request_default_ysmc"); |
| | | // String lis_tmh_prefix = configService.selectConfigByKey("make_lis_tmh_prefix"); |
| | | // List<TbTransition> detailList = transitionService.getBlTbTransitionListByCusId(customer.getCusIdcard(),cardId,jxbz); |
| | | // Boolean useLisAndPacsRegister = lisApiMethod.isUseLisAndPacsRegister(order); |
| | | // List<OutpinmedicapplyDetilsDto> outpinmedicapplyDetilsDtos =new ArrayList<>(); |
| | | // if (useLisAndPacsRegister && isTuanTiPiao) { |
| | | // // 检查申请 |
| | | // pacsReg(order, customer, jianChaProjects); |
| | | // LambdaQueryWrapper<TjSampling> wrapper = new LambdaQueryWrapper<>(); |
| | | // wrapper.eq(TjSampling::getTjNum,order.getTjNumber()); |
| | | // wrapper.eq(TjSampling::getJxbz,jxbz); |
| | | // List<TjSampling> list = tjSamplingService.list(wrapper); |
| | | // log.info("采样数据 ->{}",JSONUtil.toJsonStr(list)); |
| | | // if (!list.isEmpty()){ |
| | | // Map<String, List<TjSampling>> listMap = list.stream().collect(Collectors.groupingBy(TjSampling::getSpecimenTypeCode)); |
| | | // log.info("分组后 ->{}",JSONUtil.toJsonStr(listMap)); |
| | | // ArrayList<String> ids = new ArrayList<>(); |
| | | // for (Map.Entry<String, List<TjSampling>> entry : listMap.entrySet()) { |
| | | // log.info("key ->{},val ->{}",entry.getKey(),entry.getValue()); |
| | | // // Lis标本代码 |
| | | // String specimenTypeCode = entry.getKey(); |
| | | // List<TjSampling> samplings = entry.getValue(); |
| | | // if (samplings.size() >= 2){ |
| | | // // 进行合并 |
| | | // List<String> stringList = samplings.stream().map(TjSampling::getId).collect(Collectors.toList()); |
| | | tijianbulushenqingJinchuan( customer,date, cardId, jxbz, jianChaProjects, isTuanTiPiao); |
| | | return AjaxResult.success(); |
| | | //return AjaxResult.success(); |
| | | } |
| | | public AjaxResult tijianbulushenqingJinchuan(TjCustomer customer, String date,String cardId,String jxbz,ArrayList<TjProject> jianChaProjects,Boolean isTuanTiPiao) { |
| | | TjOrder order = orderService.getOrderByCardId(cardId); |
| | | if(null !=order){ |
| | | String dept = configService.selectConfigByKey("request_default_dept"); |
| | | String ysbm = configService.selectConfigByKey("request_default_ysbm"); |
| | | String ysmc = configService.selectConfigByKey("request_default_ysmc"); |
| | | String lis_tmh_prefix = configService.selectConfigByKey("make_lis_tmh_prefix"); |
| | | List<TbTransition> detailList = transitionService.getBlTbTransitionListByCusId(customer.getCusIdcard(),cardId,jxbz); |
| | | Boolean useLisAndPacsRegister = lisApiMethod.isUseLisAndPacsRegister(order); |
| | | List<OutpinmedicapplyDetilsDto> outpinmedicapplyDetilsDtos =new ArrayList<>(); |
| | | if (useLisAndPacsRegister && isTuanTiPiao) { |
| | | // 检查申请 |
| | | pacsReg(order, customer, jianChaProjects); |
| | | LambdaQueryWrapper<TjSampling> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TjSampling::getTjNum,order.getTjNumber()); |
| | | wrapper.eq(TjSampling::getJxbz,jxbz); |
| | | List<TjSampling> list = tjSamplingService.list(wrapper); |
| | | log.info("采样数据 ->{}",JSONUtil.toJsonStr(list)); |
| | | if (!list.isEmpty()){ |
| | | Map<String, List<TjSampling>> listMap = list.stream().collect(Collectors.groupingBy(TjSampling::getSpecimenTypeCode)); |
| | | log.info("分组后 ->{}",JSONUtil.toJsonStr(listMap)); |
| | | ArrayList<String> ids = new ArrayList<>(); |
| | | for (Map.Entry<String, List<TjSampling>> entry : listMap.entrySet()) { |
| | | log.info("key ->{},val ->{}",entry.getKey(),entry.getValue()); |
| | | // Lis标本代码 |
| | | String specimenTypeCode = entry.getKey(); |
| | | List<TjSampling> samplings = entry.getValue(); |
| | | if (samplings.size() >= 2){ |
| | | // 进行合并 |
| | | List<String> stringList = samplings.stream().map(TjSampling::getId).collect(Collectors.toList()); |
| | | // log.info("提取id ->{}",stringList); |
| | | // for (int i = 0; i < stringList.size(); i++) { |
| | | // String s = stringList.get(i); |
| | | // if (tjSamplingService.isMergeItem(s) != 0) { |
| | | // stringList.remove(s); |
| | | // ids.add(s); |
| | | // } |
| | | // } |
| | | // if (stringList.size() > 1) { |
| | | // String id = tjSamplingService.mergeCaiYangApi(stringList,lis_tmh_prefix); |
| | | // ids.add(id); |
| | | // }else { |
| | | // ids.add(stringList.get(0)); |
| | | // } |
| | | // }else { |
| | | // ids.add(samplings.get(0).getId()); |
| | | // } |
| | | // } |
| | | // Boolean confirmed = samplingServiceApi.confirmSamplingApi(ids, "Y", "N"); |
| | | // if (!confirmed) |
| | | // return AjaxResult.error("处理失败"); |
| | | for (int i = 0; i < stringList.size(); i++) { |
| | | String s = stringList.get(i); |
| | | if (tjSamplingService.isMergeItem(s) != 0) { |
| | | stringList.remove(s); |
| | | ids.add(s); |
| | | } |
| | | } |
| | | if (stringList.size() > 1) { |
| | | String id = tjSamplingService.mergeCaiYangApi(stringList,lis_tmh_prefix); |
| | | ids.add(id); |
| | | }else { |
| | | ids.add(stringList.get(0)); |
| | | } |
| | | }else { |
| | | ids.add(samplings.get(0).getId()); |
| | | } |
| | | } |
| | | Boolean confirmed = samplingServiceApi.confirmSamplingApi(ids, "Y", "N"); |
| | | if (!confirmed) |
| | | return AjaxResult.error("处理失败"); |
| | | } |
| | | }else { |
| | | List<TjOutpinmedicXm> outpinmedicXms = tjOutpinmedicXmService.list(); |
| | | //检验申请 |
| | | if (null != detailList && !detailList.isEmpty()) { |
| | | LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); |
| | | wq.in(TjProject::getProId, detailList.stream().map(TbTransition::getParentProId).collect(Collectors.toList())); |
| | | // wq.groupBy(TjProject::getHisXmbm); |
| | | // wq.in(TjProject::getDeptId, "241", "317"); |
| | | wq.in(TjProject::getDeptId,deptService.getJyDeptIds()); |
| | | List<TjProject> projects = projectService.list(wq); |
| | | if (null != projects && !projects.isEmpty()) { |
| | | List<TjProject> notNull = projects.stream().filter(i -> i.getSpecimenType() != null).collect(Collectors.toList()); |
| | | List<TjProject> isNull = projects.stream().filter(i -> i.getSpecimenType() == null).collect(Collectors.toList()); |
| | | Map<String, List<TjProject>> listMap = notNull.stream().collect(Collectors.groupingBy(TjProject::getSpecimenType)); |
| | | if (!isNull.isEmpty()) |
| | | listMap.put("",isNull); |
| | | for (Map.Entry<String, List<TjProject>> entry : listMap.entrySet()) { |
| | | OutpintestapplyDto dto = new OutpintestapplyDto(); |
| | | dto.setHisRegistrationId(cardId); |
| | | dto.setSfzh(customer.getCusIdcard()); |
| | | dto.setSqysbm(ysbm); |
| | | dto.setMzksbm(dept); |
| | | dto.setSjrq(date); |
| | | dto.setCzybm(ysbm); |
| | | dto.setCzyksbm(dept); |
| | | dto.setSfjz("0"); |
| | | List<OutpintestapplyDetailsDto> detailsDtos = new ArrayList<>(); |
| | | List<TjProject> value = entry.getValue(); |
| | | for (TjProject project : value) { |
| | | LambdaQueryWrapper<TjProject> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TjProject::getProParentId,project.getProId()); |
| | | if (!mapJinchuan.isEmpty()) { |
| | | wrapper.notIn(TjProject::getProId, mapJinchuan); |
| | | wrapper.notIn(TjProject::getProParentId, mapJinchuan); |
| | | } |
| | | List<TjProject> list = projectService.list(wrapper); |
| | | for (TjProject tjProject : list) { |
| | | if (StrUtil.isNotBlank(tjProject.getHisXmbm()) && tjProject.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | detailsDto.setMxfyxmbm(tjProject.getHisXmbm()); |
| | | if (tjProject.getSfzhfy().equals("Y")) { |
| | | detailsDto.setSfzhfy("1"); |
| | | } else { |
| | | detailsDto.setSfzhfy("0"); |
| | | } |
| | | detailsDto.setSl(tjProject.getSl()); |
| | | detailsDto.setProjg(tjProject.getProPrice()); |
| | | detailsDtos.add(detailsDto); |
| | | } |
| | | } |
| | | if (!outpinmedicXms.isEmpty()) { |
| | | outpinmedicXms.stream().filter(i -> i.getProId().equals(project.getProId())).forEach(i -> { |
| | | OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | detilsDto.setYpbm(i.getYpbm()); |
| | | detilsDto.setPcbm(i.getPcbm()); |
| | | detilsDto.setSl(i.getSl()); |
| | | detilsDto.setDj(i.getDj()); |
| | | detilsDto.setDcjl(i.getDcjl()); |
| | | detilsDto.setPj(i.getPj()); |
| | | detilsDto.setJj(i.getJj()); |
| | | detilsDto.setJldw(""); |
| | | detilsDto.setTjbm(""); |
| | | detilsDto.setPs(""); |
| | | detilsDto.setPsbm(""); |
| | | detilsDto.setYyts(""); |
| | | detilsDto.setXtph(""); |
| | | detilsDto.setScph(""); |
| | | detilsDto.setYpxq(""); |
| | | detilsDto.setCdbm(""); |
| | | detilsDto.setKfdw(""); |
| | | detilsDto.setYfdw(""); |
| | | detilsDto.setYysm(""); |
| | | detilsDto.setYpmc(i.getYpmc()); |
| | | detilsDto.setFzbl(i.getFzbl()); |
| | | detilsDto.setZh(i.getZh()); |
| | | outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | }); |
| | | } |
| | | } |
| | | if (!detailsDtos.isEmpty()) { |
| | | dto.setDetails(detailsDtos); |
| | | AjaxResult ajaxResult1 = controller.Outpintestapply(dto); |
| | | String result5 = getAjaxResult(ajaxResult1); |
| | | JSONObject object3 = getJSONObject(result5); |
| | | String code3 = object3.getStr("ResultCode"); |
| | | if (code3.equals("0")) { |
| | | List<OutpintestapplyDetailsDto> details = dto.getDetails(); |
| | | for (OutpintestapplyDetailsDto detail : details) { |
| | | LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | tree.setCardId(dto.getHisRegistrationId()); |
| | | tree.setPationid(customer.getPationId()); |
| | | JSONObject resultData = object3.getJSONObject("ResultData"); |
| | | tree.setSqdh(resultData.getStr("jysqdh")); |
| | | tree.setFyhj(resultData.getStr("fyhj")); |
| | | String mxfyxmbm = detail.getMxfyxmbm(); |
| | | tree.setHisXmdm(mxfyxmbm); |
| | | tree.setType("检验"); |
| | | tree.setService("his"); |
| | | tree.setTjPrice(String.valueOf(detail.getProjg())); |
| | | LambdaQueryWrapper<LtkjJfzhglmxjfxmzd> wrapper1 = new LambdaQueryWrapper<>(); |
| | | if (detail.getSfzhfy().equals("1")) |
| | | wrapper1.eq(LtkjJfzhglmxjfxmzd::getZhxmdm, mxfyxmbm); |
| | | else wrapper1.eq(LtkjJfzhglmxjfxmzd::getXmdm, mxfyxmbm); |
| | | List<LtkjJfzhglmxjfxmzd> ltkjJfzhglmxjfxmzds = ltkjJfzhglmxjfxmzdService.list(wrapper1); |
| | | if (ltkjJfzhglmxjfxmzds != null && !ltkjJfzhglmxjfxmzds.isEmpty()) { |
| | | String xmdm = ltkjJfzhglmxjfxmzds.get(0).getXmdm(); |
| | | LambdaQueryWrapper<LtkjMxjfxmzd> wrapper2 = new LambdaQueryWrapper<>(); |
| | | wrapper2.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper2); |
| | | LambdaQueryWrapper<LtkjEjjfxmzd> wrapper3 = new LambdaQueryWrapper<>(); |
| | | wrapper3.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper3); |
| | | tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | } |
| | | tree.setCreateTime(DateUtil.date()); |
| | | ltkjJianchajianyanTreeService.save(tree); |
| | | } |
| | | // TODO 个人以及团体 暂不向采样管理写数据 |
| | | // HIS发送无法合并操作 无法获取LIS的检验序号 条码无法打印 |
| | | // TjOrder tjOrder = orderService.getOrderByCardId(cardId); |
| | | // if(null !=tjOrder){ |
| | | // List<TjOrderDetail> dengJi = tjOrderDetailService.getCaiYangDengJi(tjOrder.getOrderId()); |
| | | // tjSysAsyncService.addCaiYangDengJi(dengJi,!dengJi.isEmpty(),tjOrder, SecurityUtils.getLoginUser().getUser(), null); |
| | | // } |
| | | // }else { |
| | | // //检验申请 |
| | | // OutpintestapplyDto dto = new OutpintestapplyDto(); |
| | | // dto.setHisRegistrationId(cardId); |
| | | // dto.setSfzh(customer.getCusIdcard()); |
| | | // dto.setSqysbm(ysbm); |
| | | // dto.setMzksbm(dept); |
| | | // dto.setSjrq(date); |
| | | // dto.setCzybm(ysbm); |
| | | // dto.setCzyksbm(dept); |
| | | // dto.setSfjz("0"); |
| | | // |
| | | // List<OutpintestapplyDetailsDto> detailsDtos = new ArrayList<>(); |
| | | // if (null != detailList && !detailList.isEmpty()) { |
| | | // LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); |
| | | // wq.in(TjProject::getProId, detailList.stream().map(TbTransition::getParentProId).collect(Collectors.toList())); |
| | | //// wq.groupBy(TjProject::getHisXmbm); |
| | | //// wq.in(TjProject::getDeptId, "241", "317"); |
| | | // wq.in(TjProject::getDeptId,deptService.getJyDeptIds()); |
| | | // List<TjProject> projects = projectService.list(wq); |
| | | // if (null != projects && !projects.isEmpty()) { |
| | | // for (TjProject project : projects) { |
| | | // if (0 == project.getProParentId() && project.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | // if (null != project.getHisXmbm()) { |
| | | // OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | // detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | // if (project.getSfzhfy().equals("Y")) { |
| | | // detailsDto.setSfzhfy("1"); |
| | | // } else { |
| | | // detailsDto.setSfzhfy("0"); |
| | | // } |
| | | // detailsDto.setSl(project.getSl()); |
| | | // detailsDto.setProjg(project.getProPrice()); |
| | | // detailsDtos.add(detailsDto); |
| | | // } |
| | | // if(project.getProId()==1740177341251154377L){ |
| | | // OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | // detilsDto.setYpbm("00006670"); |
| | | // detilsDto.setPcbm("06"); |
| | | // detilsDto.setSl("1"); |
| | | // detilsDto.setDj("60"); |
| | | // detilsDto.setDcjl("1"); |
| | | // detilsDto.setPj("60"); |
| | | // detilsDto.setJj("60"); |
| | | // detilsDto.setJldw(""); |
| | | // detilsDto.setTjbm(""); |
| | | // detilsDto.setPs(""); |
| | | // detilsDto.setPsbm(""); |
| | | // detilsDto.setYyts(""); |
| | | // detilsDto.setXtph(""); |
| | | // detilsDto.setScph(""); |
| | | // detilsDto.setYpxq(""); |
| | | // detilsDto.setCdbm(""); |
| | | // detilsDto.setKfdw(""); |
| | | // detilsDto.setYfdw(""); |
| | | // detilsDto.setYysm(""); |
| | | // detilsDto.setFzbl("1"); |
| | | // detilsDto.setZh("0"); |
| | | // outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // if (!detailsDtos.isEmpty()) { |
| | | // dto.setDetails(detailsDtos); |
| | | // AjaxResult ajaxResult1 = controller.Outpintestapply(dto); |
| | | // String result5 = getAjaxResult(ajaxResult1); |
| | | // JSONObject object3 = getJSONObject(result5); |
| | | // String code3 = object3.getStr("ResultCode"); |
| | | // if (code3.equals("0")) { |
| | | // List<OutpintestapplyDetailsDto> details = dto.getDetails(); |
| | | // for (OutpintestapplyDetailsDto detail : details) { |
| | | // LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | // tree.setJxbz(jxbz); |
| | | // tree.setCardId(dto.getHisRegistrationId()); |
| | | // tree.setPationid(customer.getPationId()); |
| | | // JSONObject resultData = object3.getJSONObject("ResultData"); |
| | | // tree.setSqdh(resultData.getStr("jysqdh")); |
| | | // tree.setFyhj(resultData.getStr("fyhj")); |
| | | // String mxfyxmbm = detail.getMxfyxmbm(); |
| | | // tree.setHisXmdm(mxfyxmbm); |
| | | // tree.setType("检验"); |
| | | // tree.setService("his"); |
| | | // tree.setTjPrice(String.valueOf(detail.getProjg())); |
| | | // LambdaQueryWrapper<LtkjJfzhglmxjfxmzd> wrapper1 = new LambdaQueryWrapper<>(); |
| | | // if (detail.getSfzhfy().equals("1")) |
| | | // wrapper1.eq(LtkjJfzhglmxjfxmzd::getZhxmdm, mxfyxmbm); |
| | | // else wrapper1.eq(LtkjJfzhglmxjfxmzd::getXmdm, mxfyxmbm); |
| | | // List<LtkjJfzhglmxjfxmzd> ltkjJfzhglmxjfxmzds = ltkjJfzhglmxjfxmzdService.list(wrapper1); |
| | | // if (ltkjJfzhglmxjfxmzds != null && !ltkjJfzhglmxjfxmzds.isEmpty()) { |
| | | // String xmdm = ltkjJfzhglmxjfxmzds.get(0).getXmdm(); |
| | | // LambdaQueryWrapper<LtkjMxjfxmzd> wrapper2 = new LambdaQueryWrapper<>(); |
| | | // wrapper2.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | // LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper2); |
| | | // LambdaQueryWrapper<LtkjEjjfxmzd> wrapper3 = new LambdaQueryWrapper<>(); |
| | | // wrapper3.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | // LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper3); |
| | | // tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | // } |
| | | // tree.setCreateTime(DateUtil.date()); |
| | | // ltkjJianchajianyanTreeService.save(tree); |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // //门诊检查申请 |
| | | // OutpinexamapplyDto outpinexamapplyDto = new OutpinexamapplyDto(); |
| | | // outpinexamapplyDto.setHisRegistrationId(cardId); |
| | | // outpinexamapplyDto.setSfzh(customer.getCusIdcard()); |
| | | // outpinexamapplyDto.setSqysbm(ysbm); |
| | | // outpinexamapplyDto.setMzksbm(dept); |
| | | // outpinexamapplyDto.setCzybm(ysbm); |
| | | // outpinexamapplyDto.setCzyksbm(dept); |
| | | // outpinexamapplyDto.setSfjz("0"); |
| | | //// List<TbTransition> detailLists = tbTransitionService.getTbTransitionListByCusId(customer.getCusIdcard(),cardId); |
| | | // List<OutpintestapplyDetailsDto> detailsDtoss = new ArrayList<>(); |
| | | // if (null != detailList && !detailList.isEmpty()) { |
| | | // LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); |
| | | // wq.in(TjProject::getProId, detailList.stream().map(TbTransition::getParentProId).collect(Collectors.toList())); |
| | | // wq.in(TjProject::getDeptId,deptService.getJcDeptIds()); |
| | | // List<TjProject> projects = projectService.list(wq); |
| | | // if (null != projects && !projects.isEmpty()) { |
| | | // for (TjProject project : projects) { |
| | | // if (0 == project.getProParentId() && project.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | // if (null != project.getHisXmbm()) { |
| | | // OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | // detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | // if (project.getSfzhfy().equals("Y")) { |
| | | // detailsDto.setSfzhfy("1"); |
| | | // } else { |
| | | // detailsDto.setSfzhfy("0"); |
| | | // } |
| | | // detailsDto.setSl(project.getSl()); |
| | | // detailsDto.setProjg(project.getProPrice()); |
| | | // detailsDtoss.add(detailsDto); |
| | | // } |
| | | // if(project.getProId()==1740177341251154377L){ |
| | | // OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | // detilsDto.setYpbm("00006670"); |
| | | // detilsDto.setPcbm("06"); |
| | | // detilsDto.setSl("1"); |
| | | // detilsDto.setDj("60"); |
| | | // detilsDto.setDcjl("1"); |
| | | // detilsDto.setPj("60"); |
| | | // detilsDto.setJj("60"); |
| | | // detilsDto.setJldw(""); |
| | | // detilsDto.setTjbm(""); |
| | | // detilsDto.setPs(""); |
| | | // detilsDto.setPsbm(""); |
| | | // detilsDto.setYyts(""); |
| | | // detilsDto.setXtph(""); |
| | | // detilsDto.setScph(""); |
| | | // detilsDto.setYpxq(""); |
| | | // detilsDto.setCdbm(""); |
| | | // detilsDto.setKfdw(""); |
| | | // detilsDto.setYfdw(""); |
| | | // detilsDto.setYysm(""); |
| | | // detilsDto.setFzbl("1"); |
| | | // detilsDto.setZh("0"); |
| | | // outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // if (!detailsDtoss.isEmpty()) { |
| | | // outpinexamapplyDto.setDetails(detailsDtoss); |
| | | // AjaxResult ajaxResult2 = controller.Outpinexamapply(outpinexamapplyDto); |
| | | // String result6 = getAjaxResult(ajaxResult2); |
| | | // JSONObject object5 = getJSONObject(result6); |
| | | // String code4 = object5.getStr("ResultCode"); |
| | | // if (code4.equals("0")) { |
| | | // List<OutpintestapplyDetailsDto> details = outpinexamapplyDto.getDetails(); |
| | | // for (OutpintestapplyDetailsDto detail : details) { |
| | | // LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | // tree.setJxbz(jxbz); |
| | | // tree.setCardId(outpinexamapplyDto.getHisRegistrationId()); |
| | | // tree.setPationid(customer.getPationId()); |
| | | // JSONObject resultData = object5.getJSONObject("ResultData"); |
| | | // tree.setSqdh(resultData.getStr("jcsqdh")); |
| | | // tree.setFyhj(resultData.getStr("fyhj")); |
| | | // String mxfyxmbm = detail.getMxfyxmbm(); |
| | | // tree.setHisXmdm(mxfyxmbm); |
| | | // tree.setType("检查"); |
| | | // tree.setService("his"); |
| | | // tree.setTjPrice(String.valueOf(detail.getProjg())); |
| | | // LambdaQueryWrapper<LtkjJfzhglmxjfxmzd> wrapper1 = new LambdaQueryWrapper<>(); |
| | | // if (detail.getSfzhfy().equals("1")) |
| | | // wrapper1.eq(LtkjJfzhglmxjfxmzd::getZhxmdm, mxfyxmbm); |
| | | // else wrapper1.eq(LtkjJfzhglmxjfxmzd::getXmdm, mxfyxmbm); |
| | | // List<LtkjJfzhglmxjfxmzd> ltkjJfzhglmxjfxmzds = ltkjJfzhglmxjfxmzdService.list(wrapper1); |
| | | // if (ltkjJfzhglmxjfxmzds != null && !ltkjJfzhglmxjfxmzds.isEmpty()) { |
| | | // String xmdm = ltkjJfzhglmxjfxmzds.get(0).getXmdm(); |
| | | // LambdaQueryWrapper<LtkjMxjfxmzd> wrapper2 = new LambdaQueryWrapper<>(); |
| | | // wrapper2.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | // LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper2); |
| | | // LambdaQueryWrapper<LtkjEjjfxmzd> wrapper3 = new LambdaQueryWrapper<>(); |
| | | // wrapper3.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | // LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper3); |
| | | // tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | // } |
| | | // tree.setCreateTime(DateUtil.date()); |
| | | // ltkjJianchajianyanTreeService.save(tree); |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // //门诊治疗处置申请 |
| | | // OutpintreatapplyDto dao = new OutpintreatapplyDto(); |
| | | // dao.setHisRegistrationId(cardId); |
| | | // dao.setSfzh(customer.getCusIdcard()); |
| | | // dao.setSqysbm(ysbm); |
| | | // dao.setMzksbm(dept); |
| | | // dao.setSjrq(date); |
| | | // dao.setCzybm(ysbm); |
| | | // dao.setCzyksbm(dept); |
| | | // dao.setSfjz("0"); |
| | | //// List<TbTransition> details = tbTransitionService.getTbTransitionListByCusId(customer.getCusIdcard(),cardId); |
| | | // List<OutpintestapplyDetailsDto> detailDtos = new ArrayList<>(); |
| | | // if (null != detailList && !detailList.isEmpty()) { |
| | | // LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); |
| | | // wq.in(TjProject::getProId, detailList.stream().map(TbTransition::getParentProId).collect(Collectors.toList())); |
| | | // wq.in(TjProject::getDeptId,deptService.getCzDeptIds()); |
| | | // List<TjProject> projects = projectService.list(wq); |
| | | // if (null != projects && !projects.isEmpty()) { |
| | | // for (TjProject project : projects) { |
| | | // if (0 == project.getProParentId() && project.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | // if (null != project.getHisXmbm()) { |
| | | // OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | // detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | // if (project.getSfzhfy().equals("Y")) { |
| | | // detailsDto.setSfzhfy("1"); |
| | | // } else { |
| | | // detailsDto.setSfzhfy("0"); |
| | | // } |
| | | // detailsDto.setSl(project.getSl()); |
| | | // detailsDto.setProjg(project.getProPrice()); |
| | | // detailDtos.add(detailsDto); |
| | | // } |
| | | // if(project.getProId()==1740177341251154377L){ |
| | | // OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | // detilsDto.setYpbm("00006670"); |
| | | // detilsDto.setPcbm("06"); |
| | | // detilsDto.setSl("1"); |
| | | // detilsDto.setDj("60"); |
| | | // detilsDto.setDcjl("1"); |
| | | // detilsDto.setPj("60"); |
| | | // detilsDto.setJj("60"); |
| | | // detilsDto.setJldw(""); |
| | | // detilsDto.setTjbm(""); |
| | | // detilsDto.setPs(""); |
| | | // detilsDto.setPsbm(""); |
| | | // detilsDto.setYyts(""); |
| | | // detilsDto.setXtph(""); |
| | | // detilsDto.setScph(""); |
| | | // detilsDto.setYpxq(""); |
| | | // detilsDto.setCdbm(""); |
| | | // detilsDto.setKfdw(""); |
| | | // detilsDto.setYfdw(""); |
| | | // detilsDto.setYysm(""); |
| | | // detilsDto.setFzbl("1"); |
| | | // detilsDto.setZh("0"); |
| | | // outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // if (!detailDtos.isEmpty()) { |
| | | // dao.setDetails(detailDtos); |
| | | // AjaxResult mzylyzsq1 = controller.Outpintreatapply(dao); |
| | | // String mzylyzsq2 = getAjaxResult(mzylyzsq1); |
| | | // JSONObject mzylyzsq3 = getJSONObject(mzylyzsq2); |
| | | // String code5 = mzylyzsq3.getStr("ResultCode"); |
| | | // if (code5.equals("0")) { |
| | | // List<OutpintestapplyDetailsDto> details1 = dao.getDetails(); |
| | | // for (OutpintestapplyDetailsDto detail : details1) { |
| | | // LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | // tree.setJxbz(jxbz); |
| | | // tree.setCardId(dao.getHisRegistrationId()); |
| | | // tree.setPationid(customer.getPationId()); |
| | | // JSONObject resultData = mzylyzsq3.getJSONObject("ResultData"); |
| | | // tree.setSqdh(resultData.getStr("zlczh")); |
| | | // tree.setFyhj(resultData.getStr("fyhj")); |
| | | // String mxfyxmbm = detail.getMxfyxmbm(); |
| | | // tree.setHisXmdm(mxfyxmbm); |
| | | // tree.setType("处置"); |
| | | // tree.setTjPrice(String.valueOf(detail.getProjg())); |
| | | // LambdaQueryWrapper<LtkjJfzhglmxjfxmzd> wrapper1 = new LambdaQueryWrapper<>(); |
| | | // if (detail.getSfzhfy().equals("1")) |
| | | // wrapper1.eq(LtkjJfzhglmxjfxmzd::getZhxmdm, mxfyxmbm); |
| | | // else wrapper1.eq(LtkjJfzhglmxjfxmzd::getXmdm, mxfyxmbm); |
| | | // List<LtkjJfzhglmxjfxmzd> ltkjJfzhglmxjfxmzds = ltkjJfzhglmxjfxmzdService.list(wrapper1); |
| | | // if (ltkjJfzhglmxjfxmzds != null && !ltkjJfzhglmxjfxmzds.isEmpty()) { |
| | | // String xmdm = ltkjJfzhglmxjfxmzds.get(0).getXmdm(); |
| | | // LambdaQueryWrapper<LtkjMxjfxmzd> wrapper2 = new LambdaQueryWrapper<>(); |
| | | // wrapper2.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | // LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper2); |
| | | // LambdaQueryWrapper<LtkjEjjfxmzd> wrapper3 = new LambdaQueryWrapper<>(); |
| | | // wrapper3.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | // LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper3); |
| | | // tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | // } |
| | | // tree.setCreateTime(DateUtil.date()); |
| | | // ltkjJianchajianyanTreeService.save(tree); |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // //药品申请 |
| | | // if(!outpinmedicapplyDetilsDtos.isEmpty()){ |
| | | // OutpinmedicapplyDto dto1=new OutpinmedicapplyDto(); |
| | | // dto1.setHisRegistrationId(cardId); |
| | | // dto1.setSfzh(customer.getCusIdcard()); |
| | | // dto1.setSqysbm(ysbm); |
| | | // dto1.setMzksbm(dept); |
| | | // dto1.setSjrq(date); |
| | | // dto1.setCzybm(ysbm); |
| | | // dto1.setCzyksbm(dept); |
| | | // dto1.setCflxbm("A"); |
| | | // dto1.setYfbm("1"); |
| | | // dto1.setFyts("1"); |
| | | // dto1.setMzzd(""); |
| | | // dto1.setDetails(outpinmedicapplyDetilsDtos); |
| | | // AjaxResult result = controller.Outpinmedicapply(dto1); |
| | | // String result1 = getAjaxResult(result); |
| | | // JSONObject object = getJSONObject(result1); |
| | | // String code = object.getStr("ResultCode"); |
| | | // if(null !=code && code.equals("0")){ |
| | | // JSONObject resultData = object.getJSONObject("ResultData"); |
| | | //// Map<String, Object> resultDatasss = (Map<String, Object>) resultData.get(0); |
| | | // String cfh = resultData.getStr("cfh"); |
| | | // log.info("药品申请后的处方号是: "+cfh+" outpinmedicapplyDetilsDtos 里面的值为: "+outpinmedicapplyDetilsDtos.toString()); |
| | | // for (OutpinmedicapplyDetilsDto detilsDto : outpinmedicapplyDetilsDtos) { |
| | | // TjCf cf=new TjCf(); |
| | | // cf.setJxbz(jxbz); |
| | | // cf.setCardId(cardId); |
| | | // cf.setSfzh(customer.getCusIdcard()); |
| | | // cf.setCfh(cfh); |
| | | // cf.setSqysbm(ysbm); |
| | | // cf.setSqysxm(ysmc); |
| | | // cf.setMzksbn(dept); |
| | | // cf.setSqrq(date); |
| | | // cf.setCzybm(ysbm); |
| | | // cf.setYpbm(detilsDto.getYpbm()); |
| | | // cf.setYpmc("尿素[14C]呼气试验药盒"); |
| | | // cf.setSl(String.valueOf(detilsDto.getSl())); |
| | | // cf.setDj(String.valueOf(detilsDto.getDj())); |
| | | // cf.setDcjl(String.valueOf(detilsDto.getDcjl())); |
| | | // cf.setPj(String.valueOf(detilsDto.getPj())); |
| | | // cf.setJj(String.valueOf(detilsDto.getJj())); |
| | | // cf.setCreateTime(new Date()); |
| | | // cfService.save(cf); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // return AjaxResult.success(); |
| | | // } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //门诊检查申请 |
| | | // List<TbTransition> detailLists = tbTransitionService.getTbTransitionListByCusId(customer.getCusIdcard(),cardId); |
| | | if (null != detailList && !detailList.isEmpty()) { |
| | | LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); |
| | | wq.in(TjProject::getProId, detailList.stream().map(TbTransition::getParentProId).collect(Collectors.toList())); |
| | | wq.in(TjProject::getDeptId,deptService.getJcDeptIds()); |
| | | List<TjProject> projects = projectService.list(wq); |
| | | List<Long> proIds = projects.stream().map(TjProject::getProId).collect(Collectors.toList()); |
| | | if (!proIds.isEmpty()){ |
| | | QueryWrapper<TjProject> wrapper4 = new QueryWrapper<>(); |
| | | wrapper4.select("sum(sl) as sl","pro_id" |
| | | ,"pro_parent_id","pro_name","his_xmbm","his_xmmc" |
| | | ,"pro_price"); |
| | | wrapper4.in("pro_parent_id",proIds); |
| | | wrapper4.groupBy("his_xmbm"); |
| | | if (!mapJinchuan.isEmpty()) { |
| | | wrapper4.notIn("pro_id", mapJinchuan); |
| | | wrapper4.notIn("pro_parent_id", mapJinchuan); |
| | | } |
| | | projects = projectService.list(wrapper4); |
| | | if (null != projects && !projects.isEmpty()) { |
| | | List<OutpintestapplyDetailsDto> detailsDtoss = new ArrayList<>(); |
| | | for (TjProject project : projects) { |
| | | if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | if (StrUtil.isNotBlank(project.getHisXmbm()) && project.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | detailsDto.setSfzhfy("0"); |
| | | detailsDto.setSl(project.getSl()); |
| | | detailsDto.setProjg(project.getProPrice()); |
| | | detailsDtoss.add(detailsDto); |
| | | } |
| | | } |
| | | } |
| | | List<Long> proParentIds = projects.stream().map(TjProject::getProParentId).distinct().collect(Collectors.toList()); |
| | | if (!outpinmedicXms.isEmpty()) { |
| | | outpinmedicXms.stream().filter(i -> proParentIds.contains(i.getProId())).forEach(i -> { |
| | | OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | detilsDto.setYpbm(i.getYpbm()); |
| | | detilsDto.setPcbm(i.getPcbm()); |
| | | detilsDto.setSl(i.getSl()); |
| | | detilsDto.setDj(i.getDj()); |
| | | detilsDto.setDcjl(i.getDcjl()); |
| | | detilsDto.setPj(i.getPj()); |
| | | detilsDto.setJj(i.getJj()); |
| | | detilsDto.setJldw(""); |
| | | detilsDto.setTjbm(""); |
| | | detilsDto.setPs(""); |
| | | detilsDto.setPsbm(""); |
| | | detilsDto.setYyts(""); |
| | | detilsDto.setXtph(""); |
| | | detilsDto.setScph(""); |
| | | detilsDto.setYpxq(""); |
| | | detilsDto.setCdbm(""); |
| | | detilsDto.setKfdw(""); |
| | | detilsDto.setYfdw(""); |
| | | detilsDto.setYysm(""); |
| | | detilsDto.setYpmc(i.getYpmc()); |
| | | detilsDto.setFzbl(i.getFzbl()); |
| | | detilsDto.setZh(i.getZh()); |
| | | outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | }); |
| | | } |
| | | if (!detailsDtoss.isEmpty()) { |
| | | OutpinexamapplyDto outpinexamapplyDto = new OutpinexamapplyDto(); |
| | | outpinexamapplyDto.setHisRegistrationId(cardId); |
| | | outpinexamapplyDto.setSfzh(customer.getCusIdcard()); |
| | | outpinexamapplyDto.setSqysbm(ysbm); |
| | | outpinexamapplyDto.setMzksbm(dept); |
| | | outpinexamapplyDto.setCzybm(ysbm); |
| | | outpinexamapplyDto.setCzyksbm(dept); |
| | | outpinexamapplyDto.setSfjz("0"); |
| | | outpinexamapplyDto.setDetails(detailsDtoss); |
| | | AjaxResult ajaxResult2 = controller.Outpinexamapply(outpinexamapplyDto); |
| | | String result6 = getAjaxResult(ajaxResult2); |
| | | JSONObject object5 = getJSONObject(result6); |
| | | String code4 = object5.getStr("ResultCode"); |
| | | if (code4.equals("0")) { |
| | | List<OutpintestapplyDetailsDto> details = outpinexamapplyDto.getDetails(); |
| | | for (OutpintestapplyDetailsDto detail : details) { |
| | | LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | tree.setJxbz(jxbz); |
| | | tree.setCardId(outpinexamapplyDto.getHisRegistrationId()); |
| | | tree.setPationid(customer.getPationId()); |
| | | JSONObject resultData = object5.getJSONObject("ResultData"); |
| | | tree.setSqdh(resultData.getStr("jcsqdh")); |
| | | tree.setFyhj(resultData.getStr("fyhj")); |
| | | String mxfyxmbm = detail.getMxfyxmbm(); |
| | | tree.setHisXmdm(mxfyxmbm); |
| | | tree.setType("检查"); |
| | | tree.setService("his"); |
| | | tree.setTjPrice(String.valueOf(detail.getProjg())); |
| | | LambdaQueryWrapper<LtkjJfzhglmxjfxmzd> wrapper1 = new LambdaQueryWrapper<>(); |
| | | if (detail.getSfzhfy().equals("1")) |
| | | wrapper1.eq(LtkjJfzhglmxjfxmzd::getZhxmdm, mxfyxmbm); |
| | | else wrapper1.eq(LtkjJfzhglmxjfxmzd::getXmdm, mxfyxmbm); |
| | | List<LtkjJfzhglmxjfxmzd> ltkjJfzhglmxjfxmzds = ltkjJfzhglmxjfxmzdService.list(wrapper1); |
| | | if (ltkjJfzhglmxjfxmzds != null && !ltkjJfzhglmxjfxmzds.isEmpty()) { |
| | | String xmdm = ltkjJfzhglmxjfxmzds.get(0).getXmdm(); |
| | | LambdaQueryWrapper<LtkjMxjfxmzd> wrapper2 = new LambdaQueryWrapper<>(); |
| | | wrapper2.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper2); |
| | | LambdaQueryWrapper<LtkjEjjfxmzd> wrapper3 = new LambdaQueryWrapper<>(); |
| | | wrapper3.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper3); |
| | | tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | } |
| | | tree.setCreateTime(DateUtil.date()); |
| | | ltkjJianchajianyanTreeService.save(tree); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //门诊治疗处置申请 |
| | | OutpintreatapplyDto dao = new OutpintreatapplyDto(); |
| | | dao.setHisRegistrationId(cardId); |
| | | dao.setSfzh(customer.getCusIdcard()); |
| | | dao.setSqysbm(ysbm); |
| | | dao.setMzksbm(dept); |
| | | dao.setSjrq(date); |
| | | dao.setCzybm(ysbm); |
| | | dao.setCzyksbm(dept); |
| | | dao.setSfjz("0"); |
| | | // List<TbTransition> details = tbTransitionService.getTbTransitionListByCusId(customer.getCusIdcard(),cardId); |
| | | if (null != detailList && !detailList.isEmpty()) { |
| | | LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); |
| | | wq.in(TjProject::getProId, detailList.stream().map(TbTransition::getParentProId).collect(Collectors.toList())); |
| | | wq.in(TjProject::getDeptId,deptService.getCzDeptIds()); |
| | | List<TjProject> projects = projectService.list(wq); |
| | | List<Long> proIds = projects.stream().map(TjProject::getProId).collect(Collectors.toList()); |
| | | if (!proIds.isEmpty()){ |
| | | QueryWrapper<TjProject> wrapper4 = new QueryWrapper<>(); |
| | | wrapper4.select("sum(sl) as sl","pro_id" |
| | | ,"pro_parent_id","pro_name","his_xmbm","his_xmmc" |
| | | ,"pro_price"); |
| | | wrapper4.in("pro_parent_id",proIds); |
| | | wrapper4.groupBy("his_xmbm"); |
| | | if (!mapJinchuan.isEmpty()) { |
| | | wrapper4.notIn("pro_id", mapJinchuan); |
| | | wrapper4.notIn("pro_parent_id", mapJinchuan); |
| | | } |
| | | projects = projectService.list(wrapper4); |
| | | if (null != projects && !projects.isEmpty()) { |
| | | List<OutpintestapplyDetailsDto> detailDtos = new ArrayList<>(); |
| | | for (TjProject project : projects) { |
| | | if (StrUtil.isNotBlank(project.getHisXmbm()) && project.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | detailsDto.setSfzhfy("0"); |
| | | detailsDto.setSl(project.getSl()); |
| | | detailsDto.setProjg(project.getProPrice()); |
| | | detailDtos.add(detailsDto); |
| | | } |
| | | } |
| | | List<Long> proParentIds = projects.stream().map(TjProject::getProParentId).distinct().collect(Collectors.toList()); |
| | | if (!outpinmedicXms.isEmpty()) { |
| | | outpinmedicXms.stream().filter(i -> proParentIds.contains(i.getProId())).forEach(i -> { |
| | | OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | detilsDto.setYpbm(i.getYpbm()); |
| | | detilsDto.setPcbm(i.getPcbm()); |
| | | detilsDto.setSl(i.getSl()); |
| | | detilsDto.setDj(i.getDj()); |
| | | detilsDto.setDcjl(i.getDcjl()); |
| | | detilsDto.setPj(i.getPj()); |
| | | detilsDto.setJj(i.getJj()); |
| | | detilsDto.setJldw(""); |
| | | detilsDto.setTjbm(""); |
| | | detilsDto.setPs(""); |
| | | detilsDto.setPsbm(""); |
| | | detilsDto.setYyts(""); |
| | | detilsDto.setXtph(""); |
| | | detilsDto.setScph(""); |
| | | detilsDto.setYpxq(""); |
| | | detilsDto.setCdbm(""); |
| | | detilsDto.setKfdw(""); |
| | | detilsDto.setYfdw(""); |
| | | detilsDto.setYysm(""); |
| | | detilsDto.setYpmc(i.getYpmc()); |
| | | detilsDto.setFzbl(i.getFzbl()); |
| | | detilsDto.setZh(i.getZh()); |
| | | outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | }); |
| | | } |
| | | if (!detailDtos.isEmpty()) { |
| | | dao.setDetails(detailDtos); |
| | | AjaxResult mzylyzsq1 = controller.Outpintreatapply(dao); |
| | | String mzylyzsq2 = getAjaxResult(mzylyzsq1); |
| | | JSONObject mzylyzsq3 = getJSONObject(mzylyzsq2); |
| | | String code5 = mzylyzsq3.getStr("ResultCode"); |
| | | if (code5.equals("0")) { |
| | | List<OutpintestapplyDetailsDto> details1 = dao.getDetails(); |
| | | for (OutpintestapplyDetailsDto detail : details1) { |
| | | LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | tree.setJxbz(jxbz); |
| | | tree.setCardId(dao.getHisRegistrationId()); |
| | | tree.setPationid(customer.getPationId()); |
| | | JSONObject resultData = mzylyzsq3.getJSONObject("ResultData"); |
| | | tree.setSqdh(resultData.getStr("zlczh")); |
| | | tree.setFyhj(resultData.getStr("fyhj")); |
| | | String mxfyxmbm = detail.getMxfyxmbm(); |
| | | tree.setHisXmdm(mxfyxmbm); |
| | | tree.setType("处置"); |
| | | tree.setTjPrice(String.valueOf(detail.getProjg())); |
| | | LambdaQueryWrapper<LtkjJfzhglmxjfxmzd> wrapper1 = new LambdaQueryWrapper<>(); |
| | | if (detail.getSfzhfy().equals("1")) |
| | | wrapper1.eq(LtkjJfzhglmxjfxmzd::getZhxmdm, mxfyxmbm); |
| | | else wrapper1.eq(LtkjJfzhglmxjfxmzd::getXmdm, mxfyxmbm); |
| | | List<LtkjJfzhglmxjfxmzd> ltkjJfzhglmxjfxmzds = ltkjJfzhglmxjfxmzdService.list(wrapper1); |
| | | if (ltkjJfzhglmxjfxmzds != null && !ltkjJfzhglmxjfxmzds.isEmpty()) { |
| | | String xmdm = ltkjJfzhglmxjfxmzds.get(0).getXmdm(); |
| | | LambdaQueryWrapper<LtkjMxjfxmzd> wrapper2 = new LambdaQueryWrapper<>(); |
| | | wrapper2.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper2); |
| | | LambdaQueryWrapper<LtkjEjjfxmzd> wrapper3 = new LambdaQueryWrapper<>(); |
| | | wrapper3.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper3); |
| | | tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | } |
| | | tree.setCreateTime(DateUtil.date()); |
| | | ltkjJianchajianyanTreeService.save(tree); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //药品申请 |
| | | if(!outpinmedicapplyDetilsDtos.isEmpty()){ |
| | | OutpinmedicapplyDto dto1=new OutpinmedicapplyDto(); |
| | | dto1.setHisRegistrationId(cardId); |
| | | dto1.setSfzh(customer.getCusIdcard()); |
| | | dto1.setSqysbm(ysbm); |
| | | dto1.setMzksbm(dept); |
| | | dto1.setSjrq(date); |
| | | String yfbm = configService.selectConfigByKey("chufang_yfbm"); |
| | | String mzzd = configService.selectConfigByKey("chufang_mzzd"); |
| | | String czybm = configService.selectConfigByKey("chufang_czybm"); |
| | | String czyksbm = configService.selectConfigByKey("chufang_czyksbm"); |
| | | String cflxbm = configService.selectConfigByKey("chufang_cflxbm"); |
| | | if (czybm.equalsIgnoreCase("N")) |
| | | dto1.setCzybm(ysbm); |
| | | else dto1.setCzybm(czybm); |
| | | if (czyksbm.equalsIgnoreCase("N")) |
| | | dto1.setCzyksbm(dept); |
| | | else dto1.setCzyksbm(dept); |
| | | dto1.setCflxbm(cflxbm); |
| | | if (yfbm.equalsIgnoreCase("N")) |
| | | dto1.setYfbm("1"); |
| | | else dto1.setYfbm(yfbm); |
| | | dto1.setFyts("1"); |
| | | if (mzzd.equalsIgnoreCase("N")) |
| | | dto1.setMzzd(""); |
| | | else dto1.setMzzd(mzzd); |
| | | dto1.setDetails(outpinmedicapplyDetilsDtos); |
| | | AjaxResult result = controller.Outpinmedicapply(dto1); |
| | | String result1 = getAjaxResult(result); |
| | | JSONObject object = getJSONObject(result1); |
| | | String code = object.getStr("ResultCode"); |
| | | if(null !=code && code.equals("0")){ |
| | | JSONObject resultData = object.getJSONObject("ResultData"); |
| | | // Map<String, Object> resultDatasss = (Map<String, Object>) resultData.get(0); |
| | | String cfh = resultData.getStr("cfh"); |
| | | log.info("药品申请后的处方号是: "+cfh+" outpinmedicapplyDetilsDtos 里面的值为: "+outpinmedicapplyDetilsDtos.toString()); |
| | | for (OutpinmedicapplyDetilsDto detilsDto : outpinmedicapplyDetilsDtos) { |
| | | TjCf cf=new TjCf(); |
| | | cf.setJxbz(jxbz); |
| | | cf.setCardId(cardId); |
| | | cf.setSfzh(customer.getCusIdcard()); |
| | | cf.setCfh(cfh); |
| | | cf.setSqysbm(ysbm); |
| | | cf.setSqysxm(ysmc); |
| | | cf.setMzksbn(dept); |
| | | cf.setSqrq(date); |
| | | cf.setCzybm(ysbm); |
| | | cf.setYpbm(detilsDto.getYpbm()); |
| | | cf.setYpmc(detilsDto.getYpmc()); |
| | | cf.setSl(String.valueOf(detilsDto.getSl())); |
| | | cf.setDj(String.valueOf(detilsDto.getDj())); |
| | | cf.setDcjl(String.valueOf(detilsDto.getDcjl())); |
| | | cf.setPj(String.valueOf(detilsDto.getPj())); |
| | | cf.setJj(String.valueOf(detilsDto.getJj())); |
| | | cf.setCreateTime(new Date()); |
| | | cfService.save(cf); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | // 体检对his申请单调用方法 |
| | | public AjaxResult tijianbulushenqingOld(TjCustomer customer, String date,String cardId,String jxbz,ArrayList<TjProject> jianChaProjects,Boolean isTuanTiPiao) { |
| | | TjOrder order = orderService.getOrderByCardId(cardId); |
| | | if(null !=order){ |
| | | String dept = configService.selectConfigByKey("request_default_dept"); |
| | | String ysbm = configService.selectConfigByKey("request_default_ysbm"); |
| | | String ysmc = configService.selectConfigByKey("request_default_ysmc"); |
| | | String lis_tmh_prefix = configService.selectConfigByKey("make_lis_tmh_prefix"); |
| | | List<TbTransition> detailList = transitionService.getBlTbTransitionListByCusId(customer.getCusIdcard(),cardId,jxbz); |
| | | Boolean useLisAndPacsRegister = lisApiMethod.isUseLisAndPacsRegister(order); |
| | | List<OutpinmedicapplyDetilsDto> outpinmedicapplyDetilsDtos =new ArrayList<>(); |
| | | if (useLisAndPacsRegister && isTuanTiPiao) { |
| | | // 检查申请 |
| | | pacsReg(order, customer, jianChaProjects); |
| | | LambdaQueryWrapper<TjSampling> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TjSampling::getTjNum,order.getTjNumber()); |
| | | wrapper.eq(TjSampling::getJxbz,jxbz); |
| | | List<TjSampling> list = tjSamplingService.list(wrapper); |
| | | log.info("采样数据 ->{}",JSONUtil.toJsonStr(list)); |
| | | if (!list.isEmpty()){ |
| | | Map<String, List<TjSampling>> listMap = list.stream().collect(Collectors.groupingBy(TjSampling::getSpecimenTypeCode)); |
| | | log.info("分组后 ->{}",JSONUtil.toJsonStr(listMap)); |
| | | ArrayList<String> ids = new ArrayList<>(); |
| | | for (Map.Entry<String, List<TjSampling>> entry : listMap.entrySet()) { |
| | | log.info("key ->{},val ->{}",entry.getKey(),entry.getValue()); |
| | | // Lis标本代码 |
| | | String specimenTypeCode = entry.getKey(); |
| | | List<TjSampling> samplings = entry.getValue(); |
| | | if (samplings.size() >= 2){ |
| | | // 进行合并 |
| | | List<String> stringList = samplings.stream().map(TjSampling::getId).collect(Collectors.toList()); |
| | | log.info("提取id ->{}",stringList); |
| | | for (int i = 0; i < stringList.size(); i++) { |
| | | String s = stringList.get(i); |
| | | if (tjSamplingService.isMergeItem(s) != 0) { |
| | | stringList.remove(s); |
| | | ids.add(s); |
| | | } |
| | | } |
| | | if (stringList.size() > 1) { |
| | | String id = tjSamplingService.mergeCaiYangApi(stringList,lis_tmh_prefix); |
| | | ids.add(id); |
| | | }else { |
| | | ids.add(stringList.get(0)); |
| | | } |
| | | }else { |
| | | ids.add(samplings.get(0).getId()); |
| | | } |
| | | } |
| | | Boolean confirmed = samplingServiceApi.confirmSamplingApi(ids, "Y", "N"); |
| | | if (!confirmed) |
| | | return AjaxResult.error("处理失败"); |
| | | } |
| | | }else { |
| | | List<TjOutpinmedicXm> outpinmedicXms = tjOutpinmedicXmService.list(); |
| | | //检验申请 |
| | | OutpintestapplyDto dto = new OutpintestapplyDto(); |
| | | dto.setHisRegistrationId(cardId); |
| | | dto.setSfzh(customer.getCusIdcard()); |
| | | dto.setSqysbm(ysbm); |
| | | dto.setMzksbm(dept); |
| | | dto.setSjrq(date); |
| | | dto.setCzybm(ysbm); |
| | | dto.setCzyksbm(dept); |
| | | dto.setSfjz("0"); |
| | | |
| | | List<OutpintestapplyDetailsDto> detailsDtos = new ArrayList<>(); |
| | | if (null != detailList && !detailList.isEmpty()) { |
| | | LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); |
| | | wq.in(TjProject::getProId, detailList.stream().map(TbTransition::getParentProId).collect(Collectors.toList())); |
| | | // wq.groupBy(TjProject::getHisXmbm); |
| | | // wq.in(TjProject::getDeptId, "241", "317"); |
| | | wq.in(TjProject::getDeptId,deptService.getJyDeptIds()); |
| | | List<TjProject> projects = projectService.list(wq); |
| | | if (null != projects && !projects.isEmpty()) { |
| | | for (TjProject project : projects) { |
| | | if (0 == project.getProParentId() && project.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | if (null != project.getHisXmbm()) { |
| | | if (project.getSfzhfy().equals("Y")) { |
| | | mapJinchuan.add(project.getProId().toString()); |
| | | OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | if (project.getSfzhfy().equals("Y")) { |
| | | detailsDto.setSfzhfy("1"); |
| | | } else { |
| | | detailsDto.setSfzhfy("0"); |
| | | } |
| | | detailsDto.setSl(project.getSl()); |
| | | detailsDto.setProjg(project.getProPrice()); |
| | | detailsDtos.add(detailsDto); |
| | | } |
| | | } |
| | | if (!outpinmedicXms.isEmpty()) { |
| | | outpinmedicXms.stream().filter(i -> i.getProId().equals(project.getProId())).forEach(i -> { |
| | | OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | detilsDto.setYpbm(i.getYpbm()); |
| | | detilsDto.setPcbm(i.getPcbm()); |
| | | detilsDto.setSl(i.getSl()); |
| | | detilsDto.setDj(i.getDj()); |
| | | detilsDto.setDcjl(i.getDcjl()); |
| | | detilsDto.setPj(i.getPj()); |
| | | detilsDto.setJj(i.getJj()); |
| | | detilsDto.setJldw(""); |
| | | detilsDto.setTjbm(""); |
| | | detilsDto.setPs(""); |
| | | detilsDto.setPsbm(""); |
| | | detilsDto.setYyts(""); |
| | | detilsDto.setXtph(""); |
| | | detilsDto.setScph(""); |
| | | detilsDto.setYpxq(""); |
| | | detilsDto.setCdbm(""); |
| | | detilsDto.setKfdw(""); |
| | | detilsDto.setYfdw(""); |
| | | detilsDto.setYysm(""); |
| | | detilsDto.setYpmc(i.getYpmc()); |
| | | detilsDto.setFzbl(i.getFzbl()); |
| | | detilsDto.setZh(i.getZh()); |
| | | outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (!detailsDtos.isEmpty()) { |
| | | dto.setDetails(detailsDtos); |
| | | AjaxResult ajaxResult1 = controller.Outpintestapply(dto); |
| | | String result5 = getAjaxResult(ajaxResult1); |
| | | JSONObject object3 = getJSONObject(result5); |
| | | String code3 = object3.getStr("ResultCode"); |
| | | if (code3.equals("0")) { |
| | | List<OutpintestapplyDetailsDto> details = dto.getDetails(); |
| | | for (OutpintestapplyDetailsDto detail : details) { |
| | | LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | tree.setJxbz(jxbz); |
| | | tree.setCardId(dto.getHisRegistrationId()); |
| | | tree.setPationid(customer.getPationId()); |
| | | JSONObject resultData = object3.getJSONObject("ResultData"); |
| | | tree.setSqdh(resultData.getStr("jysqdh")); |
| | | tree.setFyhj(resultData.getStr("fyhj")); |
| | | String mxfyxmbm = detail.getMxfyxmbm(); |
| | | tree.setHisXmdm(mxfyxmbm); |
| | | tree.setType("检验"); |
| | | tree.setService("his"); |
| | | tree.setTjPrice(String.valueOf(detail.getProjg())); |
| | | LambdaQueryWrapper<LtkjJfzhglmxjfxmzd> wrapper1 = new LambdaQueryWrapper<>(); |
| | | if (detail.getSfzhfy().equals("1")) |
| | | wrapper1.eq(LtkjJfzhglmxjfxmzd::getZhxmdm, mxfyxmbm); |
| | | else wrapper1.eq(LtkjJfzhglmxjfxmzd::getXmdm, mxfyxmbm); |
| | | List<LtkjJfzhglmxjfxmzd> ltkjJfzhglmxjfxmzds = ltkjJfzhglmxjfxmzdService.list(wrapper1); |
| | | if (ltkjJfzhglmxjfxmzds != null && !ltkjJfzhglmxjfxmzds.isEmpty()) { |
| | | String xmdm = ltkjJfzhglmxjfxmzds.get(0).getXmdm(); |
| | | LambdaQueryWrapper<LtkjMxjfxmzd> wrapper2 = new LambdaQueryWrapper<>(); |
| | | wrapper2.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper2); |
| | | LambdaQueryWrapper<LtkjEjjfxmzd> wrapper3 = new LambdaQueryWrapper<>(); |
| | | wrapper3.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper3); |
| | | tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | } |
| | | tree.setCreateTime(DateUtil.date()); |
| | | ltkjJianchajianyanTreeService.save(tree); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //门诊检查申请 |
| | | OutpinexamapplyDto outpinexamapplyDto = new OutpinexamapplyDto(); |
| | | outpinexamapplyDto.setHisRegistrationId(cardId); |
| | | outpinexamapplyDto.setSfzh(customer.getCusIdcard()); |
| | | outpinexamapplyDto.setSqysbm(ysbm); |
| | | outpinexamapplyDto.setMzksbm(dept); |
| | | outpinexamapplyDto.setCzybm(ysbm); |
| | | outpinexamapplyDto.setCzyksbm(dept); |
| | | outpinexamapplyDto.setSfjz("0"); |
| | | // List<TbTransition> detailLists = tbTransitionService.getTbTransitionListByCusId(customer.getCusIdcard(),cardId); |
| | | List<OutpintestapplyDetailsDto> detailsDtoss = new ArrayList<>(); |
| | | if (null != detailList && !detailList.isEmpty()) { |
| | | LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); |
| | | wq.in(TjProject::getProId, detailList.stream().map(TbTransition::getParentProId).collect(Collectors.toList())); |
| | | wq.in(TjProject::getDeptId,deptService.getJcDeptIds()); |
| | | List<TjProject> projects = projectService.list(wq); |
| | | if (null != projects && !projects.isEmpty()) { |
| | | for (TjProject project : projects) { |
| | | if (0 == project.getProParentId() && project.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | if (null != project.getHisXmbm()) { |
| | | if (project.getSfzhfy().equals("Y")) { |
| | | mapJinchuan.add(project.getProParentId().toString()); |
| | | OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | if (project.getSfzhfy().equals("Y")) { |
| | | detailsDto.setSfzhfy("1"); |
| | | } else { |
| | | detailsDto.setSfzhfy("0"); |
| | | } |
| | | detailsDto.setSl(project.getSl()); |
| | | detailsDto.setProjg(project.getProPrice()); |
| | | detailsDtoss.add(detailsDto); |
| | | } |
| | | } |
| | | List<Long> proParentIds = projects.stream().map(TjProject::getProParentId).distinct().collect(Collectors.toList()); |
| | | if (!outpinmedicXms.isEmpty()) { |
| | | outpinmedicXms.stream().filter(i -> proParentIds.contains(i.getProId())).forEach(i -> { |
| | | OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | detilsDto.setYpbm(i.getYpbm()); |
| | | detilsDto.setPcbm(i.getPcbm()); |
| | | detilsDto.setSl(i.getSl()); |
| | | detilsDto.setDj(i.getDj()); |
| | | detilsDto.setDcjl(i.getDcjl()); |
| | | detilsDto.setPj(i.getPj()); |
| | | detilsDto.setJj(i.getJj()); |
| | | detilsDto.setJldw(""); |
| | | detilsDto.setTjbm(""); |
| | | detilsDto.setPs(""); |
| | | detilsDto.setPsbm(""); |
| | | detilsDto.setYyts(""); |
| | | detilsDto.setXtph(""); |
| | | detilsDto.setScph(""); |
| | | detilsDto.setYpxq(""); |
| | | detilsDto.setCdbm(""); |
| | | detilsDto.setKfdw(""); |
| | | detilsDto.setYfdw(""); |
| | | detilsDto.setYysm(""); |
| | | detilsDto.setYpmc(i.getYpmc()); |
| | | detilsDto.setFzbl(i.getFzbl()); |
| | | detilsDto.setZh(i.getZh()); |
| | | outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (!detailsDtoss.isEmpty()) { |
| | | outpinexamapplyDto.setDetails(detailsDtoss); |
| | | AjaxResult ajaxResult2 = controller.Outpinexamapply(outpinexamapplyDto); |
| | | String result6 = getAjaxResult(ajaxResult2); |
| | | JSONObject object5 = getJSONObject(result6); |
| | | String code4 = object5.getStr("ResultCode"); |
| | | if (code4.equals("0")) { |
| | | List<OutpintestapplyDetailsDto> details = outpinexamapplyDto.getDetails(); |
| | | for (OutpintestapplyDetailsDto detail : details) { |
| | | LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | tree.setJxbz(jxbz); |
| | | tree.setCardId(outpinexamapplyDto.getHisRegistrationId()); |
| | | tree.setPationid(customer.getPationId()); |
| | | JSONObject resultData = object5.getJSONObject("ResultData"); |
| | | tree.setSqdh(resultData.getStr("jcsqdh")); |
| | | tree.setFyhj(resultData.getStr("fyhj")); |
| | | String mxfyxmbm = detail.getMxfyxmbm(); |
| | | tree.setHisXmdm(mxfyxmbm); |
| | | tree.setType("检查"); |
| | | tree.setService("his"); |
| | | tree.setTjPrice(String.valueOf(detail.getProjg())); |
| | | LambdaQueryWrapper<LtkjJfzhglmxjfxmzd> wrapper1 = new LambdaQueryWrapper<>(); |
| | | if (detail.getSfzhfy().equals("1")) |
| | | wrapper1.eq(LtkjJfzhglmxjfxmzd::getZhxmdm, mxfyxmbm); |
| | | else wrapper1.eq(LtkjJfzhglmxjfxmzd::getXmdm, mxfyxmbm); |
| | | List<LtkjJfzhglmxjfxmzd> ltkjJfzhglmxjfxmzds = ltkjJfzhglmxjfxmzdService.list(wrapper1); |
| | | if (ltkjJfzhglmxjfxmzds != null && !ltkjJfzhglmxjfxmzds.isEmpty()) { |
| | | String xmdm = ltkjJfzhglmxjfxmzds.get(0).getXmdm(); |
| | | LambdaQueryWrapper<LtkjMxjfxmzd> wrapper2 = new LambdaQueryWrapper<>(); |
| | | wrapper2.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper2); |
| | | LambdaQueryWrapper<LtkjEjjfxmzd> wrapper3 = new LambdaQueryWrapper<>(); |
| | | wrapper3.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper3); |
| | | tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | } |
| | | tree.setCreateTime(DateUtil.date()); |
| | | ltkjJianchajianyanTreeService.save(tree); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //门诊治疗处置申请 |
| | | OutpintreatapplyDto dao = new OutpintreatapplyDto(); |
| | | dao.setHisRegistrationId(cardId); |
| | | dao.setSfzh(customer.getCusIdcard()); |
| | | dao.setSqysbm(ysbm); |
| | | dao.setMzksbm(dept); |
| | | dao.setSjrq(date); |
| | | dao.setCzybm(ysbm); |
| | | dao.setCzyksbm(dept); |
| | | dao.setSfjz("0"); |
| | | // List<TbTransition> details = tbTransitionService.getTbTransitionListByCusId(customer.getCusIdcard(),cardId); |
| | | List<OutpintestapplyDetailsDto> detailDtos = new ArrayList<>(); |
| | | if (null != detailList && !detailList.isEmpty()) { |
| | | LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); |
| | | wq.in(TjProject::getProId, detailList.stream().map(TbTransition::getParentProId).collect(Collectors.toList())); |
| | | wq.in(TjProject::getDeptId,deptService.getCzDeptIds()); |
| | | List<TjProject> projects = projectService.list(wq); |
| | | if (null != projects && !projects.isEmpty()) { |
| | | for (TjProject project : projects) { |
| | | if (0 == project.getProParentId() && project.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | if (null != project.getHisXmbm()) { |
| | | { |
| | | mapJinchuan.add(project.getProParentId().toString()); |
| | | OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | if (project.getSfzhfy().equals("Y")) { |
| | | detailsDto.setSfzhfy("1"); |
| | | } else { |
| | | detailsDto.setSfzhfy("0"); |
| | | } |
| | | detailsDto.setSl(project.getSl()); |
| | | detailsDto.setProjg(project.getProPrice()); |
| | | detailDtos.add(detailsDto); |
| | | } |
| | | } |
| | | List<Long> proParentIds = projects.stream().map(TjProject::getProParentId).distinct().collect(Collectors.toList()); |
| | | if (!outpinmedicXms.isEmpty()) { |
| | | outpinmedicXms.stream().filter(i -> proParentIds.contains(i.getProId())).forEach(i -> { |
| | | OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | detilsDto.setYpbm(i.getYpbm()); |
| | | detilsDto.setPcbm(i.getPcbm()); |
| | | detilsDto.setSl(i.getSl()); |
| | | detilsDto.setDj(i.getDj()); |
| | | detilsDto.setDcjl(i.getDcjl()); |
| | | detilsDto.setPj(i.getPj()); |
| | | detilsDto.setJj(i.getJj()); |
| | | detilsDto.setJldw(""); |
| | | detilsDto.setTjbm(""); |
| | | detilsDto.setPs(""); |
| | | detilsDto.setPsbm(""); |
| | | detilsDto.setYyts(""); |
| | | detilsDto.setXtph(""); |
| | | detilsDto.setScph(""); |
| | | detilsDto.setYpxq(""); |
| | | detilsDto.setCdbm(""); |
| | | detilsDto.setKfdw(""); |
| | | detilsDto.setYfdw(""); |
| | | detilsDto.setYysm(""); |
| | | detilsDto.setYpmc(i.getYpmc()); |
| | | detilsDto.setFzbl(i.getFzbl()); |
| | | detilsDto.setZh(i.getZh()); |
| | | outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (!detailDtos.isEmpty()) { |
| | | dao.setDetails(detailDtos); |
| | | AjaxResult mzylyzsq1 = controller.Outpintreatapply(dao); |
| | | String mzylyzsq2 = getAjaxResult(mzylyzsq1); |
| | | JSONObject mzylyzsq3 = getJSONObject(mzylyzsq2); |
| | | String code5 = mzylyzsq3.getStr("ResultCode"); |
| | | if (code5.equals("0")) { |
| | | List<OutpintestapplyDetailsDto> details1 = dao.getDetails(); |
| | | for (OutpintestapplyDetailsDto detail : details1) { |
| | | LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | tree.setJxbz(jxbz); |
| | | tree.setCardId(dao.getHisRegistrationId()); |
| | | tree.setPationid(customer.getPationId()); |
| | | JSONObject resultData = mzylyzsq3.getJSONObject("ResultData"); |
| | | tree.setSqdh(resultData.getStr("zlczh")); |
| | | tree.setFyhj(resultData.getStr("fyhj")); |
| | | String mxfyxmbm = detail.getMxfyxmbm(); |
| | | tree.setHisXmdm(mxfyxmbm); |
| | | tree.setType("处置"); |
| | | tree.setTjPrice(String.valueOf(detail.getProjg())); |
| | | LambdaQueryWrapper<LtkjJfzhglmxjfxmzd> wrapper1 = new LambdaQueryWrapper<>(); |
| | | if (detail.getSfzhfy().equals("1")) |
| | | wrapper1.eq(LtkjJfzhglmxjfxmzd::getZhxmdm, mxfyxmbm); |
| | | else wrapper1.eq(LtkjJfzhglmxjfxmzd::getXmdm, mxfyxmbm); |
| | | List<LtkjJfzhglmxjfxmzd> ltkjJfzhglmxjfxmzds = ltkjJfzhglmxjfxmzdService.list(wrapper1); |
| | | if (ltkjJfzhglmxjfxmzds != null && !ltkjJfzhglmxjfxmzds.isEmpty()) { |
| | | String xmdm = ltkjJfzhglmxjfxmzds.get(0).getXmdm(); |
| | | LambdaQueryWrapper<LtkjMxjfxmzd> wrapper2 = new LambdaQueryWrapper<>(); |
| | | wrapper2.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper2); |
| | | LambdaQueryWrapper<LtkjEjjfxmzd> wrapper3 = new LambdaQueryWrapper<>(); |
| | | wrapper3.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper3); |
| | | tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | } |
| | | tree.setCreateTime(DateUtil.date()); |
| | | ltkjJianchajianyanTreeService.save(tree); |
| | | } |
| | | } |
| | | } |
| | | /* |
| | | //药品申请 |
| | | if(!outpinmedicapplyDetilsDtos.isEmpty()){ |
| | | OutpinmedicapplyDto dto1=new OutpinmedicapplyDto(); |
| | | dto1.setHisRegistrationId(cardId); |
| | | dto1.setSfzh(customer.getCusIdcard()); |
| | | dto1.setSqysbm(ysbm); |
| | | dto1.setMzksbm(dept); |
| | | dto1.setSjrq(date); |
| | | dto1.setCzybm(ysbm); |
| | | dto1.setCzyksbm(dept); |
| | | dto1.setCflxbm("A"); |
| | | dto1.setYfbm("1"); |
| | | dto1.setFyts("1"); |
| | | dto1.setMzzd(""); |
| | | dto1.setDetails(outpinmedicapplyDetilsDtos); |
| | | AjaxResult result = controller.Outpinmedicapply(dto1); |
| | | String result1 = getAjaxResult(result); |
| | | JSONObject object = getJSONObject(result1); |
| | | String code = object.getStr("ResultCode"); |
| | | if(null !=code && code.equals("0")){ |
| | | JSONObject resultData = object.getJSONObject("ResultData"); |
| | | // Map<String, Object> resultDatasss = (Map<String, Object>) resultData.get(0); |
| | | String cfh = resultData.getStr("cfh"); |
| | | log.info("药品申请后的处方号是: "+cfh+" outpinmedicapplyDetilsDtos 里面的值为: "+outpinmedicapplyDetilsDtos.toString()); |
| | | for (OutpinmedicapplyDetilsDto detilsDto : outpinmedicapplyDetilsDtos) { |
| | | TjCf cf=new TjCf(); |
| | | cf.setJxbz(jxbz); |
| | | cf.setCardId(cardId); |
| | | cf.setSfzh(customer.getCusIdcard()); |
| | | cf.setCfh(cfh); |
| | | cf.setSqysbm(ysbm); |
| | | cf.setSqysxm(ysmc); |
| | | cf.setMzksbn(dept); |
| | | cf.setSqrq(date); |
| | | cf.setCzybm(ysbm); |
| | | cf.setYpbm(detilsDto.getYpbm()); |
| | | cf.setYpmc("尿素[14C]呼气试验药盒"); |
| | | cf.setSl(String.valueOf(detilsDto.getSl())); |
| | | cf.setDj(String.valueOf(detilsDto.getDj())); |
| | | cf.setDcjl(String.valueOf(detilsDto.getDcjl())); |
| | | cf.setPj(String.valueOf(detilsDto.getPj())); |
| | | cf.setJj(String.valueOf(detilsDto.getJj())); |
| | | cf.setCreateTime(new Date()); |
| | | cfService.save(cf); |
| | | } |
| | | } |
| | | } |
| | | */ |
| | | } |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /**/ |
| | | // public AjaxResult tijianbulushenqing(TjCustomer customer, String date,String cardId,String jxbz,ArrayList<TjProject> jianChaProjects,Boolean isTuanTiPiao) { |
| | |
| | | detilsDto.setYpmc(i.getYpmc()); |
| | | detilsDto.setFzbl(i.getFzbl()); |
| | | detilsDto.setZh(i.getZh()); |
| | | detilsDto.setCflx(i.getCflx()); |
| | | outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | }); |
| | | } |
| | |
| | | detilsDto.setYpmc(i.getYpmc()); |
| | | detilsDto.setFzbl(i.getFzbl()); |
| | | detilsDto.setZh(i.getZh()); |
| | | detilsDto.setCflx(i.getCflx()); |
| | | outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | }); |
| | | } |
| | |
| | | detilsDto.setYpmc(i.getYpmc()); |
| | | detilsDto.setFzbl(i.getFzbl()); |
| | | detilsDto.setZh(i.getZh()); |
| | | detilsDto.setCflx(i.getCflx()); |
| | | outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | }); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | //药品申请 |
| | | //药品申请 原版 |
| | | // if(!outpinmedicapplyDetilsDtos.isEmpty()){ |
| | | // OutpinmedicapplyDto dto1=new OutpinmedicapplyDto(); |
| | | // dto1.setHisRegistrationId(cardId); |
| | | // dto1.setSfzh(customer.getCusIdcard()); |
| | | // dto1.setSqysbm(ysbm); |
| | | // dto1.setMzksbm(dept); |
| | | // dto1.setSjrq(date); |
| | | // String yfbm = configService.selectConfigByKey("chufang_yfbm"); |
| | | // String mzzd = configService.selectConfigByKey("chufang_mzzd"); |
| | | // String czybm = configService.selectConfigByKey("chufang_czybm"); |
| | | // String czyksbm = configService.selectConfigByKey("chufang_czyksbm"); |
| | | // String cflxbm = configService.selectConfigByKey("chufang_cflxbm"); |
| | | // if (czybm.equalsIgnoreCase("N")) |
| | | // dto1.setCzybm(ysbm); |
| | | // else dto1.setCzybm(czybm); |
| | | // if (czyksbm.equalsIgnoreCase("N")) |
| | | // dto1.setCzyksbm(dept); |
| | | // else dto1.setCzyksbm(dept); |
| | | // dto1.setCflxbm(cflxbm); |
| | | // if (yfbm.equalsIgnoreCase("N")) |
| | | // dto1.setYfbm("1"); |
| | | // else dto1.setYfbm(yfbm); |
| | | // dto1.setFyts("1"); |
| | | // if (mzzd.equalsIgnoreCase("N")) |
| | | // dto1.setMzzd(""); |
| | | // else dto1.setMzzd(mzzd); |
| | | // dto1.setDetails(outpinmedicapplyDetilsDtos); |
| | | // AjaxResult result = controller.Outpinmedicapply(dto1); |
| | | // String result1 = getAjaxResult(result); |
| | | // JSONObject object = getJSONObject(result1); |
| | | // String code = object.getStr("ResultCode"); |
| | | // if(null !=code && code.equals("0")){ |
| | | // JSONObject resultData = object.getJSONObject("ResultData"); |
| | | //// Map<String, Object> resultDatasss = (Map<String, Object>) resultData.get(0); |
| | | // String cfh = resultData.getStr("cfh"); |
| | | // log.info("药品申请后的处方号是: "+cfh+" outpinmedicapplyDetilsDtos 里面的值为: "+outpinmedicapplyDetilsDtos.toString()); |
| | | // for (OutpinmedicapplyDetilsDto detilsDto : outpinmedicapplyDetilsDtos) { |
| | | // TjCf cf=new TjCf(); |
| | | // cf.setJxbz(jxbz); |
| | | // cf.setCardId(cardId); |
| | | // cf.setSfzh(customer.getCusIdcard()); |
| | | // cf.setCfh(cfh); |
| | | // cf.setSqysbm(ysbm); |
| | | // cf.setSqysxm(ysmc); |
| | | // cf.setMzksbn(dept); |
| | | // cf.setSqrq(date); |
| | | // cf.setCzybm(ysbm); |
| | | // cf.setYpbm(detilsDto.getYpbm()); |
| | | // cf.setYpmc(detilsDto.getYpmc()); |
| | | // cf.setSl(String.valueOf(detilsDto.getSl())); |
| | | // cf.setDj(String.valueOf(detilsDto.getDj())); |
| | | // cf.setDcjl(String.valueOf(detilsDto.getDcjl())); |
| | | // cf.setPj(String.valueOf(detilsDto.getPj())); |
| | | // cf.setJj(String.valueOf(detilsDto.getJj())); |
| | | // cf.setCreateTime(new Date()); |
| | | // cfService.save(cf); |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | |
| | | /** |
| | | * 药品申请 处方类型维护在药品表 |
| | | */ |
| | | if(!outpinmedicapplyDetilsDtos.isEmpty()){ |
| | | OutpinmedicapplyDto dto1=new OutpinmedicapplyDto(); |
| | | dto1.setHisRegistrationId(cardId); |
| | | dto1.setSfzh(customer.getCusIdcard()); |
| | | dto1.setSqysbm(ysbm); |
| | | dto1.setMzksbm(dept); |
| | | dto1.setSjrq(date); |
| | | String yfbm = configService.selectConfigByKey("chufang_yfbm"); |
| | | String mzzd = configService.selectConfigByKey("chufang_mzzd"); |
| | | String czybm = configService.selectConfigByKey("chufang_czybm"); |
| | | String czyksbm = configService.selectConfigByKey("chufang_czyksbm"); |
| | | String cflxbm = configService.selectConfigByKey("chufang_cflxbm"); |
| | | if (czybm.equalsIgnoreCase("N")) |
| | | dto1.setCzybm(ysbm); |
| | | else dto1.setCzybm(czybm); |
| | | if (czyksbm.equalsIgnoreCase("N")) |
| | | dto1.setCzyksbm(dept); |
| | | else dto1.setCzyksbm(dept); |
| | | dto1.setCflxbm(cflxbm); |
| | | if (yfbm.equalsIgnoreCase("N")) |
| | | dto1.setYfbm("1"); |
| | | else dto1.setYfbm(yfbm); |
| | | dto1.setFyts("1"); |
| | | if (mzzd.equalsIgnoreCase("N")) |
| | | dto1.setMzzd(""); |
| | | else dto1.setMzzd(mzzd); |
| | | dto1.setDetails(outpinmedicapplyDetilsDtos); |
| | | AjaxResult result = controller.Outpinmedicapply(dto1); |
| | | String result1 = getAjaxResult(result); |
| | | JSONObject object = getJSONObject(result1); |
| | | String code = object.getStr("ResultCode"); |
| | | if(null !=code && code.equals("0")){ |
| | | JSONObject resultData = object.getJSONObject("ResultData"); |
| | | // Map<String, Object> resultDatasss = (Map<String, Object>) resultData.get(0); |
| | | String cfh = resultData.getStr("cfh"); |
| | | log.info("药品申请后的处方号是: "+cfh+" outpinmedicapplyDetilsDtos 里面的值为: "+outpinmedicapplyDetilsDtos.toString()); |
| | | for (OutpinmedicapplyDetilsDto detilsDto : outpinmedicapplyDetilsDtos) { |
| | | TjCf cf=new TjCf(); |
| | | cf.setJxbz(jxbz); |
| | | cf.setCardId(cardId); |
| | | cf.setSfzh(customer.getCusIdcard()); |
| | | cf.setCfh(cfh); |
| | | cf.setSqysbm(ysbm); |
| | | cf.setSqysxm(ysmc); |
| | | cf.setMzksbn(dept); |
| | | cf.setSqrq(date); |
| | | cf.setCzybm(ysbm); |
| | | cf.setYpbm(detilsDto.getYpbm()); |
| | | cf.setYpmc(detilsDto.getYpmc()); |
| | | cf.setSl(String.valueOf(detilsDto.getSl())); |
| | | cf.setDj(String.valueOf(detilsDto.getDj())); |
| | | cf.setDcjl(String.valueOf(detilsDto.getDcjl())); |
| | | cf.setPj(String.valueOf(detilsDto.getPj())); |
| | | cf.setJj(String.valueOf(detilsDto.getJj())); |
| | | cf.setCreateTime(new Date()); |
| | | cfService.save(cf); |
| | | // String cflxbm = configService.selectConfigByKey("chufang_cflxbm"); |
| | | Map<String, List<OutpinmedicapplyDetilsDto>> listMap = outpinmedicapplyDetilsDtos.stream().collect(Collectors.groupingBy(OutpinmedicapplyDetilsDto::getCflx)); |
| | | listMap.forEach((cflx, details) -> { |
| | | OutpinmedicapplyDto dto1 = new OutpinmedicapplyDto(); |
| | | dto1.setHisRegistrationId(cardId); |
| | | dto1.setSfzh(customer.getCusIdcard()); |
| | | dto1.setSqysbm(ysbm); |
| | | dto1.setMzksbm(dept); |
| | | dto1.setSjrq(date); |
| | | if (czybm.equalsIgnoreCase("N")) |
| | | dto1.setCzybm(ysbm); |
| | | else dto1.setCzybm(czybm); |
| | | if (czyksbm.equalsIgnoreCase("N")) |
| | | dto1.setCzyksbm(dept); |
| | | else dto1.setCzyksbm(czyksbm); |
| | | dto1.setCflxbm(cflx); |
| | | if (yfbm.equalsIgnoreCase("N")) |
| | | dto1.setYfbm("1"); |
| | | else dto1.setYfbm(yfbm); |
| | | dto1.setFyts("1"); |
| | | if (mzzd.equalsIgnoreCase("N")) |
| | | dto1.setMzzd(""); |
| | | else dto1.setMzzd(mzzd); |
| | | dto1.setDetails(details); |
| | | AjaxResult result = controller.Outpinmedicapply(dto1); |
| | | String result1 = getAjaxResult(result); |
| | | JSONObject object = getJSONObject(result1); |
| | | String code = object.getStr("ResultCode"); |
| | | if (null != code && code.equals("0")) { |
| | | JSONObject resultData = object.getJSONObject("ResultData"); |
| | | String cfh = resultData.getStr("cfh"); |
| | | log.info("药品申请后的处方号是: " + cfh + " outpinmedicapplyDetilsDtos 里面的值为: " + outpinmedicapplyDetilsDtos.toString()); |
| | | for (OutpinmedicapplyDetilsDto detilsDto : outpinmedicapplyDetilsDtos) { |
| | | TjCf cf = new TjCf(); |
| | | cf.setCardId(cardId); |
| | | cf.setSfzh(customer.getCusIdcard()); |
| | | cf.setCfh(cfh); |
| | | cf.setSqysbm(ysbm); |
| | | cf.setSqysxm(ysmc); |
| | | cf.setMzksbn(dept); |
| | | cf.setSqrq(date); |
| | | cf.setCzybm(ysbm); |
| | | cf.setYpbm(detilsDto.getYpbm()); |
| | | cf.setYpmc(detilsDto.getYpmc()); |
| | | cf.setSl(String.valueOf(detilsDto.getSl())); |
| | | cf.setDj(String.valueOf(detilsDto.getDj())); |
| | | cf.setDcjl(String.valueOf(detilsDto.getDcjl())); |
| | | cf.setPj(String.valueOf(detilsDto.getPj())); |
| | | cf.setJj(String.valueOf(detilsDto.getJj())); |
| | | cf.setCreateTime(new Date()); |
| | | cfService.save(cf); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | } |