opt: B2分切对接位下料校验起点问题,异常提示

This commit is contained in:
2025-01-07 10:26:47 +08:00
parent 4be3280f46
commit 8f47bed08e
6 changed files with 31 additions and 4 deletions

View File

@@ -27,4 +27,11 @@ public interface SchBaseTaskMapper extends BaseMapper<SchBaseTask> {
* @return /
*/
List<SchBaseTask> getTaskByPlanQzzNoAndDevice(String resourceName);
/**
* 检测点位起点的任务是否存在
* @param code
* @return
*/
List<SchBaseTask> checkHaveStartTask(String code);
}

View File

@@ -7,6 +7,7 @@
SELECT *
FROM sch_base_task
WHERE task_status <![CDATA[ <= ]]> '071' AND task_status <![CDATA[ <> ]]> '07'
AND is_delete = '0'
AND ( point_code1 = #{code}
OR point_code2 = #{code}
OR point_code3 = #{code}
@@ -20,4 +21,11 @@
AND p.resource_name = #{resourceName}
AND IFNULL(p.qzzno, '') <![CDATA[ <> ]]> ''
</select>
<select id="checkHaveStartTask" resultType="org.nl.b_lms.sch.task.dao.SchBaseTask">
SELECT *
FROM sch_base_task
WHERE task_status <![CDATA[ <= ]]> '071' AND task_status <![CDATA[ <> ]]> '07'
AND is_delete = '0'
AND point_code1 = #{code}
</select>
</mapper>

View File

@@ -87,6 +87,13 @@ public interface IschBaseTaskService extends IService<SchBaseTask> {
* @return /
*/
Boolean checkHaveTaskByZcPoint(BstIvtCutpointivt point);
/**
* 判断是否有起点未完成的任务
* @param pointCode
* @return
*/
List<SchBaseTask> checkHaveStartTask(String pointCode);
}

View File

@@ -161,6 +161,11 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
return list(lam).size() > 0;
}
@Override
public List<SchBaseTask> checkHaveStartTask(String pointCode) {
return schBaseTaskMapper.checkHaveStartTask(pointCode);
}
}

View File

@@ -60,7 +60,7 @@
AND bcp.point_location = #{location}
AND 0 = (
SELECT COUNT(*) FROM sch_base_task t
WHERE t.task_status <![CDATA[ <= ]]> '071' AND t.task_status <![CDATA[ <> ]]> '07' AND (t.point_code2 = bcp.point_code OR t.point_code2 = bcp.truss_point_code1
WHERE t.task_status <![CDATA[ <= ]]> '071' AND 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 = ABS(bcp.sort_seq - #{sortSeq})

View File

@@ -530,8 +530,8 @@ public class SlitterServiceImpl implements SlitterService {
device.getSort_seq(),
getPointLocationInCutDevice(getNumberByResourceCode(demoPlan.getResource_name()), area));
if (emptyPoints.size() == 0) {
log.error("分切机【" + device.getExt_code() + "】找不到对应的对接位!");
throw new BadRequestException("分切机【" + device.getExt_code() + "】找不到对应的对接位!");
log.error("分切机【" + device.getExt_code() + "】找不到对应的对接位, 或已存在任务!");
throw new BadRequestException("分切机【" + device.getExt_code() + "】找不到对应的对接位,或已存在任务!");
}
// 枷锁
BstIvtCutpointivt emptyPoint = emptyPoints.get(0);
@@ -1549,7 +1549,7 @@ public class SlitterServiceImpl implements SlitterService {
// param: point_code
String pointCode = param.getString("point_code");
// 校验是否存在任务
List<SchBaseTask> taskList = taskService.checkHaveTask(pointCode);
List<SchBaseTask> taskList = taskService.checkHaveStartTask(pointCode);
if (taskList.size() > 0) {
throw new BadRequestException("操作失败,点位[" + pointCode + "]存在未完成的任务!");
}