opt: 分切暂存<>内包间任务过滤071任务状态
This commit is contained in:
@@ -147,7 +147,9 @@
|
||||
FROM sch_base_task t
|
||||
WHERE t.task_status <![CDATA[ < ]]> '07'
|
||||
AND t.is_delete = '0'
|
||||
AND (t.point_code1 = bic.point_code OR t.point_code2 = bic.point_code)
|
||||
AND (t.point_code1 = bic.point_code OR t.point_code2 = bic.point_code
|
||||
OR t.point_code1 = bic.truss_point_code1 oR t.point_code2 = bic.truss_point_code1
|
||||
OR t.point_code1 = bic.truss_point_code2 oR t.point_code2 = bic.truss_point_code2)
|
||||
)
|
||||
AND 0 = (SELECT COUNT(*)
|
||||
FROM sch_base_task t
|
||||
|
||||
@@ -116,7 +116,12 @@ public class AutoSendAirShaftAgvTask {
|
||||
// 如果两个气涨轴编码则表示一组满了
|
||||
// 查找分切对接没任务的空位
|
||||
// hint: B1、B2、B3、B4分切区分两个桁架位置 (B1,B3: 1-6为上。B2,B4是1-5为上区域)
|
||||
List<BstIvtCutpointivt> emptyPoint = slitterMapper.getEmptyCutPointNotTask(area,
|
||||
// List<BstIvtCutpointivt> emptyPoint = slitterMapper.getEmptyCutPointNotTask(area,
|
||||
// deviceCut.getSort_seq(),
|
||||
// SlitterTaskUtil.getPointLocationInCutDevice(
|
||||
// SlitterTaskUtil.getNumberByResourceCode(demoPlan.getResource_name()),
|
||||
// area));
|
||||
List<BstIvtCutpointivt> emptyPoint = slitterMapper.nbjGetEmptyCutPointNotTask(area,
|
||||
deviceCut.getSort_seq(),
|
||||
SlitterTaskUtil.getPointLocationInCutDevice(
|
||||
SlitterTaskUtil.getNumberByResourceCode(demoPlan.getResource_name()),
|
||||
|
||||
@@ -50,4 +50,13 @@ public interface SlitterMapper {
|
||||
List<BstIvtCutpointivt> getReadyShaftPoint(String extCode);
|
||||
|
||||
List<BstIvtCutpointivt> getAreaFullVolumeByArea(List<String> areas);
|
||||
|
||||
/**
|
||||
* 内包间获取分切机下料位没任务的点位,过滤071任务
|
||||
* @param area
|
||||
* @param sortSeq
|
||||
* @param location
|
||||
* @return
|
||||
*/
|
||||
List<BstIvtCutpointivt> nbjGetEmptyCutPointNotTask(String area, BigDecimal sortSeq, String location);
|
||||
}
|
||||
|
||||
@@ -100,4 +100,40 @@
|
||||
))
|
||||
ORDER BY bct.point_type DESC
|
||||
</select>
|
||||
<select id="nbjGetEmptyCutPointNotTask"
|
||||
resultType="org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt">
|
||||
SELECT
|
||||
bcp.*
|
||||
FROM
|
||||
`bst_ivt_cutpointivt` bcp
|
||||
WHERE bcp.point_type = '3' AND bcp.point_status = '1' AND bcp.is_used = '1'
|
||||
AND bcp.product_area = #{area}
|
||||
AND bcp.point_location = #{location}
|
||||
AND 0 = (
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
sch_base_task t
|
||||
WHERE
|
||||
t.task_status <![CDATA[ < ]]> '07'
|
||||
AND t.is_delete = '0'
|
||||
AND (
|
||||
t.point_code2 = bcp.point_code
|
||||
OR t.point_code2 = bcp.truss_point_code1
|
||||
OR t.point_code4 = bcp.truss_point_code1
|
||||
OR t.point_code2 = bcp.truss_point_code2
|
||||
OR t.point_code4 = bcp.truss_point_code2
|
||||
)
|
||||
)
|
||||
AND 0 = (
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
sch_base_task t
|
||||
WHERE t.task_status = '071'
|
||||
AND t.is_delete = '0'
|
||||
AND t.point_code2 = bcp.point_code
|
||||
)
|
||||
AND 0 = ABS(bcp.sort_seq - #{sortSeq})
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -391,29 +391,30 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
@Override
|
||||
public JSONObject acsSendShaftToCache(JSONObject param) {
|
||||
log.info("ACS申请送气涨轴到气涨轴暂存位的输入参数为:{}", param);
|
||||
String lock = "lock";
|
||||
JSONObject res = new JSONObject();
|
||||
String deviceCode = param.getString("device_code");
|
||||
String qzzSize = param.getString("size");
|
||||
// 判断是否有未完成的任务
|
||||
List<SchBaseTask> list = taskService.list(new LambdaQueryWrapper<SchBaseTask>()
|
||||
.eq(SchBaseTask::getPoint_code1, deviceCode)
|
||||
.lt(SchBaseTask::getTask_status, "07"));
|
||||
if (list.size() > 0) {
|
||||
throw new BadRequestException("点位[" + deviceCode + "]存在未完成得任务!");
|
||||
}
|
||||
BstIvtShafttubeivt startPoint = shafttubeivtService.getByPointCode(deviceCode, false);
|
||||
// 临时存放气涨轴尺寸
|
||||
startPoint.setQzz_size(qzzSize);
|
||||
// 获取空位
|
||||
List<BstIvtShafttubeivt> shafttubeivts = shafttubeivtService.getNotTaskShaftCacheEmpty(startPoint);
|
||||
if (shafttubeivts.size() == 0) {
|
||||
throw new BadRequestException("未找到可存放气涨轴规格「" + qzzSize + "」的空暂存位");
|
||||
}
|
||||
BstIvtShafttubeivt shafttubeivt = shafttubeivts.get(0);
|
||||
RLock lockPoint = redissonClient.getLock(shafttubeivt.getPoint_code());
|
||||
RLock lockPoint = redissonClient.getLock(lock + qzzSize);
|
||||
boolean tryLockPoint = lockPoint.tryLock(0, TimeUnit.SECONDS);
|
||||
try {
|
||||
if (tryLockPoint) {
|
||||
// 判断是否有未完成的任务
|
||||
List<SchBaseTask> list = taskService.list(new LambdaQueryWrapper<SchBaseTask>()
|
||||
.eq(SchBaseTask::getPoint_code1, deviceCode)
|
||||
.lt(SchBaseTask::getTask_status, "07"));
|
||||
if (list.size() > 0) {
|
||||
throw new BadRequestException("点位[" + deviceCode + "]存在未完成得任务!");
|
||||
}
|
||||
BstIvtShafttubeivt startPoint = shafttubeivtService.getByPointCode(deviceCode, false);
|
||||
// 临时存放气涨轴尺寸
|
||||
startPoint.setQzz_size(qzzSize);
|
||||
// 获取空位
|
||||
List<BstIvtShafttubeivt> shafttubeivts = shafttubeivtService.getNotTaskShaftCacheEmpty(startPoint);
|
||||
if (shafttubeivts.size() == 0) {
|
||||
throw new BadRequestException("未找到可存放气涨轴规格「" + qzzSize + "」的空暂存位");
|
||||
}
|
||||
BstIvtShafttubeivt shafttubeivt = shafttubeivts.get(0);
|
||||
// 创建任务
|
||||
param.put("point_code1", deviceCode);
|
||||
param.put("point_code2", shafttubeivt.getPoint_code());
|
||||
@@ -1400,7 +1401,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
String upQzzno = deviceCode.getUp_qzzno();
|
||||
String downQzzno = deviceCode.getDown_qzzno();
|
||||
if (ObjectUtil.isNotEmpty(upQzzno)) {
|
||||
List<PdmBiSlittingproductionplan> byQzzNo = slittingproductionplanService.getByQzzNoByStatus(upQzzno, "05");
|
||||
List<PdmBiSlittingproductionplan> byQzzNo = slittingproductionplanService.getByQzzNoByNoStatus(upQzzno);
|
||||
if (byQzzNo.size() == 0) {
|
||||
msg = "上轴对应的数据不存在!";
|
||||
} else {
|
||||
@@ -1409,12 +1410,16 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
.map(PdmBiSlittingproductionplan::getContainer_name)
|
||||
.collect(Collectors.joining(","));
|
||||
data.put("up", collect);
|
||||
PdmBiSlittingproductionplan dplan = byQzzNo.get(0);
|
||||
if (!dplan.getStatus().equals("05")) {
|
||||
msg = "上轴的计划不是入站完成!";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
msg = "上轴无子卷信息!";
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(downQzzno)) {
|
||||
List<PdmBiSlittingproductionplan> byQzzNo = slittingproductionplanService.getByQzzNoByStatus(downQzzno, "05");
|
||||
List<PdmBiSlittingproductionplan> byQzzNo = slittingproductionplanService.getByQzzNoByNoStatus(downQzzno);
|
||||
if (byQzzNo.size() == 0) {
|
||||
msg = msg + "下轴对应的数据不存在!";
|
||||
} else {
|
||||
@@ -1423,6 +1428,10 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
.map(PdmBiSlittingproductionplan::getContainer_name)
|
||||
.collect(Collectors.joining(","));
|
||||
data.put("down", collect);
|
||||
PdmBiSlittingproductionplan dplan = byQzzNo.get(0);
|
||||
if (!dplan.getStatus().equals("05")) {
|
||||
msg = "下轴的计划不是入站完成!";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
msg = msg + "下轴无子卷信息!";
|
||||
|
||||
Reference in New Issue
Block a user