zhaowenxuan
2024-10-11 cebb4511b4f7102570b0151d48779670b32cad62
ltkj-admin/src/main/java/com/ltkj/web/controller/lis/LisApiMethod.java
@@ -11,6 +11,7 @@
import com.ltkj.common.core.domain.AjaxResult;
import com.ltkj.common.utils.AgeResult;
import com.ltkj.common.utils.DateUtils;
import com.ltkj.common.utils.IdUtils;
import com.ltkj.hosp.domain.*;
import com.ltkj.hosp.hisDto.OutpintestapplyDetailsDto;
import com.ltkj.hosp.lisDto.LisSaveSqdxxDto;
@@ -55,6 +56,8 @@
    private LtkjJfxmgljyxmzdService ltkjJfxmgljyxmzdService;
    @Autowired
    private LtkjJyxmzdService jyxmzdService;
    @Autowired
    private IdUtils idUtils;
    /**
     * 保存检验单申请信息
@@ -80,8 +83,10 @@
                            LisSaveSqdxxDto lisSaveSqdxxDto = new LisSaveSqdxxDto();
                            LtkjJyxmzd jyxmzd = getGetYbDm(project);
                            BigDecimal allPrice = new BigDecimal("0");
                            detailList.stream().filter(item -> Objects.equals(item.getParentProId(), project.getProId()))
                                    .forEach(item -> allPrice.add(item.getNowPrice()));
                            for (TbTransition transition : detailList.stream().filter(item -> Objects.equals(item.getParentProId(), project.getProId()))
                                    .collect(Collectors.toList())) {
                                allPrice = allPrice.add(transition.getNowPrice());
                            }
                            if (jyxmzd != null) {
                                ArrayList<LisSaveSqdxxJyxmlistDto> dtos = new ArrayList<>();
                                AtomicInteger xh = new AtomicInteger();
@@ -89,10 +94,11 @@
                                        .forEach(item -> {
                                            LisSaveSqdxxJyxmlistDto dto = new LisSaveSqdxxJyxmlistDto();
                                            dto.setXh(String.valueOf(xh.getAndIncrement()));
                                            dto.setJyxm(item.getProName());
                                            TjProject project1 = projectService.getById(item.getProId());
                                            LtkjJyxmzd jyxmzd1 = getGetYbDm(project1);
                                            dto.setXmmc(jyxmzd1.getJyxmdm());
                                            if (jyxmzd1 == null) dto.setJyxm(project1.getHisXmbm());
                                            else dto.setJyxm(jyxmzd1.getJyxmdm());
                                            dto.setXmmc(project1.getProName());
                                            dtos.add(dto);
                                            OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto();
@@ -108,8 +114,9 @@
                                        });
                                String yyyyMMdd = DateFormatUtils.format(tjCustomer.getCusBrithday(), "yyyyMMdd");
                                String sqdh = "3"+yyyyMMdd.substring(2)+ RandomUtil.randomString(String.valueOf(System.currentTimeMillis()), 3);
                                lisSaveSqdxxDto.setJyxh(sqdh);
//                                String sqdh = "3"+yyyyMMdd.substring(2)+ RandomUtil.randomString(String.valueOf(System.currentTimeMillis()), 3);
                                String jyxh = idUtils.generateID();
                                lisSaveSqdxxDto.setJyxh(jyxh);
                                lisSaveSqdxxDto.setBah(tjOrder.getCardId());
                                lisSaveSqdxxDto.setBrxm(tjCustomer.getCusName());
                                lisSaveSqdxxDto.setBrdm(PinyinUtil.getPinyin(tjCustomer.getCusName()));
@@ -131,7 +138,7 @@
                                lisSaveSqdxxDto.setKsbm("0101");
                                lisSaveSqdxxDto.setSqys("00029");
                                lisSaveSqdxxDto.setJyxmlistDtoList(dtos);
                                System.out.println(JSONUtil.toJsonStr(lisSaveSqdxxDto));
                                log.info("检验申请 ->{}",JSONUtil.toJsonStr(lisSaveSqdxxDto));
                                // TODO 暂不发出请求
                                if (!detailsDtos.isEmpty() && false) {
                                    AjaxResult ajaxResult = lisApiMethodService.saveSqdxx(lisSaveSqdxxDto);
@@ -144,7 +151,7 @@
                                            LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree();
                                            tree.setCardId(tjOrder.getCardId());
                                            tree.setPationid(tjCustomer.getPationId());
                                            tree.setSqdh(sqdh);
                                            tree.setSqdh(jyxh);
                                            tree.setFyhj(allPrice.toString());
                                            String mxfyxmbm = detail.getMxfyxmbm();
                                            tree.setHisXmdm(mxfyxmbm);
@@ -215,7 +222,7 @@
            LtkjJfxmgljyxmzd jfxmgljyxmzd = ltkjJfxmgljyxmzdService.getOne(wrapper1);
            if (jfxmgljyxmzd != null) jyxmdm = jfxmgljyxmzd.getJyxmdm();
        }
        if (StrUtil.isBlank(jyxmdm)) log.error("获取检验项目代码为空 ->{}", project);
//        if (StrUtil.isBlank(jyxmdm)) log.error("获取检验项目代码为空 ->{}", project);
        LambdaQueryWrapper<LtkjJyxmzd> wrapper2 = new LambdaQueryWrapper<>();
        wrapper2.eq(LtkjJyxmzd::getJyxmdm,jyxmdm);
        LtkjJyxmzd jyxmzd = jyxmzdService.getOne(wrapper2);