rev:修改
This commit is contained in:
@@ -299,9 +299,20 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
agv_status = 2;
|
agv_status = 2;
|
||||||
//到达普通站点取货完成
|
//到达普通站点取货完成
|
||||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||||
|
StandardOrdinarySiteDeviceDriver deviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||||
|
// 校验是否是需要人工取货
|
||||||
|
if (!"YPJ01,YPJ02,BYJ01,BYJ02".contains(device_code)) {
|
||||||
|
deviceDriver.setIs_get_confirm(true);
|
||||||
|
}
|
||||||
|
if (deviceDriver.getIs_get_confirm()) {
|
||||||
data = ndcAgvService.sendAgvOneModeInst(phase, index, 0);
|
data = ndcAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
log.info("agv进入" + device_code + "取货完成");
|
log.info("agv进入" + device_code + "取货完成");
|
||||||
flag = true;
|
flag = true;
|
||||||
|
deviceDriver.setIs_get_confirm(false);
|
||||||
|
} else {
|
||||||
|
log.info("agv进入" + device_code + "等待上位下发取货完成信号");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//到达货架取货完成
|
//到达货架取货完成
|
||||||
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||||
@@ -464,9 +475,20 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
agv_status = 4;
|
agv_status = 4;
|
||||||
//agv普通站点放货完成
|
//agv普通站点放货完成
|
||||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||||
|
StandardOrdinarySiteDeviceDriver deviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||||
|
// 校验是否是需要人工取货
|
||||||
|
if (!"YPJ01,YPJ02,BYJ01,BYJ02".contains(device_code)) {
|
||||||
|
deviceDriver.setIs_put_confirm(true);
|
||||||
|
}
|
||||||
|
if (deviceDriver.getIs_put_confirm()) {
|
||||||
log.info("{}放货完成", device_code);
|
log.info("{}放货完成", device_code);
|
||||||
data = ndcAgvService.sendAgvOneModeInst(phase, index, 0);
|
data = ndcAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
flag = true;
|
flag = true;
|
||||||
|
deviceDriver.setIs_put_confirm(false);
|
||||||
|
} else {
|
||||||
|
log.info("{}等待上位下发放货完成信号", device_code);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//agv货架放货完成
|
//agv货架放货完成
|
||||||
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||||
|
|||||||
@@ -87,6 +87,12 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple
|
|||||||
//申请物料
|
//申请物料
|
||||||
private Boolean apply_material = false;
|
private Boolean apply_material = false;
|
||||||
|
|
||||||
|
// 是否取货完成
|
||||||
|
private Boolean is_get_confirm = false;
|
||||||
|
|
||||||
|
// 是否放货完成
|
||||||
|
private Boolean is_put_confirm = false;
|
||||||
|
|
||||||
// 1取货完成 2放货完成 3进入区域 4离开区域
|
// 1取货完成 2放货完成 3进入区域 4离开区域
|
||||||
private int flag;
|
private int flag;
|
||||||
|
|
||||||
|
|||||||
@@ -120,4 +120,12 @@ public class WmsToAcsController {
|
|||||||
return new ResponseEntity<>(wmstoacsService.getEmpReady(param), HttpStatus.OK);
|
return new ResponseEntity<>(wmstoacsService.getEmpReady(param), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/isGetPut")
|
||||||
|
@Log("wms下发是否放货/取货完成")
|
||||||
|
/** wms获取栈板机信号 */
|
||||||
|
@SaIgnore
|
||||||
|
public ResponseEntity<Object> isGetPut(@RequestBody JSONObject param) {
|
||||||
|
return new ResponseEntity<>(wmstoacsService.isGetPut(param), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,4 +130,6 @@ public interface WmsToAcsService {
|
|||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
CreateTaskResponse getEmpReady(JSONObject param);
|
CreateTaskResponse getEmpReady(JSONObject param);
|
||||||
|
|
||||||
|
CreateTaskResponse isGetPut(JSONObject param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.nl.acs.ext.wms.service.impl;
|
package org.nl.acs.ext.wms.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import cn.hutool.core.util.NumberUtil;
|
||||||
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 cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
@@ -12,6 +13,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.acs.device.domain.Device;
|
import org.nl.acs.device.domain.Device;
|
||||||
import org.nl.acs.device_driver.basedriver.pallet_dispenser.PalletDispenseDeviceDriver;
|
import org.nl.acs.device_driver.basedriver.pallet_dispenser.PalletDispenseDeviceDriver;
|
||||||
|
import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
|
||||||
import org.nl.acs.device_driver.basedriver.weight_platform.WeightPlatformDeviceDriver;
|
import org.nl.acs.device_driver.basedriver.weight_platform.WeightPlatformDeviceDriver;
|
||||||
import org.nl.acs.device_driver.conveyor.primary_device.PrimaryDeviceConveyorDeviceDriver;
|
import org.nl.acs.device_driver.conveyor.primary_device.PrimaryDeviceConveyorDeviceDriver;
|
||||||
import org.nl.acs.ext.wms.data.JsonUtl;
|
import org.nl.acs.ext.wms.data.JsonUtl;
|
||||||
@@ -470,7 +472,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
|
|
||||||
// 返回wms重量
|
// 返回wms重量
|
||||||
HashMap<String, String> data = new HashMap<>();
|
HashMap<String, String> data = new HashMap<>();
|
||||||
data.put("weigh", weight);
|
data.put("weigh", NumberUtil.div(weight, "100").toString());
|
||||||
response.setStatus(200);
|
response.setStatus(200);
|
||||||
response.setParameters(data);
|
response.setParameters(data);
|
||||||
log.info("ACS接收WMS任务获取重量--------------:输出参数:" + JSON.toJSONString(response));
|
log.info("ACS接收WMS任务获取重量--------------:输出参数:" + JSON.toJSONString(response));
|
||||||
@@ -512,4 +514,55 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CreateTaskResponse isGetPut(JSONObject param) {
|
||||||
|
log.info("ACS接收WMS下发取放货完成信息-----输入参数{}", param);
|
||||||
|
CreateTaskResponse response = new CreateTaskResponse();
|
||||||
|
|
||||||
|
// 1-取货完成 2-放货完成
|
||||||
|
String type = param.getString("type");
|
||||||
|
String device_code = param.getString("device_code");
|
||||||
|
if (ObjectUtil.isEmpty(type)) {
|
||||||
|
response.setStatus(400);
|
||||||
|
response.setMessage("取放类型不能为空");
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isEmpty(device_code)) {
|
||||||
|
response.setStatus(400);
|
||||||
|
response.setMessage("设备不能为空");
|
||||||
|
}
|
||||||
|
// 获取设备驱动
|
||||||
|
Device device = deviceAppService.findDeviceByCode(device_code);
|
||||||
|
if (ObjectUtil.isEmpty(device)) {
|
||||||
|
response.setStatus(400);
|
||||||
|
response.setMessage("点位【"+device_code+"】不存在!");
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||||
|
StandardOrdinarySiteDeviceDriver deviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||||
|
|
||||||
|
if ("YPJ01,YPJ02,BYJ01,BYJ02".contains(device_code)) {
|
||||||
|
if (type.equals("1")) {
|
||||||
|
// 取货完成
|
||||||
|
response.setStatus(200);
|
||||||
|
deviceDriver.setIs_get_confirm(true);
|
||||||
|
}
|
||||||
|
if (type.equals("2")) {
|
||||||
|
// 放货完成
|
||||||
|
response.setStatus(200);
|
||||||
|
deviceDriver.setIs_put_confirm(true);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
response.setStatus(400);
|
||||||
|
response.setMessage("当前点位不需要下发取放货完成信号!");
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
response.setStatus(400);
|
||||||
|
response.setMessage("当前点位不需要下发取放货完成信号!");
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
log.info("ACS接收WMS下发取放货完成信息--------------:输出参数:" + JSON.toJSONString(response));
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user