| | |
| | | QualityInspect qualityInspect = qualityInspectService.getById(unqualified.getInspectId()); |
| | | String batchNo = qualityInspect == null ? null |
| | | : resolveProductionBatchNo(qualityInspect.getProductMainId(), qualityInspect.getId(), qualityInspect.getProductModelId()); |
| | | if (qualityUnqualified.getDealType() != null) { |
| | | switch (qualityUnqualified.getDealType()) { |
| | | case 0: |
| | | qualityUnqualified.setDealResult("轻微返工"); |
| | | break; |
| | | case 1: |
| | | qualityUnqualified.setDealResult("严重返工"); |
| | | break; |
| | | case 2: |
| | | qualityUnqualified.setDealResult("报废"); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | if (ObjectUtils.isNotNull(qualityInspect) && qualityInspect.getInspectType() != 0) { |
| | | switch (qualityUnqualified.getDealResult()) { |
| | | case "返修": |
| | | case "返工": |
| | | case "严重返工": |
| | | case "轻微返工": |
| | | if (ObjectUtils.isNotNull(qualityInspect.getProductMainId())) { |
| | | ProductionProductMain sourceMain = productionProductMainMapper.selectById(qualityInspect.getProductMainId()); |
| | | if (sourceMain == null || sourceMain.getProductionOperationTaskId() == null) { |
| | | throw new ServiceException("历史报工未绑定生产工单,无法按新模型返修/返工"); |
| | | throw new ServiceException("历史报工未绑定生产工单,无法按新模型返工"); |
| | | } |
| | | createReworkProductionByNewModel(sourceMain, unqualified.getQuantity()); |
| | | } |
| | |
| | | case "报废": |
| | | stockUtils.addUnStockWithBatchNo(qualityInspect.getProductModelId(), unqualified.getQuantity(), |
| | | StockInQualifiedRecordTypeEnum.DEFECTIVE_SCRAP.getCode(), unqualified.getId(), batchNo); |
| | | qualityUnqualified.setRegenerateNewOrder(1); |
| | | break; |
| | | case "让步放行": |
| | | stockUtils.addStockWithBatchNo(qualityInspect.getProductModelId(), unqualified.getQuantity(), |