| | |
| | | |
| | | String config = configService.selectConfigByKey("sfkqdyhis"); |
| | | |
| | | //检验 |
| | | List<OutpintestapplyDetailsDto> detailsDtos = new ArrayList<>(); |
| | | |
| | | //检查 |
| | | List<OutpintestapplyDetailsDto> detailsDtoss = new ArrayList<>(); |
| | | |
| | | |
| | | //处置 |
| | | List<OutpintestapplyDetailsDto> detailDtos = new ArrayList<>(); |
| | | |
| | | List<OutpinmedicapplyDetilsDto> outpinmedicapplyDetilsDtos =new ArrayList<>(); |
| | | // //检验 |
| | | // List<OutpintestapplyDetailsDto> detailsDtos = new ArrayList<>(); |
| | | // |
| | | // //检查 |
| | | // List<OutpintestapplyDetailsDto> detailsDtoss = new ArrayList<>(); |
| | | // |
| | | // |
| | | // //处置 |
| | | // List<OutpintestapplyDetailsDto> detailDtos = new ArrayList<>(); |
| | | // |
| | | // List<OutpinmedicapplyDetilsDto> outpinmedicapplyDetilsDtos =new ArrayList<>(); |
| | | |
| | | List<TjProject> projectList=new ArrayList<>(); |
| | | |
| | | ArrayList<TjOrderDetail> tjOrderDetails = new ArrayList<>(); |
| | | for (String tjProId : tjProIds) { |
| | | // LambdaQueryWrapper<TbTransition> wqq = new LambdaQueryWrapper<>(); |
| | | // wqq.eq(TbTransition::getCusId, customer.getCusIdcard()); |
| | | // wqq.isNull(TbTransition::getTjNum); |
| | | TjProject project = projectService.getById(Long.valueOf(tjProId)); |
| | | if (null != project && project.getProParentId() == 0) { |
| | | TjOrderRemark tjOrderRemark = new TjOrderRemark(); |
| | |
| | | detail1.setJxbz(jxbz); |
| | | tjOrderDetailService.save(detail1); |
| | | } |
| | | // wqq.in(TbTransition::getProId, proIds); |
| | | |
| | | if(null !=config && config.equals("Y")){ |
| | | //检验 |
| | | // if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && (project.getDeptId() == 241L || project.getDeptId() == 317L)) { |
| | | if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getJyDeptIds().contains(project.getDeptId().toString())) { |
| | | 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()); |
| | | 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 (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getJyDeptIds().contains(project.getDeptId().toString())) { |
| | | // 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()); |
| | | // 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 (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && |
| | | // (project.getDeptId() == 247 || project.getDeptId() == 248 || project.getDeptId() == 249 || |
| | | // project.getDeptId() == 250 || project.getDeptId() == 251 || project.getDeptId() == 252 || |
| | | // project.getDeptId() == 271 || project.getDeptId() == 273 || project.getDeptId() == 274 || |
| | | // project.getDeptId() == 275 || project.getDeptId() == 298)) { |
| | | if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getJcDeptIds().contains(project.getDeptId().toString())) { |
| | | 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()); |
| | | 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 (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getJcDeptIds().contains(project.getDeptId().toString())) { |
| | | // 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()); |
| | | // 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 (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && |
| | | // (project.getDeptId() == 100 || project.getDeptId() == 240 || project.getDeptId() == 253 || |
| | | // project.getDeptId() == 254 || project.getDeptId() == 255 || project.getDeptId() == 257 || |
| | | // project.getDeptId() == 258 || project.getDeptId() == 259 || project.getDeptId() == 269 || |
| | | // project.getDeptId() == 270)) { |
| | | if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getCzDeptIds().contains(project.getDeptId().toString())) { |
| | | 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()); |
| | | 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 (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getCzDeptIds().contains(project.getDeptId().toString())) { |
| | | // 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()); |
| | | // 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); |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | |
| | | |
| | | } else { |
| | | // wqq.in(TbTransition::getProId, Arrays.asList(tjProIds)); |
| | | |
| | | //如果该项目存在 则 不保存 |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | // List<TbTransition> tbTransitionList = transitionService.list(wqq); |
| | | List<TbTransition> tbTransitionList = transitionService.getTbTransitionListByCusIdAndPacIdAndProId(customer.getCusIdcard(),tjProId); |
| | | if (null != tbTransitionList && !tbTransitionList.isEmpty()) { |
| | | for (TbTransition transition : tbTransitionList) { |
| | | // transition.setJxbz(jxbz); |
| | | // transition.setTjNum(order.getTjNumber()); |
| | | // transition.setCardId(order.getCardId()); |
| | | // transition.setNowPrice(transition.getOrdPrice().multiply(BigDecimal.valueOf(Double.parseDouble(tjFlowingWater.getDiscount())).divide(BigDecimal.valueOf(10)))); |
| | | // transitionService.updateById(transition); |
| | | transitionService.updateTbTransitionById(transition.getId().toString(),jxbz,order.getTjNumber(),order.getCardId(), |
| | | transition.getOrdPrice().multiply(BigDecimal.valueOf(Double.parseDouble(tjFlowingWater.getDiscount())).divide(BigDecimal.valueOf(10)))); |
| | | } |
| | | } |
| | | |
| | | } |
| | | // List<TjOrderDetail> collect = tjOrderDetails.stream().filter(item -> { |
| | | // TjProject project = projectService.getById(item.getProId()); |
| | | // return project != null && project.getProParentId() == 0; |
| | | // }).collect(Collectors.toList()); |
| | | //// addCaiYangDengJi(collect, !collect.isEmpty(), order, sysUser,jxbz); |
| | | List<TjOrderDetail> detailList = tjOrderDetailService.getCaiYangDengJi(order.getOrderId()); |
| | | addCaiYangDengJi(detailList,!detailList.isEmpty(), order, sysUser,jxbz); |
| | | |
| | | tjOrderDetails = new ArrayList<>(); |
| | | |
| | | ArrayList<TjProject> jianChaProjects = new ArrayList<>(); |
| | | ArrayList<TjProject> jianYanProjects = new ArrayList<>(); |
| | | // ArrayList<TjProject> jianYanProjects = new ArrayList<>(); |
| | | |
| | | if(!projectList.isEmpty()){ |
| | | List<TjProject> list = projectList.stream().distinct().collect(Collectors.toList()); |
| | |
| | | detail1.setJxbz(jxbz); |
| | | tjOrderDetailService.save(detail1); |
| | | tjOrderDetails.add(detail1); |
| | | if(null !=config && config.equals("Y")){ |
| | | // if(null !=config && config.equals("Y")){ |
| | | //检验 |
| | | // if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && (project.getDeptId() == 241L || project.getDeptId() == 317L)) { |
| | | if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getJyDeptIds().contains(project.getDeptId().toString())) { |
| | | if (null != project.getHisXmbm()) { |
| | | jianYanProjects.add(project); |
| | | OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | |
| | | detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | |
| | | if (project.getSfzhfy().equals("Y")) { |
| | | detailsDto.setSfzhfy("1"); |
| | | } else { |
| | | detailsDto.setSfzhfy("0"); |
| | | } |
| | | detailsDto.setSl(project.getSl()); |
| | | 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 (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getJyDeptIds().contains(project.getDeptId().toString())) { |
| | | // if (null != project.getHisXmbm()) { |
| | | // jianYanProjects.add(project); |
| | | // OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | // |
| | | // detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | // |
| | | // if (project.getSfzhfy().equals("Y")) { |
| | | // detailsDto.setSfzhfy("1"); |
| | | // } else { |
| | | // detailsDto.setSfzhfy("0"); |
| | | // } |
| | | // detailsDto.setSl(project.getSl()); |
| | | // 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 (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && |
| | | // (project.getDeptId() == 247L || project.getDeptId() == 248L || project.getDeptId() == 249L || |
| | | // project.getDeptId() == 250L || project.getDeptId() == 251L || project.getDeptId() == 252L || |
| | | // project.getDeptId() == 271L || project.getDeptId() == 273L || project.getDeptId() == 274L || |
| | | // project.getDeptId() == 275L || project.getDeptId() == 298L)) { |
| | | |
| | | if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getJcDeptIds().contains(project.getDeptId().toString())) { |
| | | if (null != project.getHisXmbm()) { |
| | | jianChaProjects.add(project); |
| | | OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | if (project.getSfzhfy().equals("Y")) { |
| | | detailsDto.setSfzhfy("1"); |
| | | } else { |
| | | detailsDto.setSfzhfy("0"); |
| | | } |
| | | detailsDto.setSl(project.getSl()); |
| | | detailsDtoss.add(detailsDto); |
| | | // OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | // detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | // if (project.getSfzhfy().equals("Y")) { |
| | | // detailsDto.setSfzhfy("1"); |
| | | // } else { |
| | | // detailsDto.setSfzhfy("0"); |
| | | // } |
| | | // detailsDto.setSl(project.getSl()); |
| | | // 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(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 (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && |
| | | // (project.getDeptId() == 100L || project.getDeptId() == 240L || project.getDeptId() == 253L || |
| | | // project.getDeptId() == 254L || project.getDeptId() == 255L || project.getDeptId() == 257L || |
| | | // project.getDeptId() == 258L || project.getDeptId() == 259L || project.getDeptId() == 269L || |
| | | // project.getDeptId() == 270L)) { |
| | | if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getCzDeptIds().contains(project.getDeptId().toString())) { |
| | | 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()); |
| | | 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 (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getCzDeptIds().contains(project.getDeptId().toString())) { |
| | | // 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()); |
| | | // 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); |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | // collect = tjOrderDetails.stream().filter(item -> { |
| | | // TjProject project = projectService.getById(item.getProId()); |
| | | // return project != null && project.getProParentId() == 0; |
| | | // }).collect(Collectors.toList()); |
| | | //// addCaiYangDengJi(collect, !collect.isEmpty(), order, sysUser,jxbz); |
| | | |
| | | List<TjOrderDetail> detailLists = tjOrderDetailService.getCaiYangDengJi(order.getOrderId()); |
| | | addCaiYangDengJi(detailLists,!detailLists.isEmpty(), order, sysUser,jxbz); |
| | | } |
| | | |
| | | Boolean useLisAndPacsRegister = lisApiMethod.isUseLisAndPacsRegister(order); |
| | | // Boolean useLisAndPacsRegister = lisApiMethod.isUseLisAndPacsRegister(order); |
| | | if(null !=config && config.equals("Y")){ |
| | | if (useLisAndPacsRegister) { |
| | | tijianbulushenqing(customer,date,order.getCardId(),jxbz,jianChaProjects); |
| | | // if (useLisAndPacsRegister) { |
| | | // List<TjProject> projectList2 = jianYanProjects.stream().distinct().collect(Collectors.toList()); |
| | | // 检查申请 |
| | | pacsReg(order, customer, jianChaProjects); |
| | | }else { |
| | | //检验申请 |
| | | // pacsReg(order, customer, jianChaProjects); |
| | | // }else { |
| | | |
| | | |
| | | /* //检验申请 |
| | | if(!detailsDtos.isEmpty()){ |
| | | OutpintestapplyDto dto = new OutpintestapplyDto(); |
| | | dto.setHisRegistrationId(order.getCardId()); |
| | |
| | | ltkjJianchajianyanTreeService.save(tree); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //药品申请 |
| | | }*/ |
| | | // } |
| | | /* //药品申请 |
| | | if(!outpinmedicapplyDetilsDtos.isEmpty()){ |
| | | OutpinmedicapplyDto dto1=new OutpinmedicapplyDto(); |
| | | dto1.setHisRegistrationId(order.getCardId()); |
| | |
| | | ltkjJianchajianyanTreeService.save(tree); |
| | | } |
| | | } |
| | | } |
| | | }*/ |
| | | } |
| | | |
| | | //父项耗材 |
| | |
| | | // } |
| | | } |
| | | |
| | | private void pacsReg(TjOrder order, TjCustomer customer, ArrayList<TjProject> jianChaProjects) { |
| | | |
| | | //体检对his申请单调用方法 |
| | | public AjaxResult tijianbulushenqing(TjCustomer customer, String date,String cardId,String jxbz,ArrayList<TjProject> jianChaProjects) { |
| | | TjOrder order = orderService.getOrderByCardId(cardId); |
| | | if(null !=order){ |
| | | List<TbTransition> detailList = transitionService.getBlTbTransitionListByCusId(customer.getCusIdcard(),cardId,jxbz); |
| | | Boolean useLisAndPacsRegister = lisApiMethod.isUseLisAndPacsRegister(order); |
| | | List<OutpinmedicapplyDetilsDto> outpinmedicapplyDetilsDtos =new ArrayList<>(); |
| | | if (useLisAndPacsRegister) { |
| | | // 检查申请 |
| | | pacsReg(order, customer, jianChaProjects); |
| | | }else { |
| | | //检验申请 |
| | | OutpintestapplyDto dto = new OutpintestapplyDto(); |
| | | dto.setHisRegistrationId(cardId); |
| | | dto.setSfzh(customer.getCusIdcard()); |
| | | dto.setSqysbm("00029"); |
| | | dto.setMzksbm("0101"); |
| | | dto.setSjrq(date); |
| | | dto.setCzybm("00029"); |
| | | dto.setCzyksbm("0101"); |
| | | 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.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("00029"); |
| | | outpinexamapplyDto.setMzksbm("0101"); |
| | | outpinexamapplyDto.setCzybm("00029"); |
| | | outpinexamapplyDto.setCzyksbm("0101"); |
| | | 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.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("00029"); |
| | | dao.setMzksbm("0101"); |
| | | dao.setSjrq(date); |
| | | dao.setCzybm("00029"); |
| | | dao.setCzyksbm("0101"); |
| | | 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("00029"); |
| | | dto1.setMzksbm("0101"); |
| | | dto1.setSjrq(date); |
| | | dto1.setCzybm("00029"); |
| | | dto1.setCzyksbm("0101"); |
| | | 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("00029"); |
| | | cf.setSqysxm("王健萍"); |
| | | cf.setMzksbn("0101"); |
| | | cf.setSqrq(date); |
| | | cf.setCzybm("00029"); |
| | | 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 void pacsReg(TjOrder order, TjCustomer customer, ArrayList<TjProject> jianChaProjects) { |
| | | List<TjProject> projectList1 = jianChaProjects.stream().distinct().collect(Collectors.toList()); |
| | | JSONArray array = JSONUtil.createArray(); |
| | | ArrayList<SavePacsApply> successPacsList = new ArrayList<>(); |