Browse Source

添加标签是否在盘校验

master
shenzhouyu 1 month ago
parent
commit
60aaaaa07f
  1. 10
      src/main/java/com/gaotao/modules/mr/service/impl/MrServiceImpl.java
  2. 15
      src/main/java/com/gaotao/modules/production/service/impl/ProductionIssueServiceImpl.java

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

15
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<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)

Loading…
Cancel
Save