opt: 备货区没有空位只做拔轴,暂存区没有空位不做拔轴,任务查看手持功能
This commit is contained in:
@@ -323,5 +323,11 @@ public class SlitterPdaController {
|
|||||||
public ResponseEntity<Object> getTubeVehicleInfo(@RequestBody JSONObject param) {
|
public ResponseEntity<Object> getTubeVehicleInfo(@RequestBody JSONObject param) {
|
||||||
return new ResponseEntity<>(slitterService.getTubeVehicleInfo(param), HttpStatus.OK);
|
return new ResponseEntity<>(slitterService.getTubeVehicleInfo(param), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
@PostMapping("/seeTaskByPoint")
|
||||||
|
@Log("任务查看")
|
||||||
|
@SaIgnore
|
||||||
|
public ResponseEntity<Object> seeTaskByPoint(@RequestBody JSONObject param) {
|
||||||
|
return new ResponseEntity<>(slitterService.seeTaskByPoint(param), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ import java.time.LocalDateTime;
|
|||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.function.Consumer;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
@@ -62,6 +61,7 @@ import static org.nl.b_lms.sch.tasks.slitter.util.SlitterTaskUtil.doSavePaperInf
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 定时器呼叫套轴任务
|
* 定时器呼叫套轴任务
|
||||||
|
*
|
||||||
* @Author: lyd
|
* @Author: lyd
|
||||||
* @Date: 2024/2/1
|
* @Date: 2024/2/1
|
||||||
* @Description: 自动任务 呼叫套轴 根据分切计划来呼叫套轴任务 桁架任务
|
* @Description: 自动任务 呼叫套轴 根据分切计划来呼叫套轴任务 桁架任务
|
||||||
@@ -107,6 +107,7 @@ public class AutoCallAirShaftTask extends Prun {
|
|||||||
public final static String IS_ONLY_PULLING = "IS_ONLY_PULLING";
|
public final static String IS_ONLY_PULLING = "IS_ONLY_PULLING";
|
||||||
public final static String TZ_DAY = "TZ_DAY";
|
public final static String TZ_DAY = "TZ_DAY";
|
||||||
public final static String USE_XN = "USE_XN";
|
public final static String USE_XN = "USE_XN";
|
||||||
|
public final static String BZ_CHECK_EMPTY = "BZ_CHECK_EMPTY";
|
||||||
public List<String> stepErrorInfo = new ArrayList<>();
|
public List<String> stepErrorInfo = new ArrayList<>();
|
||||||
@Autowired
|
@Autowired
|
||||||
private RedissonClient redissonClient;
|
private RedissonClient redissonClient;
|
||||||
@@ -154,6 +155,7 @@ public class AutoCallAirShaftTask extends Prun {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void doCallShaft(BstIvtShafttubeivt empty, Param isOnlyPulling, Param tzDay, Param paramObj, Param useXn) {
|
public void doCallShaft(BstIvtShafttubeivt empty, Param isOnlyPulling, Param tzDay, Param paramObj, Param useXn) {
|
||||||
log.info(empty.getPoint_code() + "执行中...");
|
log.info(empty.getPoint_code() + "执行中...");
|
||||||
@@ -310,12 +312,13 @@ public class AutoCallAirShaftTask extends Prun {
|
|||||||
List<CutpointAirShhaftDto> qzzPoint = sortByPointEmpty(notTaskPoints);
|
List<CutpointAirShhaftDto> qzzPoint = sortByPointEmpty(notTaskPoints);
|
||||||
log.info("查找到满足到对应尺寸的点位-{}", qzzPoint);
|
log.info("查找到满足到对应尺寸的点位-{}", qzzPoint);
|
||||||
if (qzzPoint.size() == 0) {
|
if (qzzPoint.size() == 0) {
|
||||||
stepErrorInfo.add("没有可拔轴的点位。");
|
stepErrorInfo.add("没有套轴暂存位没有相同规格的气胀轴来拔轴,直接去气胀轴库获取。");
|
||||||
//若套轴暂存位没有相同规格的气胀轴,直接去气胀轴库找即可
|
//若套轴暂存位没有相同规格的气胀轴,直接去气胀轴库找即可
|
||||||
// 调用ACS滚条气涨轴下来
|
// 调用ACS滚条气涨轴下来
|
||||||
if (!toAcsOutShaft(needPlans, plans, qzzSize, location, empty)) {
|
if (!toAcsOutShaft(needPlans, plans, qzzSize, location, empty)) {
|
||||||
log.error("呼叫出轴失败-穿拔轴{}不进行套轴,跳过!", empty.getPoint_code());
|
log.error("呼叫出轴失败-穿拔轴{}不进行套轴,跳过!", empty.getPoint_code());
|
||||||
stepErrorInfo.add("呼叫出轴失败-穿拔轴" + empty.getPoint_code() + "不进行套轴,跳过!");
|
stepErrorInfo.add("呼叫出轴失败-穿拔轴" + empty.getPoint_code() + "不进行套轴,直接做拔轴!");
|
||||||
|
makePullShaft(empty, specification);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 保存所需要的分切计划数据到点位上(套轴对接位)更新分切计划
|
// 保存所需要的分切计划数据到点位上(套轴对接位)更新分切计划
|
||||||
@@ -422,6 +425,7 @@ public class AutoCallAirShaftTask extends Prun {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断是不是有空位置
|
* 判断是不是有空位置
|
||||||
|
*
|
||||||
* @param planD
|
* @param planD
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -503,6 +507,7 @@ public class AutoCallAirShaftTask extends Prun {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 跳过跟当前套轴计划一样的管芯的分切计划
|
* 跳过跟当前套轴计划一样的管芯的分切计划
|
||||||
|
*
|
||||||
* @param needPlans 当前能套轴的计划
|
* @param needPlans 当前能套轴的计划
|
||||||
*/
|
*/
|
||||||
public void skipTheSameTubePlans(List<PdmBiSlittingproductionplan> needPlans) {
|
public void skipTheSameTubePlans(List<PdmBiSlittingproductionplan> needPlans) {
|
||||||
@@ -540,6 +545,7 @@ public class AutoCallAirShaftTask extends Prun {
|
|||||||
/**
|
/**
|
||||||
* <h2>呼叫AGV更换纸管</h2>
|
* <h2>呼叫AGV更换纸管</h2>
|
||||||
* <p>默认双管芯尺寸一致
|
* <p>默认双管芯尺寸一致
|
||||||
|
*
|
||||||
* @param needPlans 所需要套轴的分切计划
|
* @param needPlans 所需要套轴的分切计划
|
||||||
* @param location 位置
|
* @param location 位置
|
||||||
* @param empty 穿拔轴点位
|
* @param empty 穿拔轴点位
|
||||||
@@ -774,8 +780,7 @@ public class AutoCallAirShaftTask extends Prun {
|
|||||||
List<BstIvtStockingivt> list = stockingivtService.getEmptyPointNotTask(location, "0");
|
List<BstIvtStockingivt> list = stockingivtService.getEmptyPointNotTask(location, "0");
|
||||||
if (list.size() == 0) {
|
if (list.size() == 0) {
|
||||||
stepErrorInfo.add("备货区找不到空位置搬运, 请检查备货区点位情况!");
|
stepErrorInfo.add("备货区找不到空位置搬运, 请检查备货区点位情况!");
|
||||||
redisUtils.set("ERROR" + empty.getPoint_code(), stepErrorInfo);
|
return 2;
|
||||||
throw new RuntimeException("备货区找不到空位置搬运, 请检查备货区点位情况!");
|
|
||||||
}
|
}
|
||||||
BstIvtStockingivt endPoint = list.get(0);
|
BstIvtStockingivt endPoint = list.get(0);
|
||||||
// 创建任务 -> HINT: 在此任务完成之后会调用搬回来的任务,因此任务中要记录需要搬运的点位放在任务请求参数中。
|
// 创建任务 -> HINT: 在此任务完成之后会调用搬回来的任务,因此任务中要记录需要搬运的点位放在任务请求参数中。
|
||||||
@@ -807,6 +812,7 @@ public class AutoCallAirShaftTask extends Prun {
|
|||||||
Integer movePaperTube = toCallAgvMovePaperTube(needPlans, location, empty, plans);
|
Integer movePaperTube = toCallAgvMovePaperTube(needPlans, location, empty, plans);
|
||||||
if (movePaperTube == 2) {
|
if (movePaperTube == 2) {
|
||||||
log.info("跳过,无法更换托盘。");
|
log.info("跳过,无法更换托盘。");
|
||||||
|
stepErrorInfo.add("呼叫AGV更换托盘失败,无法更换托盘。");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (movePaperTube != 0) {
|
if (movePaperTube != 0) {
|
||||||
@@ -986,7 +992,10 @@ public class AutoCallAirShaftTask extends Prun {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PdmBiSlittingproductionplan plan = list.get(0);
|
PdmBiSlittingproductionplan plan = list.get(0);
|
||||||
// todo: 考虑是否有空位(如果气涨轴库和气胀轴暂存架都没有空位,则退出)【暂时不考虑】
|
// hint: 考虑是否有空位(如果气涨轴库和气胀轴暂存架都没有空位,则退出)
|
||||||
|
if (doCheckHaveEmptyPoint(empty, specification, plan)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
List<String> collect = list.stream().map(PdmBiSlittingproductionplan::getContainer_name).collect(Collectors.toList());
|
List<String> collect = list.stream().map(PdmBiSlittingproductionplan::getContainer_name).collect(Collectors.toList());
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
param.put("point_code1", pointCode1);
|
param.put("point_code1", pointCode1);
|
||||||
@@ -1010,8 +1019,69 @@ public class AutoCallAirShaftTask extends Prun {
|
|||||||
stepErrorInfo.add("只做拔轴,拔轴任务已经创建...");
|
stepErrorInfo.add("只做拔轴,拔轴任务已经创建...");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检测气胀轴密集库/气胀轴缓存库有没有空位
|
||||||
|
* @param empty
|
||||||
|
* @param specification
|
||||||
|
* @param plan
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private boolean doCheckHaveEmptyPoint(BstIvtShafttubeivt empty, String specification, PdmBiSlittingproductionplan plan) {
|
||||||
|
Param bzCheckEmpty = paramService.findByCode(BZ_CHECK_EMPTY);
|
||||||
|
if (ObjectUtil.isEmpty(bzCheckEmpty)) {
|
||||||
|
stepErrorInfo.add("参数未配置【BZ_CHECK_EMPTY】,默认拔轴不检验空位!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if ("0".equals(bzCheckEmpty.getValue())) {
|
||||||
|
stepErrorInfo.add("参数配置【BZ_CHECK_EMPTY】拔轴不检验空位!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 需要区分上下 - 气胀轴库(3寸能放7个,6寸能放6个)
|
||||||
|
List<BstIvtShafttubeivt> shafttubeivts = bstIvtShafttubeivtService.getByQzzSize(plan.getQzz_size(), empty.getPoint_code(), empty.getPoint_location());
|
||||||
|
if (shafttubeivts.size() == 0) {
|
||||||
|
log.error("气胀轴库找不到[" + plan.getQzz_size() + "]规格的气涨轴位");
|
||||||
|
stepErrorInfo.add("拔轴空位校验失败:气胀轴库找不到[" + plan.getQzz_size() + "]规格的气涨轴位");
|
||||||
|
} else {
|
||||||
|
Integer qty = 7;
|
||||||
|
// 气涨轴库
|
||||||
|
BstIvtShafttubeivt shafttubeivt = shafttubeivts.get(0);
|
||||||
|
qty = "3".equals(shafttubeivt.getQzz_size()) ? 7 : 6;
|
||||||
|
JSONArray device_rows = new JSONArray();
|
||||||
|
JSONObject device_obj = new JSONObject();
|
||||||
|
device_rows.add(device_obj);
|
||||||
|
device_obj.put("device_code", shafttubeivt.getPoint_code());
|
||||||
|
// todo: 暂时都是B1
|
||||||
|
device_obj.put("product_area", "B1");
|
||||||
|
JSONObject pointStatus = wmsToAcsService.getPointStatus(device_rows);
|
||||||
|
if (ObjectUtil.isEmpty(pointStatus)) {
|
||||||
|
log.error("获取气胀轴库信息失败");
|
||||||
|
stepErrorInfo.add("拔轴空位校验失败:获取ACS气胀轴库信息失败...");
|
||||||
|
} else {
|
||||||
|
boolean judgment1 = true;
|
||||||
|
boolean judgment2 = true;
|
||||||
|
// 获取气涨轴缓存没有任务的点位
|
||||||
|
List<BstIvtShafttubeivt> qzzCache = bstIvtShafttubeivtService.getNotTaskShaftCacheEmpty(empty);
|
||||||
|
if (qzzCache.size() == 0) {
|
||||||
|
log.warn("未找到气胀轴密集库可以存放气涨轴规格「" + plan.getQzz_size() + "」的暂存位");
|
||||||
|
judgment2 = false;
|
||||||
|
}
|
||||||
|
JSONObject data2 = pointStatus.getJSONArray("data").getJSONObject(0);
|
||||||
|
if (ObjectUtil.isNotEmpty(data2.get("qty")) && data2.getInteger("qty") > 0 && (qty - data2.getInteger("qty") <= 0)) {
|
||||||
|
log.warn("气胀轴库【" + shafttubeivt.getPoint_code() + "】没有空位。");
|
||||||
|
judgment1 = false;
|
||||||
|
}
|
||||||
|
if (!judgment1 && !judgment2) {
|
||||||
|
stepErrorInfo.add("拔轴空位校验:密集库/缓存架没有可以存放气涨轴规格「" + plan.getQzz_size() + "-" + specification + "」的暂存位");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 排序
|
* 排序
|
||||||
|
*
|
||||||
* @param notTaskPoints
|
* @param notTaskPoints
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package org.nl.b_lms.sch.tasks.slitter.service;
|
|||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt;
|
import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt;
|
||||||
|
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||||
import org.nl.b_lms.sch.tasks.slitter.mapper.dto.CallPlanViewVO;
|
import org.nl.b_lms.sch.tasks.slitter.mapper.dto.CallPlanViewVO;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
|
||||||
@@ -408,4 +409,6 @@ public interface SlitterService {
|
|||||||
JSONObject taskTubeVehicle(JSONObject param);
|
JSONObject taskTubeVehicle(JSONObject param);
|
||||||
|
|
||||||
JSONObject getTubeVehicleInfo(JSONObject param);
|
JSONObject getTubeVehicleInfo(JSONObject param);
|
||||||
|
|
||||||
|
List<SchBaseTask> seeTaskByPoint(JSONObject param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ import java.util.Arrays;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import java.util.function.Consumer;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
@@ -3275,6 +3276,18 @@ public class SlitterServiceImpl implements SlitterService {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SchBaseTask> seeTaskByPoint(JSONObject param) {
|
||||||
|
String data = param.getString("data");
|
||||||
|
return taskService.list(new LambdaQueryWrapper<SchBaseTask>()
|
||||||
|
.eq(SchBaseTask::getIs_delete, "0")
|
||||||
|
.lt(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
|
||||||
|
.and(ObjectUtil.isNotEmpty(data), la2 -> la2.like(SchBaseTask::getPoint_code1, data).or()
|
||||||
|
.like(SchBaseTask::getPoint_code2, data).or()
|
||||||
|
.like(SchBaseTask::getPoint_code3, data).or()
|
||||||
|
.like(SchBaseTask::getPoint_code4, data)));
|
||||||
|
}
|
||||||
|
|
||||||
public List<String> getRedisListValue(String key) {
|
public List<String> getRedisListValue(String key) {
|
||||||
List<String> stepTipLogs = (List<String>) redisUtils.get(key);
|
List<String> stepTipLogs = (List<String>) redisUtils.get(key);
|
||||||
if (CollectionUtil.isEmpty(stepTipLogs)) {
|
if (CollectionUtil.isEmpty(stepTipLogs)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user