| | |
| | | .specifications(inspectionVo.getSpecifications()) |
| | | .formTime(inspectionVo.getFormTime()) |
| | | .inspectionId(inspection.getId()) |
| | | .notes(inspectionVo.getNotes()) |
| | | .build(); |
| | | inspectionMaterialMapper.insert(inspectionMaterial); |
| | | /*新增检验项目表*/ |
| | |
| | | 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 -> { |
| | | //将一个对象的值赋值给另一个对象 |
| | |
| | | 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()); |