diff --git a/src/main/java/com/gaotao/modules/mr/service/impl/MrServiceImpl.java b/src/main/java/com/gaotao/modules/mr/service/impl/MrServiceImpl.java index 1013f9e..da149c9 100644 --- a/src/main/java/com/gaotao/modules/mr/service/impl/MrServiceImpl.java +++ b/src/main/java/com/gaotao/modules/mr/service/impl/MrServiceImpl.java @@ -99,7 +99,7 @@ public class MrServiceImpl implements MrService { } if(mrIssueDto.getSelectedMaterials() != null && mrIssueDto.getSelectedMaterials().size()>0){ - boolean b = validateHandingUnitQty(mrIssueDto.getSelectedMaterials()); + boolean b = validateHandingUnitQty(mrIssueDto.getSelectedMaterials(),mrIssueDto.getSite()); if(b){ throw new Exception("输入数量大于数据库标签数量,不允许发料"); } @@ -414,7 +414,13 @@ public class MrServiceImpl implements MrService { } @Transactional - public boolean validateHandingUnitQty(List selectedMaterials)throws Exception{ + public boolean validateHandingUnitQty(List selectedMaterials,String site)throws Exception{ + for (MrIssueMaterialDto material : selectedMaterials){ + String s = validateInventoryPartInStockService.validatePalletDetailByHu(material.getLabelCode(),site); + if(!"200".equals(s)){ + throw new IllegalArgumentException("标签"+material.getLabelCode()+"在栈板"+s+"上,请先扫出"); + } + } Set unitIds = selectedMaterials.stream() .map(MrIssueMaterialDto::getLabelCode) .filter(Objects::nonNull) diff --git a/src/main/java/com/gaotao/modules/production/service/impl/ProductionIssueServiceImpl.java b/src/main/java/com/gaotao/modules/production/service/impl/ProductionIssueServiceImpl.java index cbb5710..ab08c37 100644 --- a/src/main/java/com/gaotao/modules/production/service/impl/ProductionIssueServiceImpl.java +++ b/src/main/java/com/gaotao/modules/production/service/impl/ProductionIssueServiceImpl.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.gaotao.common.exception.XJException; import com.gaotao.common.utils.CountModeChecker; import com.gaotao.common.utils.HttpUtils; +import com.gaotao.common.utils.R; import com.gaotao.modules.api.entity.issueAndReturnVo.IssueShopOrderDto; import com.gaotao.modules.api.entity.issueAndReturnVo.MaterialRequisitionVo; import com.gaotao.modules.api.service.IfsApiIssueAndReturnService; @@ -136,7 +137,7 @@ public class ProductionIssueServiceImpl implements ProductionIssueService { throw new XJException("工单状态不允许发料"); } if(directIssueDto.getSelectedMaterials() != null && directIssueDto.getSelectedMaterials().size()>0){ - boolean b = validateHandingUnitQty(directIssueDto.getSelectedMaterials()); + boolean b = validateHandingUnitQty(directIssueDto.getSelectedMaterials(),directIssueDto.getSite()); if(b){ throw new Exception("输入数量大于数据库标签数量,不允许发料"); } @@ -541,7 +542,7 @@ public class ProductionIssueServiceImpl implements ProductionIssueService { throw new XJException("工单状态不允许发料"); } if(directIssueDto.getSelectedMaterials() != null && directIssueDto.getSelectedMaterials().size()>0){ - boolean b = validateHandingUnitQty(directIssueDto.getSelectedMaterials()); + boolean b = validateHandingUnitQty(directIssueDto.getSelectedMaterials(),directIssueDto.getSite()); if(b){ throw new Exception("输入数量大于数据库标签数量,不允许发料"); } @@ -699,7 +700,7 @@ public class ProductionIssueServiceImpl implements ProductionIssueService { throw new XJException("工单状态不允许发料"); } if(directIssueDto.getSelectedMaterials() != null && directIssueDto.getSelectedMaterials().size()>0){ - boolean b = validateHandingUnitQty(directIssueDto.getSelectedMaterials()); + boolean b = validateHandingUnitQty(directIssueDto.getSelectedMaterials(),directIssueDto.getSite()); if(b){ throw new Exception("输入数量大于数据库标签数量,不允许发料"); } @@ -840,7 +841,13 @@ public class ProductionIssueServiceImpl implements ProductionIssueService { return null; } - public boolean validateHandingUnitQty(List selectedMaterials){ + public boolean validateHandingUnitQty(List selectedMaterials,String site){ + for (WorkOrderMaterialDto material : selectedMaterials){ + String s = validateInventoryPartInStockService.validatePalletDetailByHu(material.getLabelCode(),site); + if(!"200".equals(s)){ + throw new IllegalArgumentException("标签"+material.getLabelCode()+"在栈板"+s+"上,请先扫出"); + } + } Set unitIds = selectedMaterials.stream() .map(WorkOrderMaterialDto::getLabelCode) .filter(Objects::nonNull)