NDC调度接口更新
This commit is contained in:
@@ -66,4 +66,6 @@ public interface NDCAgvService {
|
||||
*/
|
||||
public byte[] sendAgvOneModeInst(int phase, int index, int result);
|
||||
|
||||
void updateAgvFromCache(AgvDto dto);
|
||||
|
||||
}
|
||||
|
||||
@@ -439,7 +439,8 @@ public class MagicAgvServiceImpl implements MagicAgvService {
|
||||
}
|
||||
//请求放货
|
||||
} else if ("Unload".equals(action)) {
|
||||
if (standardInspectSiteDeviceDriver.getMode() == 2 && standardInspectSiteDeviceDriver.getMove() == 0) {
|
||||
if (standardInspectSiteDeviceDriver.getMode() == 2
|
||||
&& standardInspectSiteDeviceDriver.getMove() == 0) {
|
||||
inst.setExecute_status("3");
|
||||
is_feedback = true;
|
||||
}
|
||||
@@ -856,7 +857,8 @@ public class MagicAgvServiceImpl implements MagicAgvService {
|
||||
}
|
||||
//放货完成离开
|
||||
if (lnshStationDeviceDriver.getFlag() == 3) {
|
||||
if (lnshStationDeviceDriver.getMove() == 1 && (lnshStationDeviceDriver.getIo_action() == 3 || lnshStationDeviceDriver.getIo_action() == 2)) {
|
||||
if (lnshStationDeviceDriver.getMove() == 1
|
||||
&& (lnshStationDeviceDriver.getIo_action() == 3 || lnshStationDeviceDriver.getIo_action() == 2)) {
|
||||
flag = true;
|
||||
lnshStationDeviceDriver.setFlag(0);
|
||||
lnshStationDeviceDriver.writing(3);
|
||||
|
||||
@@ -130,6 +130,7 @@ public class NDCAgvServiceImpl implements NDCAgvService {
|
||||
if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.FORKAGV).toString(), "1")) {
|
||||
String instcode = inst.getInstruction_code();
|
||||
int type = Integer.parseInt(inst.getInstruction_type());
|
||||
|
||||
int priority = Integer.parseInt(inst.getPriority()) + 128;
|
||||
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
||||
DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class);
|
||||
@@ -382,4 +383,12 @@ public class NDCAgvServiceImpl implements NDCAgvService {
|
||||
return AGVDeviceStatus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateAgvFromCache(AgvDto dto) {
|
||||
if (AGVDeviceStatus.containsKey(dto.getName())) {
|
||||
AGVDeviceStatus.remove(dto.getName());
|
||||
}
|
||||
AGVDeviceStatus.put(dto.getName(), dto);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -158,5 +158,12 @@ public interface AcsToWmsService {
|
||||
*/
|
||||
HttpResponse queryDoorsStatus();
|
||||
|
||||
/**
|
||||
* 向WMS反馈动作状态
|
||||
*
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
public HttpResponse feedbackActionStatusToWms(JSONArray arr);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package org.nl.acs.ext.wms.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
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;
|
||||
@@ -912,4 +914,49 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResponse feedbackActionStatusToWms(JSONArray data) {
|
||||
String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL);
|
||||
|
||||
String task_code = "";
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
net.sf.json.JSONObject json = (net.sf.json.JSONObject) data.get(i);
|
||||
task_code = json.optString("task_code");
|
||||
}
|
||||
TaskDto taskDto = taskService.findByCode(task_code);
|
||||
String vehicle_code = taskDto.getVehicle_code();
|
||||
|
||||
HttpResponse result2 = null;
|
||||
log.info("feedbackActionStatusToWms-----请求参数{}", data.toString());
|
||||
AddressDto addressDto = addressService.findByCode("feedbackActionStatusToWms");
|
||||
String methods_url = addressDto.getMethods_url();
|
||||
try {
|
||||
result2 = HttpRequest.post(wmsurl + methods_url)
|
||||
// .header("Authorization", token)
|
||||
.body(String.valueOf(data))
|
||||
.execute();
|
||||
} catch (Exception e) {
|
||||
String msg = e.getMessage();
|
||||
//网络不通
|
||||
System.out.println(msg);
|
||||
log.info("feedbackActionStatusToWms-----异常返回参数{}", msg);
|
||||
}
|
||||
|
||||
String type = "";
|
||||
if(!ObjectUtil.isEmpty(result2)){
|
||||
if (result2.getStatus() == 200) {
|
||||
type = "info";
|
||||
} else {
|
||||
type = "error";
|
||||
}
|
||||
} else {
|
||||
type = "error";
|
||||
}
|
||||
|
||||
|
||||
JSONObject jo = (JSONObject) JSON.toJSON(result2.body());
|
||||
log.info("feedbackActionStatusToWms-----输出参数{}", jo.toString());
|
||||
return result2;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public class InstructionDto implements Serializable {
|
||||
/**
|
||||
* 执行状态
|
||||
*/
|
||||
//暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域
|
||||
//暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 9到达等待点
|
||||
private String execute_status;
|
||||
|
||||
/**
|
||||
|
||||
@@ -889,28 +889,28 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
String next_device_code = acsTask.getNext_device_code();
|
||||
String maxInstnumber = acsConfigService.findConfigFromCache().get(AcsConfig.MAXINSTNUMBER);
|
||||
|
||||
/**
|
||||
* 开始平均分解校验
|
||||
*/
|
||||
String this_device_code = this.queryAssignedByDevice(acsTask.getStart_device_code(), acsTask.getNext_device_code());
|
||||
if (StrUtil.isEmpty(this_device_code)) {
|
||||
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, acsTask.getNext_device_code(), route_plan_code);
|
||||
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);
|
||||
} else {
|
||||
next_device_code = this_device_code;
|
||||
}
|
||||
// /**
|
||||
// * 开始平均分解校验
|
||||
// */
|
||||
// String this_device_code = this.queryAssignedByDevice(acsTask.getStart_device_code(), acsTask.getNext_device_code());
|
||||
// if (StrUtil.isEmpty(this_device_code)) {
|
||||
// List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, acsTask.getNext_device_code(), route_plan_code);
|
||||
// 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);
|
||||
// } else {
|
||||
// next_device_code = this_device_code;
|
||||
// }
|
||||
|
||||
if (StrUtil.equals(appService.findDeviceTypeByCode(next_device_code), "storage")) {
|
||||
next_point_code = next_device_code + "-" + acsTask.getTo_y() + "-" + acsTask.getTo_z();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -360,15 +360,63 @@ export default {
|
||||
return
|
||||
}
|
||||
for (const val in this.data1) {
|
||||
// if (this.data1[val].code.indexOf('move') !== -1) {
|
||||
// this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 1)
|
||||
// }
|
||||
// if (this.data1[val].code.indexOf('error') !== -1) {
|
||||
// this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 5)
|
||||
// }
|
||||
// if (this.data1[val].code.indexOf('task') !== -1) {
|
||||
// this.data1[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 7)
|
||||
// }
|
||||
if (this.data1[val].code.indexOf('move') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 1)
|
||||
}
|
||||
if (this.data1[val].code.indexOf('action') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 2)
|
||||
}
|
||||
if (this.data1[val].code.indexOf('ioaction') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 3)
|
||||
}
|
||||
if (this.data1[val].code.indexOf('error') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 4)
|
||||
}
|
||||
if (this.data1[val].code.indexOf('task') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 5)
|
||||
}
|
||||
if (this.data1[val].code.indexOf('weight') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 9)
|
||||
}
|
||||
if (this.data1[val].code.indexOf('batch') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 13)
|
||||
}
|
||||
if (this.data1[val].code.indexOf('specifications') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'STRING' + (parseInt(endNumber) + 17) + '.50'
|
||||
}
|
||||
if (this.data1[val].code.indexOf('material') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'STRING' + (parseInt(endNumber) + 273) + '.50'
|
||||
}
|
||||
if (this.data1[val].code.indexOf('barcode') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'STRING' + (parseInt(endNumber) + 529) + '.50'
|
||||
}
|
||||
if (this.data1[val].code.indexOf('AlongSide') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 785)
|
||||
}
|
||||
if (this.data1[val].code.indexOf('BshortSide') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 787)
|
||||
}
|
||||
if (this.data1[val].code.indexOf('Htrapezoidal') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 789)
|
||||
}
|
||||
if (this.data1[val].code.indexOf('Wthickness') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 791)
|
||||
}
|
||||
if (this.data1[val].code.indexOf('status') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'B' + (parseInt(endNumber) + 795)
|
||||
}
|
||||
if (this.data1[val].code.indexOf('unqualified_qty') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 795)
|
||||
}
|
||||
if (this.data1[val].code.indexOf('encoder_qty') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 799)
|
||||
}
|
||||
if (this.data1[val].code.indexOf('order_qty') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 803)
|
||||
}
|
||||
if (this.data1[val].code.indexOf('order_No') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'STRING' + (parseInt(endNumber) + 807) + '.50'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -386,14 +434,41 @@ export default {
|
||||
if (isNaN(parseInt(endNumber))) {
|
||||
return
|
||||
}
|
||||
// for (const val in this.data2) {
|
||||
// if (this.data2[val].code.indexOf('to_target') !== -1) {
|
||||
// this.data2[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 2)
|
||||
// }
|
||||
// if (this.data2[val].code.indexOf('to_task') !== -1) {
|
||||
// this.data2[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 6)
|
||||
// }
|
||||
// }
|
||||
for (const val in this.data2) {
|
||||
if (this.data2[val].code.indexOf('to_target') !== -1) {
|
||||
this.data2[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 2)
|
||||
}
|
||||
if (this.data2[val].code.indexOf('to_task') !== -1) {
|
||||
this.data2[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 4)
|
||||
}
|
||||
if (this.data2[val].code.indexOf('to_barcode') !== -1) {
|
||||
this.data2[val].db = beforeStr + '.' + 'STRING' + (parseInt(endNumber) + 8) + '.50'
|
||||
}
|
||||
if (this.data2[val].code.indexOf('to_error') !== -1) {
|
||||
this.data2[val].db = beforeStr + '.' + 'B' + (parseInt(endNumber) + 264)
|
||||
}
|
||||
if (this.data2[val].code.indexOf('to_allow_pallet_qty') !== -1) {
|
||||
this.data2[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 266)
|
||||
}
|
||||
if (this.data2[val].code.indexOf('to_material_type') !== -1) {
|
||||
this.data2[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 268)
|
||||
}
|
||||
// if (this.data2[val].code.indexOf('to_material_code') !== -1) {
|
||||
// this.data2[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 272)
|
||||
// }
|
||||
if (this.data2[val].code.indexOf('to_order_qty') !== -1) {
|
||||
this.data2[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 276)
|
||||
}
|
||||
if (this.data2[val].code.indexOf('to_product_code') !== -1) {
|
||||
this.data2[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 280)
|
||||
}
|
||||
if (this.data2[val].code.indexOf('to_order_No') !== -1) {
|
||||
this.data2[val].db = beforeStr + '.' + 'STRING' + (parseInt(endNumber) + 284) + '.50'
|
||||
}
|
||||
if (this.data2[val].code.indexOf('to_material_code') !== -1) {
|
||||
this.data2[val].db = beforeStr + '.' + 'STRING' + (parseInt(endNumber) + 540) + '.50'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
changeOpc(val) {
|
||||
|
||||
Reference in New Issue
Block a user