fix: 套轴加强校验气涨轴库库存校验(1、2号插拔轴机同时申请套管,气胀轴库里只有1根轴,但是同时生成了两个分别去1、2号拔轴机的任务)

This commit is contained in:
2025-05-01 15:03:44 +08:00
parent 29fa04701a
commit 368f6b6427
7 changed files with 56 additions and 9 deletions

View File

@@ -86,6 +86,14 @@ public interface IBstIvtShafttubeivtService extends IService<BstIvtShafttubeivt>
* @return
*/
List<BstIvtShafttubeivt> getNotTaskShaftCache(String qzzSize, String specification, String location);
/**
* 获取没任务的气涨轴缓存位2
* @param qzzSize
* @param specification
* @param location
* @return
*/
List<BstIvtShafttubeivt> getNotTaskShaftCache2(String qzzSize, String specification, String location);
/**
* 获取没任务的空的位置

View File

@@ -39,4 +39,15 @@ public interface BstIvtShafttubeivtMapper extends BaseMapper<BstIvtShafttubeivt>
List<BstIvtShafttubeivt> getNotTaskEmptyShaftCache(@Param("size") String size,
@Param("qzz_generation") String qzz_generation,
@Param("location") String location);
/**
* 获取含有气胀轴的气胀轴暂存位
* @param qzzSize 气胀轴尺寸
* @param specification 标箔/锂电
* @param location 位置(上下)
* @return /
*/
List<BstIvtShafttubeivt> getNotTaskShaftCache2(@Param("qzzSize") String qzzSize,
@Param("specification") String specification,
@Param("location") String location);
}

View File

@@ -83,4 +83,19 @@
AND bb.qzz_size = #{size} AND bb.point_location = #{location} AND bb.sort_seq > b.sort_seq)
ORDER BY b.sort_seq ASC
</select>
<select id="getNotTaskShaftCache2"
resultType="org.nl.b_lms.bst.ivt.shafttubeivt.service.dao.BstIvtShafttubeivt">
SELECT *
FROM `bst_ivt_shafttubeivt` b
WHERE b.have_qzz = '1'
AND b.point_type = '6'
AND b.qzz_size = #{qzzSize}
<if test="qzzSize != 6">
AND b.qzz_generation = #{specification}
</if>
AND b.point_location = #{location}
AND 0 = (SELECT COUNT(*) FROM sch_base_task t WHERE t.task_status <![CDATA[ < ]]> '07' AND t.point_code1 = b.point_code)
AND (b.plan <![CDATA[ <> ]]> '1' OR b.plan IS NULL)
ORDER BY b.sort_seq DESC
</select>
</mapper>

View File

@@ -127,6 +127,11 @@ public class BstIvtShafttubeivtServiceImpl extends ServiceImpl<BstIvtShafttubeiv
return bstIvtShafttubeivtMapper.getNotTaskShaftCache(qzzSize, specification, location);
}
@Override
public List<BstIvtShafttubeivt> getNotTaskShaftCache2(String qzzSize, String specification, String location) {
return bstIvtShafttubeivtMapper.getNotTaskShaftCache2(qzzSize, specification, location);
}
@Override
public List<BstIvtShafttubeivt> getNotTaskShaftCacheEmpty(BstIvtShafttubeivt startPoint) {
return bstIvtShafttubeivtMapper.getNotTaskShaftCacheEmpty(startPoint);

View File

@@ -86,6 +86,8 @@ public class TrussCallShaftCacheTask extends AbstractAcsTask {
// 起点清空,如果是入密集库的行架任务,起点不清空
if(!startPointObj.getPoint_code().contains("B_CBJ")){
startPointObj.setHave_qzz("0");
startPointObj.setTube_name1("");
startPointObj.setPlan("");
TaskUtils.updateOptMessageByBShaftPoint(startPointObj);
shafttubeivtService.updateById(startPointObj);
}

View File

@@ -1,5 +1,6 @@
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.JSON;
import com.alibaba.fastjson.JSONArray;
@@ -578,18 +579,26 @@ public class AutoCallAirShaftTask {
}
boolean judgment1 = true;
boolean judgment2 = true;
JSONObject data2 = pointStatus.getJSONArray("data").getJSONObject(0);
if (data2.getInteger("qty") == 0) {
log.warn("气胀轴库【" + shafttubeivt.getPoint_code() + "】没有气胀轴。");
judgment1 = false;
}
// 获取气涨轴缓存没有任务的点位
List<BstIvtShafttubeivt> qzzCache = bstIvtShafttubeivtService.getNotTaskShaftCache(qzzSize,
List<BstIvtShafttubeivt> qzzCache = bstIvtShafttubeivtService.getNotTaskShaftCache2(qzzSize,
shafttubeivt.getQzz_generation(), location);
if (qzzCache.size() == 0) {
log.warn("未找到气胀轴密集库气涨轴规格「" + qzzSize + "」的暂存位");
judgment2 = false;
}
JSONObject data2 = pointStatus.getJSONArray("data").getJSONObject(0);
if (data2.getInteger("qty") == 0) {
log.warn("气胀轴库【" + shafttubeivt.getPoint_code() + "】没有气胀轴。");
judgment1 = false;
// 预扣除
if (judgment2) {
BstIvtShafttubeivt waitUsedPoint = qzzCache.get(0);
waitUsedPoint.setPlan("1");
waitUsedPoint.setTube_name1("预分配给" + empty.getPoint_code());
waitUsedPoint.setUpdate_time(DateUtil.now());
bstIvtShafttubeivtService.updateById(waitUsedPoint);
}
}
stepStr += ",30";
if (!judgment1 && !judgment2) {
log.warn("没有气胀轴不给ACS写出轴信息");

View File

@@ -12,9 +12,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.nl.b_lms.bst.ivt.cutpointivt.service.IBstIvtCutpointivtService;