| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 对之前代码增加总价以及价格计算规则逻辑 |
| | | * @param customer |
| | | * @param date |
| | | * @param cardId |
| | | * @return |
| | | */ |
| | | public AjaxResult tijianshenqing_v2(TjCustomer customer, String date,String cardId) { |
| | | String dept = configService.selectConfigByKey("request_default_dept"); |
| | | String ysbm = configService.selectConfigByKey("request_default_ysbm"); |
| | | String ysmc = configService.selectConfigByKey("request_default_ysmc"); |
| | | |
| | | List<TbTransition> detailList = tbTransitionService.getTbTransitionListByCusId(customer.getCusIdcard(),cardId); |
| | | |
| | | List<TjOutpinmedicXm> outpinmedicXms = tjOutpinmedicXmService.list(); |
| | | |
| | | // his直接单开体检费单项目总价编码 |
| | | String tjfhisxmbm = configService.selectConfigByKey("tjfhisxmbm"); |
| | | // 是否开启his直接单开体检费单项目 N使用明细开单 其他都为单项目开总价 |
| | | String lycdzjhmxj = configService.selectConfigByKey("lycdzjhmxj"); |
| | | // 是否使用his价格传递规则 Y开启 |
| | | String sfsyhisjgrule = configService.selectConfigByKey("sfsyhisjgrule"); |
| | | // his价格传递规则保留得位数 默认2位 |
| | | String sfsyhisjgrulebaoliuweishu = configService.selectConfigByKey("sfsyhisjgrulebaoliuweishu"); |
| | | // his价格传递规则 1四舍五入 2直接舍去 |
| | | String sfsyhisjgrulesconfig = configService.selectConfigByKey("sfsyhisjgrulesconfig"); |
| | | |
| | | if (StrUtil.isNotBlank(lycdzjhmxj) && lycdzjhmxj.equalsIgnoreCase("Y")){ |
| | | // 检验项目 |
| | | LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); |
| | | wq.in(TjProject::getProId, detailList.stream().map(TbTransition::getParentProId).collect(Collectors.toList())); |
| | | wq.in(TjProject::getDeptId,deptService.getJyDeptIds()); |
| | | List<TjProject> jyxms = projectService.list(wq); |
| | | if (!jyxms.isEmpty()){ |
| | | List<TjProject> notNull = jyxms.stream().filter(i -> i.getSpecimenType() != null).collect(Collectors.toList()); |
| | | List<TjProject> isNull = jyxms.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()) { |
| | | |
| | | } |
| | | } |
| | | // 检查项目 |
| | | wq = new LambdaQueryWrapper<>(); |
| | | wq.in(TjProject::getProId, detailList.stream().map(TbTransition::getParentProId).collect(Collectors.toList())); |
| | | wq.in(TjProject::getDeptId,deptService.getJcDeptIds()); |
| | | List<TjProject> jcxms = projectService.list(wq); |
| | | |
| | | }else { |
| | | |
| | | } |
| | | |
| | | //检验申请 |
| | | List<OutpinmedicapplyDetilsDto> outpinmedicapplyDetilsDtos =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.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()); |
| | | 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()); |
| | | detilsDto.setCflx(i.getCflx()); |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //门诊检查申请 |
| | | 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"); |
| | | projects = projectService.list(wrapper4); |
| | | if (null != projects && !projects.isEmpty()) { |
| | | List<OutpintestapplyDetailsDto> detailsDtoss = 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()); |
| | | 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()); |
| | | detilsDto.setCflx(i.getCflx()); |
| | | 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.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"); |
| | | projects = projectService.list(wrapper4); |
| | | if (null != projects && !projects.isEmpty()) { |
| | | List<OutpintestapplyDetailsDto> detailDtos = 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()); |
| | | 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()); |
| | | detilsDto.setCflx(i.getCflx()); |
| | | 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.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(czyksbm); |
| | | // 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.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()){ |
| | | 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"); |
| | | 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); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | public AjaxResult tijianshenqing(TjCustomer customer, String date, TjOrder tjOrder, SysUser sysUser, AjaxResult result) { |
| | | List<TbTransition> detailList = tbTransitionService.getTbTransitionListByCusId(customer.getCusIdcard(), tjOrder.getCardId()); |