rev: 限制木箱高度

This commit is contained in:
2023-10-26 17:00:54 +08:00
parent 384872d687
commit 0c466793ba

View File

@@ -206,6 +206,34 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
if (ObjectUtil.isEmpty(vehicle_code)) throw new BadRequestException("ACS申请任务失败载具不能为空");
//通过该木箱码查询对应的分配明细
JSONArray dis_rows = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("box_no", vehicle_code).addParam("flag", "28").process().getResultJSONArray(0);
// 校验木箱高度
String height = whereJson.getString("height"); // 高度类型
JSONObject jsonSub = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("package_box_sn = '" + vehicle_code + "'").uniqueResult(0);
double box_high = jsonSub.getDoubleValue("box_high");
// 入库木箱下限
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();
String box_type = "";
if (Double.parseDouble(in_download_box_high) < box_high && box_high <= Double.parseDouble(in_up_box_high) ) {
box_type = "2";
}
if (Double.parseDouble(in_download_box_high) > box_high) {
box_type = "1";
}
if (ObjectUtil.isEmpty(box_type)) {
throw new BadRequestException("木箱高度超出指定范围,比对失败!");
}
if (!StrUtil.equals(box_type,height)) {
throw new BadRequestException("木箱高度类型错误:当前类型为"+height+",实际类型应为"+box_type);
}
if (ObjectUtil.isEmpty(dis_rows)) {
throw new BadRequestException("未查询到木箱:" + vehicle_code + "相关入库分配明细记录!");
}