堆叠位置修改

This commit is contained in:
18188916393
2022-09-09 16:18:24 +08:00
parent e0301e2dfd
commit 2407b6e85c
2 changed files with 48 additions and 37 deletions

View File

@@ -22,6 +22,7 @@ import org.nl.wms.database.service.dto.VehicleDto;
import org.nl.wms.ext.acs.service.AcsToWmsService;
import org.nl.wms.sch.manage.AreaEnum;
import org.nl.wms.sch.manage.TaskStatusEnum;
import org.nl.wms.sch.manage.VehicleTypeEnum;
import org.nl.wms.sch.manage.buss.*;
import org.nl.wms.sch.service.PointService;
import org.nl.wms.sch.service.TaskService;
@@ -175,44 +176,54 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
case "4":
//叫空托盘
jsonObject.put("next_point_code", device_code);
produceInfoByCode = this.getProduceInfoByCode(device_code);
//假如是码垛位的上料位,则去看看有没有当前排产单生产的物料的半满托
if (StrUtil.equals(device_code, "FJJXSXLW201") ||
StrUtil.equals(device_code, "FJJXSXLW202") ||
StrUtil.equals(device_code, "FJJXSXLW301") ||
StrUtil.equals(device_code, "FJJXSXLW302")
) {
JSONObject joo = pointTable.query("point_code='" + device_code + "'").uniqueResult(0);
material_id = produceInfoByCode.getString("material_id");
String workprocedure_id = WorkProcedureEnum.FJGX.getId();
JSONObject jsonObject1 = WQL.getWO("ACSTOMES_001").addParam("flag", "1")
.addParam("workprocedure_id", workprocedure_id)
.addParam("material_id", material_id)
.addParam("point_id", joo.getString("point_id"))
.process().uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonObject1)) {
//如果有库存,则出半满托盘
//叫料出库
jsonObject.put("next_point_code", device_code);
jsonObject.put("create_mode", "01");
jsonObject.put("material_id", material_id);
jsonObject.put("is_full", "0");
jsonObject.put("workprocedure_id", WorkProcedureEnum.BZGX.getId());
jsonObject.put("group_device", jsonObject1.getString("group_device_id"));
callMaterialTask.createTask((JSONObject) JSON.toJSON(jsonObject));
break;
//如果是叠盘位3 ,则去铁托盘缓存区取
if (!StrUtil.equals(device_code,"KTPHCW3")){
//1 更新缓存位
JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", AreaEnum.KTTHCQ.getCode()).addParam("flag", "4").process().getResultJSONArray(0);
PointUpdateUtil.updatePoint(pointarr);
jsonObject.put("vehicle_type", VehicleTypeEnum.GTP.getCode() );
}else{
produceInfoByCode = this.getProduceInfoByCode(device_code);
//假如是码垛位的上料位,则去看看有没有当前排产单生产的物料的半满托
if (StrUtil.equals(device_code, "FJJXSXLW201") ||
StrUtil.equals(device_code, "FJJXSXLW202") ||
StrUtil.equals(device_code, "FJJXSXLW301") ||
StrUtil.equals(device_code, "FJJXSXLW302")
) {
JSONObject joo = pointTable.query("point_code='" + device_code + "'").uniqueResult(0);
material_id = produceInfoByCode.getString("material_id");
String workprocedure_id = WorkProcedureEnum.FJGX.getId();
JSONObject jsonObject1 = WQL.getWO("ACSTOMES_001").addParam("flag", "1")
.addParam("workprocedure_id", workprocedure_id)
.addParam("material_id", material_id)
.addParam("point_id", joo.getString("point_id"))
.process().uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonObject1)) {
//如果有库存,则出半满托盘
//叫料出库
jsonObject.put("next_point_code", device_code);
jsonObject.put("create_mode", "01");
jsonObject.put("material_id", material_id);
jsonObject.put("is_full", "0");
jsonObject.put("workprocedure_id", WorkProcedureEnum.BZGX.getId());
jsonObject.put("group_device", jsonObject1.getString("group_device_id"));
callMaterialTask.createTask((JSONObject) JSON.toJSON(jsonObject));
break;
}
//需要更新覆膜机的托盘类型
JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", "05").addParam("flag", "4").process().getResultJSONArray(0);
PointUpdateUtil.updatePoint(pointarr);
}
//需要更新覆膜机的托盘类型
JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", "05").addParam("flag", "4").process().getResultJSONArray(0);
if (ObjectUtil.isEmpty(produceInfoByCode)) {
throw new BadRequestException("未找到点位为'" + device_code + "'对应机械手的生产工单!");
}
jsonObject.put("vehicle_type", produceInfoByCode.getString("vehicle_type"));
//需要更新堆叠位的点位状态
JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("point_code", "KTPDDW5").addParam("flag", "4").process().getResultJSONArray(0);
PointUpdateUtil.updatePoint(pointarr);
}
if (ObjectUtil.isEmpty(produceInfoByCode)) {
throw new BadRequestException("未找到点位为'" + device_code + "'对应机械手的生产工单!");
}
jsonObject.put("vehicle_type", produceInfoByCode.getString("vehicle_type"));
//需要更新堆叠位的点位状态
JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("point_code", "KTPDDW5").addParam("flag", "4").process().getResultJSONArray(0);
PointUpdateUtil.updatePoint(pointarr);
callEmptyVehicleTask.createTask((JSONObject) JSON.toJSON(jsonObject));
break;
//生产rgv搬运任务

View File

@@ -219,16 +219,16 @@ public class CallEmptyVehicleTask extends AbstractAcsTask {
start_area = AreaEnum.MTPQ.getCode();
is_auto_issue = "0";
break;
//叠托盘位置 请求去缓存位置
default:
vehicle_type = VehicleTypeEnum.GTP.getCode();
start_area = AreaEnum.KTTDDQ.getCode();
start_area = AreaEnum.KTTHCQ.getCode();
}
JSONObject param = new JSONObject();
//如果托盘类型不是02则需要加上托盘类型
if (!StrUtil.equals(vehicle_type, "02")) {
param.put("vehicle_type", vehicle_type);
}
param.put("area_type", start_area);
JSONObject outStructObj = StructFindUtil.getEmptyVehicleOutStruct(param);
if (ObjectUtil.isEmpty(outStructObj)) {