no message

main
HUOJIN\92525 2025-03-14 13:50:53 +08:00
parent b31e2f2e27
commit 905d028b0e
3 changed files with 31 additions and 20 deletions

View File

@ -301,28 +301,40 @@ public class MesServiceImpl implements MesService {
if (srcPoint == null) {
return transTask.getPointCode() + "点位不存在!";
}
//容器
Stock stock = stockService.findByPointCode(srcPoint.getCode());
// 查找可用的终点点位
Point endPoint = findAvailableEndPoint();
if (endPoint == null) {
// 没有可用终点点位的处理逻辑
if (!agvTaskService.isSrcPointAvailable(srcPoint.getCode(), BizStatus.Cp_Off_Line, "RACK_MOVE")) {
return srcPoint.getCode() + "点位有任务,请稍后再试!";
Point endPoint = null;
//判断起点是CPXX003则任务搬运到成品下线异常缓存区否则搬运到成品上线区
if ("CPXX003".equals(srcPoint.getCode())) {
String enddPointCode = "CPYCHC";
endPoint = pointRepository.findByCode(enddPointCode);
if (endPoint == null) {
return "CPYCHC点位不存在!";
}
// 生成等待任务
agvTaskService.createAgvTask(BizStatus.Cp_Off_Line, stock, srcPoint.getCode(), null, "RACK_MOVE");
// 检查终点点位状态
if (BaseStatus.USED.equals(endPoint.getStatus())) {
return "异常缓存区CPYCHC点位容器没有放行";
}
} else {
endPoint = findAvailableEndPoint();
if (endPoint == null) {
// 没有可用终点点位的处理逻辑
if (!agvTaskService.isSrcPointAvailable(srcPoint.getCode(), BizStatus.Cp_Off_Line, "RACK_MOVE")) {
return srcPoint.getCode() + "点位有任务,请稍后再试!";
}
// 生成等待任务
agvTaskService.createAgvTask(BizStatus.Cp_Off_Line, stock, srcPoint.getCode(), null, "RACK_MOVE");
// 更新点位状态
pointService.usedPoint(srcPoint);
// 更新点位状态
pointService.usedPoint(srcPoint);
// 占用容器
stockService.usedStock(stock, srcPoint, BaseStatus.USED);
return "成品入库区和成品下线缓存区都没有空闲点位,请稍后再试!";
// 占用容器
stockService.usedStock(stock, srcPoint, BaseStatus.USED);
// 生成等待任务
return "成品入库区和成品下线缓存区都没有空闲点位,请稍后再试!";
}
}
// 验证终点是否有任务
if (!agvTaskService.isEndPointAvailable(endPoint.getCode(), BizStatus.Cp_Off_Line, "RACK_MOVE")) {
return transTask.getPointCode() + "点位有任务,请稍后再试!";
@ -333,9 +345,11 @@ public class MesServiceImpl implements MesService {
// 更新点位状态
pointService.usedPoint(endPoint);
// 占用容器
stockService.usedStock(stock, srcPoint, BaseStatus.USED);
return "呼叫成功";
}

View File

@ -85,7 +85,6 @@ public class jlBackTask {
private String getAreaName(String pointCode) {
Point srcPoint = pointService.validatePoint(pointCode);
Stock stock = stockService.findByPointCode(srcPoint.getCode());
String areaName = AreaNameDic.XJJLQ.equals(srcPoint.getArea().getName()) ? AreaNameDic.XJFBCQ : AreaNameDic.DJFBCQ;
return areaName;
}
@ -96,9 +95,7 @@ public class jlBackTask {
* @return null
*/
private Point findAvailableEndPoint(String areaName) {
String dstAreaCode = AreaNameDic.XJJLQ.equals(areaName) ? AreaNameDic.XJFBCQ : AreaNameDic.DJFBCQ;
List<Point> endPointList = pointService.queryPoints(null, BaseStatus.FREE, BaseStatus.BOX, dstAreaCode);
List<Point> endPointList = pointService.queryPoints(null, BaseStatus.FREE, BaseStatus.BOX, areaName);
return endPointList.isEmpty() ? null : endPointList.get(0);
}
}

View File

@ -4,7 +4,7 @@ spring:
druid:
db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
url: jdbc:log4jdbc:mysql://${DB_HOST:47.103.100.52}:${DB_PORT:53306}/${DB_NAME:byd_wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&rewriteBatchedStatements=true
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:53306}/${DB_NAME:byd_wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&rewriteBatchedStatements=true
username: ${DB_USER:root}
password: ${DB_PWD:Youchain@56}
# 初始连接数