| | |
| | | BeanUtils.copyProperties(inspectionMaterial, inspectDetailVo); |
| | | /*查询检验单里面的检验项目,并封装到RawInspectVo对象中*/ |
| | | LambdaQueryWrapper<InspectionProduct> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(InspectionProduct::getInspectionMaterialId, inspectionMaterial.getId()); |
| | | 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 -> { |
| | | //将一个对象的值赋值给另一个对象 |
| | |
| | | insProductVo.setInstrumentName(equipmentName); |
| | | } |
| | | //获取用户名(前提是如果存在) |
| | | if (insProduct.getUserId() != null) { |
| | | String userName = userMapper.selectById(insProduct.getUserId()).getName(); |
| | | if (insProduct.getUserProId() != null) { |
| | | String userName = userMapper.selectById(insProduct.getUserProId()).getName(); |
| | | insProductVo.setUserName(userName); |
| | | } |
| | | //项目关联物料id |
| | | insProductVo.setInspectionMaterialId(inspectionMaterial.getId()); |
| | | insProductVo.setId(insProduct.getId()); |
| | | return insProductVo; |
| | | }).collect(Collectors.toList()); |
| | | inspectDetailVo.setInsProducts(insProductVos); |