opt: 任务追加子卷号到任务参数中

This commit is contained in:
2024-08-26 10:47:20 +08:00
parent cf8e8459f9
commit 6b6ab8cdc5
6 changed files with 35 additions and 6 deletions

View File

@@ -66,6 +66,14 @@ public interface IPdmBiSlittingproductionplanService extends IService<PdmBiSlitt
*/
List<PdmBiSlittingproductionplan> getByQzzNos(List<String> qzzNo, String status);
/**
* 根据气胀轴数组获取分切计划
* @param qzzNo /
* @param status 状态
* @return /
*/
List<PdmBiSlittingproductionplan> getByQzzNos(List<String> qzzNo);
/**
* 获取需要的分切计划
* @param qzzs /

View File

@@ -105,6 +105,13 @@ public class PdmBiSlittingproductionplanServiceImpl extends ServiceImpl<PdmBiSli
.eq(PdmBiSlittingproductionplan::getStatus, status);
return pdmBiSlittingproductionplanMapper.selectList(lam);
}
@Override
public List<PdmBiSlittingproductionplan> getByQzzNos(List<String> qzzNo) {
LambdaQueryWrapper<PdmBiSlittingproductionplan> lam = new QueryWrapper<PdmBiSlittingproductionplan>().lambda();
lam.in(PdmBiSlittingproductionplan::getQzzno, qzzNo)
.eq(PdmBiSlittingproductionplan::getIs_delete, "0");
return pdmBiSlittingproductionplanMapper.selectList(lam);
}
@Override
public List<SlitterPlanDistinctDto> getAllHalfPlan(List<String> qzzs) {

View File

@@ -133,7 +133,7 @@ public class AutoCallAirShaftTask {
// todo: 这里需要注意不要去校验071的任务不然提前释放货位没意义。
List<BstIvtCutpointivt> emptyShaftPoint = bcutpointivtService.getAreaNotTaskPointByStatus("1",
"1", location, "0");
// 如果满了就只做拔轴 预留一个货位,防止套轴直接站满
// 如果满了就只做拔轴 预留一个货位?,防止套轴直接站满
if (emptyShaftPoint.size() == 0) {
log.info("暂存位没有空位!正在检测是否存在半个点位!");
// 校验是否存在半个位置,且有分切计划
@@ -250,6 +250,7 @@ public class AutoCallAirShaftTask {
param.put("casingCount", needPlans.size());
// 拔管数量
param.put("pullCount", oldPlans.size());
param.put("containers", oldPlans.stream().map(PdmBiSlittingproductionplan::getContainer_name).collect(Collectors.toList()));
trussCallAirShaftTask.createTask(param);
toCallAgvMovePaperTube(needPlans, location, empty);
// 将分切计划is_paper_ok 1(纸管已经准备好) -> 2(已经套轴)
@@ -485,11 +486,13 @@ public class AutoCallAirShaftTask {
throw new BadRequestException("气涨轴[" + qzzNo + "]对应的分切计划不存在!");
}
PdmBiSlittingproductionplan plan = list.get(0);
List<String> collect = list.stream().map(PdmBiSlittingproductionplan::getContainer_name).collect(Collectors.toList());
JSONObject param = new JSONObject();
param.put("point_code1", pointCode1);
param.put("point_code2", empty.getPoint_code());
param.put("vehicle_code", qzzNo);
param.put("qzz_no", qzzNo);
param.put("containers", collect);
// 当前纸管信息
SlitterTaskUtil.putCurrentPaperSpec(param, list);
// 套管数量

View File

@@ -28,6 +28,7 @@ import java.util.concurrent.TimeUnit;
* @see SlitterDownAgvTask#createTask(JSONObject)
*/
@Slf4j
@Deprecated
@Component
public class AutoSlitterCacheDownAgvTask {

View File

@@ -28,6 +28,7 @@ import java.util.stream.Stream;
* @Date: 2024/2/1
*/
@Slf4j
@Deprecated
@Component
public class AutoUpShaftTrussTask {
@Autowired

View File

@@ -515,9 +515,7 @@ public class SlitterServiceImpl implements SlitterService {
List<BstIvtCutpointivt> cutPointList = slitterMapper.getReadyShaftPoint(device.getExt_code());
// 任务参数
JSONObject taskParam = new JSONObject();
// 设置纸管长度
// taskParam.put("up_length", getPaperLength(currentUpPlan));
// taskParam.put("down_lengtht", getPaperLength(currentDownPlan));
taskParam.put("containers", containers);
if (timePlans.size() == 0 || cutPointList.size() == 0) {
// 如果没有下一组的分切计划,就只做下卷任务(判断下单/下双)
// 获取分切对接位没任务的空位置
@@ -1020,6 +1018,14 @@ public class SlitterServiceImpl implements SlitterService {
if (ObjectUtil.isEmpty(point.getQzz_no1()) && ObjectUtil.isEmpty(point.getQzz_no2())) {
throw new BadRequestException("点位:" + point.getPoint_code() + " 的气胀轴编码为空!");
}
JSONObject taskParam = new JSONObject();
// 将子卷信息存到任务中
List<String> qzzNos = Stream.of(point.getQzz_no1(), point.getQzz_no2()).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(qzzNos)) {
List<PdmBiSlittingproductionplan> plans = slittingproductionplanService.getByQzzNos(qzzNos);
List<String> collect = plans.stream().map(PdmBiSlittingproductionplan::getContainer_name).collect(Collectors.toList());
taskParam.put("containers", collect);
}
List<BstIvtCutpointivt> areaEmptyNotTaskPoint = bcutpointivtService.getAreaNotTaskPointByStatus("1",
"1", "0", "2");
if (areaEmptyNotTaskPoint.size() == 0) {
@@ -1035,7 +1041,6 @@ public class SlitterServiceImpl implements SlitterService {
}
try {
if (tryLock) {
JSONObject taskParam = new JSONObject();
taskParam.put("point_code1", point.getPoint_code());
taskParam.put("point_code2", endPoint.getPoint_code());
taskParam.put("vehicle_code1", point.getQzz_no1());
@@ -1544,6 +1549,11 @@ public class SlitterServiceImpl implements SlitterService {
if (!"B2".equals(cut.getProduct_area())) {
throw new BadRequestException("操作失败只有B2才能去暂存位!");
}
JSONObject taskParam = new JSONObject();
List<String> collect = Stream.of(cut.getQzz_no1(), cut.getQzz_no2()).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
List<PdmBiSlittingproductionplan> byQzzNos = slittingproductionplanService.getByQzzNos(collect);
List<String> containers = byQzzNos.stream().map(PdmBiSlittingproductionplan::getContainer_name).collect(Collectors.toList());
taskParam.put("containers", containers);
List<BstIvtCutpointivt> areaEmptyNotTaskPoint = bcutpointivtService.getAreaNotTaskPointByStatus("2",
"1", "0","0");
if (areaEmptyNotTaskPoint.size() == 0) {
@@ -1560,7 +1570,6 @@ public class SlitterServiceImpl implements SlitterService {
}
try {
if (tryLock) {
JSONObject taskParam = new JSONObject();
taskParam.put("point_code1", cut.getPoint_code());
taskParam.put("point_code2", endPoint.getPoint_code());
taskParam.put("vehicle_code1", cut.getQzz_no1());