Browse Source

提交

master
18188916393 2 years ago
parent
commit
b530ec8590
  1. 3
      wms/hd/nladmin-system/src/main/java/org/nl/wms/WorkProcedureEnum.java
  2. 23
      wms/hd/nladmin-system/src/main/java/org/nl/wms/common/StructFindUtil.java
  3. 32
      wms/hd/nladmin-system/src/main/java/org/nl/wms/common/wql/QSTRUCT_RULE.wql
  4. 19
      wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/wql/ACSTOMES_001.wql
  5. 22
      wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallEmptyVehicleTask.java
  6. 4
      wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/SendEmptyVehicleTask.java

3
wms/hd/nladmin-system/src/main/java/org/nl/wms/WorkProcedureEnum.java

@ -11,7 +11,8 @@ public enum WorkProcedureEnum {
HNGX(1, "1514444198529601536", "01", "混碾工序", ""), HNGX(1, "1514444198529601536", "01", "混碾工序", ""),
YZGX(2, "1514444247439380480", "02", "压制工序", ""), YZGX(2, "1514444247439380480", "02", "压制工序", ""),
SZGX(3, "1514444321896665088", "03", "烧制工序", ""), SZGX(3, "1514444321896665088", "03", "烧制工序", ""),
FJGX(4, "1514444386174373888", "04", "分拣工序", ""); FJGX(4, "1514444386174373888", "04", "分拣工序", ""),
DPGX(4, "1514444386174373888", "05", "分拣工序", "");
//顺序号 //顺序号
private int index; private int index;
//工序标识 //工序标识

23
wms/hd/nladmin-system/src/main/java/org/nl/wms/common/StructFindUtil.java

@ -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;
} }

32
wms/hd/nladmin-system/src/main/java/org/nl/wms/common/wql/QSTRUCT_RULE.wql

@ -13,15 +13,16 @@
################################################# #################################################
## 表字段对应输入参数 ## 表字段对应输入参数
################################################# #################################################
输入.flag TYPEAS s_string 输入.flag TYPEAS s_string
输入.code TYPEAS s_string 输入.code TYPEAS s_string
输入.material_id TYPEAS s_string 输入.material_id TYPEAS s_string
输入.sect_id TYPEAS s_string 输入.sect_id TYPEAS s_string
输入.area_type TYPEAS s_string 输入.area_type TYPEAS s_string
输入.vehicle_type TYPEAS s_string 输入.vehicle_type TYPEAS s_string
输入.workprocedure_id TYPEAS s_string 输入.workprocedure_id TYPEAS s_string
输入.is_full TYPEAS s_string 输入.is_full TYPEAS s_string
输入.vehicle_type TYPEAS s_string 输入.vehicle_type TYPEAS s_string
输入.point_code TYPEAS s_string
[临时表] [临时表]
@ -149,13 +150,11 @@ ENDIF
IF 输入.flag = "4" IF 输入.flag = "4"
QUERY QUERY
SELECT DISTINCT SELECT DISTINCT
structattr.struct_id, point.point_id as struct_id,
structattr.struct_code, point.point_code as struct_code,
structattr.struct_name point.point_name as struct_name
FROM FROM
st_ivt_structattr structattr sch_base_point point ON point.point_id = structattr.struct_id
LEFT JOIN sch_base_point point ON point.point_id = structattr.struct_id
LEFT JOIN ST_IVT_StructRelaVehicleType rulevehicle ON rulevehicle.struct_id = structattr.struct_id
WHERE WHERE
point.lock_type = '00' point.lock_type = '00'
AND ( point.vehicle_code = '' OR point.vehicle_code IS NULL ) AND ( point.vehicle_code = '' OR point.vehicle_code IS NULL )
@ -163,12 +162,12 @@ IF 输入.flag = "4"
OPTION 输入.area_type <> "" OPTION 输入.area_type <> ""
point.area_type = 输入.area_type point.area_type = 输入.area_type
ENDOPTION ENDOPTION
OPTION 输入.sect_id <> ""
point.structattr = 输入.sect_id
ENDOPTION
OPTION 输入.vehicle_type <> "" OPTION 输入.vehicle_type <> ""
rulevehicle.vehicle_type = 输入.vehicle_type rulevehicle.vehicle_type = 输入.vehicle_type
ENDOPTION ENDOPTION
OPTION 输入.point_code <> ""
point.point_code = 输入.point_code
ENDOPTION
ENDSELECT ENDSELECT
ENDQUERY ENDQUERY
ENDIF ENDIF
@ -181,8 +180,6 @@ IF 输入.flag = "5"
point.point_code AS struct_code, point.point_code AS struct_code,
point.point_name AS struct_name, point.point_name AS struct_name,
point.vehicle_code point.vehicle_code
FROM FROM
sch_base_point point sch_base_point point
LEFT JOIN md_pb_vehicle vehicle ON vehicle.vehicle_code = point.vehicle_code LEFT JOIN md_pb_vehicle vehicle ON vehicle.vehicle_code = point.vehicle_code
@ -196,6 +193,11 @@ IF 输入.flag = "5"
OPTION 输入.vehicle_type <> "" OPTION 输入.vehicle_type <> ""
vehicle.vehicle_type = 输入.vehicle_type vehicle.vehicle_type = 输入.vehicle_type
ENDOPTION ENDOPTION
OPTION 输入.point_code <> ""
point.point_code = 输入.point_code
ENDOPTION
ENDSELECT ENDSELECT
ENDQUERY ENDQUERY
ENDIF ENDIF

19
wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/wql/ACSTOMES_001.wql

@ -61,3 +61,22 @@
ENDSELECT ENDSELECT
ENDQUERY ENDQUERY
ENDIF ENDIF
IF 输入.flag = "2"
QUERY
SELECT
point.point_code as device_code
FROM
sch_base_point point
WHERE
1=1
OPTION 输入.area_type <> ""
point.area_type = 输入.area_type
ENDOPTION
OPTION 输入.point_code <> ""
point.point_code = 输入.point_code
ENDOPTION
ENDSELECT
ENDQUERY
ENDIF

22
wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallEmptyVehicleTask.java

@ -115,17 +115,17 @@ public class CallEmptyVehicleTask extends AbstractAcsTask {
vehicle_type = VehicleTypeEnum.XLZ.getCode(); vehicle_type = VehicleTypeEnum.XLZ.getCode();
start_area = AreaEnum.KLHJ.getCode(); start_area = AreaEnum.KLHJ.getCode();
break; break;
// 压制工序 // 压制工序
case YZGX: case YZGX:
vehicle_type = VehicleTypeEnum.GTP.getCode(); vehicle_type = VehicleTypeEnum.GTP.getCode();
start_area = AreaEnum.KLHJ.getCode(); start_area = AreaEnum.KLHJ.getCode();
break; break;
//烧制工序 //烧制工序
case SZGX: case SZGX:
vehicle_type = VehicleTypeEnum.GTP.getCode(); vehicle_type = VehicleTypeEnum.GTP.getCode();
start_area = AreaEnum.KLHJ.getCode(); start_area = AreaEnum.KLHJ.getCode();
break; break;
//分拣工序 //分拣工序
case FJGX: case FJGX:
// 根据点位code查找对应设备,根据设备查找对应工单,从工单中取托盘类型 // 根据点位code查找对应设备,根据设备查找对应工单,从工单中取托盘类型
vehicle_type = WQL.getWO("BUSSTASK_001") vehicle_type = WQL.getWO("BUSSTASK_001")
@ -141,7 +141,7 @@ public class CallEmptyVehicleTask extends AbstractAcsTask {
start_area = AreaEnum.KLHJ.getCode(); start_area = AreaEnum.KLHJ.getCode();
} }
//寻找一个合适的仓位 //寻找一个合适的仓位
param.put("vehicle_type",vehicle_type); param.put("vehicle_type", vehicle_type);
JSONObject outStructObj = StructFindUtil.getEmptyVehicleOutStruct(param); JSONObject outStructObj = StructFindUtil.getEmptyVehicleOutStruct(param);
if (ObjectUtil.isEmpty(outStructObj)) { if (ObjectUtil.isEmpty(outStructObj)) {
continue; continue;
@ -213,7 +213,7 @@ public class CallEmptyVehicleTask extends AbstractAcsTask {
case YZGX: case YZGX:
vehicle_type = VehicleTypeEnum.GTP.getCode(); vehicle_type = VehicleTypeEnum.GTP.getCode();
start_area = AreaEnum.KGTDDQ.getCode(); start_area = AreaEnum.KGTDDQ.getCode();
start_point_code = "KGTPDDW05";
break; break;
//烧制工序 //烧制工序
case SZGX: case SZGX:
@ -227,6 +227,13 @@ public class CallEmptyVehicleTask extends AbstractAcsTask {
start_area = AreaEnum.CYZC.getCode(); start_area = AreaEnum.CYZC.getCode();
is_auto_issue = "0"; is_auto_issue = "0";
break; break;
//叠盘工序
case DPGX:
//托盘类型取当前工单生产的托盘类型
vehicle_type = VehicleTypeEnum.GTP.getCode();
start_area = AreaEnum.CYHJ.getCode();
is_auto_issue = "0";
break;
default: default:
vehicle_type = VehicleTypeEnum.DLZ.getCode(); vehicle_type = VehicleTypeEnum.DLZ.getCode();
start_area = AreaEnum.KLHJ.getCode(); start_area = AreaEnum.KLHJ.getCode();
@ -234,6 +241,7 @@ public class CallEmptyVehicleTask extends AbstractAcsTask {
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("vehicle_type", vehicle_type); param.put("vehicle_type", vehicle_type);
param.put("area_type", start_area); param.put("area_type", start_area);
param.put("point_code", start_point_code);
JSONObject outStructObj = StructFindUtil.getEmptyVehicleOutStruct(param); JSONObject outStructObj = StructFindUtil.getEmptyVehicleOutStruct(param);
if (ObjectUtil.isEmpty(outStructObj)) { if (ObjectUtil.isEmpty(outStructObj)) {
throw new BadRequestException("未找到合适的空托盘点位"); throw new BadRequestException("未找到合适的空托盘点位");
@ -258,6 +266,10 @@ public class CallEmptyVehicleTask extends AbstractAcsTask {
} }
String task_id = IdUtil.getSnowflake(1, 1).nextId() + ""; String task_id = IdUtil.getSnowflake(1, 1).nextId() + "";
//生成空载具搬运单据 //生成空载具搬运单据
//如果载具点位上取不到,则给一个默认的999
if (StrUtil.isEmpty(vehicle_code)) {
vehicle_code = "999";
}
JSONObject EmptyVehicleObj = new JSONObject(); JSONObject EmptyVehicleObj = new JSONObject();
EmptyVehicleObj.put("record_uuid", IdUtil.getSnowflake(1, 1).nextId()); EmptyVehicleObj.put("record_uuid", IdUtil.getSnowflake(1, 1).nextId());
EmptyVehicleObj.put("bill_code", CodeUtil.getNewCode("KZJ_BILL_CODE")); EmptyVehicleObj.put("bill_code", CodeUtil.getNewCode("KZJ_BILL_CODE"));

4
wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/SendEmptyVehicleTask.java

@ -154,7 +154,6 @@ public class SendEmptyVehicleTask extends AbstractAcsTask {
if (StrUtil.isEmpty(vehicle_code)) { if (StrUtil.isEmpty(vehicle_code)) {
throw new BadRequestException("载具未找到!"); throw new BadRequestException("载具未找到!");
} }
//判断起点有没有未完成的指令 //判断起点有没有未完成的指令
JSONObject beforTaskObj = taskTable. JSONObject beforTaskObj = taskTable.
query("is_delete='0' and start_point_code='" + start_point_code + "' and task_status <>'" + TaskStatusEnum.FINISHED.getCode() + "'") query("is_delete='0' and start_point_code='" + start_point_code + "' and task_status <>'" + TaskStatusEnum.FINISHED.getCode() + "'")
@ -162,7 +161,6 @@ public class SendEmptyVehicleTask extends AbstractAcsTask {
if (ObjectUtil.isNotEmpty(beforTaskObj)) { if (ObjectUtil.isNotEmpty(beforTaskObj)) {
throw new BadRequestException("存在指令号为'" + beforTaskObj.getString("task_code") + "' 未完成!"); throw new BadRequestException("存在指令号为'" + beforTaskObj.getString("task_code") + "' 未完成!");
} }
//根据起点去找工序,找一个合适的仓位 并且生成单据 //根据起点去找工序,找一个合适的仓位 并且生成单据
if (StrUtil.isEmpty(next_point_code)) { if (StrUtil.isEmpty(next_point_code)) {
JSONObject workInfo = WQL.getWO("QSTRUCT_RULE").addParam("flag", "1").addParam("code", start_point_code) JSONObject workInfo = WQL.getWO("QSTRUCT_RULE").addParam("flag", "1").addParam("code", start_point_code)
@ -186,6 +184,7 @@ public class SendEmptyVehicleTask extends AbstractAcsTask {
//分拣工序 //分拣工序
case FJGX: case FJGX:
next_area = AreaEnum.KGTDDQ.getCode(); next_area = AreaEnum.KGTDDQ.getCode();
next_point_code = "KGTPDDW05";
break; break;
default: default:
next_area = AreaEnum.KLHJ.getCode(); next_area = AreaEnum.KLHJ.getCode();
@ -193,6 +192,7 @@ public class SendEmptyVehicleTask extends AbstractAcsTask {
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("area_type", next_area); param.put("area_type", next_area);
param.put("vehicle_code", vehicle_code); param.put("vehicle_code", vehicle_code);
param.put("point_code", next_point_code);
JSONObject inStructObj = StructFindUtil.getEmptyVehicleInStruct(param); JSONObject inStructObj = StructFindUtil.getEmptyVehicleInStruct(param);
next_point_code = inStructObj.getString("struct_code"); next_point_code = inStructObj.getString("struct_code");
} }

Loading…
Cancel
Save