| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.mapper.InspectUnacceptedMapper; |
| | | import com.yuanchu.mom.mapper.InspectionItemMapper; |
| | | import com.yuanchu.mom.mapper.RawInsProductMapper; |
| | | import com.yuanchu.mom.pojo.*; |
| | | import com.yuanchu.mom.pojo.dto.InspectionItemDto; |
| | | import com.yuanchu.mom.pojo.vo.RawInspectVo; |
| | |
| | | //原材料检验子数据 |
| | | @Autowired |
| | | private RawInsProductService rawInsProductService; |
| | | |
| | | @Resource |
| | | RawInsProductMapper rawInsProductMapper; |
| | | |
| | | //产品检验 |
| | | @Autowired |
| | |
| | | // 等于0:原材料 |
| | | if (type == 0) { |
| | | // 根据Id查询原材料检验信息 |
| | | RawInspectVo map = inspectUnacceptedMapper.editDisposalOpinionConfirmation(rawUnacceptedId); |
| | | RawInspect rawInspect = new RawInspect(); |
| | | BeanUtils.copyProperties(map, rawInspect); |
| | | RawInspect rawInspect = rawInspectService.getById(inspectUnaccepted.getRawInspectId()); |
| | | List<RawInsProduct> rawInsProductList = rawInsProductMapper.selectList(Wrappers.<RawInsProduct>query() |
| | | .eq("raw_inspect_id", rawInspect.getId())); |
| | | // 保存父级 |
| | | rawInspect.setId(null); |
| | | rawInspect.setInsState(0); |
| | | rawInspect.setJudgeState(null); |
| | | rawInspect.setInsTime(null); |
| | | rawInspectService.save(rawInspect); |
| | | // 批量保存子级 |
| | | rawInsProductService.batchAddInsProduct(rawInspect.getId(), map.getRawInsProducts()); |
| | | List<RawInsProduct> rawInsProducts = rawInsProductList.stream().map(rawInsProduct -> { |
| | | rawInsProduct.setId(null); |
| | | rawInsProduct.setTestValue(null); |
| | | rawInsProduct.setTestState(null); |
| | | rawInsProduct.setDeviceId(null); |
| | | rawInsProduct.setRawInspectId(rawInspect.getId()); |
| | | rawInsProduct.setUserId(null); |
| | | return rawInsProduct; |
| | | }).collect(Collectors.toList()); |
| | | rawInsProductService.saveBatch(rawInsProducts); |
| | | } |
| | | // 等于1:产品检验(半成品) |
| | | else if (type == 1) { |