|
|
@ -28,6 +28,7 @@ import org.nl.acs.opc.Device; |
|
|
|
import org.nl.acs.opc.DeviceAppService; |
|
|
|
import org.nl.acs.opc.DeviceAppServiceImpl; |
|
|
|
import org.nl.acs.route.service.RouteLineService; |
|
|
|
import org.nl.acs.route.service.dto.RouteLineDto; |
|
|
|
import org.nl.acs.task.service.TaskService; |
|
|
|
import org.nl.acs.task.service.dto.TaskDto; |
|
|
|
import org.nl.acs.task.service.impl.TaskServiceImpl; |
|
|
@ -45,6 +46,7 @@ import org.springframework.security.crypto.password.PasswordEncoder; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
@ -61,6 +63,7 @@ public class NdxyHandServiceImpl implements NdxyHandService { |
|
|
|
private final PasswordEncoder passwordEncoder; |
|
|
|
private final DeviceService deviceService; |
|
|
|
private final DeviceAppService deviceAppService; |
|
|
|
private final RouteLineService routeLineService; |
|
|
|
private final AgvService agvService; |
|
|
|
InstructionService instructionService = null; |
|
|
|
|
|
|
@ -114,10 +117,10 @@ public class NdxyHandServiceImpl implements NdxyHandService { |
|
|
|
if (device.getDeviceDriver() instanceof NdxySpecialDeviceDriver) { |
|
|
|
ndxySpecialDeviceDriver = (NdxySpecialDeviceDriver) device.getDeviceDriver(); |
|
|
|
|
|
|
|
if (ndxySpecialDeviceDriver.getHasGoods() == 0) { |
|
|
|
if (ndxySpecialDeviceDriver.getMove() == 0) { |
|
|
|
status = "0"; |
|
|
|
status_name = "空"; |
|
|
|
} else if (ndxySpecialDeviceDriver.getHasGoods() == 1) { |
|
|
|
} else if (ndxySpecialDeviceDriver.getMove() == 1) { |
|
|
|
status = "1"; |
|
|
|
status_name = "有货"; |
|
|
|
} |
|
|
@ -128,6 +131,10 @@ public class NdxyHandServiceImpl implements NdxyHandService { |
|
|
|
// if (ndxySpecialDeviceDriver.getChecked()) {
|
|
|
|
// status = "3";
|
|
|
|
// status_name = "已选择";
|
|
|
|
// }
|
|
|
|
// if (ndxySpecialDeviceDriver.getChecked() && ndxySpecialDeviceDriver.getHasGoods() == 1) {
|
|
|
|
// status = "4";
|
|
|
|
// status_name = "已选择且有货";
|
|
|
|
// }
|
|
|
|
|
|
|
|
Device device_code1 = deviceAppService.findDeviceByCode(devicejo.optString("device_code")); |
|
|
@ -230,10 +237,10 @@ public class NdxyHandServiceImpl implements NdxyHandService { |
|
|
|
if (device.getDeviceDriver() instanceof NdxySpecialDeviceDriver) { |
|
|
|
ndxySpecialDeviceDriver = (NdxySpecialDeviceDriver) device.getDeviceDriver(); |
|
|
|
|
|
|
|
if (ndxySpecialDeviceDriver.getHasGoods() == 0) { |
|
|
|
if (ndxySpecialDeviceDriver.getMove() == 0) { |
|
|
|
status = "0"; |
|
|
|
status_name = "无货"; |
|
|
|
} else if (ndxySpecialDeviceDriver.getHasGoods() == 1) { |
|
|
|
} else if (ndxySpecialDeviceDriver.getMove() == 1) { |
|
|
|
status = "1"; |
|
|
|
status_name = "有货"; |
|
|
|
} |
|
|
@ -241,10 +248,14 @@ public class NdxyHandServiceImpl implements NdxyHandService { |
|
|
|
status = "2"; |
|
|
|
status_name = "故障"; |
|
|
|
} |
|
|
|
if (ndxySpecialDeviceDriver.getChecked()) { |
|
|
|
status = "3"; |
|
|
|
status_name = "已选择"; |
|
|
|
} |
|
|
|
// if (ndxySpecialDeviceDriver.getChecked()) {
|
|
|
|
// status = "3";
|
|
|
|
// status_name = "已选择";
|
|
|
|
// }
|
|
|
|
// if (ndxySpecialDeviceDriver.getChecked() && ndxySpecialDeviceDriver.getHasGoods() == 1) {
|
|
|
|
// status = "4";
|
|
|
|
// status_name = "已选择且有货";
|
|
|
|
// }
|
|
|
|
Device device_code1 = deviceAppService.findDeviceByCode(devicejo.optString("device_code")); |
|
|
|
jo.put("status", status); |
|
|
|
jo.put("status_name", status_name); |
|
|
@ -400,12 +411,12 @@ public class NdxyHandServiceImpl implements NdxyHandService { |
|
|
|
@Override |
|
|
|
public Map<String, Object> queryInst(Map<String, String> jsonObject) { |
|
|
|
//查询位完成的指令
|
|
|
|
JSONObject resultJson = new JSONObject(); |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
|
|
|
|
String key = jsonObject.get("keyword"); |
|
|
|
String start_point = jsonObject.get("start_devicecode"); |
|
|
|
String next_point = jsonObject.get("next_devicecode"); |
|
|
|
String type = jsonObject.get("type"); |
|
|
|
map.put("flag", "4"); |
|
|
|
if (StrUtil.isNotEmpty(key)) { |
|
|
|
map.put("key", "%" + key + "%"); |
|
|
@ -417,10 +428,40 @@ public class NdxyHandServiceImpl implements NdxyHandService { |
|
|
|
map.put("next_point", "%" + next_point + "%"); |
|
|
|
} |
|
|
|
JSONArray resultArr = WQL.getWO("QNDXY_QUERY003").addParamMap(map).addParamMap((HashMap) jsonObject).process().getResultJSONArray(0); |
|
|
|
resultJson.put("code", "1"); |
|
|
|
resultJson.put("desc", "查询成功"); |
|
|
|
resultJson.put("result", resultArr); |
|
|
|
return resultJson; |
|
|
|
JSONArray array = new JSONArray(); |
|
|
|
if (type.equals("1")) { |
|
|
|
for (int i = 0; i < resultArr.size(); i++) { |
|
|
|
JSONObject js = resultArr.getJSONObject(i); |
|
|
|
Device device = deviceAppService.findDeviceByCode(js.getString("next_devicecode")); |
|
|
|
if (ObjectUtil.isNotEmpty(device.getExtraValue().get("put_storage"))) { |
|
|
|
if (StrUtil.equals(device.getExtraValue().get("put_storage").toString(),"true")) { |
|
|
|
array.add(js); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
JSONObject resultJson = new JSONObject(); |
|
|
|
resultJson.put("code", "1"); |
|
|
|
resultJson.put("desc", "查询成功"); |
|
|
|
resultJson.put("result", array); |
|
|
|
return resultJson; |
|
|
|
} |
|
|
|
if (type.equals("2")) { |
|
|
|
for (int i = 0; i < resultArr.size(); i++) { |
|
|
|
JSONObject js = resultArr.getJSONObject(i); |
|
|
|
Device device = deviceAppService.findDeviceByCode(js.getString("start_devicecode")); |
|
|
|
if (ObjectUtil.isNotEmpty(device.getExtraValue().get("outbound"))) { |
|
|
|
if (StrUtil.equals(device.getExtraValue().get("outbound").toString(), "true")) { |
|
|
|
array.add(js); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
JSONObject resultJson = new JSONObject(); |
|
|
|
resultJson.put("code", "1"); |
|
|
|
resultJson.put("desc", "查询成功"); |
|
|
|
resultJson.put("result", array); |
|
|
|
return resultJson; |
|
|
|
} |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -442,9 +483,8 @@ public class NdxyHandServiceImpl implements NdxyHandService { |
|
|
|
if (StrUtil.isEmpty(routeplan_type)) { |
|
|
|
throw new BadRequestException("路由方案类型不能为空!"); |
|
|
|
} |
|
|
|
if (StrUtil.isEmpty(priority)) { |
|
|
|
priority = "1"; |
|
|
|
} |
|
|
|
|
|
|
|
priority = "1"; |
|
|
|
|
|
|
|
if (start_devicecode.equals(next_devicecode)) { |
|
|
|
resultJson.put("code", "0"); |
|
|
@ -486,6 +526,7 @@ public class NdxyHandServiceImpl implements NdxyHandService { |
|
|
|
String key = jsonObject.get("keyword"); |
|
|
|
String start_point = jsonObject.get("start_devicecode"); |
|
|
|
String next_point = jsonObject.get("next_devicecode"); |
|
|
|
String type = jsonObject.get("type"); |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
map.put("flag", "2"); |
|
|
|
if (StrUtil.isNotEmpty(key)) { |
|
|
@ -499,11 +540,41 @@ public class NdxyHandServiceImpl implements NdxyHandService { |
|
|
|
} |
|
|
|
//查询有任务 但是没有指令的任务
|
|
|
|
JSONArray result = WQL.getWO("QNDXY_QUERY003").addParamMap(map).process().getResultJSONArray(0); |
|
|
|
JSONObject resultJson = new JSONObject(); |
|
|
|
resultJson.put("code", "1"); |
|
|
|
resultJson.put("desc", "查询成功"); |
|
|
|
resultJson.put("result", result); |
|
|
|
return resultJson; |
|
|
|
JSONArray array = new JSONArray(); |
|
|
|
if (type.equals("1")) { |
|
|
|
for (int i = 0; i < result.size(); i++) { |
|
|
|
JSONObject js = result.getJSONObject(i); |
|
|
|
Device device = deviceAppService.findDeviceByCode(js.getString("next_devicecode")); |
|
|
|
if (ObjectUtil.isNotEmpty(device.getExtraValue().get("put_storage"))) { |
|
|
|
if (StrUtil.equals(device.getExtraValue().get("put_storage").toString(),"true")) { |
|
|
|
array.add(js); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
JSONObject resultJson = new JSONObject(); |
|
|
|
resultJson.put("code", "1"); |
|
|
|
resultJson.put("desc", "查询成功"); |
|
|
|
resultJson.put("result", array); |
|
|
|
return resultJson; |
|
|
|
} |
|
|
|
if (type.equals("2")) { |
|
|
|
for (int i = 0; i < result.size(); i++) { |
|
|
|
JSONObject js = result.getJSONObject(i); |
|
|
|
Device device = deviceAppService.findDeviceByCode(js.getString("start_devicecode")); |
|
|
|
if (ObjectUtil.isNotEmpty(device.getExtraValue().get("outbound"))) { |
|
|
|
if (StrUtil.equals(device.getExtraValue().get("outbound").toString(), "true")) { |
|
|
|
array.add(js); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
JSONObject resultJson = new JSONObject(); |
|
|
|
resultJson.put("code", "1"); |
|
|
|
resultJson.put("desc", "查询成功"); |
|
|
|
resultJson.put("result", array); |
|
|
|
return resultJson; |
|
|
|
} |
|
|
|
|
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -512,9 +583,10 @@ public class NdxyHandServiceImpl implements NdxyHandService { |
|
|
|
//修改任务的状态
|
|
|
|
String device_code = jsonObject.get("device_code"); |
|
|
|
String type = jsonObject.get("status_type"); |
|
|
|
String number = jsonObject.get("number"); |
|
|
|
JSONObject resultJson = new JSONObject(); |
|
|
|
DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class); |
|
|
|
|
|
|
|
TaskService taskService = SpringContextHolder.getBean(TaskServiceImpl.class); |
|
|
|
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); |
|
|
|
Device device = appService.findDeviceByCode(device_code); |
|
|
|
//纽迪希亚专用
|
|
|
@ -522,55 +594,181 @@ public class NdxyHandServiceImpl implements NdxyHandService { |
|
|
|
|
|
|
|
DeviceDto dto = deviceService.findByCode(device_code); |
|
|
|
|
|
|
|
//修改
|
|
|
|
//选中
|
|
|
|
if (type.equals("1")) { |
|
|
|
int num = 0; |
|
|
|
JSONArray acs_deviceja = WQLObject.getWQLObject("acs_device").query("region = '" + dto.getRegion() + "'", "seq_num,device_name").getResultJSONArray(0); |
|
|
|
for (int i = 0; i < acs_deviceja.size(); i++) { |
|
|
|
JSONObject devicejo = acs_deviceja.getJSONObject(i); |
|
|
|
String deviceCode = devicejo.optString("device_code"); |
|
|
|
Device device1 = appService.findDeviceByCode(deviceCode); |
|
|
|
if (device1.getDeviceDriver() instanceof NdxySpecialDeviceDriver) { |
|
|
|
ndxySpecialDeviceDriver = (NdxySpecialDeviceDriver) device1.getDeviceDriver(); |
|
|
|
if (ndxySpecialDeviceDriver.getChecked()) { |
|
|
|
num++; |
|
|
|
if (ObjectUtil.isNotEmpty(device.getExtraValue().get("outbound"))) { |
|
|
|
if (StrUtil.equals(device.getExtraValue().get("outbound").toString(), "true")) { |
|
|
|
|
|
|
|
for (int i = 0; i < Integer.parseInt(number); i++) { |
|
|
|
TaskDto taskDto = new TaskDto(); |
|
|
|
String now = DateUtil.now(); |
|
|
|
taskDto.setTask_id(IdUtil.simpleUUID()); |
|
|
|
taskDto.setCreate_by(device.getDevice_code()); |
|
|
|
taskDto.setUpdate_by(device.getDevice_code()); |
|
|
|
|
|
|
|
taskDto.setTask_status("0"); |
|
|
|
taskDto.setPriority("1"); |
|
|
|
String next_device_code = ""; |
|
|
|
List<RouteLineDto> list = routeLineService.getShortPathLinesByCode(device_code, "normal"); |
|
|
|
for (int j = 0; j < list.size(); j++) { |
|
|
|
RouteLineDto routeLineDto = list.get(j); |
|
|
|
next_device_code = routeLineDto.getNext_device_code(); |
|
|
|
} |
|
|
|
|
|
|
|
if (StrUtil.isEmpty(next_device_code)) { |
|
|
|
throw new RuntimeException("该设备未找到对应路由"); |
|
|
|
} |
|
|
|
|
|
|
|
taskDto.setStart_point_code(device_code); |
|
|
|
taskDto.setStart_device_code(device_code); |
|
|
|
taskDto.setNext_point_code(next_device_code); |
|
|
|
taskDto.setNext_device_code(next_device_code); |
|
|
|
taskDto.setUpdate_time(now); |
|
|
|
taskDto.setCreate_time(now); |
|
|
|
String task_code = CodeUtil.getNewCode("TASK_NO"); |
|
|
|
taskDto.setTask_code("-" + task_code); |
|
|
|
|
|
|
|
WQLObject wo = WQLObject.getWQLObject("acs_task"); |
|
|
|
JSONObject json = JSONObject.fromObject(taskDto); |
|
|
|
wo.insert(json); |
|
|
|
|
|
|
|
} |
|
|
|
//纽迪希亚专用
|
|
|
|
if (device.getDeviceDriver() instanceof NdxySpecialDeviceDriver) { |
|
|
|
ndxySpecialDeviceDriver = (NdxySpecialDeviceDriver) device.getDeviceDriver(); |
|
|
|
ndxySpecialDeviceDriver.setChecked(true); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (num != 0) { |
|
|
|
resultJson.put("code", "0"); |
|
|
|
resultJson.put("desc", "只能选择一个站点"); |
|
|
|
resultJson.put("result", new JSONObject()); |
|
|
|
return resultJson; |
|
|
|
} |
|
|
|
|
|
|
|
//纽迪希亚专用
|
|
|
|
if (device.getDeviceDriver() instanceof NdxySpecialDeviceDriver) { |
|
|
|
ndxySpecialDeviceDriver = (NdxySpecialDeviceDriver) device.getDeviceDriver(); |
|
|
|
if (ndxySpecialDeviceDriver.getChecked()) { |
|
|
|
resultJson.put("code", "0"); |
|
|
|
resultJson.put("desc", "该站点已经被选中"); |
|
|
|
resultJson.put("code", "1"); |
|
|
|
resultJson.put("desc", "更新成功"); |
|
|
|
resultJson.put("result", new JSONObject()); |
|
|
|
|
|
|
|
return resultJson; |
|
|
|
} |
|
|
|
} |
|
|
|
//判断当前设备是否为入库位
|
|
|
|
if (ObjectUtil.isNotEmpty(device.getExtraValue().get("put_storage"))) { |
|
|
|
if (StrUtil.equals(device.getExtraValue().get("put_storage").toString(), "true")) { |
|
|
|
int moveNumber = 0; |
|
|
|
//纽迪希亚专用
|
|
|
|
if (device.getDeviceDriver() instanceof NdxySpecialDeviceDriver) { |
|
|
|
ndxySpecialDeviceDriver = (NdxySpecialDeviceDriver) device.getDeviceDriver(); |
|
|
|
|
|
|
|
if (ndxySpecialDeviceDriver.getMove() != 0) { |
|
|
|
moveNumber += 1; |
|
|
|
} |
|
|
|
//查询关联设备
|
|
|
|
if (ObjectUtil.isNotEmpty(device.getExtraValue().get("link_device_code"))) { |
|
|
|
Object[] arr = (Object[]) device.getExtraValue().get("link_device_code"); |
|
|
|
String[] str_arr = new String[arr.length]; |
|
|
|
for (int j = 0; j < arr.length; j++) { |
|
|
|
str_arr[j] = (String) arr[j]; |
|
|
|
} |
|
|
|
//获得每个关联设备
|
|
|
|
for (int j = 0; j < str_arr.length; j++) { |
|
|
|
String link_device_code = str_arr[j]; |
|
|
|
Device relevance_device = appService.findDeviceByCode(link_device_code); |
|
|
|
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; |
|
|
|
if (relevance_device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { |
|
|
|
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) relevance_device.getDeviceDriver(); |
|
|
|
if (standardInspectSiteDeviceDriver.getMove() != 0) { |
|
|
|
moveNumber += 1; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
for (int i = 0; i < 5 - moveNumber; i++) { |
|
|
|
TaskDto taskDto = new TaskDto(); |
|
|
|
String now = DateUtil.now(); |
|
|
|
taskDto.setTask_id(IdUtil.simpleUUID()); |
|
|
|
taskDto.setCreate_by(device.getDevice_code()); |
|
|
|
taskDto.setUpdate_by(device.getDevice_code()); |
|
|
|
|
|
|
|
taskDto.setTask_status("0"); |
|
|
|
taskDto.setPriority("1"); |
|
|
|
String start_device_code = ""; |
|
|
|
List<RouteLineDto> list = routeLineService.getPathLinesByCode(device_code, "normal"); |
|
|
|
for (int j = 0; j < list.size(); j++) { |
|
|
|
RouteLineDto routeLineDto = list.get(j); |
|
|
|
start_device_code = routeLineDto.getDevice_code(); |
|
|
|
} |
|
|
|
|
|
|
|
ndxySpecialDeviceDriver.setChecked(true); |
|
|
|
if (StrUtil.isEmpty(start_device_code)) { |
|
|
|
throw new RuntimeException("该设备未找到对应路由"); |
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
Thread.sleep(1000); |
|
|
|
} catch (InterruptedException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
taskDto.setStart_point_code(start_device_code); |
|
|
|
taskDto.setStart_device_code(start_device_code); |
|
|
|
taskDto.setNext_point_code(device_code); |
|
|
|
taskDto.setNext_device_code(device_code); |
|
|
|
taskDto.setUpdate_time(now); |
|
|
|
taskDto.setCreate_time(now); |
|
|
|
String task_code = CodeUtil.getNewCode("TASK_NO"); |
|
|
|
taskDto.setTask_code("-" + task_code); |
|
|
|
|
|
|
|
if (!ndxySpecialDeviceDriver.getChecked() && !ndxySpecialDeviceDriver.getChoose()) { |
|
|
|
resultJson.put("code", "0"); |
|
|
|
resultJson.put("desc", "该条线不满足运输条件"); |
|
|
|
resultJson.put("result", new JSONObject()); |
|
|
|
return resultJson; |
|
|
|
WQLObject wo = WQLObject.getWQLObject("acs_task"); |
|
|
|
JSONObject json = JSONObject.fromObject(taskDto); |
|
|
|
wo.insert(json); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
ndxySpecialDeviceDriver.setChecked(true); |
|
|
|
|
|
|
|
resultJson.put("code", "1"); |
|
|
|
resultJson.put("desc", "更新成功"); |
|
|
|
resultJson.put("result", new JSONObject()); |
|
|
|
|
|
|
|
return resultJson; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// int num = 0;
|
|
|
|
// JSONArray acs_deviceja = WQLObject.getWQLObject("acs_device").query("region = '" + dto.getRegion() + "'", "seq_num,device_name").getResultJSONArray(0);
|
|
|
|
// for (int i = 0; i < acs_deviceja.size(); i++) {
|
|
|
|
// JSONObject devicejo = acs_deviceja.getJSONObject(i);
|
|
|
|
// String deviceCode = devicejo.optString("device_code");
|
|
|
|
// Device device1 = appService.findDeviceByCode(deviceCode);
|
|
|
|
// if (device1.getDeviceDriver() instanceof NdxySpecialDeviceDriver) {
|
|
|
|
// ndxySpecialDeviceDriver = (NdxySpecialDeviceDriver) device1.getDeviceDriver();
|
|
|
|
// if (ndxySpecialDeviceDriver.getChecked()) {
|
|
|
|
// num++;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// if (num != 0) {
|
|
|
|
// resultJson.put("code", "0");
|
|
|
|
// resultJson.put("desc", "只能选择一个站点");
|
|
|
|
// resultJson.put("result", new JSONObject());
|
|
|
|
// return resultJson;
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// //纽迪希亚专用
|
|
|
|
// if (device.getDeviceDriver() instanceof NdxySpecialDeviceDriver) {
|
|
|
|
// ndxySpecialDeviceDriver = (NdxySpecialDeviceDriver) device.getDeviceDriver();
|
|
|
|
// if (ndxySpecialDeviceDriver.getChecked()) {
|
|
|
|
// resultJson.put("code", "0");
|
|
|
|
// resultJson.put("desc", "该站点已经被选中");
|
|
|
|
// resultJson.put("result", new JSONObject());
|
|
|
|
// return resultJson;
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// ndxySpecialDeviceDriver.setChecked(true);
|
|
|
|
//
|
|
|
|
// try {
|
|
|
|
// Thread.sleep(1000);
|
|
|
|
// } catch (InterruptedException e) {
|
|
|
|
// e.printStackTrace();
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// if (!ndxySpecialDeviceDriver.getChecked() && !ndxySpecialDeviceDriver.getChoose()) {
|
|
|
|
// resultJson.put("code", "0");
|
|
|
|
// resultJson.put("desc", "该条线不满足运输条件");
|
|
|
|
// resultJson.put("result", new JSONObject());
|
|
|
|
// return resultJson;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
} |
|
|
|
//清空
|
|
|
|
//强制完成
|
|
|
|
if (type.equals("2")) { |
|
|
|
//纽迪希亚专用
|
|
|
|
if (device.getDeviceDriver() instanceof NdxySpecialDeviceDriver) { |
|
|
@ -578,6 +776,15 @@ public class NdxyHandServiceImpl implements NdxyHandService { |
|
|
|
ndxySpecialDeviceDriver.setChecked(false); |
|
|
|
} |
|
|
|
} |
|
|
|
//入窑
|
|
|
|
if (type.equals("3")) { |
|
|
|
//纽迪希亚专用
|
|
|
|
if (device.getDeviceDriver() instanceof NdxySpecialDeviceDriver) { |
|
|
|
ndxySpecialDeviceDriver = (NdxySpecialDeviceDriver) device.getDeviceDriver(); |
|
|
|
ndxySpecialDeviceDriver.setChecked(false); |
|
|
|
ndxySpecialDeviceDriver.writing(1,4); |
|
|
|
} |
|
|
|
} |
|
|
|
resultJson.put("code", "1"); |
|
|
|
resultJson.put("desc", "更新成功"); |
|
|
|
resultJson.put("result", new JSONObject()); |
|
|
@ -798,6 +1005,17 @@ public class NdxyHandServiceImpl implements NdxyHandService { |
|
|
|
return jo; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Map<String, Object> createChargingTask(Map<String, String> whereJson) { |
|
|
|
String type = whereJson.get("type"); |
|
|
|
AgvService agvService = SpringContextHolder.getBean(AgvServiceImpl.class); |
|
|
|
agvService.createChargingTaskToNDC(type); |
|
|
|
JSONObject jo = new JSONObject(); |
|
|
|
jo.put("code", "1"); |
|
|
|
jo.put("desc", "创建成功"); |
|
|
|
return jo; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Map<String, Object> createTask2(Map<String, String> whereJson) { |
|
|
|
String type = whereJson.get("type"); |
|
|
@ -857,7 +1075,7 @@ public class NdxyHandServiceImpl implements NdxyHandService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public JSONObject point2(Map<String, String> param) { |
|
|
|
// 返回值
|
|
|
|
// 返回值
|
|
|
|
JSONObject resultJSON = new JSONObject(); |
|
|
|
|
|
|
|
// 参数校验
|
|
|
@ -934,7 +1152,7 @@ public class NdxyHandServiceImpl implements NdxyHandService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public JSONObject queryagvStatus() { |
|
|
|
// 获取所有AGV对象
|
|
|
|
// 获取所有AGV对象
|
|
|
|
Map<String, AgvDto> agvMap = agvService.findAllAgvFromCache(); |
|
|
|
|
|
|
|
// 返回数组
|
|
|
@ -956,7 +1174,7 @@ public class NdxyHandServiceImpl implements NdxyHandService { |
|
|
|
agvStatus.put("error", agv.getErrorBuf()); |
|
|
|
break; |
|
|
|
case "IDLE": |
|
|
|
status = "空闲状态"; |
|
|
|
status = "无故障"; |
|
|
|
break; |
|
|
|
case "EXECUTING": |
|
|
|
status = "正在执行运单"; |
|
|
@ -980,4 +1198,5 @@ public class NdxyHandServiceImpl implements NdxyHandService { |
|
|
|
resultJSON.put("result", result); |
|
|
|
return resultJSON; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|