Opt:解决代码冲突
This commit is contained in:
@@ -19,13 +19,13 @@ import org.nl.b_lms.sch.tasks.slitter.InstorStockAgvTask;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterEnum;
|
||||
import org.nl.b_lms.sch.tasks.slitter.util.SlitterTaskUtil;
|
||||
import org.nl.b_lms.storage_manage.md.service.MaterialbaseService;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.common.utils.TaskUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.system.service.dict.dao.Dict;
|
||||
import org.nl.system.service.dict.dao.mapper.SysDictMapper;
|
||||
import org.nl.wms.basedata.master.service.MaterialbaseService;
|
||||
import org.nl.wms.basedata.master.service.dto.MaterialbaseDto;
|
||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@@ -5,13 +5,12 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpStatus;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.bst.ivt.cutpointivt.service.IBstIvtCutpointivtService;
|
||||
@@ -47,7 +46,6 @@ import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.common.utils.TaskUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.system.service.notice.ISysNoticeService;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
import org.nl.system.service.param.dao.Param;
|
||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||
@@ -57,7 +55,6 @@ import org.redisson.api.RedissonClient;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -127,8 +124,6 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
private UpShaftTrussTask upShaftTrussTask;
|
||||
@Autowired
|
||||
private ReturnShaftAgvTask returnShaftAgvTask;
|
||||
@Autowired
|
||||
private ISysNoticeService noticeService;
|
||||
|
||||
@Override
|
||||
|
||||
@@ -154,10 +149,6 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
List<String> tubes = Stream.of(point.getTube_code1(), point.getTube_code2())
|
||||
.filter(ObjectUtil::isNotEmpty)
|
||||
.collect(Collectors.toList());
|
||||
// 判断是否存在纸管(查找三点位是否有所需的管芯)
|
||||
// List<MdPbPapervehicle> list = papervehicleService.list(new LambdaQueryWrapper<MdPbPapervehicle>()
|
||||
// .in(MdPbPapervehicle::getMaterial_code, tubes)
|
||||
// .gt(MdPbPapervehicle::getQty, 0));
|
||||
List<GxQtyDto> gxQtyList = papervehicleService.getGxPoints(point.getPoint_location(), tubes);
|
||||
// point.getTube_code1() 编码 , getTube_name1() : 纸制筒管|纸管|6英寸|1300 or 纸制筒管|纸管|3英寸|12|650
|
||||
res.put("device_code", deviceCode);
|
||||
@@ -165,11 +156,6 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
if ("1".equals(autoSendEmpty.getValue()) && gxQtyList.size() == 0) {
|
||||
con.put("is_bushing", SlitterConstant.TO_SHAFT_INFO_97);
|
||||
} else {
|
||||
// int sum = list.stream()
|
||||
// .mapToInt(e -> e.getQty().intValue())
|
||||
// .sum();
|
||||
// // 需要求和判断当前数量和所需数
|
||||
// con.put("is_bushing", sum >= tubes.size() ? SlitterConstant.SLITTER_YES : SlitterConstant.SLITTER_NO);
|
||||
List<GxQtyDto> hasNeedPoint = gxQtyList.stream()
|
||||
.filter(gx -> "1".equals(gx.getPoint_type()) && gx.getQty() >= tubes.size())
|
||||
.collect(Collectors.toList());
|
||||
@@ -370,8 +356,6 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
}
|
||||
if (ObjectUtil.isEmpty(cutPoint)) {
|
||||
// 获取一个空位 (上下区域)
|
||||
// List<BstIvtCutpointivt> emptyNotTaskPoint = bcutpointivtService.getAreaNotTaskPointByStatus(
|
||||
// "1", "1", startPoint.getPoint_location(), "1");
|
||||
List<BstIvtCutpointivt> emptyNotTaskPoint = bcutpointivtService.getNBJAreaNotTaskPointByStatus(
|
||||
"1", "1", startPoint.getPoint_location(), "1");
|
||||
if (emptyNotTaskPoint.size() == 0) {
|
||||
@@ -444,12 +428,6 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
BstIvtShafttubeivt startPoint = shafttubeivtService.getByPointCode(deviceCode, false);
|
||||
// 临时存放气涨轴尺寸
|
||||
startPoint.setQzz_size(qzzSize);
|
||||
// 获取等待点(放货点)
|
||||
// 获取空位
|
||||
// List<BstIvtShafttubeivt> shafttubeivts = shafttubeivtService.getNotTaskShaftCacheEmpty(startPoint);
|
||||
// if (shafttubeivts.size() == 0) {
|
||||
// throw new BadRequestException("未找到可存放气涨轴规格「" + qzzSize + "」的空暂存位");
|
||||
// }
|
||||
BstIvtShafttubeivt putWaitPoint = shafttubeivtService.getOne(new LambdaQueryWrapper<BstIvtShafttubeivt>()
|
||||
.eq(BstIvtShafttubeivt::getPoint_location, startPoint.getPoint_location())
|
||||
.eq(BstIvtShafttubeivt::getPoint_type, "8"));
|
||||
@@ -482,6 +460,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
public JSONObject acsCallShaftFromCache(JSONObject param) {
|
||||
log.info("ACS申请从气涨轴暂存位呼叫气胀轴的输入参数为:{}", param);
|
||||
JSONObject res = new JSONObject();
|
||||
//拔轴设备点位
|
||||
String deviceCode = param.getString("device_code");
|
||||
String qzzSize = param.getString("size");
|
||||
// 判断是否有未完成的任务
|
||||
@@ -492,19 +471,13 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
throw new BadRequestException("点位[" + deviceCode + "]存在未完成得任务!");
|
||||
}
|
||||
BstIvtShafttubeivt startPoint = shafttubeivtService.getByPointCode(deviceCode, false);
|
||||
// 获取气涨轴缓存没有任务的点位
|
||||
// List<BstIvtShafttubeivt> shafttubeivts = shafttubeivtService.getNotTaskShaftCache(qzzSize,
|
||||
// startPoint.getQzz_generation(), startPoint.getPoint_location());
|
||||
// if (shafttubeivts.size() == 0) {
|
||||
// throw new BadRequestException("未找到气涨轴规格「" + qzzSize + "」的暂存位");
|
||||
// }
|
||||
|
||||
BstIvtShafttubeivt pickWaitPoint = shafttubeivtService.getOne(new LambdaQueryWrapper<BstIvtShafttubeivt>()
|
||||
.eq(BstIvtShafttubeivt::getPoint_location, startPoint.getPoint_location())
|
||||
.eq(BstIvtShafttubeivt::getPoint_type, "7"));
|
||||
if (ObjectUtil.isEmpty(pickWaitPoint)) {
|
||||
throw new BadRequestException("未找到可存放气涨轴规格「" + qzzSize + "」的等待点位");
|
||||
}
|
||||
// BstIvtShafttubeivt shafttubeivt = shafttubeivts.get(0);
|
||||
JSONObject taskParam = new JSONObject();
|
||||
taskParam.put("point_code1", pickWaitPoint.getPoint_code());
|
||||
taskParam.put("point_code2", startPoint.getPoint_code());
|
||||
@@ -903,11 +876,14 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
JSONObject res = new JSONObject();
|
||||
res.put("status", HttpStatus.HTTP_OK);
|
||||
res.put("message", "请求成功!");
|
||||
// param: device_code row_num
|
||||
if (ObjectUtil.isEmpty(param.getString("row_num"))) {
|
||||
log.error("设备:{},排数不能为空", param.getString("device_code"));
|
||||
throw new BadRequestException("设备:" + param.getString("device_code") + "排数不能为空");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(param.getString("col_num"))) {
|
||||
log.error("设备:{},列数不能为空", param.getString("device_code"));
|
||||
throw new BadRequestException("设备:" + param.getString("device_code") + "列数不能为空");
|
||||
}
|
||||
BstIvtStockingivt device = stockingivtService.getPointByCode(param.getString("device_code"), false);
|
||||
String vehicleCode = device.getVehicle_code();
|
||||
if (ObjectUtil.isEmpty(vehicleCode)) {
|
||||
@@ -923,38 +899,16 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
}
|
||||
MdPbPapervehicle mdPbPapervehicle = papervehicleService.getOne(new LambdaQueryWrapper<MdPbPapervehicle>()
|
||||
.eq(MdPbPapervehicle::getVehicle_code, vehicleCode)
|
||||
.eq(MdPbPapervehicle::getRow_num, param.getString("row_num")));
|
||||
.eq(MdPbPapervehicle::getRow_num, param.getString("row_num"))
|
||||
.eq(MdPbPapervehicle::getCol_num, param.getString("col_num")));
|
||||
if (ObjectUtil.isEmpty(mdPbPapervehicle)) {
|
||||
log.warn("托盘:" + vehicleCode + "第" + param.getString("row_num") + "行没数据!");
|
||||
throw new BadRequestException("托盘:" + vehicleCode + "第" + param.getString("row_num") + "行没数据!");
|
||||
log.warn("托盘:" + vehicleCode + "第" + param.getString("row_num")+"-"+param.getString("col_num") + "没数据!");
|
||||
throw new BadRequestException("托盘:" + vehicleCode + "第" + param.getString("row_num")+"-"+param.getString("col_num") + "行没数据!");
|
||||
}
|
||||
log.debug("更新前:" + vehicleCode + "第" + param.getString("row_num") + mdPbPapervehicle);
|
||||
log.debug("更新前" + vehicleCode + "数据:" + mdPbPapervehicle);
|
||||
if (mdPbPapervehicle != null || mdPbPapervehicle.getQty().intValue() > 0) {
|
||||
//数量减一
|
||||
mdPbPapervehicle.setQty(BigDecimal.valueOf(mdPbPapervehicle.getQty().intValue() - 1));
|
||||
|
||||
log.debug("更新后:" + vehicleCode + "第" + param.getString("row_num") + mdPbPapervehicle);
|
||||
|
||||
// 检查更新后的 qty 是否为 0,然后删除相应的记录
|
||||
if (mdPbPapervehicle.getQty().intValue() <= 0) {
|
||||
boolean remove = papervehicleService.removeById(mdPbPapervehicle);
|
||||
log.debug("删除0结果:" + vehicleCode + ":" + remove);
|
||||
} else {
|
||||
papervehicleService.update(mdPbPapervehicle);
|
||||
}
|
||||
// todo: 如果qty=0,创建AGV送空任务,(新的task_type)、后期优化可以新增诺宝取货完成提前释放货位,任务状态变成071
|
||||
// if (remove) { // hint: 错误
|
||||
// // 证明删除成功,创建任务搬走
|
||||
// // 查找一个没有任务的空位
|
||||
// List<BstIvtStockingivt> list = stockingivtService.getEmptyPointNotTask(device.getPoint_location(), "0");
|
||||
// if (list.size() == 0) {
|
||||
// noticeService.createNotice("管芯抓取备货区找不到空位置搬运",
|
||||
// "管芯抓取点位[" + device.getPoint_name() + "]无法从备货区找到空位",
|
||||
// NoticeTypeEnum.EXCEPTION.getCode());
|
||||
// return res;
|
||||
// }
|
||||
// BstIvtStockingivt stockingivt = list.get(0);
|
||||
// }
|
||||
boolean remove = papervehicleService.removeById(mdPbPapervehicle);
|
||||
log.debug("删除0结果:" + vehicleCode + ":" + remove);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -987,9 +941,14 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
if (taskList.size() > 0) {
|
||||
throw new BadRequestException("操作失败,点位[" + pointCode + "]存在未完成的任务!");
|
||||
}
|
||||
BstIvtShafttubeivt shaftPoint = shafttubeivtService.getByPointCode(pointCode, false);
|
||||
if (SlitterConstant.SLITTER_NO.equals(shaftPoint.getHave_qzz())) {
|
||||
throw new BadRequestException("点位不存在气胀轴信息,无需初始化!");
|
||||
BstIvtShafttubeivt shaftPoint = shafttubeivtService.getOne(new LambdaQueryWrapper<BstIvtShafttubeivt>()
|
||||
.eq(BstIvtShafttubeivt::getPoint_code, pointCode)
|
||||
);
|
||||
if (ObjectUtil.isEmpty(shaftPoint)) {
|
||||
throw new BadRequestException("点位 [" + pointCode + "] 不存在!");
|
||||
}
|
||||
if (StrUtil.equals(shaftPoint.getIs_used(), SlitterConstant.SLITTER_NO)) {
|
||||
throw new BadRequestException("点位 [" + pointCode + "] 未启用,不允许操作!");
|
||||
}
|
||||
if (SlitterConstant.SLITTER_YES.equals(isAgainTz)) {
|
||||
//2、把当前点位上子卷号对应的is_paper_ok改为1
|
||||
@@ -1009,9 +968,11 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
shaftPoint.setTube_code2("");
|
||||
shaftPoint.setTube_name1("");
|
||||
shaftPoint.setTube_name2("");
|
||||
shaftPoint.setPlan("");
|
||||
shaftPoint.setContainer_name1("");
|
||||
shaftPoint.setContainer_name2("");
|
||||
shaftPoint.setQzz_size("");
|
||||
shaftPoint.setQzz_generation("");
|
||||
TaskUtils.updateOptMessageByBShaftPoint(shaftPoint);
|
||||
shafttubeivtService.update(shaftPoint);
|
||||
JSONObject res = new JSONObject();
|
||||
@@ -1082,13 +1043,19 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
throw new BadRequestException("操作失败,点位[" + pointCode + "]存在未完成的任务!");
|
||||
}
|
||||
BstIvtCutpointivt point = bcutpointivtService.getPintByAgvCode(pointCode, false);
|
||||
if (ObjectUtil.isEmpty(point)) {
|
||||
throw new BadRequestException("点位 [" + pointCode + "] 不存在!");
|
||||
}
|
||||
if (StrUtil.equals(point.getIs_used(), SlitterConstant.SLITTER_NO)) {
|
||||
throw new BadRequestException("点位 [" + pointCode + "] 未启用,不允许操作!");
|
||||
}
|
||||
if (Objects.equals(point.getPoint_status(), "1")) {
|
||||
// 如果是没货
|
||||
throw new BadRequestException("点位:" + point.getPoint_code() + "检测无货,请确保任务执行完毕后触发!");
|
||||
throw new BadRequestException("点位:" + point.getPoint_code() + "检测到无货,不允许操作!");
|
||||
}
|
||||
if (ObjectUtil.equals(point.getPoint_status(), "2")) {
|
||||
// 如果是没货
|
||||
throw new BadRequestException("点位:" + point.getPoint_code() + "检测空气胀轴,请确保下卷任务是否完毕后触发!");
|
||||
throw new BadRequestException("点位:" + point.getPoint_code() + "检测到为空气胀轴,不允许操作!");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(point.getQzz_no1()) && ObjectUtil.isEmpty(point.getQzz_no2())) {
|
||||
throw new BadRequestException("点位:" + point.getPoint_code() + " 的气胀轴编码为空!");
|
||||
@@ -1106,9 +1073,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
} else {
|
||||
throw new BadRequestException("操作失败,点位[" + pointCode + "]无气胀轴信息,请先绑定子卷库存!");
|
||||
}
|
||||
// List<BstIvtCutpointivt> areaEmptyNotTaskPoint = bcutpointivtService.getAreaNotTaskPointByStatus("1",
|
||||
// "1", "0", "2");
|
||||
List<BstIvtCutpointivt> areaEmptyNotTaskPoint = bcutpointivtService.getNBJCanUsePoint("1", "1", "0", "2");
|
||||
List<BstIvtCutpointivt> areaEmptyNotTaskPoint = bcutpointivtService.getNBJCanUsePoint("1", "1", point.getPoint_location(), "2");
|
||||
if (areaEmptyNotTaskPoint.size() <= 1) {
|
||||
throw new BadRequestException("请求搬运失败,内包间没有可存放位置!");
|
||||
}
|
||||
@@ -1161,6 +1126,14 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
log.info("手持清理分切暂存位参数:{}", param);
|
||||
// param: point_code
|
||||
String pointCode = param.getString("point_code");
|
||||
if (ObjectUtil.isEmpty(pointCode)) {
|
||||
throw new BadRequestException("分切暂存位不能为空!");
|
||||
}
|
||||
// 校验是否存在任务
|
||||
List<SchBaseTask> taskList = taskService.checkHaveStartTask(pointCode);
|
||||
if (taskList.size() > 0) {
|
||||
throw new BadRequestException("操作失败,点位[" + pointCode + "]存在未完成的任务!");
|
||||
}
|
||||
RLock open = redissonClient.getLock(pointCode);
|
||||
boolean openLock;
|
||||
try {
|
||||
@@ -1171,6 +1144,12 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
try {
|
||||
if (openLock) {
|
||||
BstIvtCutpointivt agvCode = bcutpointivtService.getPintByTrussCode(pointCode, false);
|
||||
if (ObjectUtil.isEmpty(agvCode)) {
|
||||
throw new BadRequestException("操作失败,点位[" + pointCode + "]未找到对应的分切暂存架!");
|
||||
}
|
||||
if (StrUtil.equals(agvCode.getIs_used(), SlitterConstant.SLITTER_NO)) {
|
||||
throw new BadRequestException("点位 [" + pointCode + "] 未启用,不允许操作!");
|
||||
}
|
||||
if (agvCode.getTruss_point_code1().equals(pointCode)) {
|
||||
agvCode.setQzz_no1("");
|
||||
}
|
||||
@@ -1244,6 +1223,9 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
if (ObjectUtil.isEmpty(containerName)) {
|
||||
throw new BadRequestException("子卷号不能为空!");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(pointCode1)) {
|
||||
throw new BadRequestException("分切暂存位不能为空!");
|
||||
}
|
||||
List<String> collect = Arrays.stream(containerName.split(",")).collect(Collectors.toList());
|
||||
List<PdmBiSlittingproductionplan> plans = slittingproductionplanService.getByContainerNames(collect);
|
||||
if (plans.size() == 0) {
|
||||
@@ -1255,6 +1237,12 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
throw new BadRequestException("操作失败,点位[" + pointCode1 + "]存在未完成的任务!");
|
||||
}
|
||||
BstIvtCutpointivt pointCode = bcutpointivtService.getPintByTrussCode(pointCode1, false);
|
||||
if (ObjectUtil.isEmpty(pointCode)) {
|
||||
throw new BadRequestException("操作失败,点位[" + pointCode1 + "]未找到对应的分切暂存架!");
|
||||
}
|
||||
if (StrUtil.equals(pointCode.getIs_used(), SlitterConstant.SLITTER_NO)) {
|
||||
throw new BadRequestException("点位 [" + pointCode1 + "] 未启用,不允许操作!");
|
||||
}
|
||||
PdmBiSlittingproductionplan demoPlan = plans.get(0);
|
||||
String resourceName = demoPlan.getResource_name();
|
||||
// 创建新的气胀轴编码
|
||||
@@ -1287,15 +1275,26 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
public JSONObject shaftMaintenanceInventory(JSONObject param) {
|
||||
log.info("手持维护气胀轴库库存:{}", param);
|
||||
// param : point_code, type
|
||||
BstIvtShafttubeivt shafttubeivt = new BstIvtShafttubeivt();
|
||||
if (SlitterConstant.SLITTER_YES.equals(param.getString("type"))) {
|
||||
shafttubeivt.setHave_qzz(SlitterConstant.SLITTER_YES);
|
||||
} else {
|
||||
shafttubeivt.setHave_qzz(SlitterConstant.SLITTER_NO);
|
||||
String point_code = param.getString("point_code");
|
||||
if (ObjectUtil.isEmpty(point_code)) {
|
||||
throw new BadRequestException("点位信息不能为空!");
|
||||
}
|
||||
TaskUtils.updateOptMessageByBShaftPoint(shafttubeivt);
|
||||
shafttubeivtService.update(shafttubeivt, new LambdaQueryWrapper<BstIvtShafttubeivt>()
|
||||
.eq(BstIvtShafttubeivt::getPoint_code, param.getString("point_code")));
|
||||
BstIvtShafttubeivt point = shafttubeivtService.getOne(new LambdaQueryWrapper<BstIvtShafttubeivt>()
|
||||
.eq(BstIvtShafttubeivt::getPoint_code, param.getString("point_code"))
|
||||
);
|
||||
if (ObjectUtil.isEmpty(point)) {
|
||||
throw new BadRequestException("点位 [" + point_code + "] 不存在!");
|
||||
}
|
||||
if (StrUtil.equals(point.getIs_used(), SlitterConstant.SLITTER_NO)) {
|
||||
throw new BadRequestException("点位 [" + point_code + "] 未启用,不允许操作!");
|
||||
}
|
||||
if (SlitterConstant.SLITTER_YES.equals(param.getString("type"))) {
|
||||
point.setHave_qzz(SlitterConstant.SLITTER_YES);
|
||||
} else {
|
||||
point.setHave_qzz(SlitterConstant.SLITTER_NO);
|
||||
}
|
||||
TaskUtils.updateOptMessageByBShaftPoint(point);
|
||||
shafttubeivtService.update(point);
|
||||
JSONObject res = new JSONObject();
|
||||
res.put("status", HttpStatus.HTTP_OK);
|
||||
res.put("message", "气胀轴库设置成功!");
|
||||
@@ -1309,7 +1308,10 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
String containerName = param.getString("container_name");
|
||||
String pointCode1 = param.getString("point_code");
|
||||
if (ObjectUtil.isEmpty(containerName)) {
|
||||
throw new BadRequestException("子卷号不能为空!");
|
||||
throw new BadRequestException("待分切的子卷号不能为空!");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(pointCode1)) {
|
||||
throw new BadRequestException("分切暂存位不能为空!");
|
||||
}
|
||||
List<String> collect = Arrays.stream(containerName.split(",")).collect(Collectors.toList());
|
||||
List<PdmBiSlittingproductionplan> plans = slittingproductionplanService.getByContainerNames(collect);
|
||||
@@ -1322,6 +1324,12 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
throw new BadRequestException("操作失败,点位[" + pointCode1 + "]存在未完成的任务!");
|
||||
}
|
||||
BstIvtCutpointivt pointCode = bcutpointivtService.getPintByTrussCode(pointCode1, false);
|
||||
if (ObjectUtil.isEmpty(pointCode)) {
|
||||
throw new BadRequestException("操作失败,点位[" + pointCode1 + "]未找到对应的分切暂存架!");
|
||||
}
|
||||
if (StrUtil.equals(pointCode.getIs_used(), SlitterConstant.SLITTER_NO)) {
|
||||
throw new BadRequestException("点位 [" + pointCode1 + "] 未启用,不允许操作!");
|
||||
}
|
||||
PdmBiSlittingproductionplan demoPlan = plans.get(0);
|
||||
String resourceName = demoPlan.getResource_name();
|
||||
// 创建新的气胀轴编码
|
||||
@@ -1748,6 +1756,12 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
// param: point_code
|
||||
String pointCode = param.getString("point_code");
|
||||
BstIvtCutpointivt point = bcutpointivtService.getPintByAgvCode(pointCode, false);
|
||||
if (ObjectUtil.isEmpty(point)) {
|
||||
throw new BadRequestException("点位 [" + pointCode + "] 不存在!");
|
||||
}
|
||||
if (StrUtil.equals(point.getIs_used(), SlitterConstant.SLITTER_NO)) {
|
||||
throw new BadRequestException("点位 [" + pointCode + "] 未启用,不允许操作!");
|
||||
}
|
||||
if (!"3".equals(point.getPoint_type())) {
|
||||
throw new BadRequestException("该点位不是分切对接位,无法创建任务!");
|
||||
}
|
||||
@@ -2021,9 +2035,6 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
int uRightLen = 0;
|
||||
int dLeftLen = 0;
|
||||
int dRightLen = 0;
|
||||
if (!area.startsWith("B")) {
|
||||
throw new BadRequestException("该功能只对二期有用!");
|
||||
}
|
||||
// mes的设备号
|
||||
String deviceCode = param.getString("device_code");
|
||||
// lms的设备号
|
||||
@@ -2394,8 +2405,19 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
String size1 = param.getString("size1");
|
||||
//缓存B气胀轴规格
|
||||
String size2 = param.getString("size2");
|
||||
|
||||
if (ObjectUtil.isEmpty(pointCode)) {
|
||||
throw new BadRequestException("点位信息不能为空!");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(size1) && ObjectUtil.isEmpty(size2)) {
|
||||
throw new BadRequestException("A点、B点气胀轴规格不能同时为空!");
|
||||
}
|
||||
BstIvtCutpointivt point = bcutpointivtService.getPintByAgvCode(pointCode, false);
|
||||
if (ObjectUtil.isEmpty(point)) {
|
||||
throw new BadRequestException("点位 [" + pointCode + "] 不存在!");
|
||||
}
|
||||
if (StrUtil.equals(point.getIs_used(), SlitterConstant.SLITTER_NO)) {
|
||||
throw new BadRequestException("点位 [" + pointCode + "] 未启用,不允许操作!");
|
||||
}
|
||||
// 校验是否存在行架任务
|
||||
Boolean haveTaskByZcPoint = taskService.checkHaveTaskByZcPoint(point);
|
||||
if (haveTaskByZcPoint) {
|
||||
@@ -2409,14 +2431,15 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
|
||||
if (ObjectUtil.equals(point.getPoint_status(), "2")) {
|
||||
// 如果是没货
|
||||
throw new BadRequestException("点位:" + point.getPoint_code() + "检测空气胀轴,请先清空点位信息再触发!!");
|
||||
throw new BadRequestException("点位:" + point.getPoint_code() + "检测为空气胀轴,请先清空点位信息再触发!!");
|
||||
}
|
||||
if (ObjectUtil.equals(point.getPoint_status(), "3")) {
|
||||
throw new BadRequestException("点位:" + point.getPoint_code() + "检测子卷,请先清空点位信息再触发!!");
|
||||
throw new BadRequestException("点位:" + point.getPoint_code() + "检测为子卷,请先清空点位信息再触发!!");
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(point.getQzz_no1()) || ObjectUtil.isNotEmpty(point.getQzz_no2())) {
|
||||
throw new BadRequestException("点位:" + point.getPoint_code() + " 的气胀轴编码不为空,请先清空点位信息再触发!!");
|
||||
}
|
||||
//如果AB点都无气胀轴信息,且点位状态是无货状态,则自动设置点位为空轴退回状态
|
||||
if (Objects.equals(point.getPoint_status(), "1") && ObjectUtil.isEmpty(point.getQzz_no1()) && ObjectUtil.isEmpty(point.getQzz_no2())) {
|
||||
// 如果是没货 绑定为空轴状态
|
||||
point.setPoint_status("4");
|
||||
@@ -2425,7 +2448,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
JSONObject taskParam = new JSONObject();
|
||||
|
||||
// 获取内包间缓存位
|
||||
List<BstIvtCutpointivt> areaEmptyNotTaskPoint = bcutpointivtService.getNBJCanUsePoint("1", "1", "0", "2");
|
||||
List<BstIvtCutpointivt> areaEmptyNotTaskPoint = bcutpointivtService.getNBJCanUsePoint("1", "1", point.getPoint_location(), "2");
|
||||
if (areaEmptyNotTaskPoint.size() <= 1) {
|
||||
throw new BadRequestException("请求搬运失败,内包间没有可存放位置!");
|
||||
}
|
||||
@@ -2460,7 +2483,6 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject downBait(JSONObject param) {
|
||||
|
||||
Reference in New Issue
Block a user