|
|
|
@ -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<WorkOrderMaterialDto> selectedMaterials){ |
|
|
|
public boolean validateHandingUnitQty(List<WorkOrderMaterialDto> 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<String> unitIds = selectedMaterials.stream() |
|
|
|
.map(WorkOrderMaterialDto::getLabelCode) |
|
|
|
.filter(Objects::nonNull) |
|
|
|
|