代码修改

This commit is contained in:
lyd
2022-10-28 09:05:17 +08:00
32 changed files with 637 additions and 249 deletions

View File

@@ -15,15 +15,13 @@ public interface AcsConfig {
//撤销任务检查
String CANCELTASKCHECK = "cancelTaskCheck";
//二楼agv系统接口地址
String AGVURL = "agvurl";
String AGVURL2 = "agvurl2";
//一楼agv系统接口地址
String AGVURL2 = "agvurl";
//双工AGV系统端口
String AGVURL = "agvurl";
//AGV系统端口
String AGVPORT = "agvport";
//单工agv系统接口地址
String ONEAGVURL = "oneagvurl";
//单工AGV系统端口
String ONEAGVPORT = "oneagvport";
//二楼AGV系统端口
String AGVPORT2 = "agvport2";
//指定AGV系统
String AGVTYPE = "agvType";
//WMS系统接口地址

View File

@@ -3,6 +3,7 @@ package org.nl.acs.agv.server.impl;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
@@ -15,6 +16,7 @@ import org.nl.acs.device_driver.basedriver.empty_vehicle_stacking_position.Empty
import org.nl.acs.device_driver.basedriver.hailiang_smart_plc_test.HailiangSmartplcTestDeviceDriver;
import org.nl.acs.device_driver.basedriver.haokai_auto_conveyor.HaoKaiAutoConveyorDeviceDriver;
import org.nl.acs.device_driver.basedriver.paint_conveyor.PaintConveyorDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.log.LokiLog;
@@ -22,6 +24,8 @@ import org.nl.acs.log.LokiLogType;
import org.nl.acs.opc.Device;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.opc.DeviceAppServiceImpl;
import org.nl.acs.task.service.TaskService;
import org.nl.acs.task.service.dto.TaskDto;
import org.nl.modules.system.service.ParamService;
import org.nl.modules.wql.util.SpringContextHolder;
import org.springframework.stereotype.Service;
@@ -37,11 +41,14 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
JSONObject jo = new JSONObject();
String start_point_code = inst.getStart_point_code();
String next_point_code = inst.getNext_point_code();
//1、叠盘架追加任务2、养生区需要追加任务在缓存点等待3、二楼普通任务4、一楼普通任务
//1楼AGV普通任务
//2楼AGV普通任务
//2楼AGV起点追加任务
//2楼AGV终点追加任务
String task_type = inst.getInstruction_type();
jo.put("deadline", AgvUtil.getNextDay(1));
//判断是否追加任务
if (task_type.equals("2") || task_type.equals("1")) {
if (task_type.equals("3") || task_type.equals("4")) {
jo.put("complete", "false");
} else {
jo.put("complete", "true");
@@ -49,31 +56,32 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
jo.put("task_code", inst.getInstruction_code());
//根据任务,下发指令类型
JSONArray destinations = new JSONArray();
if (task_type.equals("1")) {
if (task_type.equals("3")) {
destinations.add(destination(start_point_code, "Wait", "5", "1"));
} else if (task_type.equals("4")) {
destinations.add(destination(start_point_code, "Load", "1", "1"));
destinations.add(destination(next_point_code, "Wait", "5", "1"));
} else {
destinations.add(destination(start_point_code, "Load", "1", "1"));
if (task_type.equals("2")) {
destinations.add(destination(next_point_code, "Wait", "5", "1"));
} else {
destinations.add(destination(next_point_code, "Unload", "5", "1"));
}
destinations.add(destination(next_point_code, "Unload", "1", "1"));
}
jo.put("destinations", destinations);
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
String url = "";
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
String agvurl2 = paramService.findByCode(AcsConfig.AGVURL2).getValue();
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
String agvport2 = paramService.findByCode(AcsConfig.AGVPORT2).getValue();
//不同楼层下发不同的agv系统
if (task_type.equals("8")) {
url = agvurl2;
if (task_type.equals("1")) {
agvurl = agvurl + ":" + agvport + "/v1/transportOrders/" + inst.getInstruction_code();
} else {
url = agvurl;
agvurl = agvurl2 + ":" + agvport2 + "/v1/transportOrders/" + inst.getInstruction_code();
}
url = url + ":" + agvport + "v1/transportOrders/" + inst.getInstruction_code();
log.info("下发agv任务请求:{}", url);
log.info("下发agv任务请求:{}", agvurl);
HttpResponse result = HttpRequest.post(agvurl)
.body(String.valueOf(jo))//表单内容
@@ -92,16 +100,17 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
public HttpResponse queryAgvInstStatus(String type) {
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
String agvurl = "";
String agvport = "";
if (type.equals("1")) {
agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
}
if (type.equals("2")) {
agvurl = paramService.findByCode(AcsConfig.AGVURL2).getValue();
agvport = paramService.findByCode(AcsConfig.AGVPORT2).getValue();
}
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
agvurl = agvurl + ":" + agvport + "/transportOrders";
agvurl = agvurl + ":" + agvport + "/v1/transportOrders";
HttpResponse result = HttpRequest.get(agvurl)
.timeout(20000)//超时,毫秒
.execute();
@@ -128,8 +137,11 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
address = address.substring(0, address.indexOf("-"));
}
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");
Instruction inst = instructionService.findByCodeFromCache(jobno);
TaskService taskService = SpringContextHolder.getBean("taskServiceImpl");
AcsToWmsService acsToWmsService = SpringContextHolder.getBean("acsToWmsServiceImpl");
Instruction inst = instructionService.findByCodeFromCache(jobno);
TaskDto task = taskService.findByCode(inst.getTask_code());
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
Device addressdevice = appService.findDeviceByCode(address);
@@ -233,35 +245,43 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
JSONArray destinations = new JSONArray();
String inst_type = inst.getInstruction_type();
//如果任务类型为1在点位进行等待则查询当前叠盘位的数量取当前数量的层数进行追加任务
if ("1".equals(inst_type)) {
emptyVehicleStackingPositionDeviceDriver = (EmptyVehicleStackingPositionDeviceDriver) addressdevice.getDeviceDriver();
int current_num = emptyVehicleStackingPositionDeviceDriver.getNumber();
if (current_num > 12) {
log.info("当前叠盘架:" + jobno + "已放满!");
return null;
}
String start_point_code = inst.getStart_point_code();
String next_point_code = inst.getNext_point_code();
start_point_code = start_point_code + "." + (current_num + 1);
destinations.add(destination(start_point_code, "Load", "1", "1"));
destinations.add(destination(next_point_code, "Unload", "1", "1"));
// if ("1".equals(inst_type)) {
// emptyVehicleStackingPositionDeviceDriver = (EmptyVehicleStackingPositionDeviceDriver) addressdevice.getDeviceDriver();
// int current_num = emptyVehicleStackingPositionDeviceDriver.getNumber();
// if (current_num > 12) {
// log.info("当前叠盘架:" + jobno + "已放满!");
// return null;
// }
// String start_point_code = inst.getStart_point_code();
// String next_point_code = inst.getNext_point_code();
// start_point_code = start_point_code + "." + (current_num + 1);
// destinations.add(destination(start_point_code, "Load", "1", "1"));
// destinations.add(destination(next_point_code, "Unload", "1", "1"));
//
// }
String resp = acsToWmsService.requestTaskAgain(address,task.getExt_task_id(),inst.getVehicle_code());
JSONObject respjson = JSONObject.parseObject(resp);
if(StrUtil.equals(inst.getInstruction_type(),"3")){
//2楼AGV起点追加任务
String start_device_code = respjson.getString("device_code");
String next_device_code = inst.getNext_device_code();
destinations.add(destination(start_device_code, "load", "1", "1"));
destinations.add(destination(next_device_code, "Unload", "1", "1"));
} else if(StrUtil.equals(inst.getInstruction_type(),"4")){
//2楼AGV终点追加任务
String next_device_code = respjson.getString("device_code");
destinations.add(destination(next_device_code, "Unload", "1", "1"));
}
//如果任务类型为2在点位进行等待则调用LMS的货位申请接口
if ("2".equals(inst_type)) {
String next_point_code = "";
//调用LMS接口
destinations.add(destination(next_point_code, "Unload", "5", "1"));
}
jo.put("destinations", destinations);
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
String url = agvurl + ":" + agvport + "addDestinations";
String url = agvurl + ":" + agvport + "/addDestinations";
log.info("下发agv任务请求:{}", url);
HttpResponse result = HttpRequest.post(url)

View File

@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -20,6 +21,7 @@ import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.log.service.DeviceExecuteLogService;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.Device;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.route.service.RouteLineService;
@@ -39,7 +41,7 @@ import java.util.*;
@Slf4j
@Data
@RequiredArgsConstructor
public class CargoLiftConveyorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver {
public class CargoLiftConveyorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired
@@ -310,4 +312,54 @@ public class CargoLiftConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
ReadUtil.write(itemMap, server);
}
@Override
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
String mode = "";
String action = "";
String move = "";
if (this.getMode() == 0) {
mode = "未联机";
} else if (this.getMode() == 1) {
mode = "单机";
} else if (this.getMode() == 2) {
mode = "联机";
} else if (this.getMode() == 3) {
mode = "运行中";
}
if (this.getAction() == 0) {
action = "禁止取放";
} else if (this.getAction() == 1) {
action = "允许取货";
} else if (this.getAction() == 2) {
action = "允许放货";
} else if (this.getAction() == 3) {
action = "允许取放";
}
if (this.getMove() == 0) {
move = "无货";
} else if (this.getMove() == 1) {
move = "有货";
} else if (this.getMove() == 2) {
move = "有托盘有货";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("move", move);
jo.put("action", action);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("isError", this.getIserror());
jo.put("task", this.getTask());
return jo;
}
@Override
public void setDeviceStatus(JSONObject data) {
}
}

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.empty_vehicle_stacking_position;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -15,6 +16,7 @@ import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.log.service.DeviceExecuteLogService;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.Device;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.route.service.RouteLineService;
@@ -35,7 +37,7 @@ import java.util.Map;
@Slf4j
@Data
@RequiredArgsConstructor
public class EmptyVehicleStackingPositionDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver {
public class EmptyVehicleStackingPositionDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired
DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class);
@@ -191,4 +193,46 @@ public class EmptyVehicleStackingPositionDeviceDriver extends AbstractOpcDeviceD
itemMap.put(to_command, value);
ReadUtil.write(itemMap, server);
}
@Override
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
String mode = "";
String action = "";
String move = "";
if (this.getMode() == 0) {
mode = "未联机";
} else if (this.getMode() == 1) {
mode = "单机";
} else if (this.getMode() == 2) {
mode = "联机";
} else if (this.getMode() == 3) {
mode = "运行中";
}
if (this.getMove() == 0) {
move = "无货";
jo.put("hasGoods", false);
} else if (this.getMove() == 1) {
move = "有货";
jo.put("hasGoods", true);
} else if (this.getMove() == 2) {
move = "有托盘有货";
jo.put("hasGoods", true);
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("move", move);
jo.put("action", action);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("isError", this.getIserror());
jo.put("task", this.getTask());
return jo;
}
@Override
public void setDeviceStatus(JSONObject data) {
}
}

View File

@@ -15,6 +15,7 @@ import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.log.service.DeviceExecuteLogService;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.Device;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.route.service.RouteLineService;
@@ -34,7 +35,7 @@ import java.util.Map;
@Slf4j
@Data
@RequiredArgsConstructor
public class HailiangSmartplcTestDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver {
public class HailiangSmartplcTestDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired
DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class);
@@ -224,4 +225,47 @@ public class HailiangSmartplcTestDeviceDriver extends AbstractOpcDeviceDriver im
itemMap.put(to_command, value);
ReadUtil.write(itemMap, server);
}
@Override
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
String mode = "";
String action = "";
String move = "";
if (this.getMode() == 0) {
mode = "未联机";
} else if (this.getMode() == 1) {
mode = "单机";
} else if (this.getMode() == 2) {
mode = "联机";
} else if (this.getMode() == 3) {
mode = "运行中";
}
if (this.getMove() == 0) {
move = "无货";
jo.put("hasGoods", false);
} else if (this.getMove() == 1) {
move = "有货";
jo.put("hasGoods", true);
} else if (this.getMove() == 2) {
move = "有托盘有货";
jo.put("hasGoods", true);
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("move", move);
jo.put("action", action);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("isError", this.getIserror());
jo.put("task", this.getTask());
return jo;
}
@Override
public void setDeviceStatus(JSONObject data) {
}
}

View File

@@ -18,6 +18,7 @@ import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.log.service.DeviceExecuteLogService;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.Device;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.route.service.RouteLineService;
@@ -38,7 +39,7 @@ import java.util.Map;
@Slf4j
@Data
@RequiredArgsConstructor
public class HaoKaiAutoConveyorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver {
public class HaoKaiAutoConveyorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver , DeviceStageMonitor {
protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired
DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class);
@@ -233,4 +234,47 @@ public class HaoKaiAutoConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
ReadUtil.write(itemMap, server);
}
@Override
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
String mode = "";
String action = "";
String move = "";
if (this.getMode() == 0) {
mode = "未联机";
} else if (this.getMode() == 1) {
mode = "单机";
} else if (this.getMode() == 2) {
mode = "联机";
} else if (this.getMode() == 3) {
mode = "运行中";
}
if (this.getMove() == 0) {
move = "无货";
jo.put("hasGoods", false);
} else if (this.getMove() == 1) {
move = "有货";
jo.put("hasGoods", true);
} else if (this.getMove() == 2) {
move = "有托盘有货";
jo.put("hasGoods", true);
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("move", move);
jo.put("action", action);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("isError", this.getIserror());
jo.put("task", this.getTask());
return jo;
}
@Override
public void setDeviceStatus(JSONObject data) {
}
}

View File

@@ -15,6 +15,7 @@ import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.log.service.DeviceExecuteLogService;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.Device;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.route.service.RouteLineService;
@@ -34,7 +35,7 @@ import java.util.Map;
@Slf4j
@Data
@RequiredArgsConstructor
public class PaintConveyorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver {
public class PaintConveyorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired
DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class);
@@ -257,4 +258,46 @@ public class PaintConveyorDeviceDriver extends AbstractOpcDeviceDriver implement
itemMap.put(to_command, value);
ReadUtil.write(itemMap, server);
}
@Override
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
String mode = "";
String action = "";
String move = "";
if (this.getMode() == 0) {
mode = "未联机";
} else if (this.getMode() == 1) {
mode = "单机";
} else if (this.getMode() == 2) {
mode = "联机";
} else if (this.getMode() == 3) {
mode = "运行中";
}
if (this.getMove() == 0) {
move = "无货";
jo.put("hasGoods", false);
} else if (this.getMove() == 1) {
move = "有货";
jo.put("hasGoods", true);
} else if (this.getMove() == 2) {
move = "有托盘有货";
jo.put("hasGoods", true);
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("move", move);
jo.put("action", action);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("isError", this.getIserror());
jo.put("task", this.getTask());
return jo;
}
@Override
public void setDeviceStatus(JSONObject data) {
}
}

View File

@@ -17,6 +17,7 @@ import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.Device;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.opc.WcsConfig;
@@ -42,7 +43,7 @@ import java.util.Map;
@Slf4j
@Data
@RequiredArgsConstructor
public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver {
public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired
DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class);
@@ -435,4 +436,46 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver
public synchronized boolean apply_InEmpty() throws Exception {
return false;
}
@Override
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
String mode = "";
String action = "";
String move = "";
if (this.getMode() == 0) {
mode = "未联机";
} else if (this.getMode() == 1) {
mode = "单机";
} else if (this.getMode() == 2) {
mode = "联机";
} else if (this.getMode() == 3) {
mode = "运行中";
}
if (this.getMove() == 0) {
move = "无货";
jo.put("hasGoods", false);
} else if (this.getMove() == 1) {
move = "有货";
jo.put("hasGoods", true);
} else if (this.getMove() == 2) {
move = "有托盘有货";
jo.put("hasGoods", true);
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("move", move);
jo.put("action", action);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("isError", this.getIserror());
jo.put("task", this.getTask());
return jo;
}
@Override
public void setDeviceStatus(JSONObject data) {
}
}

View File

@@ -20,6 +20,7 @@ import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.Device;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.opc.WcsConfig;
@@ -42,7 +43,7 @@ import java.util.*;
@Slf4j
@Data
@RequiredArgsConstructor
public class StandardCoveyorControlWithPlcScannerDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver {
public class StandardCoveyorControlWithPlcScannerDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired
InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class);
@@ -835,5 +836,47 @@ public class StandardCoveyorControlWithPlcScannerDeviceDriver extends AbstractOp
}
}
@Override
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
String mode = "";
String action = "";
String move = "";
if (this.getMode() == 0) {
mode = "未联机";
} else if (this.getMode() == 1) {
mode = "单机";
} else if (this.getMode() == 2) {
mode = "联机";
} else if (this.getMode() == 3) {
mode = "运行中";
}
if (this.getMove() == 0) {
move = "无货";
jo.put("hasGoods", false);
} else if (this.getMove() == 1) {
move = "有货";
jo.put("hasGoods", true);
} else if (this.getMove() == 2) {
move = "有托盘有货";
jo.put("hasGoods", true);
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("move", move);
jo.put("action", action);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("isError", this.getIserror());
jo.put("task", this.getTask());
return jo;
}
@Override
public void setDeviceStatus(JSONObject data) {
}
}

View File

@@ -72,7 +72,8 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
private Date instruction_finished_time = new Date();
private Date instruction_apply_time = new Date();
private int instruction_require_time_out = 3000;
//当前指令
Instruction inst = null;
int heartbeat = 0;
int mode = 0;
int move = 0;
@@ -92,7 +93,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
int last_error = 0;
int last_task = 0;
String last_container;
String inst_message;
String device_code;
String message;
@@ -132,7 +133,10 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
ScannerDeviceDriver scanner = this.getScanner();
scanner.cleanBarcode();
}
public synchronized boolean finish_instruction() throws Exception {
instructionService.finish(inst);
return true;
}
private ScannerDeviceDriver getScanner() throws Exception {
String scanner_code = (String) this.getDevice().getExtraValue().get(StandardConveyorWithScannerConfig.relation_scanner);
@@ -183,6 +187,21 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
if (error != last_error) {
}
if (mode == 2 && move != 0 && task > 0) {
//inst_message
inst = instructionService.findByCodeFromCache(String.valueOf(task));
if (inst != null) {
inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code();
if (StrUtil.equals(inst.getInstruction_status(), "1") && StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())) {
finish_instruction();
}
if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) {
inst.setInstruction_status("1");
instructionService.update(inst);
}
}
}
} catch (Exception var17) {
return;
}
@@ -552,27 +571,15 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
JSONObject jo = new JSONObject();
String mode = "";
String action = "";
String io_action = "";
String move = "";
String status = "";
if (this.getMode() == 0) {
mode = "未联机";
} else if (this.getMode() == 1) {
mode = "单机";
} else if (this.getMode() == 2) {
mode = "联机";
} else if (this.getMode() == 4) {
mode = "人工排产确认";
} else if (this.getMode() == 5) {
mode = "申请空盘";
} else if (this.getMode() == 6) {
mode = "申请入库";
} else if (this.getMode() == 7) {
mode = "码垛完成";
} else if (this.getMode() == 8) {
mode = "码垛强制完成";
} else if (this.getMode() == 9) {
mode = "工单完成";
} else if (this.getMode() == 3) {
mode = "运行中";
}
if (this.getAction() == 0) {
@@ -588,17 +595,18 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
if (this.getMove() == 0) {
move = "无货";
jo.put("hasGoods", false);
} else if (this.getMove() == 1) {
move = "有货";
jo.put("hasGoods", true);
} else if (this.getMove() == 2) {
move = "有托盘有货";
jo.put("hasGoods", true);
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("move", move);
jo.put("action", action);
jo.put("status", status);
jo.put("io_action", io_action);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("isError", this.getIserror());

View File

@@ -15,6 +15,7 @@ import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.Device;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.opc.DeviceAppServiceImpl;
@@ -40,7 +41,7 @@ import java.util.Map;
@Slf4j
@Data
@RequiredArgsConstructor
public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver {
public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver , DeviceStageMonitor {
protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");
@@ -437,5 +438,45 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
}
}
@Override
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
String mode = "";
String action = "";
String move = "";
if (this.getMode() == 0) {
mode = "未联机";
} else if (this.getMode() == 1) {
mode = "单机";
} else if (this.getMode() == 2) {
mode = "联机";
} else if (this.getMode() == 3) {
mode = "运行中";
}
if (this.getMove() == 0) {
move = "无货";
jo.put("hasGoods", false);
} else if (this.getMove() == 1) {
move = "有货";
jo.put("hasGoods", true);
} else if (this.getMove() == 2) {
move = "有托盘有货";
jo.put("hasGoods", true);
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("move", move);
jo.put("action", action);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("isError", this.getIserror());
jo.put("task", this.getTask());
return jo;
}
@Override
public void setDeviceStatus(JSONObject data) {
}
}

View File

@@ -1,6 +1,7 @@
package org.nl.acs.device_driver.basedriver.standard_ordinary_site;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -16,6 +17,7 @@ import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.log.service.DeviceExecuteLogService;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.task.service.TaskService;
@@ -31,7 +33,7 @@ import java.util.Date;
@Slf4j
@Data
@RequiredArgsConstructor
public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver {
public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver , DeviceStageMonitor {
@Autowired
DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class);
@Autowired
@@ -181,5 +183,47 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple
}
}
@Override
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
String mode = "";
String action = "";
String move = "";
if (this.getMode() == 0) {
mode = "未联机";
} else if (this.getMode() == 1) {
mode = "单机";
} else if (this.getMode() == 2) {
mode = "联机";
} else if (this.getMode() == 3) {
mode = "运行中";
}
if (this.getMove() == 0) {
move = "无货";
jo.put("hasGoods", false);
} else if (this.getMove() == 1) {
move = "有货";
jo.put("hasGoods", true);
} else if (this.getMove() == 2) {
move = "有托盘有货";
jo.put("hasGoods", true);
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("move", move);
jo.put("action", action);
jo.put("isOnline", true);
jo.put("error", this.getError());
jo.put("isError", this.getIserror());
return jo;
}
@Override
public void setDeviceStatus(JSONObject data) {
}
}

View File

@@ -1,11 +1,13 @@
package org.nl.acs.device_driver.basedriver.standard_scanner;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.ScannerDeviceDriver;
import org.nl.acs.device_driver.driver.AbstractDeviceDriver;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.socket.SocketConfig;
import org.nl.acs.udw.UnifiedDataAccessor;
import org.nl.acs.udw.UnifiedDataAccessorFactory;
@@ -15,7 +17,7 @@ import org.nl.acs.udw.UnifiedDataAccessorFactory;
*/
@Slf4j
@Data
public class StandardScannerDeviceDriver extends AbstractDeviceDriver implements ScannerDeviceDriver, DeviceDriver {
public class StandardScannerDeviceDriver extends AbstractDeviceDriver implements ScannerDeviceDriver, DeviceDriver, DeviceStageMonitor {
UnifiedDataAccessor accessor_value;
@@ -59,5 +61,22 @@ public class StandardScannerDeviceDriver extends AbstractDeviceDriver implements
}
}
@Override
public JSONObject getDeviceStatusName() throws Exception {
JSONObject jo = new JSONObject();
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("isOnline", true);
jo.put("device_type", device.getDevice_type());
//点击弹出
jo.put("is_click", true);
jo.put("ip", this.getIp());
jo.put("container", StrUtil.isEmpty(this.readBarcode()) ? "" : this.readBarcode());
return jo;
}
@Override
public void setDeviceStatus(JSONObject data) {
}
}

View File

@@ -2,6 +2,7 @@
package org.nl.acs.ext.wms.rest;
import cn.dev33.satoken.annotation.SaIgnore;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -31,6 +32,7 @@ public class WmsToAcsController {
@PostMapping("/task")
@Log("接收WMS任务")
@ApiOperation("接收WMS任务")
@SaIgnore
public ResponseEntity<Object> createFromWms(@RequestBody String whereJson) {
return new ResponseEntity<>(wmstoacsService.createFromWms(whereJson), HttpStatus.OK);
}

View File

@@ -202,9 +202,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
String device_code = deviceService.queryDeviceCodeByAddress(Integer.parseInt(address));
JSONObject jo = new JSONObject();
jo.put("device_code", device_code);
jo.put("task_id", task_id);
jo.put("vehicle_code", vehicle_code);
String result2 = null;
AddressDto addressDto = addressService.findByCode("requestTaskAgain");

View File

@@ -290,15 +290,8 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
dto.setStart_parent_code(task.getStart_parent_code());
dto.setNext_parent_code(task.getNext_parent_code());
if (StrUtil.equals(task.getTask_type(), "1")) {
dto.setAgv_inst_type("1");
} else if (StrUtil.equals(task.getTask_type(), "2")) {
dto.setAgv_inst_type("2");
} else if (StrUtil.equals(task.getTask_type(), "3")) {
dto.setAgv_inst_type("3");
} else if (StrUtil.equals(task.getTask_type(), "4")) {
dto.setAgv_inst_type("4");
if(ObjectUtil.isNotEmpty(task.getTask_type())){
dto.setInstruction_type(task.getTask_type());
}
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
@@ -501,16 +494,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
// != 0 为agv任务
if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "2")) {
/**
* 1 双工agv双任务
* 2 双工agv但认为
* 3 单入-单任务
* 4 双入-双任务
* 5 点对点任务
* 6 称重平台称重PS20 agvtype:1
* 7 不去称重平台称重PS20 agvtype:2
* 8 RT20 agvtype:3
*/
if (StrUtil.equals("1", dto.getInstruction_type())) {
ndcAgvService.sendAgvTwoInstToNDC(dto, dto2);
dto.setSend_status("1");

View File

@@ -12,7 +12,7 @@ public interface DeviceStageMonitor {
* 根据设备获取设备状态(中文名:如故障、联机等)
* @return
*/
public JSONObject getDeviceStatusName();
public JSONObject getDeviceStatusName() throws Exception;
/**
* 根据舞台数据修改设备驱动状态

View File

@@ -31,7 +31,7 @@ public class DeviceStageMonitorController {
@Log("获取舞台设备信息")
@ApiOperation("获取舞台设备信息")
@PostMapping("/getDeviceByCodes")
public ResponseEntity<Object> getDeviceByCodes(@RequestBody String json) {
public ResponseEntity<Object> getDeviceByCodes(@RequestBody String json) throws Exception {
JSONArray jsonArray = JSONArray.parseArray(json);
return new ResponseEntity<>(deviceStageMonitorService.getData(jsonArray), HttpStatus.OK);
}

View File

@@ -14,5 +14,5 @@ public interface DeviceStageMonitorService {
* @param jsonArray 前端传来设备编号和节点的id
* @return
*/
public JSONArray getData(JSONArray jsonArray);
public JSONArray getData(JSONArray jsonArray) throws Exception;
}

View File

@@ -24,7 +24,7 @@ public class DeviceStageMonitorServiceImpl implements DeviceStageMonitorService
@Override
public JSONArray getData(JSONArray jsonArray) {
public JSONArray getData(JSONArray jsonArray) throws Exception {
JSONArray arr = new JSONArray();
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject obj = new JSONObject();

View File

@@ -829,7 +829,6 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
String compound_task = acsTask.getCompound_task();
String next_point_code = acsTask.getNext_point_code();
String next_device_code = acsTask.getNext_device_code();
String maxInstnumber = paramService.findByCode(AcsConfig.MAXINSTNUMBER).getValue();
/**
* 开始平均分解校验

View File

@@ -58,37 +58,38 @@ public class AutoCreateInst {
if(StrUtil.equals(is_send,"0")){
continue;
}
//校验路由关系
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code);
if (ObjectUtils.isEmpty(shortPathsList)) {
acsTask.setRemark("路由不通无法生成指令");
taskserver.updateByCodeFromCache(acsTask);
continue;
}
if (!StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
continue;
}
RouteLineDto routeLineDto = shortPathsList.get(0);
String path = routeLineDto.getPath();
String type = routeLineDto.getType();
String[] str = path.split("->");
List<String> pathlist = Arrays.asList(str);
int index = 0;
for (int m = 0; m < pathlist.size(); m++) {
if (pathlist.get(m).equals(start_device_code)) {
index = m + 1;
break;
if(StrUtil.equals(acsTask.getTask_type(),"1") || StrUtil.equals(acsTask.getTask_type(),"2")){
//校验路由关系
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code);
if (ObjectUtils.isEmpty(shortPathsList)) {
acsTask.setRemark("路由不通无法生成指令");
taskserver.updateByCodeFromCache(acsTask);
continue;
}
}
next_device_code = pathlist.get(index);
if (StrUtil.equals(appService.findDeviceTypeByCode(next_device_code), "storage")) {
next_point_code = next_device_code + "-" + acsTask.getTo_y() + "-" + acsTask.getTo_z();
} else {
next_point_code = next_device_code;
if (!StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
continue;
}
RouteLineDto routeLineDto = shortPathsList.get(0);
String path = routeLineDto.getPath();
String type = routeLineDto.getType();
String[] str = path.split("->");
List<String> pathlist = Arrays.asList(str);
int index = 0;
for (int m = 0; m < pathlist.size(); m++) {
if (pathlist.get(m).equals(start_device_code)) {
index = m + 1;
break;
}
}
next_device_code = pathlist.get(index);
if (StrUtil.equals(appService.findDeviceTypeByCode(next_device_code), "storage")) {
next_point_code = next_device_code + "-" + acsTask.getTo_y() + "-" + acsTask.getTo_z();
} else {
next_point_code = next_device_code;
}
}
Instruction instdto = new Instruction();

View File

@@ -98,7 +98,7 @@ public class QueryZDAgvTaskStatus {
HttpResponse response2 = agvService.queryAgvInstStatus("2");
//查询AGV指令列表
JSONArray inst_rows2 = JSONArray.parseArray(response.body());
JSONArray inst_rows2 = JSONArray.parseArray(response2.body());
for (int i = 0; i < inst_rows2.size(); i++) {
JSONObject inst_jo = inst_rows2.getJSONObject(i);
String inst_code = inst_jo.getString("task_code");

View File

@@ -0,0 +1,16 @@
delete from acs_device_runpoint;
delete from acs_device_extra;
delete from acs_device;
delete from acs_device_assigned;
delete from acs_opc_plc;
delete from acs_opc;
delete from acs_route_line;
delete from acs_instruction;
delete from acs_task;
delete from sys_log;
delete from acs_log;
delete from acs_task_feedback;
delete from sys_quartz_log;
delete from acs_storage_cell;
update acs_stage_actor set device_code='',image_name ='1';
update sys_code_rule_detail set current_value=0;

View File

@@ -30,8 +30,8 @@
v-model="plc_id"
placeholder="无"
clearable
@change="changePlc"
filterable
@change="changePlc"
>
<el-option
v-for="item in dataOpcPlcs"
@@ -97,6 +97,11 @@
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="最大数量">
<el-input v-model="form.max_emptypalletnum" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="关联设备" prop="device_code">
<el-select

View File

@@ -152,6 +152,42 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="门" prop="door" label-width="100px">
<el-select
v-model="form.door"
filterable
clearable
placeholder="请选择"
>
<el-option
v-for="item in doors"
:key="item.key"
:label="item.label"
:value="item.key"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="楼" prop="floor" label-width="100px">
<el-select
v-model="form.floor"
filterable
clearable
placeholder="请选择"
>
<el-option
v-for="item in floors"
:key="item.key"
:label="item.label"
:value="item.key"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
@@ -298,6 +334,20 @@ export default {
plc_code: '',
opc_id: '',
opc_code: '',
doors: [{
key: '1',
label: '前门'
}, {
key: '2',
label: '后门'
}],
floors: [{
key: '1',
label: '1楼'
}, {
key: '2',
label: '2楼'
}],
address: '',
configLoading: false,
dataOpcservers: [],

View File

@@ -109,6 +109,7 @@
<el-table-column type="selection" width="55" />
<el-table-column v-if="false" prop="instruction_id" label="指令标识" />
<el-table-column prop="instruction_code" label="指令编号" />
<el-table-column prop="instruction_type" label="指令类型" />
<el-table-column prop="link_num" label="关联编号" />
<el-table-column prop="task_code" label="任务号" />
<el-table-column prop="vehicle_code" label="载具号" />

View File

@@ -251,6 +251,7 @@
<el-table-column type="selection" width="25" />
<el-table-column v-if="false" prop="task_id" label="任务标识" />
<el-table-column prop="task_code" label="任务号" />
<el-table-column prop="task_type" label="任务类型" />
<el-table-column prop="link_num" label="关联编号" />
<el-table-column prop="vehicle_code" label="载具号" />
<el-table-column prop="task_status" label="任务状态">
@@ -266,9 +267,9 @@
</template>
</el-table-column>-->
<el-table-column prop="priority" label="任务优先级" />
<el-table-column prop="start_point_code" label="取货点" width="120px"/>
<el-table-column prop="start_point_code" label="取货点" width="120px" />
<el-table-column prop="put_point_code" label="倒料点" />
<el-table-column prop="next_point_code" label="放货点" width="120px"/>
<el-table-column prop="next_point_code" label="放货点" width="120px" />
<el-table-column prop="compound_task" label="复合任务">
<template slot-scope="scope">
<span v-if="scope.row.compound_task==='0' "></span>

View File

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

View File

@@ -295,7 +295,7 @@
</el-table-column>
<el-table-column prop="vehicle_code" label="载具编码" />
<el-table-column prop="vehicle_qty" label="载具数量" />
<el-table-column prop="remark" label="备注" />
<el-table-column prop="remark" label="备注" min-width="100" show-overflow-tooltip/>
<el-table-column prop="is_used" label="是否启用">
<template slot-scope="scope">
{{ scope.row.is_used=='1' ? '是' : '否' }}

View File

@@ -177,22 +177,6 @@
<el-form-item label="点位编码" prop="standing_time">
<el-input v-model="form.point_code" style="width: 370px;" :disabled="true"/>
</el-form-item>
<el-form-item label="点位状态">
<el-select
v-model="form.point_status"
clearable
filterable
size="mini"
class="filter-item"
style="width: 370px;"
>
<el-option
v-for="item in dict.sch_point_status"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="托盘类型">
<el-select
v-model="form.vehicle_type"
@@ -336,7 +320,7 @@ import crudRegion from '@/api/wms/sch/region'
const defaultForm = { point_id: null, point_code: null, pcsn: null, material_id: null, ivt_qty: null, qty_unit_id: null, instorage_time: null, ext_code: null, point_status: null, vehicle_type: null, row_num: null, col_num: null, layer_num: null, remark: null, is_used: null, is_lock: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null }
export default {
name: 'CppInventory',
dicts: ['sch_point_status', 'vehicle_type', 'is_used', 'd_lock_type', 'vehicle_type'],
dicts: ['sch_point_status', 'vehicle_type', 'is_used', 'd_lock_type'],
components: { pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
@@ -400,7 +384,6 @@ export default {
this.showTab = !this.showTab
},
doEdit(datas) {
console.log(datas)
if (datas.length > 0) {
crudStructivt.batchEdit(datas).then(res => {
this.crud.notify('保存成功', CRUD.NOTIFICATION_TYPE.SUCCESS)

View File

@@ -228,7 +228,7 @@
<el-table-column prop="point_code" label="点位编码" min-width="100" show-overflow-tooltip />
<el-table-column prop="region_name" label="区域名称" min-width="120" show-overflow-tooltip />
<el-table-column prop="pcsn" label="批次" />
<el-table-column prop="ivt_qty" label="库存数" min-width="100">
<el-table-column prop="ivt_qty" label="库存数" :formatter="crud.formatNum3" width="100">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.ivt_qty" v-show="!showTab" />
<span v-show="showTab">{{scope.row.ivt_qty}}</span>
@@ -331,7 +331,7 @@ const defaultForm = { point_id: null, point_code: null, pcsn: null, material_id:
export default {
name: 'Inventory',
components: { pagination, crudOperation, rrOperation, udOperation },
dicts: ['sch_point_status', 'vehicle_type', 'is_used', 'd_lock_type'],
dicts: ['vehicle_type', 'is_used', 'd_lock_type'],
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({
@@ -395,7 +395,6 @@ export default {
})
},
doEdit(datas) {
console.log(datas)
if (datas.length > 0) {
crudStructivt.batchEdit(datas).then(res => {
this.crud.notify('保存成功', CRUD.NOTIFICATION_TYPE.SUCCESS)