fix: 过滤分切计划
This commit is contained in:
@@ -2,6 +2,7 @@ package org.nl.b_lms.bst.ivt.cutpointivt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.nl.b_lms.bst.ivt.cutpointivt.service.dto.BstIvtCutpointivtQuery;
|
||||
import org.nl.b_lms.sch.tasks.slitter.mapper.dto.SlitterPlanDistinctDto;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt;
|
||||
@@ -99,4 +100,18 @@ public interface IBstIvtCutpointivtService extends IService<BstIvtCutpointivt> {
|
||||
* @return /
|
||||
*/
|
||||
List<BstIvtCutpointivt> getPintByAgvCodesByPointType(String pointType);
|
||||
|
||||
/**
|
||||
* 校验相同母卷、相同设备、相同组的数据
|
||||
* @param dto /
|
||||
* @return /
|
||||
*/
|
||||
List<BstIvtCutpointivt> getCachePointSame(SlitterPlanDistinctDto dto);
|
||||
|
||||
/**
|
||||
* 获取准备好的气胀轴,套好纸管
|
||||
* @param resourceName 设备号
|
||||
* @return /
|
||||
*/
|
||||
List<BstIvtCutpointivt> getReallyQzzSameDevice(String resourceName);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.nl.b_lms.bst.ivt.cutpointivt.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt;
|
||||
import org.nl.b_lms.sch.tasks.slitter.mapper.dto.SlitterPlanDistinctDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -18,4 +19,8 @@ public interface BstIvtCutpointivtMapper extends BaseMapper<BstIvtCutpointivt> {
|
||||
List<BstIvtCutpointivt> getAreaNotTaskPointByLocationAreaAndStatus(String location);
|
||||
|
||||
List<BstIvtCutpointivt> getAllHalfPlacePoints(String type, String pointStatus, String location);
|
||||
|
||||
List<BstIvtCutpointivt> getCachePointSame(SlitterPlanDistinctDto dto);
|
||||
|
||||
List<BstIvtCutpointivt> getReallyQzzSameDevice(String resourceName);
|
||||
}
|
||||
|
||||
@@ -91,4 +91,21 @@
|
||||
)
|
||||
)
|
||||
</select>
|
||||
<select id="getCachePointSame" resultType="org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt">
|
||||
SELECT bc.*
|
||||
FROM bst_ivt_cutpointivt bc
|
||||
LEFT JOIN pdm_bi_slittingproductionplan p ON p.qzzno = bc.qzz_no1 OR p.qzzno = bc.qzz_no2
|
||||
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.parent_container_name = #{parent_container_name} AND p.split_group = #{split_group}
|
||||
</select>
|
||||
<select id="getReallyQzzSameDevice"
|
||||
resultType="org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt">
|
||||
SELECT bc.*
|
||||
FROM bst_ivt_cutpointivt bc
|
||||
LEFT JOIN pdm_bi_slittingproductionplan p ON p.qzzno = bc.qzz_no1 OR p.qzzno = bc.qzz_no2
|
||||
WHERE bc.point_type IN ('1', '3') AND bc.point_status = '2'
|
||||
AND p.resource_name = #{resource_name}
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -14,6 +14,7 @@ import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt;
|
||||
import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.mapper.BstIvtCutpointivtMapper;
|
||||
import org.nl.b_lms.bst.ivt.cutpointivt.service.dto.BstIvtCutpointivtQuery;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
||||
import org.nl.b_lms.sch.tasks.slitter.mapper.dto.SlitterPlanDistinctDto;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
@@ -130,4 +131,14 @@ public class BstIvtCutpointivtServiceImpl extends ServiceImpl<BstIvtCutpointivtM
|
||||
return bstIvtCutpointivtMapper.selectList(new LambdaQueryWrapper<BstIvtCutpointivt>()
|
||||
.eq(BstIvtCutpointivt::getPoint_type, pointType));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BstIvtCutpointivt> getCachePointSame(SlitterPlanDistinctDto dto) {
|
||||
return bstIvtCutpointivtMapper.getCachePointSame(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BstIvtCutpointivt> getReallyQzzSameDevice(String resourceName) {
|
||||
return bstIvtCutpointivtMapper.getReallyQzzSameDevice(resourceName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,4 +20,11 @@ public interface SchBaseTaskMapper extends BaseMapper<SchBaseTask> {
|
||||
* @return 任务
|
||||
*/
|
||||
List<SchBaseTask> checkHaveTask(String code);
|
||||
|
||||
/**
|
||||
* 查找当前设备有没有送轴的任务
|
||||
* @param resourceName /
|
||||
* @return /
|
||||
*/
|
||||
List<SchBaseTask> getTaskByPlanQzzNoAndDevice(String resourceName);
|
||||
}
|
||||
|
||||
@@ -13,4 +13,10 @@
|
||||
OR point_code4 = #{code}
|
||||
)
|
||||
</select>
|
||||
<select id="getTaskByPlanQzzNoAndDevice" resultType="org.nl.b_lms.sch.task.dao.SchBaseTask">
|
||||
SELECT t.* FROM sch_base_task t
|
||||
LEFT JOIN pdm_bi_slittingproductionplan p ON p.qzzno = t.vehicle_code OR p.qzzno = t.vehicle_code2
|
||||
WHERE t.task_status <![CDATA[ <= ]]> '071' AND t.task_status <![CDATA[ <> ]]> '07' AND t.task_type = '010813'
|
||||
AND p.resource_name = #{resourceName}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -66,6 +66,13 @@ public interface IschBaseTaskService extends IService<SchBaseTask> {
|
||||
* @return 任务
|
||||
*/
|
||||
List<SchBaseTask> checkHaveTask(String code);
|
||||
|
||||
/**
|
||||
* 查找当前设备有没有送轴的任务
|
||||
* @param resourceName /
|
||||
* @return /
|
||||
*/
|
||||
List<SchBaseTask> getTaskByPlanQzzNoAndDevice(String resourceName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -108,9 +108,10 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
||||
return schBaseTaskMapper.checkHaveTask(code);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public List<SchBaseTask> getTaskByPlanQzzNoAndDevice(String resourceName) {
|
||||
return schBaseTaskMapper.getTaskByPlanQzzNoAndDevice(resourceName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -99,7 +99,8 @@ public class AutoCallAirShaftTask {
|
||||
// 2、获取分切计划数据 校验代数
|
||||
List<SlitterPlanDistinctDto> planAll = slittingproductionplanService.getAllCutPlan();
|
||||
List<SlitterPlanDistinctDto> plans = planAll.stream()
|
||||
.filter(p -> p.getResource_name().startsWith("B6")).collect(Collectors.toList());
|
||||
.filter(p -> p.getResource_name().startsWith("B6") &&
|
||||
(checkComputationPoint(p) && checkHasTask(p))).collect(Collectors.toList());
|
||||
if (plans.size() == 0) {
|
||||
// 如果不需要套轴,就只做拔轴
|
||||
makePullShaft(empty, specification);
|
||||
@@ -458,9 +459,11 @@ public class AutoCallAirShaftTask {
|
||||
* @return
|
||||
*/
|
||||
public boolean checkHasTask(SlitterPlanDistinctDto dto) {
|
||||
// 同设备,同母卷,同组别的任务
|
||||
|
||||
// 桁架也需要校验
|
||||
// 同设备,同母卷,同组别的AGV任务 010813。
|
||||
List<SchBaseTask> tasks = taskService.getTaskByPlanQzzNoAndDevice(dto.getResource_name());
|
||||
if (tasks.size() == 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -471,7 +474,18 @@ public class AutoCallAirShaftTask {
|
||||
*/
|
||||
public boolean checkComputationPoint(SlitterPlanDistinctDto dto) {
|
||||
// 同设备,同母卷,同组别的点位
|
||||
|
||||
if (ObjectUtil.isNotEmpty(dto)) {
|
||||
List<BstIvtCutpointivt> cuts = bcutpointivtService.getCachePointSame(dto);
|
||||
if (cuts.size() > 0) {
|
||||
return true;
|
||||
}
|
||||
// 校验是否在拔轴暂存位、分切对接位有相同设备的分切计划信息。
|
||||
// 有就返回false, 没有就返回true
|
||||
List<BstIvtCutpointivt> cuts2 = bcutpointivtService.getReallyQzzSameDevice(dto.getResource_name());
|
||||
if (cuts2.size() == 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// 有就返回true
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
LIMIT 1
|
||||
</select>
|
||||
<select id="getSameGroupTaskPoint" resultType="java.lang.String">
|
||||
SELECT t.point_code2
|
||||
SELECT DISTINCT t.point_code2
|
||||
FROM sch_base_task t
|
||||
LEFT JOIN pdm_bi_slittingproductionplan p ON t.vehicle_code = p.qzzno OR t.vehicle_code2 = p.qzzno
|
||||
WHERE t.task_status <![CDATA[ < ]]> '07' AND t.handle_class = 'org.nl.b_lms.sch.tasks.slitter.TrussSendAirShaftTask'
|
||||
|
||||
Reference in New Issue
Block a user