Browse Source

add 修改优化

master
zhoujj 1 month ago
parent
commit
c51180e2ad
  1. 1
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java
  2. 2
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/AcsToWmsZDController.java
  3. 2
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsZDToAcsController.java
  4. 1
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsZDServiceImpl.java
  5. 14
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsZDToAcsServiceImpl.java
  6. 39
      acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java
  7. 124
      acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java
  8. 62
      acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java
  9. 2
      acs/nladmin-system/src/main/resources/config/application-prod.yml
  10. 4
      acs/nladmin-ui/.env.production
  11. BIN
      acs/nladmin-ui/dist (2).zip
  12. BIN
      acs/nladmin-ui/dist.zip
  13. 2
      acs/nladmin-ui/public/config.js

1
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java

@ -214,6 +214,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
jo.put("taskCode", task.getTask_code()); jo.put("taskCode", task.getTask_code());
jo.put("carId", carno); jo.put("carId", carno);
jo.put("taskType ", task.getTask_type()); jo.put("taskType ", task.getTask_type());
jo.put("feedbackStatus","applyTake");
log.info("请求参数:{}", jo); log.info("请求参数:{}", jo);
HttpResponse result = acsToWmsZDService.taskFeedback(jo); HttpResponse result = acsToWmsZDService.taskFeedback(jo);
JSONObject response = JSONObject.parseObject(result.body()); JSONObject response = JSONObject.parseObject(result.body());

2
acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/AcsToWmsZDController.java

@ -21,7 +21,7 @@ import java.util.Map;
@RestController @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@Api(tags = "wms接口") @Api(tags = "wms接口")
@RequestMapping("/wcs/restful/api/v3/system_car") @RequestMapping("/wcs19033/restful/api/v3/system_car")
@Slf4j @Slf4j
@Lazy @Lazy
@SaIgnore @SaIgnore

2
acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsZDToAcsController.java

@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@Api(tags = "wms接口") @Api(tags = "wms接口")
@RequestMapping("/restful/api/v3") @RequestMapping("/restful/API/V3")
@Slf4j @Slf4j
@Service @Service
@Lazy @Lazy

1
acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsZDServiceImpl.java

@ -58,7 +58,6 @@ public class AcsToWmsZDServiceImpl implements AcsToWmsZDService {
@Override @Override
public HttpResponse taskFeedback(JSONObject whereJson) { public HttpResponse taskFeedback(JSONObject whereJson) {
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue(); String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
AddressDto addressDto = addressService.findByCode("feedAgvTaskStatus"); AddressDto addressDto = addressService.findByCode("feedAgvTaskStatus");
String methods_url = addressDto.getMethods_url(); String methods_url = addressDto.getMethods_url();
String url = wmsUrl + methods_url; String url = wmsUrl + methods_url;

14
acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsZDToAcsServiceImpl.java

@ -88,13 +88,13 @@ public class WmsZDToAcsServiceImpl implements WmsZDToAcsService {
next_device_code = next_point_code; next_device_code = next_point_code;
} }
//查询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)) {
map.put("responseCode", 1); // map.put("responseCode", 1);
map.put("responseMessage", "路由不通!"); // map.put("responseMessage", "路由不通!");
return map; // return map;
} // }
//查询任务编码是否重复 //查询任务编码是否重复
TaskDto taskDto = taskService.findByCodeFromCache(taskCode); TaskDto taskDto = taskService.findByCodeFromCache(taskCode);
if (taskDto != null) { if (taskDto != null) {

39
acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java

@ -289,7 +289,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
@Override @Override
public void create(Instruction dto) { public void create(Instruction dto) {
dto = foramte(dto); // dto = foramte(dto);
String task_code = dto.getTask_code(); String task_code = dto.getTask_code();
TaskDto task = taskService.findByCodeFromCache(task_code); TaskDto task = taskService.findByCodeFromCache(task_code);
@ -352,34 +352,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
Device startdevice = appService.findDeviceByCode(dto.getStart_device_code()); Device startdevice = appService.findDeviceByCode(dto.getStart_device_code());
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
StandardCoveyorControlWithScannerDeviceDriver standardCoveyorControlWithScannerDeviceDriver;
try { 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()))) { if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue().toString(),String.valueOf(AgvSystemEnum.Maigic.getIndex()))) {
HttpResponse result = magicAgvService.sendAgvInstToMagic(dto); HttpResponse result = magicAgvService.sendAgvInstToMagic(dto);
if (ObjectUtils.isEmpty(result) || result.getStatus() != 200) { if (ObjectUtils.isEmpty(result) || result.getStatus() != 200) {
@ -413,18 +386,13 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
ZheDaAgvService zheDaAgvService = SpringContextHolder.getBean(ZheDaAgvService.class); ZheDaAgvService zheDaAgvService = SpringContextHolder.getBean(ZheDaAgvService.class);
zheDaAgvService.sendAgvInstToAgv(dto); zheDaAgvService.sendAgvInstToAgv(dto);
} }
}
} catch (Exception e) {
dto.setSend_status("2");
e.printStackTrace();
}
}
} catch (Exception e) { } catch (Exception e) {
dto.setSend_status("2"); dto.setSend_status("2");
e.printStackTrace(); e.printStackTrace();
log.error("");
} }
WQLObject wo = WQLObject.getWQLObject("acs_instruction"); WQLObject wo = WQLObject.getWQLObject("acs_instruction");
JSONObject json = (JSONObject) JSONObject.toJSON(dto); JSONObject json = (JSONObject) JSONObject.toJSON(dto);
wo.insert(json); wo.insert(json);
@ -585,6 +553,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
dto.setCreate_by(currentUsername); dto.setCreate_by(currentUsername);
dto.setUpdate_by(currentUsername); dto.setUpdate_by(currentUsername);
dto.setUpdate_time(now); dto.setUpdate_time(now);
dto.setCreate_time(now); dto.setCreate_time(now);

124
acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java

@ -430,7 +430,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void create(TaskDto dto) throws Exception { public void create(TaskDto dto) throws Exception {
dto = foramte(dto); // dto = foramte(dto);
if (!StrUtil.isEmpty(dto.getVehicle_code())) { if (!StrUtil.isEmpty(dto.getVehicle_code())) {
TaskDto vehicle_dto = this.findByContainer(dto.getVehicle_code()); TaskDto vehicle_dto = this.findByContainer(dto.getVehicle_code());
if (vehicle_dto != null) { if (vehicle_dto != null) {
@ -470,72 +470,72 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
// 判断起点终点设备类型 // 判断起点终点设备类型
String startDeviceType = deviceAppService.findDeviceTypeByCode(dto.getStart_device_code()); String startDeviceType = deviceAppService.findDeviceTypeByCode(dto.getStart_device_code());
String nextDeviceType = deviceAppService.findDeviceTypeByCode(dto.getNext_device_code()); String nextDeviceType = deviceAppService.findDeviceTypeByCode(dto.getNext_device_code());
if (routelineserver // if (routelineserver
.getShortPathLines(dto.getStart_device_code(), dto.getNext_device_code(), plan_code) // .getShortPathLines(dto.getStart_device_code(), dto.getNext_device_code(), plan_code)
.size() // .size()
== 0) { // == 0) {
throw new Exception(dto.getStart_point_code() + "->" + dto.getNext_point_code() + "路由不通!"); // throw new Exception(dto.getStart_point_code() + "->" + dto.getNext_point_code() + "路由不通!");
} // }
String createTaskCheck = paramService.findByCode(AcsConfig.CREATETASKCHECK).getValue(); String createTaskCheck = paramService.findByCode(AcsConfig.CREATETASKCHECK).getValue();
DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class); DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class);
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
Device nextdevice = appService.findDeviceByCode(next_device_code); Device nextdevice = appService.findDeviceByCode(next_device_code);
Device startdevice = appService.findDeviceByCode(start_device_code); Device startdevice = appService.findDeviceByCode(start_device_code);
dto.setMaterial(startdevice.getMaterial_type()); // dto.setMaterial(startdevice.getMaterial_type());
if (StrUtil.equals(createTaskCheck, "1")) { // if (StrUtil.equals(createTaskCheck, "1")) {
// 判断起点为输送设备 // // 判断起点为输送设备
if (StrUtil.equals(DeviceType.conveyor.toString(), startDeviceType)) { // if (StrUtil.equals(DeviceType.conveyor.toString(), startDeviceType)) {
} // }
//
if (StrUtil.equals(DeviceType.conveyor.toString(), nextDeviceType)) { // if (StrUtil.equals(DeviceType.conveyor.toString(), nextDeviceType)) {
} // }
} else { // } else {
// 判断起点为输送设备 // // 判断起点为输送设备
if (StrUtil.equals(DeviceType.conveyor.toString(), startDeviceType)) { // if (StrUtil.equals(DeviceType.conveyor.toString(), startDeviceType)) {
} // }
//
if (StrUtil.equals(DeviceType.conveyor.toString(), nextDeviceType)) { // if (StrUtil.equals(DeviceType.conveyor.toString(), nextDeviceType)) {
// if (nextdevice.getDeviceDriver() instanceof // // if (nextdevice.getDeviceDriver() instanceof
// StandardOrdinarySiteDeviceDriver) { // // StandardOrdinarySiteDeviceDriver) {
// standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) // // standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver)
// nextdevice.getDeviceDriver(); // // nextdevice.getDeviceDriver();
// if (nextdevice.getHas_goods() != 0) { // // if (nextdevice.getHas_goods() != 0) {
// throw new Exception("任务终点需满足无货!"); // // throw new Exception("任务终点需满足无货!");
// } // // }
// } // // }
//
JSONObject jo = new JSONObject(); // JSONObject jo = new JSONObject();
JSONObject jo2 = new JSONObject(); // JSONObject jo2 = new JSONObject();
if (!StrUtil.isEmpty(dto.getMaterial())) { // if (!StrUtil.isEmpty(dto.getMaterial())) {
if (!StrUtil.equals(dto.getMaterial(), "1")) { // if (!StrUtil.equals(dto.getMaterial(), "1")) {
jo.put("hasGoodStatus", "2"); // jo.put("hasGoodStatus", "2");
jo.put("material_type", dto.getMaterial()); // jo.put("material_type", dto.getMaterial());
} else { // } else {
jo.put("hasGoodStatus", "1"); // jo.put("hasGoodStatus", "1");
jo.put("material_type", "1"); // jo.put("material_type", "1");
} // }
//
} else { // } else {
jo.put("hasGoodStatus", "1"); // jo.put("hasGoodStatus", "1");
jo.put("material_type", "1"); // jo.put("material_type", "1");
} // }
jo.put("device_code", dto.getStart_device_code()); // jo.put("device_code", dto.getStart_device_code());
jo.put("quantity", dto.getQuantity()); // jo.put("quantity", dto.getQuantity());
jo.put("remark", dto.getRemark()); // jo.put("remark", dto.getRemark());
jo.put("batch", startdevice.getBatch()); // jo.put("batch", startdevice.getBatch());
jo.put("islock", "true"); // jo.put("islock", "true");
deviceService.changeDeviceStatus(jo); // deviceService.changeDeviceStatus(jo);
Device deviceByCode = deviceAppService.findDeviceByCode(dto.getNext_device_code()); // Device deviceByCode = deviceAppService.findDeviceByCode(dto.getNext_device_code());
jo2.put("device_code", dto.getNext_device_code()); // jo2.put("device_code", dto.getNext_device_code());
jo2.put("hasGoodStatus", deviceByCode.getHas_goods()); // jo2.put("hasGoodStatus", deviceByCode.getHas_goods());
jo2.put("quantity", deviceByCode.getQuantity()); // jo2.put("quantity", deviceByCode.getQuantity());
jo2.put("remark", deviceByCode.getRemark()); // jo2.put("remark", deviceByCode.getRemark());
jo2.put("material_type", deviceByCode.getMaterial_type()); // jo2.put("material_type", deviceByCode.getMaterial_type());
jo2.put("batch", deviceByCode.getBatch()); // jo2.put("batch", deviceByCode.getBatch());
jo2.put("islock", "true"); // jo2.put("islock", "true");
deviceService.changeDeviceStatus(jo2); // deviceService.changeDeviceStatus(jo2);
} // }
} // }
WQLObject wo = WQLObject.getWQLObject("acs_task"); WQLObject wo = WQLObject.getWQLObject("acs_task");
JSONObject json = (JSONObject) JSONObject.toJSON(dto); JSONObject json = (JSONObject) JSONObject.toJSON(dto);

62
acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java

@ -75,37 +75,37 @@ public class AutoCreateInst {
continue; continue;
} }
//校验路由关系 // //校验路由关系
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code); // List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code);
if (ObjectUtils.isEmpty(shortPathsList)) { // if (ObjectUtils.isEmpty(shortPathsList)) {
acsTask.setRemark("路由不通无法生成指令"); // acsTask.setRemark("路由不通无法生成指令");
taskserver.updateByCodeFromCache(acsTask); // taskserver.updateByCodeFromCache(acsTask);
continue; // continue;
} // }
if (!StrUtil.equals(shortPathsList.get(0).getType(), "1")) { // if (!StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
continue; // continue;
} // }
RouteLineDto routeLineDto = shortPathsList.get(0); // RouteLineDto routeLineDto = shortPathsList.get(0);
String path = routeLineDto.getPath(); // String path = routeLineDto.getPath();
String type = routeLineDto.getType(); // String type = routeLineDto.getType();
String[] str = path.split("->"); // String[] str = path.split("->");
List<String> pathlist = Arrays.asList(str); // List<String> pathlist = Arrays.asList(str);
int index = 0; // int index = 0;
for (int m = 0; m < pathlist.size(); m++) { // for (int m = 0; m < pathlist.size(); m++) {
if (pathlist.get(m).equals(start_device_code)) { // if (pathlist.get(m).equals(start_device_code)) {
index = m + 1; // index = m + 1;
break; // break;
} // }
} // }
next_device_code = pathlist.get(index); // next_device_code = pathlist.get(index);
if (StrUtil.equals(appService.findDeviceTypeByCode(next_device_code), "storage")) { // if (StrUtil.equals(appService.findDeviceTypeByCode(next_device_code), "storage")) {
next_point_code = next_device_code + "-" + acsTask.getTo_y() + "-" + acsTask.getTo_z(); // next_point_code = next_device_code + "-" + acsTask.getTo_y() + "-" + acsTask.getTo_z();
} else { // } else {
next_point_code = next_device_code; // next_point_code = next_device_code;
} // }
Instruction instdto = new Instruction(); Instruction instdto = new Instruction();

2
acs/nladmin-system/src/main/resources/config/application-prod.yml

@ -6,7 +6,7 @@ spring:
druid: druid:
db-type: com.alibaba.druid.pool.DruidDataSource db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy 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} username: ${DB_USER:root}
password: ${DB_PWD:123456} password: ${DB_PWD:123456}
# 初始连接数 # 初始连接数

4
acs/nladmin-ui/.env.production

@ -2,6 +2,6 @@ ENV = 'production'
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置 # 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http # 接口地址,注意协议,如果你没有配置 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 # 如果接口是 http 形式, wss 需要改为 ws
VUE_APP_WS_API = 'ws:// 192.168.69.32:8011' VUE_APP_WS_API = 'ws:// 10.4.46.150:8011'

BIN
acs/nladmin-ui/dist (2).zip

Binary file not shown.

BIN
acs/nladmin-ui/dist.zip

Binary file not shown.

2
acs/nladmin-ui/public/config.js

@ -3,7 +3,7 @@ window.g = {
VUE_APP_BASE_API: 'http://127.0.0.1:8010' VUE_APP_BASE_API: 'http://127.0.0.1:8010'
}, },
prod: { prod: {
VUE_APP_BASE_API: 'http://192.168.69.32:8011' VUE_APP_BASE_API: 'http://10.4.46.150:8011'
} }

Loading…
Cancel
Save