| | |
| | | ManualTechnologyMapper manualTechnologyMapper; |
| | | |
| | | @Resource |
| | | ProductService productService; |
| | | ManualProductService manualProductService; |
| | | |
| | | @Resource |
| | | InspectionItemService inspectionItemService; |
| | |
| | | public Integer addProcessInspectionSheet(String userId, FinishedInspectVo finishedInspectVo) { |
| | | //根据生产订单id查询编制工序的最后一道工艺 |
| | | List<ManualTechnology> manualTechnologyList = manualTechnologyMapper.selAllByMoId(finishedInspectVo.getId()); |
| | | //获取最后一道工艺关联的工艺路线id |
| | | Integer technologyId = manualTechnologyList.get(0).getTechnologyId(); |
| | | //获取编制工艺最后一道工艺的id |
| | | Integer mtId = manualTechnologyList.get(0).getId(); |
| | | /*新增成品检验单*/ |
| | | FinishedInspect finishedInspect = new FinishedInspect(); |
| | | finishedInspect.setUserId(Integer.parseInt(userId)); |
| | |
| | | finishedInspect.setSpecificationsModel(finishedInspectVo.getSpecificationsModel()); |
| | | finishedInspect.setMaterial(finishedInspectVo.getMaterial()); |
| | | finishedInspect.setMaterialCode(finishedInspectVo.getMcode()); |
| | | finishedInspect.setTechId(technologyId); |
| | | //finishedInspect.setTechId(technologyId); |
| | | finishedInspectMapper.insert(finishedInspect); |
| | | /*批量新增成品检验项目单*/ |
| | | |
| | | /*//查询标准BOM技术指标中该型号工艺下最新版本的检验项目 |
| | | Integer ver = productService.selectVerByPro(specificationId).get(0);//该型号下技术指标最新版本*/ |
| | | List<Product> productList = productService.selProByVerSpe(technologyId); |
| | | List<InspectionItem> inspectionItemList = productList.stream().map(product -> { |
| | | List<ManualProduct> manualProductList = manualProductService.selByMtid(mtId); |
| | | List<InspectionItem> inspectionItemList = manualProductList.stream().map(manualProduct -> { |
| | | InspectionItem inspectionItem = new InspectionItem(); |
| | | BeanUtils.copyProperties(product, inspectionItem); |
| | | BeanUtils.copyProperties(manualProductList, inspectionItem); |
| | | inspectionItem.setId(null); |
| | | inspectionItem.setCreateTime(new Date()); |
| | | inspectionItem.setUpdateTime(new Date()); |
| | |
| | | return finishedInspect.getId(); |
| | | } |
| | | |
| | | |
| | | //上报(更新检验状态) |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |