rev:入库主存区仓位数限制
This commit is contained in:
@@ -31,6 +31,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
@@ -220,6 +221,44 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
||||
throw new BadRequestException("无法入立体库,木箱超高;当前木箱高度为:" + box_high);
|
||||
}
|
||||
|
||||
/*
|
||||
* 判断木箱高度能入第几层:
|
||||
* 判断仓位是否够用
|
||||
* 1.低于650mm 三层都可以入
|
||||
* 2.650mm > 木箱 <= 800mm, 只能入二、三层
|
||||
* 3.第三层要根据实际高度分配货位
|
||||
*/
|
||||
String layer_num;
|
||||
// 入库木箱下限
|
||||
String in_download_box_high = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("in_download_box_high").getValue();
|
||||
// 入库木箱上线
|
||||
String in_up_box_high = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("in_up_box_high").getValue();
|
||||
|
||||
if (Double.parseDouble(in_download_box_high) < box_high && box_high <= Double.parseDouble(in_up_box_high)) {
|
||||
// 只能入到 2/3层
|
||||
layer_num = "('2','3')";
|
||||
} else {
|
||||
// 三层都可入
|
||||
layer_num = "('1','2','3')";
|
||||
}
|
||||
|
||||
// 查询对应的仓位个数
|
||||
List<JSONObject> attrList = WQL.getWO("PDA_ST_01").addParam("flag", "10")
|
||||
.addParam("layer_num", layer_num).process()
|
||||
.getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||
|
||||
// 获取系统参数 - 最低仓位数
|
||||
String download_attr_num = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("download_attr_num").getValue();
|
||||
|
||||
// 校验仓位数是否满足
|
||||
JSONObject jsonAttr = attrList.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);
|
||||
if (ObjectUtil.isEmpty(point_jo)) {
|
||||
throw new BadRequestException("未查询到对应的点位!");
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
输入.stor_id TYPEAS s_string
|
||||
输入.sect_id TYPEAS s_string
|
||||
输入.in_stor_id TYPEAS f_string
|
||||
输入.layer_num TYPEAS f_string
|
||||
|
||||
|
||||
|
||||
@@ -248,6 +249,32 @@
|
||||
|
||||
order by update_time DESC
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "10"
|
||||
QUERY
|
||||
SELECT
|
||||
layer_num,
|
||||
count(layer_num) AS num
|
||||
FROM
|
||||
st_ivt_structattr
|
||||
WHERE
|
||||
is_used = '1'
|
||||
AND is_delete = '0'
|
||||
AND lock_type = '1'
|
||||
AND sect_code = 'ZC01'
|
||||
AND IFNULL(storagevehicle_code,'') = ''
|
||||
|
||||
OPTION 输入.layer_num <> ""
|
||||
layer_num IN 输入.layer_num
|
||||
ENDOPTION
|
||||
|
||||
group by layer_num
|
||||
|
||||
order by num ASC
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
@@ -2582,6 +2582,10 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
row_num = json.getString("row_num");
|
||||
}
|
||||
|
||||
if (ObjectUtil.isEmpty(block_num) && ObjectUtil.isEmpty(row_num)) {
|
||||
throw new BadRequestException(layer_num + "层没有仓位可分配为中转区!");
|
||||
}
|
||||
|
||||
// 2.将中转区的一排更改为主存区
|
||||
// 查询中转区满的一排
|
||||
List<JSONObject> attrListAllNoEmp = WQL.getWO("ST_UPDATESTRUCTSECT_01").addParam("flag", "3")
|
||||
|
||||
Reference in New Issue
Block a user