opt: 套轴多次问题修复、看板数据优化、送轴问题优化

This commit is contained in:
2025-06-04 13:43:40 +08:00
parent f2ae4b8670
commit e39b5c0e3b
5 changed files with 40 additions and 14 deletions

View File

@@ -202,9 +202,9 @@
},
body: JSON.stringify({ device_code: deviceCode }),
});
if (!response.ok) {
const errorText = await response.text();
const errorText = await response.text();
console.error(`HTTP error response for ${deviceCode} (log):`, errorText);
throw new Error(`HTTP error! status: ${response.status} for ${deviceCode} (log). Response: ${errorText}`);
}
@@ -324,7 +324,7 @@
row.insertCell().textContent = item.up_or_down === '1' ? '上' : (item.up_or_down === '2' ? '下' : item.up_or_down || 'N/A');
row.insertCell().textContent = item.qzz_size || 'N/A';
row.insertCell().textContent = item.qzz_generation || 'N/A';
let statusText = '已完成';
if (item.status === '01') {
statusText = '准备套轴';
@@ -333,13 +333,13 @@
} else if (item.status === '03') {
statusText = '配送完成';
} else if (item.status) {
statusText = item.status;
statusText = '已完成';
}
row.insertCell().textContent = statusText;
const startTimeCell = row.insertCell();
startTimeCell.textContent = item.start_time || 'N/A';
row.insertCell().textContent = item.tube || 'N/A';
let tzText = '未套轴';
@@ -385,7 +385,7 @@
const data = await response.json();
tip = data.tip || '';
tip2 = data.tip2 || '';
// 显示tip2在对应设备标题下方
document.getElementById('tip2-' + deviceCode).textContent = tip2;
}
@@ -413,4 +413,4 @@
</script>
</body>
</html>
</html>

View File

@@ -102,8 +102,10 @@
WHERE bc.point_type = '1' AND bc.point_status = '2' AND (IFNULL(bc.qzz_no1,'') <![CDATA[ <> ]]> '' OR IFNULL(bc.qzz_no2,'') <![CDATA[ <> ]]> ''
) AND (IFNULL(bc.qzz_no1,'') = '' OR IFNULL(bc.qzz_no2,'') = '')
AND p.resource_name = #{resource_name}
AND (p.restruct_container_name = #{parent_container_name} OR p.parent_container_name = #{parent_container_name})
AND (p.restruct_container_name = #{parent_container_name} AND p.parent_container_name = #{parent_container_name})
AND p.split_group = #{split_group}
AND p.is_delete = '0'
AND bc.is_used = '1'
</select>
<select id="getReallyQzzSameDevice"
resultType="org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt">

View File

@@ -147,7 +147,7 @@ public class AutoCallAirShaftTask extends Prun {
}
stepStr += ",2";
Integer integer = Integer.valueOf(ObjectUtil.isEmpty(tzDay.getValue()) ? "0" : tzDay.getValue());
// 2、获取分切计划数据 校验代数 todo 顺序可能需要考虑
// 2、获取分切计划数据 校验代数
List<SlitterPlanDistinctDto> planAll;
if (ObjectUtil.isNotEmpty(useXn) && "1".equals(useXn.getValue())) {
planAll = slittingproductionplanService.getAllCutPlan2(integer);
@@ -207,7 +207,6 @@ public class AutoCallAirShaftTask extends Prun {
}
log.info("获取过滤后的分切计划数据:{}", JSON.toJSONString(plans));
// 查看套轴对接位是否满了
// todo: 这里需要注意不要去校验071的任务不然提前释放货位没意义。
List<BstIvtCutpointivt> emptyShaftPoint = bcutpointivtService.getAreaNotTaskPointByStatus("1",
"1", location, "0");
stepStr += ",6";
@@ -224,7 +223,7 @@ public class AutoCallAirShaftTask extends Prun {
.collect(Collectors.toList());
if (qzzs.size() == 0) {
log.info("没有半个点位,或者对应的另一半分切计划没有找到!");
stepErrorInfo.add("找不到需要套轴的信息,只做拔轴。");
stepErrorInfo.add("没有半个点位,或者对应的另一半分切计划没有找到!");
// 如果不需要套轴,就只做拔轴
makePullShaft(empty, specification);
return;
@@ -301,7 +300,6 @@ public class AutoCallAirShaftTask extends Prun {
String qzz_generation = needPlan.getQzz_generation();
// 从套轴对接位获取相同气涨轴大小
// update: 不需要(同标箔或者锂电分开)
// todo: 需要校验区域0/1
stepStr += ",15";
List<BstIvtCutpointivt> qzzPoint = bcutpointivtService.getPointByTypeAndShaftSize("1", qzzSize, specification);
log.info("查找到满足到对应尺寸的点位-{}", qzzPoint);
@@ -796,7 +794,7 @@ public class AutoCallAirShaftTask extends Prun {
.orElse(null);
if (cutpointivt == null) {
stepStr += ",99";
stepErrorInfo.add("只进行拔轴,没有可以拔轴的点位。");
stepErrorInfo.add("只进行拔轴,没有与机构匹配尺寸/代数可以拔轴的点位。");
return;
}
stepStr += ",10";
@@ -814,7 +812,7 @@ public class AutoCallAirShaftTask extends Prun {
.set("is_used","0")
.set("remark","气胀轴" + qzzNo + "的计划不存在,无效点位自动禁用")
.set("update_time",DateUtil.now()));
stepErrorInfo.add("气胀轴" + qzzNo + "的计划不存在,无效点位自动禁用。");
stepErrorInfo.add("气胀轴" + qzzNo + "的计划不存在,无效点位[" + cutpointivt.getPoint_code() + "]自动禁用。");
return;
}
PdmBiSlittingproductionplan plan = list.get(0);
@@ -882,7 +880,15 @@ public class AutoCallAirShaftTask extends Prun {
? shafttubeivt.getContainer_name1() : shafttubeivt.getContainer_name2();
// 获取这个子卷号的分切计划
PdmBiSlittingproductionplan byContainerName = slittingproductionplanService.getByContainerName(containerCode);
String parent = SlitterConstant.SLITTER_TYPE_PAPER.equals(byContainerName.getPaper_tube_or_FRP())
? byContainerName.getParent_container_name()
: byContainerName.getRestruct_container_name();
if (byContainerName.getResource_name().equals(dto.getResource_name())) {
// 如果是同设备同母卷、同组,证明是一根轴上的,故允许套轴
if (parent.equals(dto.getParent_container_name())
&& byContainerName.getSplit_group().equals(dto.getSplit_group())) {
return true;
}
stepStr += ",4";
stepErrorInfo.add(">>>穿拔轴机" + shafttubeivt.getPoint_code() + "已经在为" + dto.getResource_name() + "套轴了...");
return false;

View File

@@ -1,8 +1,10 @@
package org.nl.b_lms.sch.tasks.slitter.auto;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.nl.b_lms.bst.ivt.cutpointivt.service.IBstIvtCutpointivtService;
@@ -64,6 +66,10 @@ public class AutoSendAirShaftAgvTask {
List<String> collect = Stream.of(cutPoint.getQzz_no1(), cutPoint.getQzz_no2())
.filter(value -> value != null && !value.isEmpty()).collect(Collectors.toList());
if (collect.size() == 0) {
cutPoint.setRemark("点位数据与状态不符合,气胀轴编码为空!");
cutPoint.setIs_used("0");
cutPoint.setUpdate_time(DateUtil.now());
bcutpointivtService.updateById(cutPoint);
continue;
}
// 最多4条分切计划
@@ -89,6 +95,11 @@ public class AutoSendAirShaftAgvTask {
sendNBJExceptionPointTask.createTask(exParam);
} else {
log.info("异常处理位无空位!");
// 点位禁用
cutPoint.setRemark("计划状态已被改变!");
cutPoint.setIs_used("0");
cutPoint.setUpdate_time(DateUtil.now());
bcutpointivtService.updateById(cutPoint);
}
continue;
}
@@ -110,6 +121,9 @@ public class AutoSendAirShaftAgvTask {
if (list.size() > 0) {
log.info("还有不同轴,所以不继续");
// 还有不同轴,所以不继续
cutPoint.setRemark("还有不同轴,暂时不送轴!");
cutPoint.setUpdate_time(DateUtil.now());
bcutpointivtService.updateById(cutPoint);
continue;
}
}
@@ -123,6 +137,9 @@ public class AutoSendAirShaftAgvTask {
area));
if (emptyPoint.size() == 0) {
log.warn("当前分切机找不到空闲的对接位置!");
cutPoint.setRemark("找不到当前分切机空闲的对接位置,暂时不送轴!");
cutPoint.setUpdate_time(DateUtil.now());
bcutpointivtService.updateById(cutPoint);
continue;
}
// 创建任务

View File

@@ -1042,6 +1042,7 @@ public class SlitterServiceImpl implements SlitterService {
shaftPoint.setQzz_size("");
TaskUtils.updateOptMessageByBShaftPoint(shaftPoint);
shafttubeivtService.update(shaftPoint);
// todo: 初始化 预分配点位
JSONObject res = new JSONObject();
res.put("status", HttpStatus.HTTP_OK);
res.put("message", "请求成功!");