代码修改
This commit is contained in:
@@ -1,93 +0,0 @@
|
||||
package org.nl.wms.sch;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
|
||||
|
||||
public class PointFindUtil {
|
||||
public static JSONObject getInStruct(JSONObject jsonObject) {
|
||||
String material_id = jsonObject.getString("material_id");
|
||||
String area_type = jsonObject.getString("area_type");
|
||||
String vehicle_code = jsonObject.getString("vehicle_code");
|
||||
if (StrUtil.isEmpty(vehicle_code)) {
|
||||
throw new BadRequestException("托盘不能为空!");
|
||||
}
|
||||
//根据托盘找托盘类型,
|
||||
JSONObject vehicleObj = WQLObject.getWQLObject("md_pb_vehicle").query("vehicle_code='" + vehicle_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(vehicleObj)) {
|
||||
throw new BadRequestException("未找到托盘号为'" + vehicle_code + "' 托盘信息!");
|
||||
}
|
||||
if (StrUtil.isEmpty(material_id)) {
|
||||
throw new BadRequestException("物料不能为空!");
|
||||
}
|
||||
if (StrUtil.isEmpty(area_type)) {
|
||||
throw new BadRequestException("区域不能为空!");
|
||||
}
|
||||
String vehice_type = vehicleObj.getString("vehicle_type");
|
||||
JSONObject result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "2")
|
||||
.addParam("material_id", material_id).addParam("area_type", area_type).addParam("vehice_type", vehice_type).process().uniqueResult(0);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static JSONObject getOutStruct(JSONObject jsonObject) {
|
||||
String material_id = jsonObject.getString("material_id");
|
||||
String area_type = jsonObject.getString("area_type");
|
||||
String is_full = jsonObject.getString("is_full");
|
||||
String workprocedure_id = jsonObject.getString("workprocedure_id");
|
||||
|
||||
if (StrUtil.isEmpty(material_id)) {
|
||||
throw new BadRequestException("物料不能为空!");
|
||||
}
|
||||
if (StrUtil.isEmpty(area_type)) {
|
||||
throw new BadRequestException("区域不能为空!");
|
||||
}
|
||||
if (StrUtil.isEmpty(is_full)) {
|
||||
throw new BadRequestException("是否满托不能为空!");
|
||||
}
|
||||
if (StrUtil.isEmpty(workprocedure_id)) {
|
||||
throw new BadRequestException("工序不能为空!");
|
||||
}
|
||||
JSONObject result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "3")
|
||||
.addParam("material_id", material_id).addParam("area_type", area_type)
|
||||
.addParam("is_full", is_full).addParam("workprocedure_id", workprocedure_id)
|
||||
.process().uniqueResult(0);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static JSONObject getEmptyVehicleInStruct(JSONObject jsonObject) {
|
||||
String area_type = jsonObject.getString("area_type");
|
||||
String vehicle_code = jsonObject.getString("vehicle_code");
|
||||
if (StrUtil.isEmpty(vehicle_code)) {
|
||||
throw new BadRequestException("托盘不能为空!");
|
||||
}
|
||||
//根据托盘找托盘类型,
|
||||
JSONObject vehicleObj = WQLObject.getWQLObject("md_pb_vehicle").query("vehicle_code='" + vehicle_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(vehicleObj)) {
|
||||
throw new BadRequestException("未找到托盘号为'" + vehicle_code + "' 托盘信息!");
|
||||
}
|
||||
if (StrUtil.isEmpty(area_type)) {
|
||||
throw new BadRequestException("区域不能为空!");
|
||||
}
|
||||
String vehice_type = vehicleObj.getString("vehicle_type");
|
||||
JSONObject result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "4")
|
||||
.addParam("area_type", area_type).addParam("vehice_type", vehice_type).process().uniqueResult(0);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static JSONObject getEmptyVehicleOutStruct(JSONObject jsonObject) {
|
||||
String area_type = jsonObject.getString("area_type");
|
||||
String vehicle_type = jsonObject.getString("vehicle_type");
|
||||
if (StrUtil.isEmpty(area_type)) {
|
||||
throw new BadRequestException("区域不能为空!");
|
||||
}
|
||||
JSONObject result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "5")
|
||||
.addParam("area_type", area_type).addParam("vehicle_type", vehicle_type).process().uniqueResult(0);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user