rev:手持入库仓位数限制
This commit is contained in:
@@ -33,6 +33,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author zhouz
|
* @author zhouz
|
||||||
@@ -251,12 +252,26 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
|||||||
String download_attr_num = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("download_attr_num").getValue();
|
String download_attr_num = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("download_attr_num").getValue();
|
||||||
|
|
||||||
// 校验仓位数是否满足
|
// 校验仓位数是否满足
|
||||||
JSONObject jsonAttr = attrList.stream()
|
if(box_high <= Double.parseDouble(in_download_box_high)) {
|
||||||
.filter(row -> row.getDoubleValue("num") <= Double.parseDouble(download_attr_num))
|
JSONObject jsonOne = attrList.stream()
|
||||||
.findFirst().orElse(null);
|
.filter(row -> row.getString("layer_num").equals("1"))
|
||||||
|
.findFirst().orElse(null);
|
||||||
|
|
||||||
if (ObjectUtil.isNotEmpty(jsonAttr)) {
|
if (jsonOne.getDoubleValue("num") <= Double.parseDouble(download_attr_num)) {
|
||||||
throw new BadRequestException(jsonAttr.getString("layer_num") + "层主存区仓位数不足" + download_attr_num +"个,不允许入库!");
|
throw new BadRequestException(jsonOne.getString("layer_num") + "层主存区仓位数不足" + download_attr_num +"个,不允许入库!");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
List<JSONObject> layerList = attrList.stream()
|
||||||
|
.filter(row -> "2,3".contains(row.getString("layer_num")))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
JSONObject jsonAttr = layerList.stream()
|
||||||
|
.filter(row -> row.getDoubleValue("num") <= Double.parseDouble(download_attr_num))
|
||||||
|
.findFirst().orElse(null);
|
||||||
|
|
||||||
|
if (ObjectUtil.isNotEmpty(jsonAttr)) {
|
||||||
|
throw new BadRequestException(jsonAttr.getString("layer_num") + "层主存区仓位数不足" + download_attr_num +"个,不允许入库!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject point_jo = WQLObject.getWQLObject("sch_base_point").query("point_code = '" + point_code + "'").uniqueResult(0);
|
JSONObject point_jo = WQLObject.getWQLObject("sch_base_point").query("point_code = '" + point_code + "'").uniqueResult(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user