add 修改优化
This commit is contained in:
@@ -214,6 +214,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
jo.put("taskCode", task.getTask_code());
|
||||
jo.put("carId", carno);
|
||||
jo.put("taskType ", task.getTask_type());
|
||||
jo.put("feedbackStatus","applyTake");
|
||||
log.info("请求参数:{}", jo);
|
||||
HttpResponse result = acsToWmsZDService.taskFeedback(jo);
|
||||
JSONObject response = JSONObject.parseObject(result.body());
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.Map;
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "wms接口")
|
||||
@RequestMapping("/wcs/restful/api/v3/system_car")
|
||||
@RequestMapping("/wcs19033/restful/api/v3/system_car")
|
||||
@Slf4j
|
||||
@Lazy
|
||||
@SaIgnore
|
||||
|
||||
@@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "wms接口")
|
||||
@RequestMapping("/restful/api/v3")
|
||||
@RequestMapping("/restful/API/V3")
|
||||
@Slf4j
|
||||
@Service
|
||||
@Lazy
|
||||
|
||||
@@ -58,7 +58,6 @@ public class AcsToWmsZDServiceImpl implements AcsToWmsZDService {
|
||||
@Override
|
||||
public HttpResponse taskFeedback(JSONObject whereJson) {
|
||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||
|
||||
AddressDto addressDto = addressService.findByCode("feedAgvTaskStatus");
|
||||
String methods_url = addressDto.getMethods_url();
|
||||
String url = wmsUrl + methods_url;
|
||||
|
||||
@@ -88,13 +88,13 @@ public class WmsZDToAcsServiceImpl implements WmsZDToAcsService {
|
||||
next_device_code = next_point_code;
|
||||
}
|
||||
|
||||
//查询wcs传过来的起点终点路由
|
||||
List<RouteLineDto> list = routeLineService.getShortPathLines(start_device_code, next_device_code, "normal");
|
||||
if (ObjectUtil.isEmpty(list)) {
|
||||
map.put("responseCode", 1);
|
||||
map.put("responseMessage", "路由不通!");
|
||||
return map;
|
||||
}
|
||||
// //查询wcs传过来的起点终点路由
|
||||
// List<RouteLineDto> list = routeLineService.getShortPathLines(start_device_code, next_device_code, "normal");
|
||||
// if (ObjectUtil.isEmpty(list)) {
|
||||
// map.put("responseCode", 1);
|
||||
// map.put("responseMessage", "路由不通!");
|
||||
// return map;
|
||||
// }
|
||||
//查询任务编码是否重复
|
||||
TaskDto taskDto = taskService.findByCodeFromCache(taskCode);
|
||||
if (taskDto != null) {
|
||||
|
||||
@@ -289,7 +289,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
|
||||
@Override
|
||||
public void create(Instruction dto) {
|
||||
dto = foramte(dto);
|
||||
// dto = foramte(dto);
|
||||
String task_code = dto.getTask_code();
|
||||
TaskDto task = taskService.findByCodeFromCache(task_code);
|
||||
|
||||
@@ -352,34 +352,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
||||
Device startdevice = appService.findDeviceByCode(dto.getStart_device_code());
|
||||
|
||||
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
|
||||
StandardCoveyorControlWithScannerDeviceDriver standardCoveyorControlWithScannerDeviceDriver;
|
||||
|
||||
try {
|
||||
String start_device_code = dto.getStart_device_code();
|
||||
String next_device_code = dto.getNext_device_code();
|
||||
String route_plan_code = task.getRoute_plan_code();
|
||||
List<RouteLineDto> shortPathsList =
|
||||
routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code);
|
||||
RouteLineDto route = null;
|
||||
for (int i = 0; i < shortPathsList.size(); i++) {
|
||||
RouteLineDto routeLineDto = shortPathsList.get(i);
|
||||
String route_device = routeLineDto.getDevice_code();
|
||||
String route_next_device = routeLineDto.getNext_device_code();
|
||||
if (route_device.equals(dto.getStart_device_code())
|
||||
&& route_next_device.equals(dto.getNext_device_code())) {
|
||||
route = routeLineDto;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isEmpty(route)) {
|
||||
throw new BadRequestException("未查询到相关路由!");
|
||||
}
|
||||
|
||||
if (StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
|
||||
|
||||
try {
|
||||
if (StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue().toString(),String.valueOf(AgvSystemEnum.Maigic.getIndex()))) {
|
||||
HttpResponse result = magicAgvService.sendAgvInstToMagic(dto);
|
||||
if (ObjectUtils.isEmpty(result) || result.getStatus() != 200) {
|
||||
@@ -413,18 +386,13 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
ZheDaAgvService zheDaAgvService = SpringContextHolder.getBean(ZheDaAgvService.class);
|
||||
zheDaAgvService.sendAgvInstToAgv(dto);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
dto.setSend_status("2");
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
dto.setSend_status("2");
|
||||
e.printStackTrace();
|
||||
log.error("");
|
||||
}
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
||||
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
||||
wo.insert(json);
|
||||
@@ -585,6 +553,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
|
||||
dto.setCreate_by(currentUsername);
|
||||
dto.setUpdate_by(currentUsername);
|
||||
|
||||
dto.setUpdate_time(now);
|
||||
dto.setCreate_time(now);
|
||||
|
||||
|
||||
@@ -430,7 +430,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(TaskDto dto) throws Exception {
|
||||
dto = foramte(dto);
|
||||
// dto = foramte(dto);
|
||||
if (!StrUtil.isEmpty(dto.getVehicle_code())) {
|
||||
TaskDto vehicle_dto = this.findByContainer(dto.getVehicle_code());
|
||||
if (vehicle_dto != null) {
|
||||
@@ -470,72 +470,72 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
// 判断起点终点设备类型
|
||||
String startDeviceType = deviceAppService.findDeviceTypeByCode(dto.getStart_device_code());
|
||||
String nextDeviceType = deviceAppService.findDeviceTypeByCode(dto.getNext_device_code());
|
||||
if (routelineserver
|
||||
.getShortPathLines(dto.getStart_device_code(), dto.getNext_device_code(), plan_code)
|
||||
.size()
|
||||
== 0) {
|
||||
throw new Exception(dto.getStart_point_code() + "->" + dto.getNext_point_code() + "路由不通!");
|
||||
}
|
||||
// if (routelineserver
|
||||
// .getShortPathLines(dto.getStart_device_code(), dto.getNext_device_code(), plan_code)
|
||||
// .size()
|
||||
// == 0) {
|
||||
// throw new Exception(dto.getStart_point_code() + "->" + dto.getNext_point_code() + "路由不通!");
|
||||
// }
|
||||
String createTaskCheck = paramService.findByCode(AcsConfig.CREATETASKCHECK).getValue();
|
||||
DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class);
|
||||
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
||||
Device nextdevice = appService.findDeviceByCode(next_device_code);
|
||||
Device startdevice = appService.findDeviceByCode(start_device_code);
|
||||
dto.setMaterial(startdevice.getMaterial_type());
|
||||
if (StrUtil.equals(createTaskCheck, "1")) {
|
||||
// 判断起点为输送设备
|
||||
if (StrUtil.equals(DeviceType.conveyor.toString(), startDeviceType)) {
|
||||
}
|
||||
|
||||
if (StrUtil.equals(DeviceType.conveyor.toString(), nextDeviceType)) {
|
||||
}
|
||||
} else {
|
||||
// 判断起点为输送设备
|
||||
if (StrUtil.equals(DeviceType.conveyor.toString(), startDeviceType)) {
|
||||
}
|
||||
|
||||
if (StrUtil.equals(DeviceType.conveyor.toString(), nextDeviceType)) {
|
||||
// if (nextdevice.getDeviceDriver() instanceof
|
||||
// StandardOrdinarySiteDeviceDriver) {
|
||||
// standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver)
|
||||
// nextdevice.getDeviceDriver();
|
||||
// if (nextdevice.getHas_goods() != 0) {
|
||||
// throw new Exception("任务终点需满足无货!");
|
||||
// }
|
||||
// }
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
JSONObject jo2 = new JSONObject();
|
||||
if (!StrUtil.isEmpty(dto.getMaterial())) {
|
||||
if (!StrUtil.equals(dto.getMaterial(), "1")) {
|
||||
jo.put("hasGoodStatus", "2");
|
||||
jo.put("material_type", dto.getMaterial());
|
||||
} else {
|
||||
jo.put("hasGoodStatus", "1");
|
||||
jo.put("material_type", "1");
|
||||
}
|
||||
|
||||
} else {
|
||||
jo.put("hasGoodStatus", "1");
|
||||
jo.put("material_type", "1");
|
||||
}
|
||||
jo.put("device_code", dto.getStart_device_code());
|
||||
jo.put("quantity", dto.getQuantity());
|
||||
jo.put("remark", dto.getRemark());
|
||||
jo.put("batch", startdevice.getBatch());
|
||||
jo.put("islock", "true");
|
||||
deviceService.changeDeviceStatus(jo);
|
||||
Device deviceByCode = deviceAppService.findDeviceByCode(dto.getNext_device_code());
|
||||
jo2.put("device_code", dto.getNext_device_code());
|
||||
jo2.put("hasGoodStatus", deviceByCode.getHas_goods());
|
||||
jo2.put("quantity", deviceByCode.getQuantity());
|
||||
jo2.put("remark", deviceByCode.getRemark());
|
||||
jo2.put("material_type", deviceByCode.getMaterial_type());
|
||||
jo2.put("batch", deviceByCode.getBatch());
|
||||
jo2.put("islock", "true");
|
||||
deviceService.changeDeviceStatus(jo2);
|
||||
}
|
||||
}
|
||||
// dto.setMaterial(startdevice.getMaterial_type());
|
||||
// if (StrUtil.equals(createTaskCheck, "1")) {
|
||||
// // 判断起点为输送设备
|
||||
// if (StrUtil.equals(DeviceType.conveyor.toString(), startDeviceType)) {
|
||||
// }
|
||||
//
|
||||
// if (StrUtil.equals(DeviceType.conveyor.toString(), nextDeviceType)) {
|
||||
// }
|
||||
// } else {
|
||||
// // 判断起点为输送设备
|
||||
// if (StrUtil.equals(DeviceType.conveyor.toString(), startDeviceType)) {
|
||||
// }
|
||||
//
|
||||
// if (StrUtil.equals(DeviceType.conveyor.toString(), nextDeviceType)) {
|
||||
// // if (nextdevice.getDeviceDriver() instanceof
|
||||
// // StandardOrdinarySiteDeviceDriver) {
|
||||
// // standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver)
|
||||
// // nextdevice.getDeviceDriver();
|
||||
// // if (nextdevice.getHas_goods() != 0) {
|
||||
// // throw new Exception("任务终点需满足无货!");
|
||||
// // }
|
||||
// // }
|
||||
//
|
||||
// JSONObject jo = new JSONObject();
|
||||
// JSONObject jo2 = new JSONObject();
|
||||
// if (!StrUtil.isEmpty(dto.getMaterial())) {
|
||||
// if (!StrUtil.equals(dto.getMaterial(), "1")) {
|
||||
// jo.put("hasGoodStatus", "2");
|
||||
// jo.put("material_type", dto.getMaterial());
|
||||
// } else {
|
||||
// jo.put("hasGoodStatus", "1");
|
||||
// jo.put("material_type", "1");
|
||||
// }
|
||||
//
|
||||
// } else {
|
||||
// jo.put("hasGoodStatus", "1");
|
||||
// jo.put("material_type", "1");
|
||||
// }
|
||||
// jo.put("device_code", dto.getStart_device_code());
|
||||
// jo.put("quantity", dto.getQuantity());
|
||||
// jo.put("remark", dto.getRemark());
|
||||
// jo.put("batch", startdevice.getBatch());
|
||||
// jo.put("islock", "true");
|
||||
// deviceService.changeDeviceStatus(jo);
|
||||
// Device deviceByCode = deviceAppService.findDeviceByCode(dto.getNext_device_code());
|
||||
// jo2.put("device_code", dto.getNext_device_code());
|
||||
// jo2.put("hasGoodStatus", deviceByCode.getHas_goods());
|
||||
// jo2.put("quantity", deviceByCode.getQuantity());
|
||||
// jo2.put("remark", deviceByCode.getRemark());
|
||||
// jo2.put("material_type", deviceByCode.getMaterial_type());
|
||||
// jo2.put("batch", deviceByCode.getBatch());
|
||||
// jo2.put("islock", "true");
|
||||
// deviceService.changeDeviceStatus(jo2);
|
||||
// }
|
||||
// }
|
||||
WQLObject wo = WQLObject.getWQLObject("acs_task");
|
||||
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
||||
|
||||
|
||||
@@ -75,37 +75,37 @@ public class AutoCreateInst {
|
||||
continue;
|
||||
}
|
||||
|
||||
//校验路由关系
|
||||
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code);
|
||||
if (ObjectUtils.isEmpty(shortPathsList)) {
|
||||
acsTask.setRemark("路由不通无法生成指令");
|
||||
taskserver.updateByCodeFromCache(acsTask);
|
||||
continue;
|
||||
}
|
||||
// //校验路由关系
|
||||
// List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code);
|
||||
// if (ObjectUtils.isEmpty(shortPathsList)) {
|
||||
// acsTask.setRemark("路由不通无法生成指令");
|
||||
// taskserver.updateByCodeFromCache(acsTask);
|
||||
// continue;
|
||||
// }
|
||||
|
||||
if (!StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
|
||||
continue;
|
||||
}
|
||||
// if (!StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
|
||||
// continue;
|
||||
// }
|
||||
|
||||
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);
|
||||
// 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);
|
||||
|
||||
if (StrUtil.equals(appService.findDeviceTypeByCode(next_device_code), "storage")) {
|
||||
next_point_code = next_device_code + "-" + acsTask.getTo_y() + "-" + acsTask.getTo_z();
|
||||
} else {
|
||||
next_point_code = next_device_code;
|
||||
}
|
||||
// if (StrUtil.equals(appService.findDeviceTypeByCode(next_device_code), "storage")) {
|
||||
// next_point_code = next_device_code + "-" + acsTask.getTo_y() + "-" + acsTask.getTo_z();
|
||||
// } else {
|
||||
// next_point_code = next_device_code;
|
||||
// }
|
||||
|
||||
|
||||
Instruction instdto = new Instruction();
|
||||
|
||||
@@ -6,7 +6,7 @@ spring:
|
||||
druid:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.2.206}:${DB_PORT:3306}/${DB_NAME:gaosheng_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:10.4.46.150}:${DB_PORT:3306}/${DB_NAME:gaosheng_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
|
||||
username: ${DB_USER:root}
|
||||
password: ${DB_PWD:123456}
|
||||
# 初始连接数
|
||||
|
||||
@@ -2,6 +2,6 @@ ENV = 'production'
|
||||
|
||||
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
|
||||
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
|
||||
VUE_APP_BASE_API = 'http:// 192.168.69.32:8011'
|
||||
VUE_APP_BASE_API = 'http:// 10.4.46.150:8011'
|
||||
# 如果接口是 http 形式, wss 需要改为 ws
|
||||
VUE_APP_WS_API = 'ws:// 192.168.69.32:8011'
|
||||
VUE_APP_WS_API = 'ws:// 10.4.46.150:8011'
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -3,7 +3,7 @@ window.g = {
|
||||
VUE_APP_BASE_API: 'http://127.0.0.1:8010'
|
||||
},
|
||||
prod: {
|
||||
VUE_APP_BASE_API: 'http://192.168.69.32:8011'
|
||||
VUE_APP_BASE_API: 'http://10.4.46.150:8011'
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user