优化0127

This commit is contained in:
zj
2026-01-27 09:54:27 +08:00
parent d2d871baf1
commit 036ee35af3
12 changed files with 139 additions and 39 deletions

View File

@@ -38,14 +38,15 @@
</dependency>
<!-- Mysql驱动包 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>mysql</groupId>-->
<!-- <artifactId>mysql-connector-java</artifactId>-->
<!-- </dependency>-->
<!-- sql server驱动包 -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>12.10.1.jre11</version>
</dependency>
<!-- 核心模块-->

View File

@@ -1,7 +1,11 @@
package com.ruoyi.api.controller;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import com.ruoyi.api.domain.agv.agvCallback.AgvCallbackRequest;
import com.ruoyi.api.domain.agv.agvCallback.AgvCallbackResponse;
import com.ruoyi.api.domain.agv.cancelTask.CancelTaskRequest;
import com.ruoyi.api.domain.agv.cancelTask.CancelTaskResponse;
import com.ruoyi.api.service.IApiService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
@@ -27,6 +31,7 @@ public class AgvController extends BaseController {
@Autowired
private IAgvQueueService agvQueueService;
/**
* agv执行状态返回接口
* @param request
@@ -75,4 +80,33 @@ public class AgvController extends BaseController {
}
/**
* 前端手动操作完成/取消AGV作业时,请求rcs,取消当前AGV正执行的作业
* @param param
* @return
*/
@PostMapping("/cancelTask")
public AjaxResult cancelTask(@RequestBody Map<String, String> param) {
AgvQueue agvQueue = agvQueueService.selectAgvQueueByTaskCode(param.get("taskCode"));
if(agvQueue==null){
return AjaxResult.error("AGV任务队列不存在!");
}else{
CancelTaskRequest cancelTaskRequest = new CancelTaskRequest();
cancelTaskRequest.setReqCode(IdUtil.fastSimpleUUID());
cancelTaskRequest.setReqTime(DateUtil.formatDateTime(DateUtil.date()));
cancelTaskRequest.setTaskCode(agvQueue.getTaskCode());
//取消rcs中指定的agv任务
CancelTaskResponse cancelTaskResponse = apiService.cancelTask(cancelTaskRequest);
if(cancelTaskResponse.getCode() == 0 && "成功".equals(cancelTaskResponse.getMessage()) && cancelTaskResponse.getReqCode() == cancelTaskRequest.getReqCode()){
return AjaxResult.success("AGV任务队列取消成功!", cancelTaskResponse);
}
return AjaxResult.error("取消RCS-AGV任务队列失败!");
}
}
}

View File

@@ -75,4 +75,5 @@ public class Wcs2WmsController {
return apiService.updateWcsPort(wcsPort);
}
}

View File

@@ -136,4 +136,8 @@ public interface IApiService
AjaxResult selectMydoJobByTrayCodeAndEntranceId(HashMap<String, Object> paramMap);
AjaxResult deleteAgvTray(AgvQueue agvQueue);
}

View File

@@ -478,4 +478,6 @@ public class ApiServiceImpl implements IApiService {
return AjaxResult.error();
}
}
}

View File

@@ -19,4 +19,6 @@ public class Constant {
public static final String REQUEST_ENTER_URL = WMS_BASE_URL+"requestEnterByTrayCodeAndEntranceId";
}

View File

@@ -198,7 +198,7 @@ public class DdjThread implements Runnable {
}
}
//正常下发
if (ddj.getYxxf() == 1 && ddj.getCzfs() == 5 && ddj.getSbzt() == 0) {
if (ddj.getYxxf() == 1 && ddj.getCzfs() == 5 && ddj.getSbzt() == 0 ) {
Long rwh = ddj.getRwh();
DdjDeviceExecutionQueue ddjDeviceExecutionQueueRunningParam = new DdjDeviceExecutionQueue();
ddjDeviceExecutionQueueRunningParam.setDdjxf("1");

View File

@@ -171,7 +171,7 @@ public class Floor1BothWayOutSsjThread implements Runnable {
MydoJob mydoJob = mydoJobService.selectMydoJobByExitList1(exitList, roadwayId);
MydoJob inJob = mydoJobService.selectMydoJobByEntranceList1(entrance_id);
if (ObjUtil.isNotNull(mydoJob) && deviceSsj.getKx() == 1 && ssj.getKx() == 0
&& ObjUtil.isNull(inJob) && inOutSsj.getInOrOut() == 1 ) {
&& ObjUtil.isNull(inJob) && inOutSsj.getInOrOut() == 1 && deviceSsj.getTaskNo() == 0) {
//所有线体为空闲 并且存在出库作业 并且不存在入库作业
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
if (ObjUtil.isNull(basCargoSpace)) {
@@ -203,6 +203,7 @@ public class Floor1BothWayOutSsjThread implements Runnable {
mydoJob.setStatus(TASK_STATUS_RUNNING);
mydoJob.setExecutionPhase(TASK_EP_DDJ);
mydoJob.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
mydoJob.setExitId(entrance_id);
mydoJobService.updateMydoJob(mydoJob);
}
}

View File

@@ -73,36 +73,67 @@ public class Floor1SingleSsjThread implements Runnable {
public void run() {
init();
while (isRun) {
for (String type : ssjCodeList.keySet()) {
//一楼单向巷道口
if ("outRoadwaySsj".equals(type)) {
for (String ssjCode : ssjCodeList.get(type)) {
try {
if (PlcSsjRead.deviceSsjMap.containsKey(ssjCode)) {
dispatch(PlcSsjRead.deviceSsjMap.get(ssjCode));
} else {
log.error("设备不存在 ssjCode{}", ssjCode);
}
} catch (RuntimeException e) {
log.error(e.getMessage(), e);
}
try {
if (PlcSsjRead.deviceSsjMap.containsKey("L2001")) {
dispatch(PlcSsjRead.deviceSsjMap.get("L2001"));
} else {
log.error("设备不存在 ssjCode{}", "L2001");
}
if (PlcSsjRead.deviceSsjMap.containsKey("L2007")) {
dispatch(PlcSsjRead.deviceSsjMap.get("L2007"));
} else {
log.error("设备不存在 ssjCode{}", "L2007");
}
if (PlcSsjRead.deviceSsjMap.containsKey("L2002")) {
dispatch2(PlcSsjRead.deviceSsjMap.get("L2002"));
} else {
log.error("设备不存在 ssjCode{}", "L2002");
}
if (PlcSsjRead.deviceSsjMap.containsKey("L2008")) {
dispatch2(PlcSsjRead.deviceSsjMap.get("L2008"));
} else {
log.error("设备不存在 ssjCode{}", "L2008");
}
}
}
if ("outSsj".equals(type)) {
for (String ssjCode : ssjCodeList.get(type)) {
try {
if (PlcSsjRead.deviceSsjMap.containsKey(ssjCode)) {
dispatch2(PlcSsjRead.deviceSsjMap.get(ssjCode));
} else {
log.error("设备不存在 ssjCode{}", ssjCode);
}
} catch (RuntimeException e) {
log.error(e.getMessage(), e);
}
}
}
} catch (RuntimeException e) {
log.error(e.getMessage(), e);
}
// for (String type : ssjCodeList.keySet()) {
// //一楼单向巷道口
// if ("outRoadwaySsj".equals(type)) {
// for (String ssjCode : ssjCodeList.get(type)) {
// try {
// if (PlcSsjRead.deviceSsjMap.containsKey(ssjCode)) {
// dispatch(PlcSsjRead.deviceSsjMap.get(ssjCode));
// } else {
// log.error("设备不存在 ssjCode{}", ssjCode);
// }
// } catch (RuntimeException e) {
// log.error(e.getMessage(), e);
// }
//
// }
// }
// if ("outSsj".equals(type)) {
// for (String ssjCode : ssjCodeList.get(type)) {
// try {
// if (PlcSsjRead.deviceSsjMap.containsKey(ssjCode)) {
// dispatch2(PlcSsjRead.deviceSsjMap.get(ssjCode));
// } else {
// log.error("设备不存在 ssjCode{}", ssjCode);
// }
// } catch (RuntimeException e) {
// log.error(e.getMessage(), e);
// }
// }
// }
// }
try {
Thread.sleep(1500);
} catch (InterruptedException e) {
@@ -149,15 +180,19 @@ public class Floor1SingleSsjThread implements Runnable {
*/
public void dispatch(DeviceSsj ssj) {
//如果入库请求1 并且 托盘码不为空
if (ssj.getKx() == 1) {
if (ssj.getKx() == 1 && ssj.getTaskNo() == 0) {
List<String> exitList = new ArrayList<>();
exitList.add("1");
String roadwayId = "";
String entrance_id = "";
if("L2001".equals(ssj.getDeviceCode())){
roadwayId = "1";
entrance_id = "L2002";
}
if("L2007".equals(ssj.getDeviceCode())){
roadwayId = "2";
entrance_id = "L2008";
}
MydoJob mydoJob = mydoJobService.selectMydoJobByExitList1(exitList,roadwayId);
if (ObjUtil.isNotNull(mydoJob)) {
@@ -192,6 +227,7 @@ public class Floor1SingleSsjThread implements Runnable {
mydoJob.setStatus(TASK_STATUS_RUNNING);
mydoJob.setExecutionPhase(TASK_EP_DDJ);
mydoJob.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
mydoJob.setExitId(entrance_id);
mydoJobService.updateMydoJob(mydoJob);
}
}

View File

@@ -9,7 +9,7 @@ spring:
# url: jdbc:sqlserver://172.16.2.170:1433;databaseName=FT517-WCS;
# username: sa
# password: Flrd0914.
url: jdbc:sqlserver://192.168.58.10:1433;databaseName=FT517-wcs;
url: jdbc:sqlserver://192.168.58.10:1433;databaseName=FT517-wcs;;encrypt=true;trustServerCertificate=true;
username: sa
password: www.123.com

View File

@@ -95,7 +95,7 @@ token:
# 令牌密钥
secret: abcdefghijklmnopqrstuvwxyz
# 令牌有效期(默认30分钟)
expireTime: 30
expireTime: 10080
# MyBatis配置
mybatis: