opt: 分切计划为改切造成套轴问题
This commit is contained in:
@@ -136,4 +136,6 @@ public interface IPdmBiSlittingproductionplanService extends IService<PdmBiSlitt
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
PdmBiSlittingproductionplan getByContainerNameNotStatus(String containerName);
|
PdmBiSlittingproductionplan getByContainerNameNotStatus(String containerName);
|
||||||
|
|
||||||
|
List<SlitterPlanDistinctDto> getAllHalfPlanRestruct(List<String> qzzs);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,4 +17,6 @@ public interface PdmBiSlittingproductionplanMapper extends BaseMapper<PdmBiSlitt
|
|||||||
List<SlitterPlanDistinctDto> getAllHalfPlan(List<String> qzzs);
|
List<SlitterPlanDistinctDto> getAllHalfPlan(List<String> qzzs);
|
||||||
|
|
||||||
List<PdmBiSlittingproductionplan> getCurrentPlanInfos(SlitterPlanDistinctDto dto);
|
List<PdmBiSlittingproductionplan> getCurrentPlanInfos(SlitterPlanDistinctDto dto);
|
||||||
|
|
||||||
|
List<SlitterPlanDistinctDto> getAllHalfPlanRestruct(List<String> qzzs);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,4 +151,49 @@
|
|||||||
AND (p.parent_container_name = #{parent_container_name} OR restruct_container_name = #{parent_container_name})
|
AND (p.parent_container_name = #{parent_container_name} OR restruct_container_name = #{parent_container_name})
|
||||||
AND p.split_group <![CDATA[ <> ]]> #{split_group}
|
AND p.split_group <![CDATA[ <> ]]> #{split_group}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getAllHalfPlanRestruct"
|
||||||
|
resultType="org.nl.b_lms.sch.tasks.slitter.mapper.dto.SlitterPlanDistinctDto">
|
||||||
|
WITH RankedData AS (
|
||||||
|
SELECT
|
||||||
|
p1.resource_name,
|
||||||
|
p1.restruct_container_name AS parent_container_name,
|
||||||
|
p1.split_group,
|
||||||
|
p1.up_or_down,
|
||||||
|
'1' AS num,
|
||||||
|
p1.qzz_size,
|
||||||
|
p1.qzz_generation,
|
||||||
|
ROW_NUMBER() OVER ( PARTITION BY p1.restruct_container_name, p1.split_group ORDER BY p1.resource_name ) AS rn
|
||||||
|
FROM
|
||||||
|
pdm_bi_slittingproductionplan p1
|
||||||
|
JOIN (
|
||||||
|
SELECT DISTINCT
|
||||||
|
p.qzzno,
|
||||||
|
p.restruct_container_name,
|
||||||
|
p.split_group,
|
||||||
|
p.up_or_down
|
||||||
|
FROM
|
||||||
|
pdm_bi_slittingproductionplan p
|
||||||
|
WHERE
|
||||||
|
p.qzzno IN
|
||||||
|
<foreach item="item" index="index" collection="qzzs" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
) p2 ON p1.restruct_container_name = p2.restruct_container_name
|
||||||
|
AND p1.split_group = p2.split_group
|
||||||
|
AND p1.up_or_down <![CDATA[ <> ]]> p2.up_or_down
|
||||||
|
AND p1.is_delete = '0'
|
||||||
|
AND p1.is_paper_ok = '1'
|
||||||
|
) SELECT
|
||||||
|
resource_name,
|
||||||
|
parent_container_name,
|
||||||
|
split_group,
|
||||||
|
up_or_down,
|
||||||
|
num,
|
||||||
|
qzz_size,
|
||||||
|
qzz_generation
|
||||||
|
FROM
|
||||||
|
RankedData
|
||||||
|
WHERE
|
||||||
|
rn = 1;
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -191,4 +191,9 @@ public class PdmBiSlittingproductionplanServiceImpl extends ServiceImpl<PdmBiSli
|
|||||||
lam.eq(PdmBiSlittingproductionplan::getContainer_name, containerName);
|
lam.eq(PdmBiSlittingproductionplan::getContainer_name, containerName);
|
||||||
return getOne(lam, false);
|
return getOne(lam, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SlitterPlanDistinctDto> getAllHalfPlanRestruct(List<String> qzzs) {
|
||||||
|
return pdmBiSlittingproductionplanMapper.getAllHalfPlanRestruct(qzzs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,7 +154,18 @@ public class AutoCallAirShaftTask {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 从寻查找分切计划,并放在plans, 没有考虑区域问题, 里面会考虑代数
|
// 从寻查找分切计划,并放在plans, 没有考虑区域问题, 里面会考虑代数
|
||||||
plans = slittingproductionplanService.getAllHalfPlan(qzzs);
|
List<PdmBiSlittingproductionplan> tzOKPlans = slittingproductionplanService.getByQzzNos(qzzs, "01");
|
||||||
|
if (ObjectUtil.isEmpty(tzOKPlans)) {
|
||||||
|
log.info("计划找不到");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
PdmBiSlittingproductionplan oneTzOkPlan = tzOKPlans.get(0);
|
||||||
|
if (oneTzOkPlan.getOrder_type().equals("1")) {
|
||||||
|
plans = slittingproductionplanService.getAllHalfPlan(qzzs);
|
||||||
|
} else {
|
||||||
|
// 改切
|
||||||
|
plans = slittingproductionplanService.getAllHalfPlanRestruct(qzzs);
|
||||||
|
}
|
||||||
if (plans.size() == 0) {
|
if (plans.size() == 0) {
|
||||||
log.info("没有找到对应的另一半分切计划没有找到");
|
log.info("没有找到对应的另一半分切计划没有找到");
|
||||||
// 如果不需要套轴,就只做拔轴
|
// 如果不需要套轴,就只做拔轴
|
||||||
|
|||||||
@@ -102,11 +102,13 @@ public class AutoSendAirShaftAgvTask {
|
|||||||
// 单条可能还有一条未套轴
|
// 单条可能还有一条未套轴
|
||||||
List<PdmBiSlittingproductionplan> list = slittingproductionplanService.list(new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
List<PdmBiSlittingproductionplan> list = slittingproductionplanService.list(new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||||
.eq(PdmBiSlittingproductionplan::getParent_container_name, demoPlan.getParent_container_name())
|
.eq(PdmBiSlittingproductionplan::getParent_container_name, demoPlan.getParent_container_name())
|
||||||
|
.eq(PdmBiSlittingproductionplan::getRestruct_container_name, demoPlan.getRestruct_container_name())
|
||||||
.eq(PdmBiSlittingproductionplan::getResource_name, demoPlan.getResource_name())
|
.eq(PdmBiSlittingproductionplan::getResource_name, demoPlan.getResource_name())
|
||||||
.eq(PdmBiSlittingproductionplan::getSplit_group, demoPlan.getSplit_group())
|
.eq(PdmBiSlittingproductionplan::getSplit_group, demoPlan.getSplit_group())
|
||||||
.ne(PdmBiSlittingproductionplan::getUp_or_down, demoPlan.getUp_or_down())
|
.ne(PdmBiSlittingproductionplan::getUp_or_down, demoPlan.getUp_or_down())
|
||||||
.eq(PdmBiSlittingproductionplan::getIs_delete, SlitterConstant.SLITTER_NO));
|
.eq(PdmBiSlittingproductionplan::getIs_delete, SlitterConstant.SLITTER_NO));
|
||||||
if (list.size() > 0) {
|
if (list.size() > 0) {
|
||||||
|
log.info("还有不同轴,所以不继续");
|
||||||
// 还有不同轴,所以不继续
|
// 还有不同轴,所以不继续
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user