From 8fedac67aaea61365b0e879af4d3889d950dd4d5 Mon Sep 17 00:00:00 2001
From: liyongde <1419499670@qq.com>
Date: Tue, 27 May 2025 20:31:53 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A5=97=E8=BD=B4=E6=97=A5=E5=BF=97?=
=?UTF-8?q?=E7=9C=8B=E6=9D=BF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../套轴点位日志记录实时看板.html | 416 ++++++++++++++++++
.../slitter/auto/AutoCallAirShaftTask.java | 36 +-
.../slitter/controller/SlitterController.java | 19 +-
.../tasks/slitter/mapper/SlitterMapper.java | 2 +
.../tasks/slitter/mapper/SlitterMapper.xml | 49 +++
.../slitter/mapper/dto/CallPlanViewVO.java | 1 +
.../tasks/slitter/service/SlitterService.java | 2 +
.../service/impl/SlitterServiceImpl.java | 106 ++++-
.../acs/service/impl/AcsToWmsServiceImpl.java | 19 +-
.../src/test/java/org/nl/init/EventTest.java | 7 +-
10 files changed, 623 insertions(+), 34 deletions(-)
create mode 100644 lms/nladmin-system/doc/套轴点位日志记录实时看板.html
diff --git a/lms/nladmin-system/doc/套轴点位日志记录实时看板.html b/lms/nladmin-system/doc/套轴点位日志记录实时看板.html
new file mode 100644
index 000000000..87c5eefce
--- /dev/null
+++ b/lms/nladmin-system/doc/套轴点位日志记录实时看板.html
@@ -0,0 +1,416 @@
+
+
+
+
+
+ 套轴点位日志记录实时看板
+
+
+
+ 套轴点位日志记录实时看板
+
+
+
+
+
套轴监控系统实时数据
+
+
+
+ | 设备 |
+ 子卷号 |
+ 轴位置 |
+ 气胀轴尺寸 |
+ 气胀轴代数 |
+ 气胀轴状态 |
+ 呼叫时间 |
+ 管芯规格 |
+ 套轴标记 |
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/slitter/auto/AutoCallAirShaftTask.java b/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/slitter/auto/AutoCallAirShaftTask.java
index 0a6db0fc3..75434d60a 100644
--- a/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/slitter/auto/AutoCallAirShaftTask.java
+++ b/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/slitter/auto/AutoCallAirShaftTask.java
@@ -47,6 +47,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
@@ -102,6 +103,7 @@ public class AutoCallAirShaftTask extends Prun {
public final static String TZ_DAY = "TZ_DAY";
public final static String USE_XN = "USE_XN";
public String stepStr = "";
+ public List stepErrorInfo = new ArrayList<>();
/**
* hint: 目前只是考虑了上区域
@@ -122,11 +124,12 @@ public class AutoCallAirShaftTask extends Prun {
// 1、获取空的插拔轴位(无任务)
List emptyPoints = bstIvtShafttubeivtService.getAllShaftPointsByConditions("2",
"0", "0");
-// emptyPoints.forEach(empty -> doCallShaft(empty, isOnlyPulling, tzDay, paramObj));
for (BstIvtShafttubeivt empty : emptyPoints) {
stepStr = "";
+ stepErrorInfo = new ArrayList<>();
doCallShaft(empty, isOnlyPulling, tzDay, paramObj, useXn);
redisUtils.set("INFO" + empty.getPoint_code(), stepStr);
+ redisUtils.set("ERROR" + empty.getPoint_code(), stepErrorInfo);
}
}
@@ -137,6 +140,7 @@ public class AutoCallAirShaftTask extends Prun {
String location = empty.getPoint_location();
stepStr += "1";
if (ObjectUtil.isNotEmpty(isOnlyPulling) && SlitterConstant.SLITTER_YES.equals(isOnlyPulling.getValue())) {
+ stepErrorInfo.add("系统设置了只做拔轴,详细看参数表:" + IS_ONLY_PULLING);
// 只做拔轴
makePullShaft(empty, specification);
return;
@@ -150,12 +154,6 @@ public class AutoCallAirShaftTask extends Prun {
} else {
planAll = slittingproductionplanService.getAllCutPlan(integer);
}
- // 排序
- /* List planAll = planAllNoSort.stream()
- .sorted(Comparator.comparing(
- dto -> LocalDateTime.parse(dto.getStart_time(), TIME_FORMATTER)
- ))
- .collect(Collectors.toList());*/
// 过滤
String value = paramObj.getValue();
List prefixList = Arrays.asList(value.split("[,,]"));
@@ -165,6 +163,7 @@ public class AutoCallAirShaftTask extends Prun {
checkComputationPoint(p, empty) && checkHasTask(p))
.collect(Collectors.toList());
if (plans.size() == 0) {
+ stepErrorInfo.add("找不到需要套轴的信息,只做拔轴。");
// 如果不需要套轴,就只做拔轴
makePullShaft(empty, specification);
return;
@@ -225,6 +224,7 @@ public class AutoCallAirShaftTask extends Prun {
.collect(Collectors.toList());
if (qzzs.size() == 0) {
log.info("没有半个点位,或者对应的另一半分切计划没有找到!");
+ stepErrorInfo.add("找不到需要套轴的信息,只做拔轴。");
// 如果不需要套轴,就只做拔轴
makePullShaft(empty, specification);
return;
@@ -235,6 +235,7 @@ public class AutoCallAirShaftTask extends Prun {
if (ObjectUtil.isEmpty(tzOKPlans)) {
stepStr += ",13";
log.info("计划找不到");
+ stepErrorInfo.add("找不到气胀轴:" + qzzs + "对应的计划。");
return;
}
PdmBiSlittingproductionplan oneTzOkPlan = tzOKPlans.get(0);
@@ -246,6 +247,7 @@ public class AutoCallAirShaftTask extends Prun {
}
if (plans.size() == 0) {
log.info("没有找到对应的另一半分切计划没有找到");
+ stepErrorInfo.add("没有找到对应的另一半分切计划, 只做拔轴");
// 如果不需要套轴,就只做拔轴
makePullShaft(empty, specification);
return;
@@ -263,6 +265,7 @@ public class AutoCallAirShaftTask extends Prun {
.orElse(null);
if (planDto == null) {
log.warn("过滤3/6寸和代数输出结果为空,跳过此次套轴,直接拔轴。此时点位对应代数:{}", specification);
+ stepErrorInfo.add("过滤3/6寸和代数输出结果为空,跳过此次套轴,直接拔轴。此时点位对应代数:{}" + specification);
// 如果不需要套轴,就只做拔轴
makePullShaft(empty, specification);
return;
@@ -303,11 +306,13 @@ public class AutoCallAirShaftTask extends Prun {
List qzzPoint = bcutpointivtService.getPointByTypeAndShaftSize("1", qzzSize, specification);
log.info("查找到满足到对应尺寸的点位-{}", qzzPoint);
if (qzzPoint.size() == 0) {
+ stepErrorInfo.add("没有可拔轴的点位。");
stepStr += ",16";
//若套轴暂存位没有相同规格的气胀轴,直接去气胀轴库找即可
// 调用ACS滚条气涨轴下来
if (!toAcsOutShaft(qzzSize,location, empty)) {
log.error("呼叫出轴失败-穿拔轴{}不进行套轴,跳过!", empty.getPoint_code());
+ stepErrorInfo.add("呼叫出轴失败-穿拔轴" + empty.getPoint_code() + "不进行套轴,跳过!");
return;
}
toCallAgvMovePaperTube(needPlans, location, empty);
@@ -325,6 +330,7 @@ public class AutoCallAirShaftTask extends Prun {
if (oldQzzNo == null) {
log.error("当前气胀轴的编码为空!");
stepStr += ",96";
+ stepErrorInfo.add(startPoint.getPoint_code() + "的气胀轴编码为空,请检查...");
return;
}
String startPointCode = ObjectUtil.isNotEmpty(startPoint.getQzz_no1())
@@ -332,6 +338,7 @@ public class AutoCallAirShaftTask extends Prun {
if (startPointCode == null) {
log.error("当前点位的编码为空!");
stepStr += ",96";
+ stepErrorInfo.add(startPoint.getPoint_code() + "的点位编码为空,检查A或B点位的信息是否正常");
return;
}
stepStr += ",34";
@@ -385,6 +392,7 @@ public class AutoCallAirShaftTask extends Prun {
startPoint.setRemark("气胀轴" + oldQzzNo + "的计划不存在,无效点位自动禁用。");
startPoint.setUpdate_time(DateUtil.now());
bcutpointivtService.updateById(startPoint);
+ stepErrorInfo.add("当前气胀轴编码{" + oldQzzNo + "},找不到对应的计划, 点位" + startPoint.getPoint_code() + "已被禁用。");
return;
}
// 保存所需要的分切计划数据到点位上(套轴对接位)更新分切计划
@@ -514,6 +522,7 @@ public class AutoCallAirShaftTask extends Prun {
// 缺省的数量
int needQuantity = 0;
// 判断当前区域location对应的备货区是否含有相同的纸管 校验了不在搬运中
+ // todo: 要考虑防止所需要的托盘被搬走!
// type=1(桁架底下的托盘), 关联对象material_code=纸管, qty > 0
List useList = stockingivtService.getPaperTubePoint("1", tubes.get(0), location, 0);
if (useList.size() > 0) {
@@ -552,6 +561,7 @@ public class AutoCallAirShaftTask extends Prun {
noticeService.createNotice("备货区找不到[" + tubes.get(0) + "]的纸管信息",
"点位[" + empty.getPoint_name() + "]无法从备货区找到纸管信息",
NoticeTypeEnum.EXCEPTION.getCode());
+ stepErrorInfo.add("备货区找不到[" + tubes.get(0) + "]的纸管信息");
return false;
}
// 找到就创建AGV搬运任务
@@ -584,6 +594,7 @@ public class AutoCallAirShaftTask extends Prun {
noticeService.createNotice("备货区找不到空位置搬运",
"点位[" + empty.getPoint_name() + "]无法从备货区找到空位",
NoticeTypeEnum.EXCEPTION.getCode());
+ stepErrorInfo.add("备货区找不到空位置搬运。");
return false;
}
BstIvtStockingivt endPoint = list.get(0);
@@ -598,6 +609,7 @@ public class AutoCallAirShaftTask extends Prun {
param.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
stockAreaSendVehicleTask.createTask(param);
stepStr += ",26";
+ stepErrorInfo.add("备货区交换托盘中...请等待。");
return true;
}
@@ -616,6 +628,7 @@ public class AutoCallAirShaftTask extends Prun {
stepStr += ",28";
if (shafttubeivts.size() == 0) {
log.error("气胀轴库找不到[" + qzzSize + "]规格的气涨轴位");
+ stepErrorInfo.add("气胀轴库找不到[" + qzzSize + "]规格的气涨轴位");
stepStr += ",98";
return false;
}
@@ -630,9 +643,10 @@ public class AutoCallAirShaftTask extends Prun {
// todo: 暂时都是B1
device_obj.put("product_area", "B1");
JSONObject pointStatus = wmsToAcsService.getPointStatus(device_rows);
- if (ObjectUtil.isEmpty(pointStatus) || ObjectUtil.isEmpty(pointStatus.getJSONArray("data"))) {
+ if (ObjectUtil.isEmpty(pointStatus) || ObjectUtil.isEmpty(pointStatus.getJSONObject("data")) || ObjectUtil.isEmpty(pointStatus.getJSONArray("data"))) {
stepStr += ",98";
log.error("获取气胀轴库信息失败");
+ stepErrorInfo.add("获取ACS气胀轴库信息失败...");
return false;
}
boolean judgment1 = true;
@@ -660,6 +674,7 @@ public class AutoCallAirShaftTask extends Prun {
stepStr += ",30";
if (!judgment1 && !judgment2) {
log.warn("没有气胀轴,不给ACS写出轴信息");
+ stepErrorInfo.add("呼叫气胀轴失败,没有气胀轴(密集库/暂存架),不给ACS写出轴信息");
stepStr += ",98";
return false;
}
@@ -767,6 +782,7 @@ public class AutoCallAirShaftTask extends Prun {
//根据point_code排序
if (notTaskPoints.size() == 0) {
stepStr += ",99";
+ stepErrorInfo.add("只进行拔轴,没有可以拔轴的点位。");
return;
}
stepStr += ",9";
@@ -780,6 +796,7 @@ public class AutoCallAirShaftTask extends Prun {
.orElse(null);
if (cutpointivt == null) {
stepStr += ",99";
+ stepErrorInfo.add("只进行拔轴,没有可以拔轴的点位。");
return;
}
stepStr += ",10";
@@ -797,7 +814,7 @@ public class AutoCallAirShaftTask extends Prun {
.set("is_used","0")
.set("remark","气胀轴" + qzzNo + "的计划不存在,无效点位自动禁用")
.set("update_time",DateUtil.now()));
-
+ stepErrorInfo.add("气胀轴" + qzzNo + "的计划不存在,无效点位自动禁用。");
return;
}
PdmBiSlittingproductionplan plan = list.get(0);
@@ -822,6 +839,7 @@ public class AutoCallAirShaftTask extends Prun {
param.put("is_bushing", SlitterConstant.SLITTER_NO);
param.put("is_pulling", SlitterConstant.SLITTER_YES);
trussCallAirShaftTask.createTask(param);
+ stepErrorInfo.add("只做拔轴,拔轴任务已经创建...");
stepStr += ",11";
}
diff --git a/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/slitter/controller/SlitterController.java b/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/slitter/controller/SlitterController.java
index 063b53431..e7dae7e2d 100644
--- a/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/slitter/controller/SlitterController.java
+++ b/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/slitter/controller/SlitterController.java
@@ -3,9 +3,7 @@ package org.nl.b_lms.sch.tasks.slitter.controller;
import cn.dev33.satoken.annotation.SaIgnore;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
-import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingproductionplan;
import org.nl.b_lms.sch.tasks.slitter.service.SlitterService;
-import org.nl.common.utils.TaskUtils;
import org.nl.modules.common.utils.RedisUtils;
import org.nl.modules.logging.annotation.Log;
import org.springframework.beans.factory.annotation.Autowired;
@@ -16,11 +14,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
/**
* @Author: lyd
* @Description:
@@ -47,4 +40,16 @@ public class SlitterController {
public ResponseEntity