|
@ -2,9 +2,11 @@ package org.nl.wms.common; |
|
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
import cn.hutool.core.util.StrUtil; |
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import org.nl.exception.BadRequestException; |
|
|
import org.nl.exception.BadRequestException; |
|
|
import org.nl.start.day01.Struct; |
|
|
import org.nl.start.day01.Struct; |
|
|
|
|
|
import org.nl.wms.sch.manage.AreaEnum; |
|
|
import org.nl.wql.WQL; |
|
|
import org.nl.wql.WQL; |
|
|
import org.nl.wql.core.bean.WQLObject; |
|
|
import org.nl.wql.core.bean.WQLObject; |
|
|
|
|
|
|
|
@ -63,9 +65,14 @@ public class StructFindUtil { |
|
|
public static JSONObject getEmptyVehicleInStruct(JSONObject jsonObject) { |
|
|
public static JSONObject getEmptyVehicleInStruct(JSONObject jsonObject) { |
|
|
String area_type = jsonObject.getString("area_type"); |
|
|
String area_type = jsonObject.getString("area_type"); |
|
|
String vehicle_code = jsonObject.getString("vehicle_code"); |
|
|
String vehicle_code = jsonObject.getString("vehicle_code"); |
|
|
|
|
|
String point_code = jsonObject.getString("point_code"); |
|
|
if (StrUtil.isEmpty(vehicle_code)) { |
|
|
if (StrUtil.isEmpty(vehicle_code)) { |
|
|
throw new BadRequestException("托盘不能为空!"); |
|
|
throw new BadRequestException("托盘不能为空!"); |
|
|
} |
|
|
} |
|
|
|
|
|
if (StrUtil.equals(point_code,"KGTPDDW05")){ |
|
|
|
|
|
JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", AreaEnum.KGTDDQ).addParam("flag", "2").process().getResultJSONArray(0); |
|
|
|
|
|
PointUpdateUtil.updatePoint(pointarr); |
|
|
|
|
|
} |
|
|
//根据托盘找托盘类型,
|
|
|
//根据托盘找托盘类型,
|
|
|
JSONObject vehicleObj = WQLObject.getWQLObject("md_pb_vehicle").query("vehicle_code='" + vehicle_code + "'").uniqueResult(0); |
|
|
JSONObject vehicleObj = WQLObject.getWQLObject("md_pb_vehicle").query("vehicle_code='" + vehicle_code + "'").uniqueResult(0); |
|
|
if (ObjectUtil.isEmpty(vehicleObj)) { |
|
|
if (ObjectUtil.isEmpty(vehicleObj)) { |
|
@ -76,18 +83,30 @@ public class StructFindUtil { |
|
|
} |
|
|
} |
|
|
String vehice_type = vehicleObj.getString("vehicle_type"); |
|
|
String vehice_type = vehicleObj.getString("vehicle_type"); |
|
|
JSONObject result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "4") |
|
|
JSONObject result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "4") |
|
|
.addParam("area_type", area_type).addParam("vehice_type", vehice_type).process().uniqueResult(0); |
|
|
.addParam("area_type", area_type) |
|
|
|
|
|
.addParam("vehice_type", vehice_type) |
|
|
|
|
|
.addParam("point_code", point_code) |
|
|
|
|
|
.process().uniqueResult(0); |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static JSONObject getEmptyVehicleOutStruct(JSONObject jsonObject) { |
|
|
public static JSONObject getEmptyVehicleOutStruct(JSONObject jsonObject) { |
|
|
String area_type = jsonObject.getString("area_type"); |
|
|
String area_type = jsonObject.getString("area_type"); |
|
|
String vehicle_type = jsonObject.getString("vehicle_type"); |
|
|
String vehicle_type = jsonObject.getString("vehicle_type"); |
|
|
|
|
|
String point_code = jsonObject.getString("point_code"); |
|
|
|
|
|
//如果是堆叠位5 需要更新 设备状态
|
|
|
|
|
|
if(StrUtil.equals(point_code,"KGTPDDW05")){ |
|
|
|
|
|
JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", AreaEnum.KGTDDQ).addParam("flag", "2").process().getResultJSONArray(0); |
|
|
|
|
|
PointUpdateUtil.updatePoint(pointarr); |
|
|
|
|
|
} |
|
|
if (StrUtil.isEmpty(area_type)) { |
|
|
if (StrUtil.isEmpty(area_type)) { |
|
|
throw new BadRequestException("区域不能为空!"); |
|
|
throw new BadRequestException("区域不能为空!"); |
|
|
} |
|
|
} |
|
|
JSONObject result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "5") |
|
|
JSONObject result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "5") |
|
|
.addParam("area_type", area_type).addParam("vehicle_type", vehicle_type).process().uniqueResult(0); |
|
|
.addParam("area_type", area_type) |
|
|
|
|
|
.addParam("vehicle_type", vehicle_type) |
|
|
|
|
|
.addParam("point_code", point_code) |
|
|
|
|
|
.process().uniqueResult(0); |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|