feat: 改造-分切下卷/上轴
This commit is contained in:
@@ -0,0 +1,263 @@
|
||||
package org.nl.b_lms.sch.tasks.slitter;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.bst.ivt.cutpointivt.service.IBstIvtCutpointivtService;
|
||||
import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt;
|
||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.IPdmBiSlittingproductionplanService;
|
||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingproductionplan;
|
||||
import org.nl.b_lms.sch.point.dao.StIvtCutpointivt;
|
||||
import org.nl.b_lms.sch.point.service.IstIvtCutpointivtService;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
import org.nl.b_lms.sch.tasks.slitter.util.SlitterTaskUtil;
|
||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.common.utils.TaskUtils;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.pdm.ivt.deliverycache.service.IDeliverycachepointivtService;
|
||||
import org.nl.wms.pdm.ivt.deliverycache.service.dao.Deliverycachepointivt;
|
||||
import org.nl.wms.sch.AcsTaskDto;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* 新的上轴任务
|
||||
* @Author: liyongde
|
||||
* @Date: 2026/4/24 14:21
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class UpShaftTrussNewTask extends AbstractAcsTask {
|
||||
private final String THIS_CLASS = UpShaftTrussNewTask.class.getName();
|
||||
@Autowired
|
||||
private IschBaseTaskService taskService;
|
||||
@Autowired
|
||||
private IPdmBiSlittingproductionplanService slittingproductionplanService;
|
||||
@Autowired
|
||||
private IBstIvtCutpointivtService bcutpointivtService;
|
||||
@Autowired
|
||||
private IstIvtCutpointivtService cutpointivtService;
|
||||
@Autowired
|
||||
private IDeliverycachepointivtService deliverycachepointivtService;
|
||||
|
||||
@Override
|
||||
public List<AcsTaskDto> addTask() {
|
||||
/*
|
||||
* 下发给ACS时需要特殊处理
|
||||
*/
|
||||
ArrayList<AcsTaskDto> resultList = new ArrayList<>();
|
||||
String agv_system_type = "2";
|
||||
List<SchBaseTask> taskList = taskService.getIssueTasks(THIS_CLASS);
|
||||
for (SchBaseTask task : taskList) {
|
||||
String requestParam = task.getRequest_param();
|
||||
JSONObject requestParamObj = JSONObject.parseObject(requestParam);
|
||||
AcsTaskDto dto = AcsTaskDto.builder()
|
||||
.ext_task_id(task.getTask_id())
|
||||
.task_code(task.getTask_code())
|
||||
.task_type(task.getAcs_task_type())
|
||||
.start_device_code(task.getPoint_code1())
|
||||
.next_device_code(task.getPoint_code2())
|
||||
.start_device_code2(task.getPoint_code3())
|
||||
.next_device_code2(task.getPoint_code4())
|
||||
.vehicle_code(task.getVehicle_code())
|
||||
.agv_system_type(agv_system_type)
|
||||
.truss_type(requestParamObj.getString("truss_type"))
|
||||
.empty_site(requestParamObj.getString("empty_site"))
|
||||
.priority(task.getPriority())
|
||||
.remark(task.getRemark())
|
||||
.product_area(task.getProduct_area())
|
||||
.build();
|
||||
resultList.add(dto);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 单任务下发,业务逻辑与无参 addTask 保持一致
|
||||
*/
|
||||
@Override
|
||||
public List<AcsTaskDto> addTask(SchBaseTask task) {
|
||||
ArrayList<AcsTaskDto> resultList = new ArrayList<>();
|
||||
String agv_system_type = "2";
|
||||
if (task != null) {
|
||||
String requestParam = task.getRequest_param();
|
||||
JSONObject requestParamObj = JSONObject.parseObject(requestParam);
|
||||
AcsTaskDto dto = AcsTaskDto.builder()
|
||||
.ext_task_id(task.getTask_id())
|
||||
.task_code(task.getTask_code())
|
||||
.task_type(task.getAcs_task_type())
|
||||
.start_device_code(task.getPoint_code1())
|
||||
.next_device_code(task.getPoint_code2())
|
||||
.start_device_code2(task.getPoint_code3())
|
||||
.next_device_code2(task.getPoint_code4())
|
||||
.vehicle_code(task.getVehicle_code())
|
||||
.agv_system_type(agv_system_type)
|
||||
.truss_type(requestParamObj.getString("truss_type"))
|
||||
.empty_site(requestParamObj.getString("empty_site"))
|
||||
.priority(task.getPriority())
|
||||
.remark(task.getRemark())
|
||||
.product_area(task.getProduct_area())
|
||||
.build();
|
||||
resultList.add(dto);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateTaskStatus(JSONObject taskObj, String status) {
|
||||
SchBaseTask task = taskService.getById(taskObj.getString("task_id"));
|
||||
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
|
||||
// 更新任务状态为执行中
|
||||
task.setTask_status(TaskStatusEnum.EXECUTING.getCode());
|
||||
}
|
||||
|
||||
if (StrUtil.equals(status, TaskStatusEnum.FINISHED.getCode())) {
|
||||
task.setTask_status(TaskStatusEnum.FINISHED.getCode());
|
||||
// 点位内容更新
|
||||
// 1是缓存架位,2是分切机下料位
|
||||
String pointCode1 = task.getPoint_code1();
|
||||
Deliverycachepointivt point1 = deliverycachepointivtService.getOneByPointCode(pointCode1, false);
|
||||
String pointCode2 = task.getPoint_code2();
|
||||
StIvtCutpointivt point2 = cutpointivtService.getPintByUpOrDownCode(pointCode2, false);
|
||||
// 可能不存在
|
||||
String pointCode3 = task.getPoint_code1();
|
||||
Deliverycachepointivt point3 = deliverycachepointivtService.getOneByPointCode(pointCode3, false);
|
||||
|
||||
// 交换数据
|
||||
point2.setUp_qzzno(task.getVehicle_code());
|
||||
point2.setDown_qzzno(task.getVehicle_code2());
|
||||
point2.setUpdate_optid(Long.valueOf(SecurityUtils.getCurrentUserId()));
|
||||
point2.setUpdate_optname(SecurityUtils.getCurrentUsername());
|
||||
point2.setUpdate_time(DateUtil.now());
|
||||
|
||||
|
||||
// 分切计划修改状态04->05
|
||||
List<String> collect = Stream.of(task.getVehicle_code(), task.getVehicle_code2())
|
||||
.filter(value -> value != null && !value.isEmpty()).collect(Collectors.toList());
|
||||
List<PdmBiSlittingproductionplan> plans = slittingproductionplanService.getByQzzNos(collect);
|
||||
PdmBiSlittingproductionplan pp = plans.get(0);
|
||||
String weightStr = SlitterTaskUtil.getPaperWeightStr(plans);
|
||||
if (pp.getContainer_name().contains("虚拟")) {
|
||||
// 如果是虚拟卷,需要执行删除标记,并且清空数据
|
||||
// 将分切计划删除,设备禁用
|
||||
plans.forEach(p1 -> {
|
||||
p1.setIs_delete("1");
|
||||
p1.setQzzno("");
|
||||
p1.setUpdate_time(DateUtil.now());
|
||||
p1.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
p1.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
});
|
||||
slittingproductionplanService.updateBatchById(plans);
|
||||
// 设备禁用
|
||||
point2.setUp_qzzno("");
|
||||
point2.setDown_qzzno("");
|
||||
} else {
|
||||
PdmBiSlittingproductionplan p = new PdmBiSlittingproductionplan();
|
||||
p.setStatus("05");
|
||||
TaskUtils.updateOptMessageBySlitterPlan(p);
|
||||
slittingproductionplanService.update(p, new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getQzzno, collect));
|
||||
}
|
||||
|
||||
point2.setRemark(weightStr);
|
||||
cutpointivtService.updateById(point2);
|
||||
|
||||
point1.setQzzno("");
|
||||
point1.setPoint_status("01");
|
||||
TaskUtils.updateOptMessageByCachePoint(point1);
|
||||
point3.setQzzno("");
|
||||
point3.setPoint_status("01");
|
||||
TaskUtils.updateOptMessageByCachePoint(point3);
|
||||
deliverycachepointivtService.updateBatchById(Stream.of(point1, point3).collect(Collectors.toList()));
|
||||
}
|
||||
// 取消
|
||||
if (status.equals(IOSEnum.IS_NOTANDYES.code("否"))) {
|
||||
task.setTask_status(TaskStatusEnum.FINISHED.getCode());
|
||||
|
||||
// 分切计划修改状态回退04 -> 03
|
||||
List<String> collect = Stream.of(task.getVehicle_code(), task.getVehicle_code2())
|
||||
.filter(value -> value != null && !value.isEmpty()).collect(Collectors.toList());
|
||||
PdmBiSlittingproductionplan p = new PdmBiSlittingproductionplan();
|
||||
p.setStatus("03");
|
||||
TaskUtils.updateOptMessageBySlitterPlan(p);
|
||||
slittingproductionplanService.update(p, new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getQzzno, collect));
|
||||
}
|
||||
TaskUtils.updateOptMessageByTask(task);
|
||||
taskService.updateById(task);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String createTask(JSONObject form) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
|
||||
SchBaseTask task = new SchBaseTask();
|
||||
task.setTask_id(IdUtil.getStringId());
|
||||
task.setTask_code(IdUtil.getStringId());
|
||||
task.setTask_status(TaskStatusEnum.START_AND_POINT.getCode());
|
||||
task.setPoint_code1(form.getString("point_code1"));
|
||||
task.setPoint_code2(form.getString("point_code2"));
|
||||
task.setPoint_code3(form.getString("point_code3"));
|
||||
task.setPoint_code4(form.getString("point_code4"));
|
||||
task.setVehicle_code(form.getString("vehicle_code1"));
|
||||
task.setVehicle_code2(form.getString("vehicle_code2"));
|
||||
task.setAcs_task_type("6");
|
||||
task.setIs_delete("0");
|
||||
task.setRequest_param(form.toJSONString());
|
||||
task.setTask_type(form.getString("task_type"));
|
||||
task.setProduct_area(form.getString("product_area"));
|
||||
task.setCreate_id(currentUserId);
|
||||
task.setCreate_name(currentUsername);
|
||||
task.setCreate_time(DateUtil.now());
|
||||
task.setHandle_class(THIS_CLASS);
|
||||
//根据类型获取对应的任务优先级
|
||||
JSONObject priority_jo = WQL.getWO("PDA_COOLIN").addParam("flag", "3").addParam("task_type", task.getTask_type()).process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(priority_jo)) {
|
||||
task.setPriority("1");
|
||||
} else {
|
||||
task.setPriority(priority_jo.getString("value"));
|
||||
}
|
||||
taskService.save(task);
|
||||
// 分切计划修改状态 03->04
|
||||
List<String> collect = Stream.of(task.getVehicle_code(), task.getVehicle_code2())
|
||||
.filter(value -> value != null && !value.isEmpty()).collect(Collectors.toList());
|
||||
PdmBiSlittingproductionplan p = new PdmBiSlittingproductionplan();
|
||||
p.setStatus("04");
|
||||
TaskUtils.updateOptMessageBySlitterPlan(p);
|
||||
slittingproductionplanService.update(p, new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getQzzno, collect));
|
||||
this.immediateTaskNotifyAcs(task);
|
||||
return task.getTask_id();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forceFinish(String task_id) {
|
||||
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
this.updateTaskStatus(taskObj, TaskStatusEnum.FINISHED.getCode());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void cancel(String task_id) {
|
||||
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
this.updateTaskStatus(taskObj, "0");
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ public enum SlitterEnum {
|
||||
, "拼单送轴", "010817", "拆单两点移动任务", "010818", "拆单四点移动任务", "010819"
|
||||
, "满轴拼单桁架任务", "010820", "送空轴AGV任务", "010821", "人工叫空轴桁架任务", "010822"
|
||||
, "备货区托盘入库", "010823", "备货区托盘出库", "010824", "送轴拆单任务", "010825"
|
||||
, "拆单桁架任务", "010826")
|
||||
, "拆单桁架任务", "010826", "分切合单下卷任务", "010827", "缓存上空轴任务", "010828")
|
||||
),
|
||||
/**
|
||||
* 二次请求
|
||||
|
||||
@@ -84,4 +84,6 @@ public interface SlitterMapper {
|
||||
List<Deliverycachepointivt> getReadyShaftCachePoint(StIvtCutpointivt actualDevice);
|
||||
|
||||
List<SlitterDownNewDto> getCanDownPoints(StIvtCutpointivt actualDevice);
|
||||
|
||||
List<Deliverycachepointivt> getReadyShaftCachePointByDevice(StIvtCutpointivt extCode);
|
||||
}
|
||||
|
||||
@@ -471,4 +471,39 @@
|
||||
ORDER BY base_id,
|
||||
truss_code
|
||||
</select>
|
||||
<select id="getReadyShaftCachePointByDevice"
|
||||
resultType="org.nl.wms.pdm.ivt.deliverycache.service.dao.Deliverycachepointivt">
|
||||
SELECT sd.*
|
||||
FROM `st_ivt_deliverycachepointivt` sd
|
||||
WHERE sd.product_area = #{product_area}
|
||||
AND sd.point_location = #{point_location}
|
||||
AND sd.point_status = '02'
|
||||
AND EXISTS (SELECT 1
|
||||
FROM pdm_bi_slittingproductionplan p
|
||||
WHERE p.qzzno = sd.qzzno
|
||||
AND p.resource_name = #{ext_code}
|
||||
AND p.is_delete = '0')
|
||||
AND NOT EXISTS (SELECT 1
|
||||
FROM (SELECT point_code1 AS code
|
||||
FROM sch_base_task
|
||||
WHERE is_delete = '0'
|
||||
AND task_status <![CDATA[ < ]]> '07'
|
||||
UNION ALL
|
||||
SELECT point_code2 AS code
|
||||
FROM sch_base_task
|
||||
WHERE is_delete = '0'
|
||||
AND task_status <![CDATA[ < ]]> '07'
|
||||
UNION ALL
|
||||
SELECT point_code3 AS code
|
||||
FROM sch_base_task
|
||||
WHERE is_delete = '0'
|
||||
AND task_status <![CDATA[ < ]]> '07'
|
||||
UNION ALL
|
||||
SELECT point_code4 AS code
|
||||
FROM sch_base_task
|
||||
WHERE is_delete = '0'
|
||||
AND task_status <![CDATA[ < ]]> '07') t
|
||||
WHERE t.code = sd.point_code)
|
||||
ORDER BY sd.update_time
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -102,7 +102,9 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
* 套轴区域
|
||||
*/
|
||||
public final static String PARAM_CODE_PLAN_AREA = "PARAM_CODE_PLAN_AREA";
|
||||
/** 合单配送 */
|
||||
/**
|
||||
* 合单配送
|
||||
*/
|
||||
public final static String IS_COMBINED_ORDER = "IS_COMBINED_ORDER";
|
||||
@Autowired
|
||||
private BstIvtStockingivtMapper bstIvtStockingivtMapper;
|
||||
@@ -170,6 +172,8 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
private IDeliverycachepointivtService deliverycachepointivtService;
|
||||
@Autowired
|
||||
private SlitterDownNewTrussTask slitterDownNewTrussTask;
|
||||
@Autowired
|
||||
private UpShaftTrussNewTask upShaftTrussNewTask;
|
||||
|
||||
// 预编译正则表达式,提升性能
|
||||
private static final Pattern GX_PATTERN = Pattern.compile("^GX(0[1-9]|[1-9]\\d)$");
|
||||
@@ -384,6 +388,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
* completeShaftLoading() - 完成套轴
|
||||
* tryCombineOrder() - 尝试拼单逻辑
|
||||
* handleNormalProcess() - 处理正常业务流程
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@@ -393,7 +398,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
public JSONObject acsFinishLoadShaft(JSONObject param) {
|
||||
String deviceCode = param.getString("device_code");
|
||||
List<String> stepTipLogs = getRedisListValue("ERROR" + deviceCode);
|
||||
|
||||
|
||||
RLock lock = redissonClient.getLock("doAcsFinishLoadShaft");
|
||||
boolean tryLock = lock.tryLock(10, TimeUnit.SECONDS);
|
||||
|
||||
@@ -405,14 +410,14 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
}
|
||||
|
||||
log.info("ACS申请套管完成参数: {}", param);
|
||||
|
||||
|
||||
// 1. 获取起点和分切计划
|
||||
BstIvtShafttubeivt startPoint = shafttubeivtService.getOne(
|
||||
new LambdaQueryWrapper<BstIvtShafttubeivt>()
|
||||
.eq(BstIvtShafttubeivt::getPoint_code, deviceCode));
|
||||
|
||||
|
||||
List<PdmBiSlittingproductionplan> plans = validateAndGetPlans(deviceCode, startPoint, stepTipLogs);
|
||||
|
||||
|
||||
// 2. 处理异常情况 - 分切计划不存在
|
||||
if (plans.isEmpty()) {
|
||||
List<String> containerNames = Stream.of(startPoint.getContainer_name1(), startPoint.getContainer_name2())
|
||||
@@ -420,22 +425,22 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
.collect(Collectors.toList());
|
||||
return handleExceptionCase(deviceCode, startPoint, containerNames, stepTipLogs);
|
||||
}
|
||||
|
||||
|
||||
// 3. 更新分切计划重量
|
||||
BigDecimal weight1 = param.getBigDecimal("weight1");
|
||||
BigDecimal weight2 = param.getBigDecimal("weight2");
|
||||
String msg = updatePlanWeights(plans, weight1, weight2);
|
||||
|
||||
|
||||
// 4. 生成气胀轴编码并完成套轴
|
||||
PdmBiSlittingproductionplan demoPlan = plans.get(0);
|
||||
String qzzNo = generateQzzNo(demoPlan);
|
||||
completeShaftLoading(plans, qzzNo);
|
||||
|
||||
|
||||
// 5. 获取子卷名称列表
|
||||
List<String> containerNames = Stream.of(startPoint.getContainer_name1(), startPoint.getContainer_name2())
|
||||
.filter(ObjectUtil::isNotEmpty)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
||||
// 6. 尝试拼单
|
||||
BstIvtCutpointivt combinedPoint = tryCombineOrder(demoPlan, deviceCode, startPoint, qzzNo);
|
||||
if (combinedPoint == null) {
|
||||
@@ -447,7 +452,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
res.put("message", "请求成功");
|
||||
res.put("msg", msg);
|
||||
return res;
|
||||
|
||||
|
||||
} finally {
|
||||
if (tryLock) {
|
||||
// 使用 TransactionSynchronization 在事务提交后释放锁
|
||||
@@ -458,7 +463,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
public void afterCompletion(int status) {
|
||||
try {
|
||||
lock.unlock();
|
||||
log.debug("分布式锁已在事务完成后释放: doAcsFinishLoadShaft, 事务状态: {}",
|
||||
log.debug("分布式锁已在事务完成后释放: doAcsFinishLoadShaft, 事务状态: {}",
|
||||
status == STATUS_COMMITTED ? "已提交" : "已回滚");
|
||||
} catch (Exception e) {
|
||||
log.error("释放分布式锁失败", e);
|
||||
@@ -716,10 +721,10 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
String targetRestructContainer = firstPlan.getRestruct_container_name();
|
||||
List<PdmBiSlittingproductionplan> filterNextPlans = allReadyPlans.stream()
|
||||
.filter(plan ->
|
||||
Objects.equals(targetGroup, plan.getSplit_group())
|
||||
&& Objects.equals(targetParentContainer, plan.getParent_container_name())
|
||||
&& Objects.equals(targetRestructContainer, plan.getRestruct_container_name())
|
||||
).collect(Collectors.toList());
|
||||
Objects.equals(targetGroup, plan.getSplit_group())
|
||||
&& Objects.equals(targetParentContainer, plan.getParent_container_name())
|
||||
&& Objects.equals(targetRestructContainer, plan.getRestruct_container_name())
|
||||
).collect(Collectors.toList());
|
||||
log.info("获取下一趟分切计划数据:{}", filterNextPlans);
|
||||
// 查找分切对接位空位(根据原理分切机先放,优先放)(区域、location、plan进行过滤)
|
||||
List<SlitterDownNewDto> slitterDownNewDtoList = slitterMapper.getCanDownPoints(actualDevice);
|
||||
@@ -926,14 +931,14 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
throw new BadRequestException("错误表达式");
|
||||
}
|
||||
// 创建任务
|
||||
taskParam.put("task_type", SlitterEnum.TASK_TYPE.code("分切机下料桁架任务"));
|
||||
taskParam.put("task_type", SlitterEnum.TASK_TYPE.code("分切合单下卷任务"));
|
||||
taskParam.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
// taskParam.put("d_containers", currentPlans.stream().map(PdmBiSlittingproductionplan::getContainer_name).collect(Collectors.toList()));
|
||||
// taskParam.put("u_containers", filterNextPlans.stream().map(PdmBiSlittingproductionplan::getContainer_name).collect(Collectors.toList()));
|
||||
JSONArray array = new JSONArray();
|
||||
array.add(taskParam);
|
||||
if (ObjectUtil.isNotEmpty(taskParam2)) {
|
||||
taskParam2.put("task_type", SlitterEnum.TASK_TYPE.code("分切机下料桁架任务"));
|
||||
taskParam2.put("task_type", SlitterEnum.TASK_TYPE.code("分切合单下卷任务"));
|
||||
taskParam2.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
// taskParam2.put("d_containers", currentPlans.stream().map(PdmBiSlittingproductionplan::getContainer_name).collect(Collectors.toList()));
|
||||
// taskParam2.put("u_containers", filterNextPlans.stream().map(PdmBiSlittingproductionplan::getContainer_name).collect(Collectors.toList()));
|
||||
@@ -1491,7 +1496,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
if (tryLock) {
|
||||
// param: point_code
|
||||
String pointCode = param.getString("point_code");
|
||||
if (ObjectUtil.isEmpty(pointCode)){
|
||||
if (ObjectUtil.isEmpty(pointCode)) {
|
||||
throw new BadRequestException("点位编码不能为空!");
|
||||
}
|
||||
// 校验是否存在任务
|
||||
@@ -2346,36 +2351,130 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
JSONObject res = new JSONObject();
|
||||
res.put("status", HttpStatus.HTTP_OK);
|
||||
res.put("message", "创建桁架任务成功!");
|
||||
// param: area, device_code
|
||||
String area = param.getString("area");
|
||||
String deviceCode = param.getString("device_code");
|
||||
// 获取当前分切机的下一组分切计划(最多四条分切计划)
|
||||
// hint: 获取到的分切可能是不同组的但具有一定时间顺序, 可能是以前的脏数据
|
||||
List<PdmBiSlittingproductionplan> timePlans = slittingproductionplanService.list(
|
||||
new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.eq(PdmBiSlittingproductionplan::getResource_name, deviceCode)
|
||||
.eq(PdmBiSlittingproductionplan::getStatus, "03")
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, "0")
|
||||
.orderByAsc(PdmBiSlittingproductionplan::getUpdate_time));
|
||||
log.info("获取下一组分切计划:{}", timePlans);
|
||||
if (timePlans.size() > 0) {
|
||||
// 寻找备好轴的对接点位
|
||||
List<BstIvtCutpointivt> cutPointList = slitterMapper.getReadyShaftPoint(deviceCode);
|
||||
if (cutPointList.size() == 0) {
|
||||
throw new BadRequestException("没有为设备[" + deviceCode + "]套好轴的位置!");
|
||||
RLock open = redissonClient.getLock("lock:doUpShaftToSlitterByDevice");
|
||||
boolean openLock = false;
|
||||
try {
|
||||
openLock = open.tryLock(0, TimeUnit.SECONDS);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
try {
|
||||
if (openLock) {
|
||||
// param: area, device_code
|
||||
String area = param.getString("area");
|
||||
String deviceCode = param.getString("device_code");
|
||||
StIvtCutpointivt extCode = cutpointivtService.getPintByExtCode(deviceCode, true);
|
||||
if (ObjectUtil.isEmpty(extCode)) {
|
||||
throw new BadRequestException("该设备不存在或者被禁用,请检查!");
|
||||
}
|
||||
List<Deliverycachepointivt> cachePoints = slitterMapper.getReadyShaftCachePointByDevice(extCode);
|
||||
List<BstIvtCutpointivt> cutPointList = slitterMapper.getReadyShaftPoint(deviceCode);
|
||||
if (cachePoints.size() > 0) {
|
||||
// 在缓存架子上
|
||||
doUpShaftToSlitterByNew(param, cachePoints, extCode);
|
||||
} else if (cutPointList.size() > 0) {
|
||||
// 在对接位
|
||||
// 找到该分切计划的点位
|
||||
BstIvtCutpointivt newCutPoint = cutPointList.get(0);
|
||||
// 创建任务
|
||||
JSONObject taskParam = new JSONObject();
|
||||
taskParam.put("point_code", newCutPoint.getPoint_code());
|
||||
doUpShaftToSlitter(taskParam);
|
||||
} else {
|
||||
throw new BadRequestException("没有为设备[" + deviceCode + "]套好轴的位置!");
|
||||
}
|
||||
} else {
|
||||
// 找到该分切计划的点位
|
||||
BstIvtCutpointivt newCutPoint = cutPointList.get(0);
|
||||
// 创建任务
|
||||
JSONObject taskParam = new JSONObject();
|
||||
taskParam.put("point_code", newCutPoint.getPoint_code());
|
||||
doUpShaftToSlitter(taskParam);
|
||||
throw new BadRequestException("系统繁忙,稍后在试!!");
|
||||
}
|
||||
} finally {
|
||||
if (openLock) {
|
||||
open.unlock();
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建新的上轴任务
|
||||
*
|
||||
* @param param 参数(区域,设备号)
|
||||
* @param cachePoints 气胀轴存放位置
|
||||
* @param device 设备实体
|
||||
*/
|
||||
public void doUpShaftToSlitterByNew(JSONObject param, List<Deliverycachepointivt> cachePoints, StIvtCutpointivt device) {
|
||||
List<Deliverycachepointivt> actualPoints = cachePoints;
|
||||
if (cachePoints.size() > 2) {
|
||||
// todo: 需要过滤(正常不会出现,先不考虑)
|
||||
throw new BadRequestException("计划冗余,请检查!");
|
||||
}
|
||||
// 获取计划数据
|
||||
List<String> qzznos = cachePoints.stream().map(Deliverycachepointivt::getQzzno).collect(Collectors.toList());
|
||||
List<PdmBiSlittingproductionplan> plans = slittingproductionplanService.getByQzzNos(qzznos);
|
||||
if (plans.isEmpty()) {
|
||||
throw new BadRequestException("计划不存在!请检查点位:"
|
||||
+ cachePoints.stream().map(Deliverycachepointivt::getPoint_code).collect(Collectors.toList())
|
||||
+ "的数据!");
|
||||
}
|
||||
JSONObject taskParam = new JSONObject();
|
||||
// 根据计划筛选上下轴任务,并构建任务参数
|
||||
PdmBiSlittingproductionplan nextUpPlan = plans.stream()
|
||||
.filter(p -> SlitterConstant.SLITTER_SHAFT_UP.equals(p.getUp_or_down()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
PdmBiSlittingproductionplan nextDownPlan = plans.stream()
|
||||
.filter(p -> SlitterConstant.SLITTER_SHAFT_DOWN.equals(p.getUp_or_down()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
Deliverycachepointivt upNeedPoint = actualPoints.stream()
|
||||
.filter(p -> {
|
||||
assert nextUpPlan != null;
|
||||
return p.getQzzno().equals(nextUpPlan.getQzzno());
|
||||
})
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
Deliverycachepointivt downNeedPoint = actualPoints.stream()
|
||||
.filter(p -> {
|
||||
assert nextDownPlan != null;
|
||||
return p.getQzzno().equals(nextDownPlan.getQzzno());
|
||||
})
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
if (ObjectUtil.isNotEmpty(nextUpPlan) && ObjectUtil.isNotEmpty(nextDownPlan)) {
|
||||
// 上轴都不会空
|
||||
// 双轴任务参数构建
|
||||
assert downNeedPoint != null;
|
||||
taskParam.put("point_code1", downNeedPoint.getPoint_code());
|
||||
taskParam.put("point_code2", device.getDown_point_code());
|
||||
assert upNeedPoint != null;
|
||||
taskParam.put("point_code3", upNeedPoint.getPoint_code());
|
||||
taskParam.put("point_code4", device.getUp_point_code());
|
||||
taskParam.put("vehicle_code1", upNeedPoint.getQzzno());
|
||||
taskParam.put("vehicle_code2", downNeedPoint.getQzzno());
|
||||
} else {
|
||||
throw new BadRequestException("没有为设备[" + deviceCode + "]套好轴的位置!");
|
||||
// 单轴任务参数构建
|
||||
if (ObjectUtil.isNotEmpty(nextUpPlan)) {
|
||||
// 上轴任务
|
||||
assert upNeedPoint != null;
|
||||
taskParam.put("point_code1", upNeedPoint.getPoint_code());
|
||||
taskParam.put("point_code2", device.getUp_point_code());
|
||||
taskParam.put("vehicle_code1", upNeedPoint.getQzzno());
|
||||
} else {
|
||||
// 下轴任务
|
||||
assert downNeedPoint != null;
|
||||
taskParam.put("point_code1", downNeedPoint.getPoint_code());
|
||||
taskParam.put("point_code2", device.getDown_point_code());
|
||||
taskParam.put("vehicle_code2", downNeedPoint.getQzzno());
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
// 构建任务的其他参数
|
||||
taskParam.put("truss_type", "1");
|
||||
taskParam.put("empty_site", "0");
|
||||
taskParam.put("task_type", SlitterEnum.TASK_TYPE.code("缓存上空轴任务"));
|
||||
taskParam.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
taskParam.put("u_containers", plans.stream().map(PdmBiSlittingproductionplan::getContainer_name).collect(Collectors.toList()));
|
||||
// 创建任务
|
||||
upShaftTrussNewTask.createTask(taskParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -3604,7 +3703,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
List<String> containerNames = Stream.of(startPoint.getContainer_name1(), startPoint.getContainer_name2())
|
||||
.filter(value -> value != null && !value.isEmpty())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
||||
if (containerNames.isEmpty()) {
|
||||
log.error("找不到[{}]对应的分切计划!", deviceCode);
|
||||
stepTipLogs.add("套轴完成->找不到[" + deviceCode + "]点位记录的分切计划!分切计划可能被删除或者拼接!");
|
||||
@@ -3617,7 +3716,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
.eq(SchBaseTask::getPoint_code1, deviceCode)
|
||||
.like(SchBaseTask::getRequest_param, containerNames.get(0))
|
||||
.lt(SchBaseTask::getTask_status, "07"));
|
||||
|
||||
|
||||
if (!existingTasks.isEmpty()) {
|
||||
log.error("点位[{}]存在未完成得任务!", deviceCode);
|
||||
stepTipLogs.add("套轴完成->点位[" + deviceCode + "]存在未完成得任务!");
|
||||
@@ -3635,17 +3734,17 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
/**
|
||||
* 处理异常情况 - 分切计划不存在
|
||||
*/
|
||||
private JSONObject handleExceptionCase(String deviceCode, BstIvtShafttubeivt startPoint,
|
||||
private JSONObject handleExceptionCase(String deviceCode, BstIvtShafttubeivt startPoint,
|
||||
List<String> containerNames, List<String> stepTipLogs) {
|
||||
log.error("找不到[{}]对应的分切计划,分切计划可能被删除或者拼接!", containerNames);
|
||||
|
||||
|
||||
// 尝试移动到异常处理位
|
||||
List<String> exceptionPointCodes = bcutpointivtService.getCanUseMinPointByShelf("4", "0");
|
||||
if (!exceptionPointCodes.isEmpty()) {
|
||||
String exceptionPoint = exceptionPointCodes.get(0);
|
||||
JSONObject exParam = buildExceptionTaskParam(startPoint, exceptionPoint, containerNames);
|
||||
sendNBJExceptionPointTask.createTask(exParam);
|
||||
|
||||
|
||||
JSONObject res = new JSONObject();
|
||||
res.put("status", HttpStatus.HTTP_OK);
|
||||
res.put("message", "创建送至异常处理位!");
|
||||
@@ -3655,10 +3754,10 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
// 创建半条任务等待补齐
|
||||
stepTipLogs.add("套轴完成->[" + containerNames + "]对应的分切计划状态已更改,无暂存位置,创建任务失败!");
|
||||
redisUtils.set("ERROR" + deviceCode, stepTipLogs);
|
||||
|
||||
|
||||
JSONObject exParam = buildWaitingTaskParam(startPoint, containerNames);
|
||||
sendNBJExceptionPointTask.createTask(exParam);
|
||||
|
||||
|
||||
JSONObject res = new JSONObject();
|
||||
res.put("status", HttpStatus.HTTP_OK);
|
||||
res.put("message", "请求成功");
|
||||
@@ -3672,19 +3771,19 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
JSONObject exParam = new JSONObject();
|
||||
exParam.put("point_code1", startPoint.getPoint_code());
|
||||
exParam.put("point_code2", exceptionPoint);
|
||||
|
||||
|
||||
if (exceptionPoint.endsWith("A")) {
|
||||
exParam.put("vehicle_code1", containerNames);
|
||||
} else {
|
||||
exParam.put("vehicle_code2", containerNames);
|
||||
}
|
||||
|
||||
|
||||
exParam.put("task_type", SlitterEnum.TASK_TYPE.code("套轴异常处理桁架任务"));
|
||||
exParam.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
exParam.put("acs_task_type", "6");
|
||||
exParam.put("containers", containerNames);
|
||||
exParam.put("qzz_size", startPoint.getQzz_size());
|
||||
|
||||
|
||||
return exParam;
|
||||
}
|
||||
|
||||
@@ -3702,7 +3801,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
exParam.put("acs_task_type", "6");
|
||||
exParam.put("containers", containerNames);
|
||||
exParam.put("qzz_size", startPoint.getQzz_size());
|
||||
|
||||
|
||||
return exParam;
|
||||
}
|
||||
|
||||
@@ -3711,7 +3810,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
*/
|
||||
private String updatePlanWeights(List<PdmBiSlittingproductionplan> plans, BigDecimal weight1, BigDecimal weight2) {
|
||||
StringBuilder msg = new StringBuilder();
|
||||
|
||||
|
||||
for (PdmBiSlittingproductionplan plan : plans) {
|
||||
if (SlitterConstant.SLITTER_SUB_VOLUME_LEFT.equals(plan.getLeft_or_right())) {
|
||||
plan.setPaper_weight(String.valueOf(NumberUtil.round(weight1, 2)));
|
||||
@@ -3722,7 +3821,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
}
|
||||
TaskUtils.updateOptMessageBySlitterPlan(plan);
|
||||
}
|
||||
|
||||
|
||||
slittingproductionplanService.updateBatchById(plans);
|
||||
return msg.toString();
|
||||
}
|
||||
@@ -3754,12 +3853,12 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
/**
|
||||
* 尝试拼单逻辑
|
||||
*/
|
||||
private BstIvtCutpointivt tryCombineOrder(PdmBiSlittingproductionplan demoPlan, String deviceCode,
|
||||
private BstIvtCutpointivt tryCombineOrder(PdmBiSlittingproductionplan demoPlan, String deviceCode,
|
||||
BstIvtShafttubeivt startPoint, String qzzNo) {
|
||||
Param codParam = paramService.findByCode(IS_COMBINED_ORDER);
|
||||
// 判断是否有同组(判断自己能不能拼单)
|
||||
Integer sameNumber = slittingproductionplanService.getSameTripParentContainerPlanCount(demoPlan);
|
||||
|
||||
|
||||
// 不允许拼单(未开启拼单逻辑)
|
||||
if (sameNumber != 0 || ObjectUtil.isEmpty(codParam) || !"1".equals(codParam.getValue())) {
|
||||
log.info("本身不允许拼单或者拼单配置未设置或者设置不拼单...");
|
||||
@@ -3768,7 +3867,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
|
||||
String resourceName = demoPlan.getResource_name();
|
||||
StIvtCutpointivt deviceInfo = cutpointivtService.getPintByExtCode(resourceName, false);
|
||||
|
||||
|
||||
// 查找能够拼单的点位(查找套轴对接位)
|
||||
List<BstIvtCutpointivt> emptyNotTaskPoint = slitterMapper.getCombinedOrders(
|
||||
CombinedOrderDto.builder()
|
||||
@@ -3797,10 +3896,10 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
/**
|
||||
* 尝试与运行中的任务拼单
|
||||
*/
|
||||
private List<BstIvtCutpointivt> tryMatchRunningTask(PdmBiSlittingproductionplan demoPlan,
|
||||
private List<BstIvtCutpointivt> tryMatchRunningTask(PdmBiSlittingproductionplan demoPlan,
|
||||
String deviceCode, StIvtCutpointivt deviceInfo) {
|
||||
List<BstIvtCutpointivt> result = new ArrayList<>();
|
||||
|
||||
|
||||
SchBaseTask runningTask = taskService.getOne(new LambdaQueryWrapper<SchBaseTask>()
|
||||
.eq(SchBaseTask::getHandle_class, "org.nl.b_lms.sch.tasks.slitter.TrussSendAirShaftTask")
|
||||
.lt(SchBaseTask::getTask_status, "07")
|
||||
@@ -3813,7 +3912,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
|
||||
List<PdmBiSlittingproductionplan> runningShafts = slittingproductionplanService.getByQzzNos(
|
||||
Arrays.asList(runningTask.getVehicle_code(), runningTask.getVehicle_code2()));
|
||||
|
||||
|
||||
if (runningShafts.isEmpty()) {
|
||||
return result;
|
||||
}
|
||||
@@ -3821,7 +3920,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
PdmBiSlittingproductionplan runningShaft = runningShafts.get(0);
|
||||
// 判断路上的轴能不能拼
|
||||
Integer otherPlans = slittingproductionplanService.getSameTripParentContainerPlanCount(runningShaft);
|
||||
|
||||
|
||||
if (otherPlans == 0) {
|
||||
StIvtCutpointivt runDeviceInfo = cutpointivtService.getPintByExtCode(runningShaft.getResource_name(), false);
|
||||
// 同个子区域
|
||||
@@ -3829,7 +3928,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
BstIvtCutpointivt one = bcutpointivtService.getOne(new LambdaQueryWrapper<BstIvtCutpointivt>()
|
||||
.eq(BstIvtCutpointivt::getTruss_point_code1, runningTask.getPoint_code2()).or()
|
||||
.eq(BstIvtCutpointivt::getTruss_point_code2, runningTask.getPoint_code2()));
|
||||
|
||||
|
||||
if (one != null && canCombineWithRunningTask(one, runningTask)) {
|
||||
result.add(one);
|
||||
}
|
||||
@@ -3852,20 +3951,21 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
|
||||
/**
|
||||
* 创建拼单任务
|
||||
* @param cutPoint 分切点位
|
||||
*
|
||||
* @param cutPoint 分切点位
|
||||
* @param startPoint 穿拔轴点位
|
||||
* @param demoPlan 分切计划
|
||||
* @param qzzNo 气胀轴编码
|
||||
* @param demoPlan 分切计划
|
||||
* @param qzzNo 气胀轴编码
|
||||
*/
|
||||
private void createCombinedOrderTask(BstIvtCutpointivt cutPoint, BstIvtShafttubeivt startPoint,
|
||||
PdmBiSlittingproductionplan demoPlan, String qzzNo) {
|
||||
private void createCombinedOrderTask(BstIvtCutpointivt cutPoint, BstIvtShafttubeivt startPoint,
|
||||
PdmBiSlittingproductionplan demoPlan, String qzzNo) {
|
||||
JSONObject taskParam = new JSONObject();
|
||||
taskParam.put("point_code1", startPoint.getPoint_code());
|
||||
|
||||
String pointCode2 = ObjectUtil.isEmpty(cutPoint.getQzz_no1())
|
||||
|
||||
String pointCode2 = ObjectUtil.isEmpty(cutPoint.getQzz_no1())
|
||||
? cutPoint.getTruss_point_code1() : cutPoint.getTruss_point_code2();
|
||||
taskParam.put("point_code2", pointCode2);
|
||||
|
||||
|
||||
String vehicleCode1 = ObjectUtil.isEmpty(cutPoint.getQzz_no1()) ? qzzNo : "";
|
||||
String vehicleCode2 = ObjectUtil.isEmpty(cutPoint.getQzz_no2()) ? qzzNo : "";
|
||||
taskParam.put("vehicle_code1", vehicleCode1);
|
||||
@@ -3874,16 +3974,16 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
taskParam.put("task_type", "010814");
|
||||
taskParam.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
taskParam.put("immediateNotifyAcs", "1");
|
||||
|
||||
|
||||
trussSendAirShaftTask.createTask(taskParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理正常业务流程(不拼单)
|
||||
*/
|
||||
private void handleNormalProcess(PdmBiSlittingproductionplan demoPlan, BstIvtShafttubeivt startPoint,
|
||||
String qzzNo, List<String> containerNames, String deviceCode,
|
||||
List<String> stepTipLogs) {
|
||||
private void handleNormalProcess(PdmBiSlittingproductionplan demoPlan, BstIvtShafttubeivt startPoint,
|
||||
String qzzNo, List<String> containerNames, String deviceCode,
|
||||
List<String> stepTipLogs) {
|
||||
// 查找是否有同组的气胀轴位置
|
||||
BstIvtCutpointivt cutPoint = findSameGroupPoint(demoPlan);
|
||||
|
||||
@@ -3891,7 +3991,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
// 获取一个空位
|
||||
List<BstIvtCutpointivt> emptyNotTaskPoint = bcutpointivtService.getNBJAreaNotTaskPointByStatus(
|
||||
"1", "1", startPoint.getPoint_location(), "1");
|
||||
|
||||
|
||||
if (!emptyNotTaskPoint.isEmpty()) {
|
||||
cutPoint = emptyNotTaskPoint.get(0);
|
||||
} else {
|
||||
@@ -3910,7 +4010,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
*/
|
||||
private BstIvtCutpointivt findSameGroupPoint(PdmBiSlittingproductionplan demoPlan) {
|
||||
BstIvtCutpointivt cutPoint = slitterMapper.getSameGroupPoint(demoPlan);
|
||||
|
||||
|
||||
if (ObjectUtil.isEmpty(cutPoint)) {
|
||||
String endPoint = slitterMapper.getSameGroupTaskPoint(demoPlan);
|
||||
if (ObjectUtil.isNotEmpty(endPoint)) {
|
||||
@@ -3919,19 +4019,19 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
.eq(BstIvtCutpointivt::getTruss_point_code2, endPoint));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return cutPoint;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建半条任务
|
||||
*/
|
||||
private void createHalfTask(BstIvtShafttubeivt startPoint, PdmBiSlittingproductionplan demoPlan,
|
||||
String qzzNo, List<String> containerNames, String deviceCode,
|
||||
List<String> stepTipLogs) {
|
||||
private void createHalfTask(BstIvtShafttubeivt startPoint, PdmBiSlittingproductionplan demoPlan,
|
||||
String qzzNo, List<String> containerNames, String deviceCode,
|
||||
List<String> stepTipLogs) {
|
||||
stepTipLogs.add("提示:套轴完成->找不到可用套轴对接位,创建半条任务,等待AGV取货完成触发!");
|
||||
redisUtils.set("ERROR" + deviceCode, stepTipLogs);
|
||||
|
||||
|
||||
JSONObject taskParam = new JSONObject();
|
||||
taskParam.put("point_code1", startPoint.getPoint_code());
|
||||
taskParam.put("point_code2", "-");
|
||||
@@ -3944,16 +4044,16 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
taskParam.put("task_status", TaskStatusEnum.SURE_START.getCode());
|
||||
taskParam.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
taskParam.put("immediateNotifyAcs", "0");
|
||||
|
||||
|
||||
trussSendAirShaftTask.createTask(taskParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建正常任务
|
||||
*/
|
||||
private void createNormalTask(BstIvtCutpointivt cutPoint, BstIvtShafttubeivt startPoint,
|
||||
PdmBiSlittingproductionplan demoPlan, String qzzNo,
|
||||
List<String> containerNames) {
|
||||
private void createNormalTask(BstIvtCutpointivt cutPoint, BstIvtShafttubeivt startPoint,
|
||||
PdmBiSlittingproductionplan demoPlan, String qzzNo,
|
||||
List<String> containerNames) {
|
||||
JSONObject taskParam = new JSONObject();
|
||||
taskParam.put("point_code1", startPoint.getPoint_code());
|
||||
taskParam.put("point_code2", SlitterConstant.SLITTER_SHAFT_UP.equals(demoPlan.getUp_or_down())
|
||||
@@ -3966,7 +4066,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
taskParam.put("qzz_size", demoPlan.getQzz_size());
|
||||
taskParam.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
taskParam.put("immediateNotifyAcs", "1");
|
||||
|
||||
|
||||
trussSendAirShaftTask.createTask(taskParam);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user