更新
This commit is contained in:
@@ -46,4 +46,11 @@ public class AcsToWmsZDController {
|
|||||||
public ResponseEntity<Object> taskDeprecate(@RequestBody Map whereJson) throws Exception {
|
public ResponseEntity<Object> taskDeprecate(@RequestBody Map whereJson) throws Exception {
|
||||||
return new ResponseEntity<>(acsToWmsZDService.taskDeprecate(whereJson), HttpStatus.OK);
|
return new ResponseEntity<>(acsToWmsZDService.taskDeprecate(whereJson), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/checkDeviceStatus")
|
||||||
|
@Log("设备状态获取")
|
||||||
|
@ApiOperation("设备状态获取")
|
||||||
|
public ResponseEntity<Object> checkDeviceStatus(@RequestBody Map whereJson) throws Exception {
|
||||||
|
return new ResponseEntity<>(acsToWmsZDService.checkDeviceStatus(whereJson), HttpStatus.OK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,5 +36,5 @@ public interface AcsToWmsZDService {
|
|||||||
*
|
*
|
||||||
* @return Map<String, Object>
|
* @return Map<String, Object>
|
||||||
*/
|
*/
|
||||||
HttpResponse deviceStatusQuery(JSONObject whereJson) throws Exception;
|
Map<String, Object> checkDeviceStatus(Map whereJson) throws Exception;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,30 +8,26 @@ import cn.hutool.http.HttpRequest;
|
|||||||
import cn.hutool.http.HttpResponse;
|
import cn.hutool.http.HttpResponse;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.sf.json.JSONArray;
|
|
||||||
import net.sf.json.JSONObject;
|
import net.sf.json.JSONObject;
|
||||||
import org.nl.acs.config.AcsConfig;
|
import org.nl.acs.config.AcsConfig;
|
||||||
import org.nl.acs.config.server.AcsConfigService;
|
import org.nl.acs.config.server.AcsConfigService;
|
||||||
import org.nl.acs.device.address.service.AddressService;
|
import org.nl.acs.device.address.service.AddressService;
|
||||||
import org.nl.acs.device.address.service.dto.AddressDto;
|
import org.nl.acs.device.address.service.dto.AddressDto;
|
||||||
import org.nl.acs.device.service.DeviceService;
|
import org.nl.acs.device.service.DeviceService;
|
||||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
import org.nl.acs.device_driver.standard_conveyor_line.StandardConveyorLineDeviceDriver;
|
||||||
import org.nl.acs.ext.wms.service.AcsToWmsZDService;
|
import org.nl.acs.ext.wms.service.AcsToWmsZDService;
|
||||||
import org.nl.acs.instruction.service.InstructionService;
|
|
||||||
import org.nl.acs.instruction.service.dto.Instruction;
|
|
||||||
import org.nl.acs.log.service.LogServer;
|
import org.nl.acs.log.service.LogServer;
|
||||||
|
import org.nl.acs.opc.Device;
|
||||||
|
import org.nl.acs.opc.DeviceAppService;
|
||||||
import org.nl.acs.route.service.RouteLineService;
|
import org.nl.acs.route.service.RouteLineService;
|
||||||
import org.nl.acs.route.service.dto.RouteLineDto;
|
import org.nl.acs.route.service.dto.RouteLineDto;
|
||||||
import org.nl.acs.task.service.TaskService;
|
import org.nl.acs.task.service.TaskService;
|
||||||
import org.nl.acs.task.service.dto.TaskDto;
|
import org.nl.acs.task.service.dto.TaskDto;
|
||||||
import org.nl.exception.BadRequestException;
|
|
||||||
import org.nl.exception.WDKException;
|
|
||||||
import org.nl.utils.SpringContextHolder;
|
|
||||||
import org.nl.wql.core.bean.WQLObject;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -40,6 +36,8 @@ import java.util.Map;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class AcsToWmsZDServiceImpl implements AcsToWmsZDService {
|
public class AcsToWmsZDServiceImpl implements AcsToWmsZDService {
|
||||||
|
|
||||||
|
private final DeviceAppService deviceAppService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
RouteLineService routeLineService;
|
RouteLineService routeLineService;
|
||||||
|
|
||||||
@@ -64,11 +62,8 @@ public class AcsToWmsZDServiceImpl implements AcsToWmsZDService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> taskCreate(JSONObject whereJson) {
|
public Map<String, Object> taskCreate(JSONObject whereJson) {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
JSONObject resultJson = new JSONObject();
|
|
||||||
log.info("taskCreate--------------:输入参数:" + whereJson.toString());
|
log.info("taskCreate--------------:输入参数:" + whereJson.toString());
|
||||||
try {
|
|
||||||
JSONArray errArr = new JSONArray();
|
|
||||||
|
|
||||||
//获取甲方wcs传过来的参数
|
//获取甲方wcs传过来的参数
|
||||||
String houseCode = whereJson.optString("houseCode");
|
String houseCode = whereJson.optString("houseCode");
|
||||||
@@ -87,16 +82,24 @@ public class AcsToWmsZDServiceImpl implements AcsToWmsZDService {
|
|||||||
String next_device_code = "";
|
String next_device_code = "";
|
||||||
//判断必填项是否为空
|
//判断必填项是否为空
|
||||||
if (StrUtil.isEmpty(taskCode)) {
|
if (StrUtil.isEmpty(taskCode)) {
|
||||||
throw new WDKException("任务号不能为空");
|
map.put("responseCode", 1);
|
||||||
|
map.put("responseMessage", "任务号不能为空");
|
||||||
|
return map;
|
||||||
}
|
}
|
||||||
if (StrUtil.isEmpty(start_point_code)) {
|
if (StrUtil.isEmpty(start_point_code)) {
|
||||||
throw new WDKException("起点不能为空");
|
map.put("responseCode", 1);
|
||||||
|
map.put("responseMessage", "起点不能为空");
|
||||||
|
return map;
|
||||||
}
|
}
|
||||||
if (StrUtil.isEmpty(next_point_code)) {
|
if (StrUtil.isEmpty(next_point_code)) {
|
||||||
throw new WDKException("终点不能为空");
|
map.put("responseCode", 1);
|
||||||
|
map.put("responseMessage", "终点不能为空");
|
||||||
|
return map;
|
||||||
}
|
}
|
||||||
if (StrUtil.isEmpty(containerCode)) {
|
if (StrUtil.isEmpty(containerCode)) {
|
||||||
throw new WDKException("容器编号不能为空");
|
map.put("responseCode", 1);
|
||||||
|
map.put("responseMessage", "容器编号不能为空");
|
||||||
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (start_point_code.indexOf("-") > 0) {
|
if (start_point_code.indexOf("-") > 0) {
|
||||||
@@ -116,18 +119,24 @@ public class AcsToWmsZDServiceImpl implements AcsToWmsZDService {
|
|||||||
//查询wcs传过来的起点终点路由
|
//查询wcs传过来的起点终点路由
|
||||||
List<RouteLineDto> list = routeLineService.getShortPathLines(start_device_code, next_device_code, "normal");
|
List<RouteLineDto> list = routeLineService.getShortPathLines(start_device_code, next_device_code, "normal");
|
||||||
if (ObjectUtil.isEmpty(list)) {
|
if (ObjectUtil.isEmpty(list)) {
|
||||||
throw new WDKException("路由不通!");
|
map.put("responseCode", 1);
|
||||||
|
map.put("responseMessage", "路由不通!");
|
||||||
|
return map;
|
||||||
}
|
}
|
||||||
//查询任务编码是否重复
|
//查询任务编码是否重复
|
||||||
TaskDto taskDto = taskService.findByCodeFromCache(taskCode);
|
TaskDto taskDto = taskService.findByCodeFromCache(taskCode);
|
||||||
if (taskDto != null) {
|
if (taskDto != null) {
|
||||||
throw new WDKException("不能存在相同的任务号!");
|
map.put("responseCode", 1);
|
||||||
|
map.put("responseMessage", "不能存在相同的任务号!");
|
||||||
|
return map;
|
||||||
}
|
}
|
||||||
//判断载具编码是否相同
|
//判断载具编码是否相同
|
||||||
if (!StrUtil.isEmpty(containerCode)) {
|
if (!StrUtil.isEmpty(containerCode)) {
|
||||||
TaskDto vehicle_dto = taskService.findByContainer(containerCode);
|
TaskDto vehicle_dto = taskService.findByContainer(containerCode);
|
||||||
if (vehicle_dto != null) {
|
if (vehicle_dto != null) {
|
||||||
throw new WDKException("已存在该容器号的任务!");
|
map.put("responseCode", 1);
|
||||||
|
map.put("responseMessage", "已存在该容器号的任务!");
|
||||||
|
return map;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,36 +158,21 @@ public class AcsToWmsZDServiceImpl implements AcsToWmsZDService {
|
|||||||
taskService.create(task_dto);
|
taskService.create(task_dto);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
JSONObject json = new JSONObject();
|
map.put("responseCode", 1);
|
||||||
json.put("task_code", taskCode);
|
map.put("responseMessage", e.getMessage());
|
||||||
json.put("message", e.getMessage());
|
return map;
|
||||||
errArr.add(json);
|
|
||||||
}
|
}
|
||||||
|
map.put("responseCode", 0);
|
||||||
if (ObjectUtil.isEmpty(errArr)) {
|
map.put("responseMessage", "创建任务成功!");
|
||||||
resultJson.put("responseCode", 0);
|
map.put("parameters", new HashMap<>());
|
||||||
resultJson.put("responseMessage", "操作成功");
|
return map;
|
||||||
} else {
|
|
||||||
resultJson.put("responseCode", 400);
|
|
||||||
resultJson.put("responseMessage", "操作失败");
|
|
||||||
}
|
|
||||||
resultJson.put("parameters", errArr);
|
|
||||||
log.info("taskCreate--------------:输出参数:" + resultJson.toString());
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
resultJson.put("responseCode", 400);
|
|
||||||
resultJson.put("parameters", e.getMessage());
|
|
||||||
resultJson.put("responseMessage", "操作失败");
|
|
||||||
log.info("taskCreate--------------:输出参数:" + resultJson.toString());
|
|
||||||
}
|
|
||||||
return resultJson;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> taskFeedback(Map whereJson) {
|
public Map<String, Object> taskFeedback(Map whereJson) {
|
||||||
log.info("taskFeedback-----请求参数{}", whereJson.toString());
|
log.info("taskFeedback-----请求参数{}", whereJson.toString());
|
||||||
String taskCode = (String) whereJson.get("task_code");
|
String taskCode = MapUtil.getStr(whereJson, "taskCode");
|
||||||
String vehicle_code = (String) whereJson.get("carId");
|
String carId = MapUtil.getStr(whereJson, "carId");
|
||||||
HttpResponse result = null;
|
HttpResponse result = null;
|
||||||
AddressDto addressDto = addressService.findByCode("taskFeedback");
|
AddressDto addressDto = addressService.findByCode("taskFeedback");
|
||||||
String wcsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WCSURL);
|
String wcsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WCSURL);
|
||||||
@@ -189,47 +183,22 @@ public class AcsToWmsZDServiceImpl implements AcsToWmsZDService {
|
|||||||
.header("Authorization", token).body(String.valueOf(whereJson))
|
.header("Authorization", token).body(String.valueOf(whereJson))
|
||||||
.execute();
|
.execute();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String msg = e.getMessage();
|
logServer.log(taskCode, "taskFeedback", "error", whereJson.toString(), result.body(), String.valueOf(result.getStatus()), url, carId);
|
||||||
//网络不通
|
Map<String, Object> map = new HashMap<>();
|
||||||
System.out.println(msg);
|
map.put("responseCode", 1);
|
||||||
logServer.log(taskCode, "taskFeedback", "error", whereJson.toString(), msg, String.valueOf(result.getStatus()), url, vehicle_code);
|
map.put("responseMessage", e.getMessage());
|
||||||
log.info("taskFeedback-----异常输出参数{}", msg);
|
map.put("parameters", new HashMap<>());
|
||||||
|
return map;
|
||||||
}
|
}
|
||||||
String type = "";
|
logServer.log(taskCode, "taskFeedback", "success", whereJson.toString(), result.body(), String.valueOf(result.getStatus()), url, carId);
|
||||||
if(!ObjectUtil.isEmpty(result)){
|
|
||||||
if (result.getStatus() == 0) {
|
|
||||||
type = "info";
|
|
||||||
} else {
|
|
||||||
type = "error";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
type = "error";
|
|
||||||
}
|
|
||||||
|
|
||||||
logServer.log(taskCode, "taskFeedback", type, whereJson.toString(), result.body(), String.valueOf(result.getStatus()), url, vehicle_code);
|
|
||||||
JSONObject jo = JSONObject.fromObject(result.body());
|
JSONObject jo = JSONObject.fromObject(result.body());
|
||||||
log.info("taskFeedback-----输出参数{}", jo.toString());
|
|
||||||
return jo;
|
return jo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> taskDeprecate(Map whereJson) throws Exception {
|
public Map<String, Object> taskDeprecate(Map whereJson) {
|
||||||
InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class);
|
|
||||||
log.info("taskDeprecate--------------:输入参数" + whereJson.toString());
|
log.info("taskDeprecate--------------:输入参数" + whereJson.toString());
|
||||||
String taskCode = MapUtil.getStr(whereJson, "task_code");
|
String taskCode = MapUtil.getStr(whereJson, "task_code");
|
||||||
String houseCode =MapUtil.getStr(whereJson,"taskhouseCode_code");
|
|
||||||
Object parameters = whereJson.get("parameters");
|
|
||||||
String systemCode = MapUtil.getStr(whereJson,"systemCode");
|
|
||||||
String reason = MapUtil.getStr(whereJson,"reason");
|
|
||||||
if(ObjectUtil.isEmpty(taskCode)){
|
|
||||||
throw new BadRequestException("任务编号不能为空");
|
|
||||||
}
|
|
||||||
JSONObject map = new JSONObject();
|
|
||||||
map.put("houseCode",houseCode);
|
|
||||||
map.put("systemCode",systemCode);
|
|
||||||
map.put("parameters",parameters);
|
|
||||||
map.put("taskCode",taskCode);
|
|
||||||
map.put("reason",reason);
|
|
||||||
HttpResponse result = null;
|
HttpResponse result = null;
|
||||||
AddressDto addressDto = addressService.findByCode("deprecateTask");
|
AddressDto addressDto = addressService.findByCode("deprecateTask");
|
||||||
String wcsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WCSURL);
|
String wcsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WCSURL);
|
||||||
@@ -240,50 +209,57 @@ public class AcsToWmsZDServiceImpl implements AcsToWmsZDService {
|
|||||||
.header("Authorization", token).body(String.valueOf(whereJson))
|
.header("Authorization", token).body(String.valueOf(whereJson))
|
||||||
.execute();
|
.execute();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String msg = e.getMessage();
|
e.printStackTrace();
|
||||||
//网络不通
|
logServer.log(taskCode, "taskFeedback", "error", whereJson.toString(), e.getMessage(), String.valueOf(result.getStatus()), url, "");
|
||||||
System.out.println(msg);
|
Map<String, Object> map = new HashMap<>();
|
||||||
logServer.log(taskCode, "taskFeedback", "error", whereJson.toString(), msg, String.valueOf(result.getStatus()), url, "");
|
map.put("responseCode", 1);
|
||||||
log.info("taskFeedback-----异常输出参数{}", msg);
|
map.put("responseMessage", e.getMessage());
|
||||||
|
return map;
|
||||||
}
|
}
|
||||||
String type = "";
|
logServer.log(taskCode, "taskDeprecate", "success", whereJson.toString(), result.body(), String.valueOf(result.getStatus()), url, "");
|
||||||
if(!ObjectUtil.isEmpty(result)){
|
|
||||||
if (result.getStatus() == 0) {
|
|
||||||
type = "info";
|
|
||||||
} else {
|
|
||||||
type = "error";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
type = "error";
|
|
||||||
}
|
|
||||||
|
|
||||||
logServer.log(taskCode, "taskDeprecate", type, whereJson.toString(), result.body(), String.valueOf(result.getStatus()), url, "");
|
|
||||||
JSONObject jo = JSONObject.fromObject(result.body());
|
JSONObject jo = JSONObject.fromObject(result.body());
|
||||||
log.info("taskDeprecate-----输出参数{}", jo.toString());
|
log.info("taskDeprecate-----输出参数{}", jo.toString());
|
||||||
return jo;
|
return jo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResponse deviceStatusQuery(JSONObject whereJson) throws Exception {
|
public Map<String, Object> checkDeviceStatus(Map whereJson) throws Exception {
|
||||||
String wmsUrl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL);
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
String systemCode = MapUtil.getStr(whereJson, "systemCode");
|
||||||
|
String houseCode = MapUtil.getStr(whereJson, "houseCode");
|
||||||
|
String parameters = MapUtil.getStr(whereJson, "parameters");
|
||||||
|
String deviceCode = MapUtil.getStr(whereJson, "deviceCode");
|
||||||
|
if (StrUtil.isEmpty(deviceCode)) {
|
||||||
|
map.put("responseCode", 1);
|
||||||
|
map.put("responseMessage", "请求设备号不能为空!");
|
||||||
|
map.put("parameters", new HashMap<>());
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
Device device = deviceAppService.findDeviceByCode(deviceCode);
|
||||||
|
StandardConveyorLineDeviceDriver standardConveyorLineDeviceDriver;
|
||||||
|
int status = 0;
|
||||||
|
Boolean hasGoods = false;
|
||||||
|
String statusDescription = "正常";
|
||||||
|
if (device.getDeviceDriver() instanceof StandardConveyorLineDeviceDriver) {
|
||||||
|
standardConveyorLineDeviceDriver = (StandardConveyorLineDeviceDriver) device.getDeviceDriver();
|
||||||
|
status = standardConveyorLineDeviceDriver.getError();
|
||||||
|
int move = standardConveyorLineDeviceDriver.getMove();
|
||||||
|
if (status != 0) {
|
||||||
|
statusDescription = "异常";
|
||||||
|
}
|
||||||
|
if (move == 1) {
|
||||||
|
hasGoods = true;
|
||||||
|
}
|
||||||
|
} else if (1 == 1) {
|
||||||
|
|
||||||
AddressDto addressDto = addressService.findByCode("deviceStatusQuery");
|
}
|
||||||
String methods_url = addressDto.getMethods_url();
|
map.put("responseCode", 0);
|
||||||
String url = wmsUrl + methods_url;
|
map.put("responseMessage", "响应成功!");
|
||||||
HttpResponse result = null;
|
map.put("parameters", new HashMap<>());
|
||||||
log.info("feedWeighing----请求参数{}", whereJson);
|
map.put("status", status);
|
||||||
|
map.put("statusDescription", statusDescription);
|
||||||
|
map.put("hasGoods", hasGoods);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
result = HttpRequest.post(url)
|
|
||||||
.body(String.valueOf(whereJson))
|
|
||||||
.execute();
|
|
||||||
System.out.println(result);
|
|
||||||
log.info("feedWeighing----返回参数{}", result);
|
|
||||||
} catch (Exception e) {
|
|
||||||
String msg = e.getMessage();
|
|
||||||
//网络不通
|
|
||||||
System.out.println(msg);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ public class AgvToAcsServiceImpl implements AgvToAcsService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> waitpointRequest(JSONObject param) {
|
public Map<String, Object> waitpointRequest(JSONObject param) {
|
||||||
// TODO 待定
|
|
||||||
String inst_code = param.getString("task_code");
|
String inst_code = param.getString("task_code");
|
||||||
String address = param.getString("address");
|
String address = param.getString("address");
|
||||||
StandardConveyorLineDeviceDriver standardConveyorLineDeviceDriver;
|
StandardConveyorLineDeviceDriver standardConveyorLineDeviceDriver;
|
||||||
@@ -44,7 +43,6 @@ public class AgvToAcsServiceImpl implements AgvToAcsService {
|
|||||||
map.put("status", 400);
|
map.put("status", 400);
|
||||||
map.put("message", "请求失败,指令为空!");
|
map.put("message", "请求失败,指令为空!");
|
||||||
logServer.log("", "waitpointRequest", "erro", param.toString(), String.valueOf(map), "400", "api/agv/waitpointRequest", "");
|
logServer.log("", "waitpointRequest", "erro", param.toString(), String.valueOf(map), "400", "api/agv/waitpointRequest", "");
|
||||||
// return map;
|
|
||||||
throw new BadRequestException("请求失败,指令为空!");
|
throw new BadRequestException("请求失败,指令为空!");
|
||||||
}
|
}
|
||||||
String task_code = instructionDto.getTask_code();
|
String task_code = instructionDto.getTask_code();
|
||||||
@@ -156,7 +154,7 @@ public class AgvToAcsServiceImpl implements AgvToAcsService {
|
|||||||
logServer.log(task_code, "waitpointRequest", type, param.toString(), String.valueOf(map), "400", "api/agv/waitpointRequest", instructionDto.getVehicle_code());
|
logServer.log(task_code, "waitpointRequest", type, param.toString(), String.valueOf(map), "400", "api/agv/waitpointRequest", instructionDto.getVehicle_code());
|
||||||
throw new BadRequestException("请求失败,终点位置无货!");
|
throw new BadRequestException("请求失败,终点位置无货!");
|
||||||
} else {
|
} else {
|
||||||
standardConveyorLineDeviceDriver.writing(1, 2);
|
standardConveyorLineDeviceDriver.writing(1, 3);
|
||||||
feedMap.put("feedbackStatus", "putFinish");
|
feedMap.put("feedbackStatus", "putFinish");
|
||||||
Map<String, Object> feedback = acsToWmsZDService.taskFeedback(feedMap);
|
Map<String, Object> feedback = acsToWmsZDService.taskFeedback(feedMap);
|
||||||
int responseCode = (int) feedback.get("responseCode");
|
int responseCode = (int) feedback.get("responseCode");
|
||||||
@@ -182,6 +180,5 @@ public class AgvToAcsServiceImpl implements AgvToAcsService {
|
|||||||
map.put("message", "请求失败,IN OUT 站点错误!");
|
map.put("message", "请求失败,IN OUT 站点错误!");
|
||||||
logServer.log(task_code, "waitpointRequest", "erro", param.toString(), String.valueOf(map), "400", "api/agv/waitpointRequest", instructionDto.getVehicle_code());
|
logServer.log(task_code, "waitpointRequest", "erro", param.toString(), String.valueOf(map), "400", "api/agv/waitpointRequest", instructionDto.getVehicle_code());
|
||||||
throw new BadRequestException("请求失败,终点位置无货!");
|
throw new BadRequestException("请求失败,终点位置无货!");
|
||||||
//return map;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,6 +108,14 @@ public class InstructionController {
|
|||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Log("强制取消指令")
|
||||||
|
@ApiOperation("强制取消指令")
|
||||||
|
@PostMapping(value = "/forceCancel/{id}")
|
||||||
|
public ResponseEntity<Object> forceCancel(@RequestBody String id) throws Exception {
|
||||||
|
instructionService.cancelNOSendAgv(id);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
@Log("导出指令")
|
@Log("导出指令")
|
||||||
@ApiOperation("导出指令")
|
@ApiOperation("导出指令")
|
||||||
@GetMapping(value = "/download")
|
@GetMapping(value = "/download")
|
||||||
|
|||||||
@@ -774,7 +774,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
|||||||
if (!StrUtil.startWith(entity.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
|
if (!StrUtil.startWith(entity.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
|
||||||
JSONObject map = new JSONObject();
|
JSONObject map = new JSONObject();
|
||||||
map.put("task_code",entity.getTask_code());
|
map.put("task_code",entity.getTask_code());
|
||||||
// map.put("reason",entity.getTask_code());
|
map.put("reason","acs手动取消!");
|
||||||
acsToWmsZDService.taskDeprecate(map);
|
acsToWmsZDService.taskDeprecate(map);
|
||||||
}
|
}
|
||||||
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(entity.getStart_device_code(), entity.getNext_device_code(), entity.getRoute_plan_code());
|
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(entity.getStart_device_code(), entity.getNext_device_code(), entity.getRoute_plan_code());
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ spring:
|
|||||||
multi-statement-alagvslow: true
|
multi-statement-alagvslow: true
|
||||||
redis:
|
redis:
|
||||||
#数据库索引
|
#数据库索引
|
||||||
database: ${REDIS_DB:0}
|
database: ${REDIS_DB:11}
|
||||||
host: ${REDIS_HOST:127.0.0.1}
|
host: ${REDIS_HOST:127.0.0.1}
|
||||||
port: ${REDIS_PORT:6379}
|
port: ${REDIS_PORT:6379}
|
||||||
password: ${REDIS_PWD:}
|
password: ${REDIS_PWD:}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ spring:
|
|||||||
freemarker:
|
freemarker:
|
||||||
check-template-location: false
|
check-template-location: false
|
||||||
profiles:
|
profiles:
|
||||||
active: prod
|
active: dev
|
||||||
jackson:
|
jackson:
|
||||||
time-zone: GMT+8
|
time-zone: GMT+8
|
||||||
data:
|
data:
|
||||||
|
|||||||
@@ -159,6 +159,7 @@
|
|||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'a')">完成</el-dropdown-item>
|
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'a')">完成</el-dropdown-item>
|
||||||
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'b')">取消</el-dropdown-item>
|
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'b')">取消</el-dropdown-item>
|
||||||
|
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'c')">强制取消</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</template>
|
</template>
|
||||||
@@ -290,6 +291,14 @@ export default {
|
|||||||
console.log(err.response.data.message)
|
console.log(err.response.data.message)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
forceCancel(index, row) {
|
||||||
|
crudInstruction.forceCancel(row.instruction_id).then(res => {
|
||||||
|
this.crud.toQuery()
|
||||||
|
this.crud.notify('强制取消成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err.response.data.message)
|
||||||
|
})
|
||||||
|
},
|
||||||
reload() {
|
reload() {
|
||||||
crudInstruction.reload().then(res => {
|
crudInstruction.reload().then(res => {
|
||||||
this.crud.toQuery()
|
this.crud.toQuery()
|
||||||
@@ -313,6 +322,9 @@ export default {
|
|||||||
case 'b':// 取消
|
case 'b':// 取消
|
||||||
this.cancel(command.index, command.row)
|
this.cancel(command.index, command.row)
|
||||||
break
|
break
|
||||||
|
case 'c':// 强制取消
|
||||||
|
this.forceCancel(command.index, command.row)
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -315,6 +315,13 @@ export default {
|
|||||||
this.form.next_device_code = Array.of(data.form.next_device_code.split('').join(''))
|
this.form.next_device_code = Array.of(data.form.next_device_code.split('').join(''))
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
|
[CRUD.HOOK.beforeSubmit](data) {
|
||||||
|
if (this.crud.status.edit === 1) {
|
||||||
|
this.form.device_code = data.form.device_code.join('')
|
||||||
|
this.form.next_device_code = data.form.next_device_code.join('')
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
},
|
||||||
// 改变状态
|
// 改变状态
|
||||||
changeEnabled(data) {
|
changeEnabled(data) {
|
||||||
var msg = '停用'
|
var msg = '停用'
|
||||||
|
|||||||
Reference in New Issue
Block a user