opt:备货区数据校验

This commit is contained in:
DESKTOP-5DIJMF9\admin
2025-05-04 11:20:19 +08:00
parent 1eccd3aa7b
commit 8cad98fc28

View File

@@ -56,6 +56,8 @@ public class BstIvtStockingivtServiceImpl extends ServiceImpl<BstIvtStockingivtM
private MaterialbaseService materialbaseService;
@Autowired
private IPdmBiOrderbominfoService pdmBiOrderbominfoService;
@Autowired
private IBstIvtStockingivtService stockingivtService;
@Override
public IPage<BstIvtStockingivt> queryAll(Map whereJson, PageQuery page) {
@@ -157,7 +159,7 @@ public class BstIvtStockingivtServiceImpl extends ServiceImpl<BstIvtStockingivtM
String row_num = jsonObject.getString("row_num");
String material_code = jsonObject.getString("material_code");
String point_code = jsonObject.getString("point_code");
Integer now_qty = jsonObject.getInteger("qty");
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
@@ -166,6 +168,20 @@ public class BstIvtStockingivtServiceImpl extends ServiceImpl<BstIvtStockingivtM
//1-绑定2-清除
String type = jsonObject.getString("type");
if (type.equals("1")) {
//校验数据
BstIvtStockingivt pointByCode = stockingivtService.getPointByCode(point_code, true);
if (ObjectUtil.isEmpty(pointByCode)) {
throw new BadRequestException("点位 [" + point_code + "] 不存在或者已被禁用!");
}
if (ObjectUtil.isEmpty(vehicle_code)) {
throw new BadRequestException("托盘信息不能为空!");
}
if(!vehicle_code.contains("GX")){
throw new BadRequestException("请扫描或输入正确的托盘码!");
}
if(now_qty<=0 || now_qty>5){
throw new BadRequestException("数量只允许输入1-5");
}
//
MaterialbaseDto mater = materialbaseService.findByCode(material_code);
String material_name = mater.getMaterial_name();