rev: 分切呼叫套轴不区分锂电标箔,只区分气胀轴尺寸

This commit is contained in:
2024-04-29 08:43:43 +08:00
parent 537295a272
commit 819e8948a0
19 changed files with 121 additions and 83 deletions

View File

@@ -57,10 +57,10 @@ public interface IBstIvtCutpointivtService extends IService<BstIvtCutpointivt> {
* 获取同尺寸的气涨轴
* @param type 点位类型1套轴对接位2分切缓存位3分切对接位
* @param size 气涨轴尺寸
* @param area 区域0上1下
* @param generation 代数45
* @return /
*/
List<BstIvtCutpointivt> getPointByTypeAndShaftSize(String type, String size, String area);
List<BstIvtCutpointivt> getPointByTypeAndShaftSize(String type, String size, String generation);
/**
* 根据桁架对应的点位编码获取点位实体
@@ -80,8 +80,7 @@ public interface IBstIvtCutpointivtService extends IService<BstIvtCutpointivt> {
/**
* 获取类型1状态3没任务的点位
* @param location 区域0上1下
* @param area区域B1 B2 B3 B4
* @return
*/
List<BstIvtCutpointivt> getAreaNotTaskPointByLocationAreaAndStatus(String location, String area);
List<BstIvtCutpointivt> getAreaNotTaskPointByLocationAreaAndStatus(String location);
}

View File

@@ -1,6 +1,7 @@
package org.nl.b_lms.bst.ivt.cutpointivt.service.dao;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@@ -84,4 +85,9 @@ public class BstIvtCutpointivt implements Serializable {
private String point_status;
@TableField(exist = false)
private String qzz_generation;
@TableField(exist = false)
private String qzz_size;
}

View File

@@ -13,7 +13,7 @@ public interface BstIvtCutpointivtMapper extends BaseMapper<BstIvtCutpointivt> {
List<BstIvtCutpointivt> getAreaNotTaskPointByStatus(String type, String pointStatus, String area, String sort);
List<BstIvtCutpointivt> getPointByTypeAndShaftSize(String type, String size, String area);
List<BstIvtCutpointivt> getPointByTypeAndShaftSize(String type, String size, String generation);
List<BstIvtCutpointivt> getAreaNotTaskPointByLocationAreaAndStatus(String location, String area);
List<BstIvtCutpointivt> getAreaNotTaskPointByLocationAreaAndStatus(String location);
}

View File

@@ -29,11 +29,14 @@
resultType="org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt">
SELECT bc.*
FROM `bst_ivt_cutpointivt` bc
LEFT JOIN pdm_bi_slittingproductionplan pp ON pp.qzzno = bc.qzz_no1
OR pp.qzzno = bc.qzz_no2
LEFT JOIN pdm_bi_slittingproductionplan pp ON pp.qzzno = bc.qzz_no1
OR pp.qzzno = bc.qzz_no2
LEFT JOIN st_ivt_cutpointivt sc ON sc.ext_code = pp.resource_name
WHERE bc.point_type = #{type}
AND pp.qzz_size = #{size}
AND LEFT(pp.resource_name, 2) = #{area}
<if test="size == '3'">
AND sc.qzz_generation = #{generation}
</if>
AND bc.is_used = '1'
AND bc.point_status = '3'
AND 0 = (SELECT COUNT(*)
@@ -43,9 +46,10 @@
</select>
<select id="getAreaNotTaskPointByLocationAreaAndStatus"
resultType="org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt">
SELECT DISTINCT bic.*
SELECT DISTINCT bic.*, sc.qzz_generation, p.qzz_size
FROM bst_ivt_cutpointivt bic
LEFT JOIN pdm_bi_slittingproductionplan p ON p.qzzno = bic.qzz_no1 OR p.qzzno = bic.qzz_no2
LEFT JOIN st_ivt_cutpointivt sc ON sc.ext_code = p.resource_name
WHERE bic.point_type = '1'
AND bic.is_used = '1'
AND bic.point_status = '3'
@@ -57,6 +61,5 @@
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 LEFT(p.resource_name,2) = #{area}
</select>
</mapper>

View File

@@ -94,8 +94,8 @@ public class BstIvtCutpointivtServiceImpl extends ServiceImpl<BstIvtCutpointivtM
}
@Override
public List<BstIvtCutpointivt> getPointByTypeAndShaftSize(String type, String size, String area) {
return bstIvtCutpointivtMapper.getPointByTypeAndShaftSize(type, size, area);
public List<BstIvtCutpointivt> getPointByTypeAndShaftSize(String type, String size, String generation) {
return bstIvtCutpointivtMapper.getPointByTypeAndShaftSize(type, size, generation);
}
@Override
@@ -115,7 +115,7 @@ public class BstIvtCutpointivtServiceImpl extends ServiceImpl<BstIvtCutpointivtM
}
@Override
public List<BstIvtCutpointivt> getAreaNotTaskPointByLocationAreaAndStatus(String location, String area) {
return bstIvtCutpointivtMapper.getAreaNotTaskPointByLocationAreaAndStatus(location, area);
public List<BstIvtCutpointivt> getAreaNotTaskPointByLocationAreaAndStatus(String location) {
return bstIvtCutpointivtMapper.getAreaNotTaskPointByLocationAreaAndStatus(location);
}
}

View File

@@ -63,11 +63,11 @@ public interface IBstIvtShafttubeivtService extends IService<BstIvtShafttubeivt>
/**
* 获得气胀轴库对应的气涨轴位置
* @param qzzSize 气涨轴尺寸
* @param specification 标箔、锂电
* @param pointCode 对应的穿拔轴机
* @param location 位置:上半部分还是下半部分
* @return
*/
List<BstIvtShafttubeivt> getByQzzSize(String qzzSize, String specification, String location);
List<BstIvtShafttubeivt> getByQzzSize(String qzzSize, String pointCode, String location);
/**
* 获取没任务的气涨轴缓存位

View File

@@ -92,4 +92,7 @@ public class BstIvtShafttubeivt implements Serializable {
/** 规划 */
private String plan;
/** 关联点位 */
private String parent_code;
}

View File

@@ -13,9 +13,21 @@ public interface BstIvtShafttubeivtMapper extends BaseMapper<BstIvtShafttubeivt>
List<BstIvtShafttubeivt> getAllShaftPointsByConditions(String type, String location, String have);
List<BstIvtShafttubeivt> getByQzzSize(String qzzSize, String specification, String location);
List<BstIvtShafttubeivt> getByQzzSize(String qzzSize, String pointCode, String location);
/**
* 获取含有气胀轴的气胀轴暂存位
* @param qzzSize 气胀轴尺寸
* @param specification 标箔/锂电
* @param location 位置(上下)
* @return /
*/
List<BstIvtShafttubeivt> getNotTaskShaftCache(String qzzSize, String specification, String location);
/**
* 获取空气胀轴的气胀轴暂存位
* @param startPoint 点位信息(包含:尺寸、类型、位置)
* @return /
*/
List<BstIvtShafttubeivt> getNotTaskShaftCacheEmpty(BstIvtShafttubeivt startPoint);
}

View File

@@ -14,12 +14,13 @@
)
</select>
<select id="getByQzzSize" resultType="org.nl.b_lms.bst.ivt.shafttubeivt.service.dao.BstIvtShafttubeivt">
SELECT
*
FROM
`bst_ivt_shafttubeivt` bsf
WHERE bsf.is_used = '1' AND bsf.qzz_size = #{qzzSize} AND bsf.point_type = '1'
AND bsf.qzz_generation = #{specification} AND bsf.point_location = #{location}
SELECT *
FROM `bst_ivt_shafttubeivt` bsf
WHERE bsf.is_used = '1'
AND bsf.qzz_size = #{qzzSize}
AND bsf.point_type = '1'
AND bsf.point_location = #{location}
AND bsf.parent_code = #{pointCode}
</select>
<select id="getNotTaskShaftCache"
resultType="org.nl.b_lms.bst.ivt.shafttubeivt.service.dao.BstIvtShafttubeivt">

View File

@@ -102,8 +102,8 @@ public class BstIvtShafttubeivtServiceImpl extends ServiceImpl<BstIvtShafttubeiv
}
@Override
public List<BstIvtShafttubeivt> getByQzzSize(String qzzSize, String specification, String location) {
return bstIvtShafttubeivtMapper.getByQzzSize(qzzSize, specification, location);
public List<BstIvtShafttubeivt> getByQzzSize(String qzzSize, String pointCode, String location) {
return bstIvtShafttubeivtMapper.getByQzzSize(qzzSize, pointCode, location);
}
@Override

View File

@@ -45,10 +45,9 @@ public interface IPdmBiSlittingproductionplanService extends IService<PdmBiSlitt
/**
* 获取可用的分切计划
* @param area 区域
* @return /
*/
List<SlitterPlanDistinctDto> getAllCutPlan(String area);
List<SlitterPlanDistinctDto> getAllCutPlan();
/**
* 通过气涨轴编码获取分切计划

View File

@@ -12,5 +12,5 @@ import java.util.List;
**/
public interface PdmBiSlittingproductionplanMapper extends BaseMapper<PdmBiSlittingproductionplan> {
List<SlitterPlanDistinctDto> getAllCutPlan(String area);
List<SlitterPlanDistinctDto> getAllCutPlan();
}

View File

@@ -9,6 +9,8 @@
p.parent_container_name,
p.split_group,
p.up_or_down,
p.qzz_size,
sc.qzz_generation,
COALESCE ( count_table.num, 0 ) num,
COALESCE ( ct1.cn, 0 ) AS cn,
COALESCE ( ct2.cnn, 0 ) AS cnn
@@ -58,12 +60,13 @@
AND p.parent_container_name = ct2.parent_container_name
AND p.split_group = ct2.split_group
AND p.up_or_down <![CDATA[ <> ]]> ct2.up_or_down
LEFT JOIN st_ivt_cutpointivt sc
ON sc.ext_code = p.resource_name
WHERE
p.`status` = '01'
AND p.is_child_tz_ok = '0'
AND p.is_paper_ok = '1'
AND p.is_delete = '0'
AND LEFT ( p.resource_name, 2 ) = #{area}
AND p.up_or_down IS NOT NULL
AND p.left_or_right IS NOT NULL
GROUP BY
@@ -71,6 +74,8 @@
p.parent_container_name,
p.split_group,
p.up_or_down,
p.qzz_size,
sc.qzz_generation,
num,
cn,
cnn

View File

@@ -77,8 +77,8 @@ public class PdmBiSlittingproductionplanServiceImpl extends ServiceImpl<PdmBiSli
}
@Override
public List<SlitterPlanDistinctDto> getAllCutPlan(String area) {
return pdmBiSlittingproductionplanMapper.getAllCutPlan(area);
public List<SlitterPlanDistinctDto> getAllCutPlan() {
return pdmBiSlittingproductionplanMapper.getAllCutPlan();
}
@Override

View File

@@ -30,9 +30,10 @@ import java.util.List;
/**
* @Author: lyd
* @Description: 自动任务 呼叫套轴 根据分切计划来呼叫套轴任务 桁架任务
* @Date: 2024/2/1
* @see TrussCallAirShaftTask#createTask(JSONObject)
* @Description: 自动任务 呼叫套轴 根据分切计划来呼叫套轴任务 桁架任务
* <p>注:内包间只是区分气胀轴大小(即代数),不需要区分锂电/标箔</p>
*/
@Slf4j
@Component
@@ -57,34 +58,21 @@ public class AutoCallAirShaftTask {
* 并根据计划来决定是进行套轴还是拔轴操作。如果需要套轴,它会寻找合适的套轴位置,并且在没有合适位置时会触发滚条气涨轴的操作。
* 同时,该方法也会更新相关的分切计划状态。
* 套拔轴缓存位满了、没有分切计划,则触发自动创建套拔轴任务
* update: 24/04/28 内包间只是区分气胀轴大小(即代数),不需要区分锂电/标箔
*/
@Transactional(rollbackFor = Exception.class)
public void run() {
// 1、获取空的插拔轴位(无任务)
List<BstIvtShafttubeivt> emptyPoints = bstIvtShafttubeivtService.getAllShaftPointsByConditions("2","0","0");
emptyPoints.forEach(empty -> {
// 标箔1锂电2
// 标箔1锂电2大小4代5代
String specification = empty.getQzz_generation();
String location = empty.getPoint_location();
String area;
if (SlitterConstant.SLITTER_STANDARD_FOIL.equals(specification)) {
if (SlitterConstant.SLITTER_AREA_UP.equals(location)) {
area = "B2";
} else {
area = "B4";
}
} else {
if (SlitterConstant.SLITTER_AREA_UP.equals(location)) {
area = "B1";
} else {
area = "B3";
}
}
// 2、获取分切计划数据hint: 根据标箔锂电区分区域
List<SlitterPlanDistinctDto> plans = slittingproductionplanService.getAllCutPlan(area);
// 2、获取分切计划数据
List<SlitterPlanDistinctDto> plans = slittingproductionplanService.getAllCutPlan();
if (plans.size() == 0) {
// 如果不需要套轴,就只做拔轴
makePullShaft(empty, area);
makePullShaft(empty, specification);
return;
}
// 查看套轴对接位是否满了
@@ -92,26 +80,35 @@ public class AutoCallAirShaftTask {
// 如果满了就只做拔轴
if (emptyShaftPoint.size() == 0) {
// 如果不需要套轴,就只做拔轴
makePullShaft(empty, area);
makePullShaft(empty, specification);
return;
}
// 获取一个分切计划的Dto。如果是6寸可以直接使用、如果是3寸需要判断当前位置是否满足
SlitterPlanDistinctDto planDto = plans.stream()
.filter(planD -> "6".equals(planD.getQzz_size()) ||
("3".equals(planD.getQzz_size()) && specification.equals(planD.getQzz_generation())))
.findFirst()
.orElse(null);
if (planDto == null) {
return;
}
// 获取一个分切计划的Dto。一根轴可能有两个分切计划
SlitterPlanDistinctDto planDto = plans.get(0);
// 获取分切计划dto中对应的需要套轴的分切计划 最多两个计划
List<PdmBiSlittingproductionplan> needPlans = slittingproductionplanService.list(new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
.eq(PdmBiSlittingproductionplan::getResource_name, planDto.getResource_name())
.eq(PdmBiSlittingproductionplan::getParent_container_name, planDto.getParent_container_name())
.eq(PdmBiSlittingproductionplan::getUp_or_down, planDto.getUp_or_down())
.eq(PdmBiSlittingproductionplan::getSplit_group, planDto.getSplit_group())
.eq(PdmBiSlittingproductionplan::getIs_delete, SlitterConstant.SLITTER_NO)
.eq(PdmBiSlittingproductionplan::getIs_paper_ok, SlitterConstant.SLITTER_YES));
// 获取其中一条
PdmBiSlittingproductionplan needPlan = needPlans.get(0);
String qzzSize = needPlan.getQzz_size();
// 从套轴对接位获取相同气涨轴大小 (同标箔或者锂电分开)
List<BstIvtCutpointivt> qzzPoint = bcutpointivtService.getPointByTypeAndShaftSize("1", qzzSize, area);
// 从套轴对接位获取相同气涨轴大小
// update: 不需要(同标箔或者锂电分开)
List<BstIvtCutpointivt> qzzPoint = bcutpointivtService.getPointByTypeAndShaftSize("1", qzzSize, specification);
if (qzzPoint.size() == 0) {
// 调用ACS滚条气涨轴下来
toAcsOutShaft(qzzSize, specification, location, empty);
toAcsOutShaft(qzzSize, location, empty);
// 保存所需要的分切计划数据到点位上(套轴对接位)更新分切计划
saveCutPlanMessage(empty, needPlans, qzzSize);
return;
@@ -121,7 +118,7 @@ public class AutoCallAirShaftTask {
if (ObjectUtil.isEmpty(startPoint)) {
// 如果不存在,则发起信号滚气涨轴
// 调用ACS滚条气涨轴下来
toAcsOutShaft(qzzSize, specification, location, empty);
toAcsOutShaft(qzzSize, location, empty);
// 保存所需要的分切计划数据到点位上(套轴对接位)更新分切计划
saveCutPlanMessage(empty, needPlans, qzzSize);
return;
@@ -172,41 +169,36 @@ public class AutoCallAirShaftTask {
/**
* 获取对应的气胀轴库1
* @param qzzSize 气涨轴尺寸
* @param specification 标箔、锂电(1,2)
* @param location 位置:上半部分还是下半部分
* @param empty 套拔轴点位
*/
private void toAcsOutShaft(String qzzSize, String specification, String location, BstIvtShafttubeivt empty) {
private void toAcsOutShaft(String qzzSize, String location, BstIvtShafttubeivt empty) {
// 需要区分上下
List<BstIvtShafttubeivt> shafttubeivts = bstIvtShafttubeivtService.getByQzzSize(qzzSize, specification, location);
List<BstIvtShafttubeivt> shafttubeivts = bstIvtShafttubeivtService.getByQzzSize(qzzSize, empty.getPoint_code(), location);
if (shafttubeivts.size() == 0) {
throw new BadRequestException("气胀轴库找不到[" + qzzSize + "]规格的气涨轴");
}
BstIvtShafttubeivt shafttubeivt = shafttubeivts.get(0);
// todo: 访问acs判断有无气涨轴
boolean flag = true;
if (!flag) {
// 气涨轴库没有对应的气涨轴,就到气涨轴暂存区获取
toCreatShaftCacheTask(qzzSize, specification, location, empty);
} else {
JSONArray acsParam = new JSONArray();
JSONObject acsQzz = new JSONObject();
acsQzz.put("device_code", shafttubeivt.getPoint_code());
acsQzz.put("code", "to_command");
acsQzz.put("value", "1");
acsQzz.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
acsParam.add(acsQzz);
wmsToAcsService.action(acsParam);
}
JSONArray acsParam = new JSONArray();
JSONObject acsQzz = new JSONObject();
acsQzz.put("device_code", shafttubeivt.getPoint_code());
acsQzz.put("code", "to_command");
acsQzz.put("value", "1");
acsQzz.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
acsParam.add(acsQzz);
wmsToAcsService.action(acsParam);
}
/**
* todo: 预留
* 创建气涨轴缓存的桁架任务
* @param qzzSize 气涨轴尺寸
* @param specification 标箔、锂电(1,2)
* @param location 位置:上半部分还是下半部分
* @param empty 套拔轴点位
*/
@Deprecated
private void toCreatShaftCacheTask(String qzzSize, String specification, String location, BstIvtShafttubeivt empty) {
// 获取气涨轴缓存没有任务的点位
List<BstIvtShafttubeivt> shafttubeivts = bstIvtShafttubeivtService.getNotTaskShaftCache(qzzSize, specification, location);
@@ -270,16 +262,25 @@ public class AutoCallAirShaftTask {
}
/**
* 不需要套轴,就只做拔轴(区分标箔、锂电)
* 不需要套轴,就只做拔轴
* update: 不需要(区分标箔、锂电)
* @param empty 空的插拔轴点位
* @param area 区域
* @param specification 代数4、5
*/
private void makePullShaft(BstIvtShafttubeivt empty, String area) {
List<BstIvtCutpointivt> notTaskPoints = bcutpointivtService.getAreaNotTaskPointByLocationAreaAndStatus(empty.getPoint_location(), area);
private void makePullShaft(BstIvtShafttubeivt empty, String specification) {
List<BstIvtCutpointivt> notTaskPoints = bcutpointivtService.getAreaNotTaskPointByLocationAreaAndStatus(empty.getPoint_location());
if (notTaskPoints.size() == 0) {
return;
}
BstIvtCutpointivt cutpointivt = notTaskPoints.get(0);
// 筛选一个满足的位置3寸看代数4/56寸直接
BstIvtCutpointivt cutpointivt = notTaskPoints.stream()
.filter(cut -> "6".equals(cut.getQzz_size()) ||
("3".equals(cut.getQzz_size()) && specification.equals(cut.getQzz_generation())))
.findFirst()
.orElse(null);
if (cutpointivt == null) {
return;
}
String pointCode1 = ObjectUtil.isNotEmpty(cutpointivt.getQzz_no1()) ? cutpointivt.getTruss_point_code1() : cutpointivt.getTruss_point_code2();
String qzzNo = ObjectUtil.isNotEmpty(cutpointivt.getQzz_no1()) ? cutpointivt.getQzz_no1() : cutpointivt.getQzz_no2();
// 获取对应的分切计划

View File

@@ -29,4 +29,12 @@ public class SlitterPlanDistinctDto {
* 数量
*/
private String num;
/**
* 气胀轴尺寸
*/
private String qzz_size;
/**
* 气胀轴代数
*/
private String qzz_generation;
}

View File

@@ -132,6 +132,7 @@ public class SlitterServiceImpl implements SlitterService {
if (ObjectUtil.isEmpty(CBJ.getTube_code1()) && ObjectUtil.isEmpty(CBJ.getTube_code2())) {
// 清空
CBJ.setHave_qzz(SlitterConstant.SLITTER_NO);
CBJ.setQzz_size("");
TaskUtils.updateOptMessageByBShaftPoint(CBJ);
shafttubeivtService.updateById(CBJ);
}

View File

@@ -139,10 +139,10 @@ public class SlitterTaskUtil {
param.put("currentLeftSpec", SlitterTaskUtil.getPaperTubeInformation(plan));
} else {
if (SlitterConstant.SLITTER_TYPE_PAPER.equals(plan.getPaper_tube_or_FRP())) {
param.put("currentRight", plan.getPaper_tube_model());
param.put("currentRight", plan.getPaper_tube_material());
param.put("currentRightSize", plan.getPaper_tube_model().split("\\|")[2].charAt(0));
} else {
param.put("currentRight", plan.getFRP_model());
param.put("currentRight", plan.getFRP_material());
param.put("currentRightSize", plan.getFRP_model().split("\\|")[2].charAt(0));
}
param.put("currentLeftSpec", SlitterTaskUtil.getPaperTubeInformation(plan));

View File

@@ -147,7 +147,7 @@
<el-table-column prop="point_code" label="点位编码" :min-width="flexWidth('point_code',crud.data,'点位编码')"/>
<el-table-column prop="point_name" label="点位名称" :min-width="flexWidth('point_name',crud.data,'点位名称')"/>
<el-table-column prop="qzz_size" label="气涨轴尺寸" :min-width="flexWidth('qzz_size',crud.data,'气涨轴尺寸')"/>
<el-table-column prop="qzz_generation" label="标箔/锂电" :min-width="flexWidth('qzz_generation',crud.data,'气涨轴代数')"/>
<el-table-column prop="qzz_generation" label="气涨轴代数" :min-width="flexWidth('qzz_generation',crud.data,'气涨轴代数')"/>
<el-table-column prop="tube_code1" label="纸管1编码" :min-width="flexWidth('tube_code1',crud.data,'纸管1编码')"/>
<el-table-column prop="tube_name1" label="纸管1描述" :min-width="flexWidth('tube_name1',crud.data,'纸管1描述')"/>
<el-table-column prop="tube_code2" label="纸管2编码" :min-width="flexWidth('tube_code2',crud.data,'纸管2编码')"/>