Fixiaobai
2023-09-01 060fc21c293f3eabcd544602da305e4e83803b42
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InspectionServiceImpl.java
@@ -155,6 +155,7 @@
                .specifications(inspectionVo.getSpecifications())
                .formTime(inspectionVo.getFormTime())
                .inspectionId(inspection.getId())
                .notes(inspectionVo.getNotes())
                .build();
        inspectionMaterialMapper.insert(inspectionMaterial);
        /*新增检验项目表*/
@@ -247,7 +248,6 @@
        queryWrapper
                .eq(InspectionProduct::getInspectionMaterialId, inspectionMaterial.getId());
        List<InspectionProduct> inspectionProducts = inspectionProductMapper.selectList(queryWrapper);
        System.out.println(inspectionProducts);
        //这里查到的设备id和检验员id要查询名称
        List<InsProductVo> insProductVos = inspectionProducts.stream().map(insProduct -> {
            //将一个对象的值赋值给另一个对象
@@ -255,13 +255,11 @@
            BeanUtils.copyProperties(insProduct, insProductVo);
            //获取设备名(前提是如果存在)
            if (insProduct.getInstrumentId() != null) {
                String equipmentName = instrumentService.getById(insProduct.getInstrumentId()).getEquipmentName();
                insProductVo.setInstrumentName(equipmentName);
                insProductVo.setInstrumentId(insProduct.getInstrumentId());
            }
            //获取用户名(前提是如果存在)
            if (insProduct.getUserProId() != null) {
                String userName = userMapper.selectById(insProduct.getUserProId()).getName();
                insProductVo.setUserName(userName);
                insProductVo.setUserId(insProduct.getUserProId());
            }
            //项目关联物料id
            insProductVo.setInspectionMaterialId(inspectionMaterial.getId());