| | |
| | | public int submit(QualityInspect inspect) { |
| | | QualityInspect qualityInspect = qualityInspectMapper.selectById(inspect.getId()); |
| | | ProductionProductMain productionProductMain = productionProductMainMapper.selectById(qualityInspect.getProductMainId()); |
| | | |
| | | String batchNo; |
| | | String customer; |
| | | if (productionProductMain != null) { |
| | | ProductWorkOrder productWorkOrder = productWorkOrderMapper.selectById(productionProductMain.getWorkOrderId()); |
| | | ProductOrder productOrder = productOrderMapper.selectById(productWorkOrder.getProductOrderId()); |
| | | batchNo = productOrder.getBatchNo(); |
| | | customer = "长治市轴承制造有限公司"; |
| | | } else { |
| | | batchNo = qualityInspect.getBatchNo(); |
| | | customer = qualityInspect.getSupplier(); |
| | | } |
| | | |
| | | //提交前必须判断是否合格 |
| | | if (ObjectUtils.isNull(qualityInspect.getCheckResult())) { |
| | | throw new RuntimeException("请先判断是否合格"); |
| | |
| | | qualityUnqualifiedMapper.insert(qualityUnqualified); |
| | | } else { |
| | | //合格直接入库 |
| | | String customer = "长治市轴承制造有限公司"; |
| | | stockUtils.addStock(qualityInspect.getProductModelId(), qualityInspect.getQuantity(), StockInQualifiedRecordTypeEnum.QUALITYINSPECT_STOCK_IN.getCode(), |
| | | qualityInspect.getId(),productOrder.getBatchNo(),customer |
| | | qualityInspect.getId(), batchNo, customer |
| | | ); |
| | | } |
| | | qualityInspect.setInspectState(1);//已提交 |