opt: 分切暂存<>内包间任务过滤071任务状态
This commit is contained in:
@@ -147,7 +147,9 @@
|
|||||||
FROM sch_base_task t
|
FROM sch_base_task t
|
||||||
WHERE t.task_status <![CDATA[ < ]]> '07'
|
WHERE t.task_status <![CDATA[ < ]]> '07'
|
||||||
AND t.is_delete = '0'
|
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(*)
|
AND 0 = (SELECT COUNT(*)
|
||||||
FROM sch_base_task t
|
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为上区域)
|
// 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(),
|
deviceCut.getSort_seq(),
|
||||||
SlitterTaskUtil.getPointLocationInCutDevice(
|
SlitterTaskUtil.getPointLocationInCutDevice(
|
||||||
SlitterTaskUtil.getNumberByResourceCode(demoPlan.getResource_name()),
|
SlitterTaskUtil.getNumberByResourceCode(demoPlan.getResource_name()),
|
||||||
|
|||||||
@@ -50,4 +50,13 @@ public interface SlitterMapper {
|
|||||||
List<BstIvtCutpointivt> getReadyShaftPoint(String extCode);
|
List<BstIvtCutpointivt> getReadyShaftPoint(String extCode);
|
||||||
|
|
||||||
List<BstIvtCutpointivt> getAreaFullVolumeByArea(List<String> areas);
|
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
|
ORDER BY bct.point_type DESC
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
|
|||||||
@@ -391,9 +391,14 @@ public class SlitterServiceImpl implements SlitterService {
|
|||||||
@Override
|
@Override
|
||||||
public JSONObject acsSendShaftToCache(JSONObject param) {
|
public JSONObject acsSendShaftToCache(JSONObject param) {
|
||||||
log.info("ACS申请送气涨轴到气涨轴暂存位的输入参数为:{}", param);
|
log.info("ACS申请送气涨轴到气涨轴暂存位的输入参数为:{}", param);
|
||||||
|
String lock = "lock";
|
||||||
JSONObject res = new JSONObject();
|
JSONObject res = new JSONObject();
|
||||||
String deviceCode = param.getString("device_code");
|
String deviceCode = param.getString("device_code");
|
||||||
String qzzSize = param.getString("size");
|
String qzzSize = param.getString("size");
|
||||||
|
RLock lockPoint = redissonClient.getLock(lock + qzzSize);
|
||||||
|
boolean tryLockPoint = lockPoint.tryLock(0, TimeUnit.SECONDS);
|
||||||
|
try {
|
||||||
|
if (tryLockPoint) {
|
||||||
// 判断是否有未完成的任务
|
// 判断是否有未完成的任务
|
||||||
List<SchBaseTask> list = taskService.list(new LambdaQueryWrapper<SchBaseTask>()
|
List<SchBaseTask> list = taskService.list(new LambdaQueryWrapper<SchBaseTask>()
|
||||||
.eq(SchBaseTask::getPoint_code1, deviceCode)
|
.eq(SchBaseTask::getPoint_code1, deviceCode)
|
||||||
@@ -410,10 +415,6 @@ public class SlitterServiceImpl implements SlitterService {
|
|||||||
throw new BadRequestException("未找到可存放气涨轴规格「" + qzzSize + "」的空暂存位");
|
throw new BadRequestException("未找到可存放气涨轴规格「" + qzzSize + "」的空暂存位");
|
||||||
}
|
}
|
||||||
BstIvtShafttubeivt shafttubeivt = shafttubeivts.get(0);
|
BstIvtShafttubeivt shafttubeivt = shafttubeivts.get(0);
|
||||||
RLock lockPoint = redissonClient.getLock(shafttubeivt.getPoint_code());
|
|
||||||
boolean tryLockPoint = lockPoint.tryLock(0, TimeUnit.SECONDS);
|
|
||||||
try {
|
|
||||||
if (tryLockPoint) {
|
|
||||||
// 创建任务
|
// 创建任务
|
||||||
param.put("point_code1", deviceCode);
|
param.put("point_code1", deviceCode);
|
||||||
param.put("point_code2", shafttubeivt.getPoint_code());
|
param.put("point_code2", shafttubeivt.getPoint_code());
|
||||||
@@ -1400,7 +1401,7 @@ public class SlitterServiceImpl implements SlitterService {
|
|||||||
String upQzzno = deviceCode.getUp_qzzno();
|
String upQzzno = deviceCode.getUp_qzzno();
|
||||||
String downQzzno = deviceCode.getDown_qzzno();
|
String downQzzno = deviceCode.getDown_qzzno();
|
||||||
if (ObjectUtil.isNotEmpty(upQzzno)) {
|
if (ObjectUtil.isNotEmpty(upQzzno)) {
|
||||||
List<PdmBiSlittingproductionplan> byQzzNo = slittingproductionplanService.getByQzzNoByStatus(upQzzno, "05");
|
List<PdmBiSlittingproductionplan> byQzzNo = slittingproductionplanService.getByQzzNoByNoStatus(upQzzno);
|
||||||
if (byQzzNo.size() == 0) {
|
if (byQzzNo.size() == 0) {
|
||||||
msg = "上轴对应的数据不存在!";
|
msg = "上轴对应的数据不存在!";
|
||||||
} else {
|
} else {
|
||||||
@@ -1409,12 +1410,16 @@ public class SlitterServiceImpl implements SlitterService {
|
|||||||
.map(PdmBiSlittingproductionplan::getContainer_name)
|
.map(PdmBiSlittingproductionplan::getContainer_name)
|
||||||
.collect(Collectors.joining(","));
|
.collect(Collectors.joining(","));
|
||||||
data.put("up", collect);
|
data.put("up", collect);
|
||||||
|
PdmBiSlittingproductionplan dplan = byQzzNo.get(0);
|
||||||
|
if (!dplan.getStatus().equals("05")) {
|
||||||
|
msg = "上轴的计划不是入站完成!";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
msg = "上轴无子卷信息!";
|
msg = "上轴无子卷信息!";
|
||||||
}
|
}
|
||||||
if (ObjectUtil.isNotEmpty(downQzzno)) {
|
if (ObjectUtil.isNotEmpty(downQzzno)) {
|
||||||
List<PdmBiSlittingproductionplan> byQzzNo = slittingproductionplanService.getByQzzNoByStatus(downQzzno, "05");
|
List<PdmBiSlittingproductionplan> byQzzNo = slittingproductionplanService.getByQzzNoByNoStatus(downQzzno);
|
||||||
if (byQzzNo.size() == 0) {
|
if (byQzzNo.size() == 0) {
|
||||||
msg = msg + "下轴对应的数据不存在!";
|
msg = msg + "下轴对应的数据不存在!";
|
||||||
} else {
|
} else {
|
||||||
@@ -1423,6 +1428,10 @@ public class SlitterServiceImpl implements SlitterService {
|
|||||||
.map(PdmBiSlittingproductionplan::getContainer_name)
|
.map(PdmBiSlittingproductionplan::getContainer_name)
|
||||||
.collect(Collectors.joining(","));
|
.collect(Collectors.joining(","));
|
||||||
data.put("down", collect);
|
data.put("down", collect);
|
||||||
|
PdmBiSlittingproductionplan dplan = byQzzNo.get(0);
|
||||||
|
if (!dplan.getStatus().equals("05")) {
|
||||||
|
msg = "下轴的计划不是入站完成!";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
msg = msg + "下轴无子卷信息!";
|
msg = msg + "下轴无子卷信息!";
|
||||||
|
|||||||
Reference in New Issue
Block a user