rev:修改
This commit is contained in:
@@ -13,6 +13,7 @@ import org.nl.acs.device.device.service.DeviceService;
|
||||
import org.nl.acs.device.device.service.entity.Device;
|
||||
import org.nl.acs.device.deviceDriver.service.defination.ordinaryDefination.AbstractStandardDeviceDriver;
|
||||
import org.nl.acs.device.deviceDriver.service.defination.ordinaryDefination.standardOrdinarySite.StandardOrdinarySiteDeviceDriver;
|
||||
import org.nl.acs.device.deviceDriver.service.defination.ordinaryDefination.standardStorage.StandardStorageDeviceDriver;
|
||||
import org.nl.acs.log.LokiLog;
|
||||
import org.nl.acs.log.LokiLogType;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
@@ -140,11 +141,31 @@ public class AgvNdcOneDeviceDriver extends AbstractStandardDeviceDriver {
|
||||
// 二次分配处理
|
||||
data = ndcAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
// 判断是否需要二次分配
|
||||
if ("".equals(inst.getStart_device_code())) {
|
||||
if ("A".equals(inst.getStart_device_code())) {
|
||||
// 向WMS申请新点位
|
||||
JSONObject response = acsToWmsService.taskRedirection(task.getTask_code(), inst.getStart_device_code());
|
||||
if (response != null && response.getInteger("responseCode") == 0
|
||||
&& ObjectUtil.isNotEmpty(response.getString("locationNew"))) {
|
||||
// 更新任务/指令起点位置
|
||||
old_device_code = response.getString("locationNew");
|
||||
if (StrUtil.contains(old_device_code, "-")) {
|
||||
String[] point = old_device_code.split("-");
|
||||
device_code = point[0];
|
||||
} else if (StrUtil.contains(old_device_code, ".")) {
|
||||
String[] point = old_device_code.split("\\.");
|
||||
device_code = point[0];
|
||||
emptyNum = point[1];
|
||||
} else {
|
||||
device_code = old_device_code;
|
||||
}
|
||||
device = deviceAppService.findDeviceByCode(device_code);
|
||||
task.setStart_device_code(device.getDevice_code());
|
||||
task.setStart_point_code(response.getString("locationNew"));
|
||||
taskserver.update(task);
|
||||
inst.setStart_device_code(device.getDevice_code());
|
||||
inst.setStart_point_code(response.getString("locationNew"));
|
||||
instructionService.update(inst);
|
||||
|
||||
// 返回NDC更换新位置
|
||||
data = ndcAgvService.sendAgvOneModeInstDis(phase, index, response.getString("locationNew"));
|
||||
}
|
||||
@@ -188,8 +209,8 @@ public class AgvNdcOneDeviceDriver extends AbstractStandardDeviceDriver {
|
||||
}
|
||||
// "========================================================================请求取货================================================================================="
|
||||
agv_status = 1;
|
||||
//到达普通站点
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
//到达普通站点或者货架
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver || device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||
boolean canTake = StrUtil.startWith(task.getTask_code(), CommonFinalParam.HYPHEN_)
|
||||
|| acsToWmsService.feedbackTask(inst, WmsFeedbackStatusEnum.APPLY_TAKE.getValue());
|
||||
|
||||
@@ -244,7 +265,7 @@ public class AgvNdcOneDeviceDriver extends AbstractStandardDeviceDriver {
|
||||
//反馈车辆动作
|
||||
agv_status = 2;
|
||||
//到达普通站点取货完成
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver || device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||
boolean canTake = StrUtil.startWith(task.getTask_code(), CommonFinalParam.HYPHEN_)
|
||||
|| acsToWmsService.feedbackTask(inst, WmsFeedbackStatusEnum.TAKE_FINISH.getValue());
|
||||
|
||||
@@ -259,11 +280,30 @@ public class AgvNdcOneDeviceDriver extends AbstractStandardDeviceDriver {
|
||||
// 二次分配处理
|
||||
data = ndcAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
// 判断是否需要二次分配
|
||||
if ("".equals(inst.getStart_device_code())) {
|
||||
if ("A".equals(inst.getNext_device_code())) {
|
||||
// 向WMS申请新点位
|
||||
JSONObject response = acsToWmsService.taskRedirection(task.getTask_code(), inst.getStart_device_code());
|
||||
JSONObject response = acsToWmsService.taskRedirection(task.getTask_code(), inst.getNext_device_code());
|
||||
if (response != null && response.getInteger("responseCode") == 0
|
||||
&& ObjectUtil.isNotEmpty(response.getString("locationNew"))) {
|
||||
// 更新任务/指令起点位置
|
||||
old_device_code = response.getString("locationNew");
|
||||
if (StrUtil.contains(old_device_code, "-")) {
|
||||
String[] point = old_device_code.split("-");
|
||||
device_code = point[0];
|
||||
} else if (StrUtil.contains(old_device_code, ".")) {
|
||||
String[] point = old_device_code.split("\\.");
|
||||
device_code = point[0];
|
||||
emptyNum = point[1];
|
||||
} else {
|
||||
device_code = old_device_code;
|
||||
}
|
||||
device = deviceAppService.findDeviceByCode(device_code);
|
||||
task.setNext_device_code(device.getDevice_code());
|
||||
task.setNext_point_code(response.getString("locationNew"));
|
||||
taskserver.update(task);
|
||||
inst.setNext_device_code(device.getDevice_code());
|
||||
inst.setNext_point_code(response.getString("locationNew"));
|
||||
instructionService.update(inst);
|
||||
// 返回NDC更换新位置
|
||||
data = ndcAgvService.sendAgvOneModeInstDis(phase, index, response.getString("locationNew"));
|
||||
}
|
||||
@@ -302,8 +342,8 @@ public class AgvNdcOneDeviceDriver extends AbstractStandardDeviceDriver {
|
||||
}
|
||||
// "========================================================================请求放货================================================================================="
|
||||
agv_status = 3;
|
||||
//普通站点
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
//到达普通站点或者货架
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver || device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||
boolean canTake = StrUtil.startWith(task.getTask_code(), CommonFinalParam.HYPHEN_)
|
||||
|| acsToWmsService.feedbackTask(inst, WmsFeedbackStatusEnum.APPLY_PUT.getValue());
|
||||
|
||||
@@ -353,7 +393,7 @@ public class AgvNdcOneDeviceDriver extends AbstractStandardDeviceDriver {
|
||||
// "========================================================================放货完成================================================================================="
|
||||
agv_status = 4;
|
||||
//agv普通站点放货完成
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver || device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||
boolean canTake = StrUtil.startWith(task.getTask_code(), CommonFinalParam.HYPHEN_)
|
||||
|| acsToWmsService.feedbackTask(inst, WmsFeedbackStatusEnum.PUT_FINISH.getValue());
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package org.nl.acs.device.deviceDriver.service.defination.ordinaryDefination.standardStorage;
|
||||
|
||||
import org.nl.acs.device.device.service.entity.Device;
|
||||
import org.nl.acs.device.device.service.enums.DeviceType;
|
||||
import org.nl.acs.device.deviceDriver.service.defination.DeviceDriverDefination;
|
||||
import org.nl.acs.device.deviceDriver.service.driver.DeviceDriver;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 货架
|
||||
*/
|
||||
@Service
|
||||
public class StandardStorageDefination implements DeviceDriverDefination {
|
||||
@Override
|
||||
public String getDriverCode() {
|
||||
return "standard_storage";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDriverName() {
|
||||
return "标准版-货架";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDriverDescription() {
|
||||
return "标准版-货架";
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceDriver getDriverInstance(Device device) {
|
||||
return (new StandardStorageDeviceDriver()).init(device, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends DeviceDriver> getDeviceDriverType() {
|
||||
return StandardStorageDeviceDriver.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeviceType> getFitDeviceTypes() {
|
||||
List<DeviceType> types = new LinkedList();
|
||||
types.add(DeviceType.storage);
|
||||
return types;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package org.nl.acs.device.deviceDriver.service.defination.ordinaryDefination.standardStorage;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.device.deviceDriver.service.defination.ordinaryDefination.AbstractStandardDeviceDriver;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 标准版货架
|
||||
*/
|
||||
@Slf4j
|
||||
@Data
|
||||
public class StandardStorageDeviceDriver extends AbstractStandardDeviceDriver {
|
||||
|
||||
|
||||
@Override
|
||||
public JSONObject getDeviceStatusName() throws Exception {
|
||||
JSONObject jo = new JSONObject();
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDeviceStatus(JSONObject data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() throws Exception {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,6 +101,8 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
private TaskService taskService;
|
||||
@Autowired
|
||||
private AcsToKitService acsToKitService;
|
||||
@Autowired
|
||||
private NDCAgvService ndcAgvService;
|
||||
|
||||
@Autowired
|
||||
private LuceneExecuteLogService luceneExecuteLogService;
|
||||
@@ -1052,6 +1054,9 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
if (ObjectUtil.isNotEmpty(entity.getAgv_system_type()) && entity.getAgv_system_type().equals(CommonFinalParam.TWO)) {
|
||||
// NDC agv指令不当场取消指令,需要等agv上报
|
||||
if ("1".equals(entity.getSend_status())) {
|
||||
// 告知NDC取消任务
|
||||
Instruction instruction = JSONObject.parseObject(JSONObject.toJSONString(entity), Instruction.class);
|
||||
ndcAgvService.deleteAgvInstToNDC(instruction);
|
||||
flag = true;
|
||||
} else {
|
||||
flag = true;
|
||||
|
||||
@@ -32,14 +32,14 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
dto.setStart_device_code(request.getLocationFrom());
|
||||
dto.setNext_point_code(request.getLocationTo());
|
||||
dto.setNext_device_code(request.getLocationTo());
|
||||
dto.setPriority(request.getPriority() == null ? null : String.valueOf(request.getPriority()));
|
||||
dto.setPriority(request.getPriority() == null ? "1" : String.valueOf(request.getPriority()));
|
||||
dto.setQuantity("1");
|
||||
dto.setRoute_plan_code("normal");
|
||||
dto.setCompound_task("0");
|
||||
dto.setCreate_type("WMS");
|
||||
dto.setFinish_type("WMS");
|
||||
// 调度系统类型:默认1
|
||||
dto.setAgv_system_type("1");
|
||||
dto.setAgv_system_type("2");
|
||||
// 当前任务模型没有完整承载 WMS 扩展字段的结构化列,先放入 remark 保留。
|
||||
JSONObject extInfo = new JSONObject();
|
||||
extInfo.put("houseCode", request.getHouseCode());
|
||||
|
||||
Reference in New Issue
Block a user