fix: 部分调整
This commit is contained in:
@@ -537,6 +537,23 @@
|
||||
function initializeDeviceFilter() {
|
||||
const filterSelect = document.getElementById('device-filter');
|
||||
if (!filterSelect) return;
|
||||
// 生成B50XN00001-B50XN00004
|
||||
for (let i = 1; i <= 4; i++) {
|
||||
const deviceId = `B50XN${String(i).padStart(5, '0')}`;
|
||||
const option = document.createElement('option');
|
||||
option.value = deviceId;
|
||||
option.textContent = deviceId;
|
||||
filterSelect.appendChild(option);
|
||||
}
|
||||
|
||||
// 生成B60XN00001-B60XN00004
|
||||
for (let i = 1; i <= 4; i++) {
|
||||
const deviceId = `B60XN${String(i).padStart(5, '0')}`;
|
||||
const option = document.createElement('option');
|
||||
option.value = deviceId;
|
||||
option.textContent = deviceId;
|
||||
filterSelect.appendChild(option);
|
||||
}
|
||||
|
||||
// 生成B50FQ00001-B50FQ00012
|
||||
for (let i = 1; i <= 12; i++) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package org.nl.b_lms.pdm.bi.slittingproductionplan.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -19,6 +18,7 @@ import org.nl.b_lms.sch.tasks.slitter.mapper.dto.SlitterPlanDistinctDto;
|
||||
import org.nl.b_lms.sch.tasks.slitter.util.SlitterTaskUtil;
|
||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.common.utils.TaskUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
@@ -28,7 +28,6 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @description 服务实现
|
||||
|
||||
@@ -21,6 +21,8 @@ import org.nl.b_lms.bst.ivt.stockingivt.service.IBstIvtStockingivtService;
|
||||
import org.nl.b_lms.bst.ivt.stockingivt.service.dao.BstIvtStockingivt;
|
||||
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.first_floor_area.auto.Prun;
|
||||
@@ -44,6 +46,7 @@ import org.nl.system.service.param.ISysParamService;
|
||||
import org.nl.system.service.param.dao.Param;
|
||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||
import org.nl.wms.pdm.ivt.deliverycache.service.IDeliverycachepointivtService;
|
||||
import org.nl.wms.pdm.ivt.deliverycache.service.dao.Deliverycachepointivt;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.redisson.api.RLock;
|
||||
import org.redisson.api.RedissonClient;
|
||||
@@ -77,6 +80,8 @@ public class AutoCallAirShaftTask extends Prun {
|
||||
@Autowired
|
||||
private IBstIvtShafttubeivtService bstIvtShafttubeivtService;
|
||||
@Autowired
|
||||
private IstIvtCutpointivtService cutpointivtService;
|
||||
@Autowired
|
||||
private IBstIvtCutpointivtService bcutpointivtService;
|
||||
@Autowired
|
||||
private IPdmBiSlittingproductionplanService slittingproductionplanService;
|
||||
|
||||
@@ -88,29 +88,6 @@ public class AutoSendAirShaftAgvTask {
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, SlitterConstant.SLITTER_NO));
|
||||
if (plans.size() == 0) {
|
||||
log.info("找不到状态01的分切计划,送到异常处理位置!");
|
||||
// hint: 搬运到异常处理位不在使用AGV,用新的定时器执行,此处只是改点位状态
|
||||
// 不能抛异常,需要通过通知的形式,并且创建agv搬到异常处理位(4)。
|
||||
// 判断套轴暂存位异常点位是否含有任务
|
||||
// List<BstIvtCutpointivt> exceptionPoints = bcutpointivtService.getAreaNotTaskPointByStatus("4", "1", "0", "0");
|
||||
// if (exceptionPoints.size() > 0) {
|
||||
// BstIvtCutpointivt exceptionPoint = exceptionPoints.get(0);
|
||||
// // 需要枷锁
|
||||
// JSONObject exParam = new JSONObject();
|
||||
// exParam.put("point_code1", cutPoint.getPoint_code());
|
||||
// exParam.put("point_code2", exceptionPoint.getPoint_code());
|
||||
// exParam.put("vehicle_code1", cutPoint.getQzz_no1());
|
||||
// exParam.put("vehicle_code2", cutPoint.getQzz_no2());
|
||||
// exParam.put("task_type", SlitterEnum.TASK_TYPE.code("套轴异常处理AGV任务"));
|
||||
// exParam.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
// sendNBJExceptionPointTask.createTask(exParam);
|
||||
// } else {
|
||||
// log.info("异常处理位无空位!");
|
||||
// // 点位禁用
|
||||
// cutPoint.setRemark("计划状态已被改变!");
|
||||
// cutPoint.setIs_used("0");
|
||||
// cutPoint.setUpdate_time(DateUtil.now());
|
||||
// bcutpointivtService.updateById(cutPoint);
|
||||
// }
|
||||
// 点位禁用
|
||||
cutPoint.setRemark("计划状态已被改变, 等待搬运到异常处理位...");
|
||||
cutPoint.setPoint_status("4");
|
||||
@@ -217,9 +194,8 @@ public class AutoSendAirShaftAgvTask {
|
||||
String area = deviceCut.getProduct_area();
|
||||
List<BstIvtCutpointivt> emptyPoint = slitterMapper.getEmptyAirShaftAgvPointNotTask(
|
||||
area,
|
||||
SlitterTaskUtil.getPointLocationInCutDevice(
|
||||
SlitterTaskUtil.getNumberByResourceCode(demoPlan.getResource_name()),
|
||||
area),
|
||||
SlitterTaskUtil.getPointLocationInCutDeviceXn(
|
||||
SlitterTaskUtil.getNumberByResourceCode(demoPlan.getResource_name())),
|
||||
deviceCut.getPlan());
|
||||
if (emptyPoint.isEmpty()) {
|
||||
log.warn("当前分切机找不到空闲的对接位置!");
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
AND DATE (p.start_time) >= DATE_SUB(CURDATE()
|
||||
, INTERVAL 1 DAY)
|
||||
AND '1' = (SELECT c.is_used FROM st_ivt_cutpointivt c WHERE c.ext_code = p.resource_name)
|
||||
AND p.parent_container_name LIKE '%虚拟-B%'
|
||||
AND p.container_name LIKE 'Z虚拟B%'
|
||||
GROUP BY
|
||||
p.workorder_id,
|
||||
p.resource_name,
|
||||
@@ -338,7 +338,7 @@
|
||||
WHERE cp.point_type = #{pointType}
|
||||
AND cp.point_status = #{pointStatus}
|
||||
AND cp.is_used = '1'
|
||||
AND (cp.plan <![CDATA[ <> ]]> '1' OR ISNULL(cp.plan))
|
||||
AND (cp.plan = '1' OR ISNULL(cp.plan))
|
||||
AND IFNULL(p.qzzno, '') <![CDATA[ <> ]]> ''
|
||||
AND (IFNULL(cp.qzz_no2, '') = '' OR IFNULL(cp.qzz_no1, '') = '')
|
||||
AND (IFNULL(cp.qzz_no2, '') != '' OR IFNULL(cp.qzz_no1, '') != '')
|
||||
|
||||
@@ -76,7 +76,6 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
@@ -296,26 +295,26 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
String leftSpec = "";
|
||||
String rightSize = "";
|
||||
String rightSpec = "";
|
||||
if(ObjectUtil.isNotEmpty(point.getTube_name1())){
|
||||
String isFrpOrPaper =point.getTube_name1().contains("FRP")?"2":"1";
|
||||
if(isFrpOrPaper.equals("1")){
|
||||
if (ObjectUtil.isNotEmpty(point.getTube_name1())) {
|
||||
String isFrpOrPaper = point.getTube_name1().contains("FRP") ? "2" : "1";
|
||||
if (isFrpOrPaper.equals("1")) {
|
||||
leftSize = MdmDescriptionParseUtils.extractPaperTubeSize(point.getTube_name1());
|
||||
}else{
|
||||
} else {
|
||||
leftSize = MdmDescriptionParseUtils.extractFRPTubeSizeTrans(point.getTube_name1());
|
||||
}
|
||||
if(ObjectUtil.isNotEmpty(point.getTube_code1())){
|
||||
leftSpec= SlitterTaskUtil.getComposePaperTubeInformation(point.getTube_name1(),isFrpOrPaper);
|
||||
if (ObjectUtil.isNotEmpty(point.getTube_code1())) {
|
||||
leftSpec = SlitterTaskUtil.getComposePaperTubeInformation(point.getTube_name1(), isFrpOrPaper);
|
||||
}
|
||||
}
|
||||
if(ObjectUtil.isNotEmpty(point.getTube_name2())){
|
||||
String isFrpOrPaper =point.getTube_name2().contains("FRP")?"2":"1";
|
||||
if(isFrpOrPaper.equals("1")){
|
||||
if (ObjectUtil.isNotEmpty(point.getTube_name2())) {
|
||||
String isFrpOrPaper = point.getTube_name2().contains("FRP") ? "2" : "1";
|
||||
if (isFrpOrPaper.equals("1")) {
|
||||
rightSize = MdmDescriptionParseUtils.extractPaperTubeSize(point.getTube_name2());
|
||||
}else{
|
||||
} else {
|
||||
rightSize = MdmDescriptionParseUtils.extractFRPTubeSizeTrans(point.getTube_name2());
|
||||
}
|
||||
if(ObjectUtil.isNotEmpty(point.getTube_code2())){
|
||||
rightSpec = SlitterTaskUtil.getComposePaperTubeInformation(point.getTube_name2(),isFrpOrPaper);
|
||||
if (ObjectUtil.isNotEmpty(point.getTube_code2())) {
|
||||
rightSpec = SlitterTaskUtil.getComposePaperTubeInformation(point.getTube_name2(), isFrpOrPaper);
|
||||
}
|
||||
}
|
||||
con.put("leftSize", leftSize);
|
||||
@@ -478,10 +477,9 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 6. 尝试拼单
|
||||
// Param xnParam = paramService.findByCode(USE_XN);
|
||||
String end_point = tryCombineOrder(demoPlan, deviceCode, startPoint, qzzNo);
|
||||
if (end_point == null) {
|
||||
// 7. 正常业务流程(不拼单)
|
||||
// 7. 正常业务流程(不拼单,如果是虚拟卷就等待被拼)
|
||||
handleNormalProcess(demoPlan, startPoint, qzzNo, containerNames, deviceCode, stepTipLogs);
|
||||
}
|
||||
res = new JSONObject();
|
||||
@@ -798,7 +796,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
if (ObjectUtil.isEmpty(ivt1) || ObjectUtil.isEmpty(ivt2)) {
|
||||
throw new BadRequestException("没找到完整的气胀轴为空气胀轴暂存点!");
|
||||
}
|
||||
if (currentUpPlan !=null){
|
||||
if (currentUpPlan != null) {
|
||||
taskParam.put("point_code1", ivt1.getPoint_code());
|
||||
taskParam.put("point_code2", actualDevice.getUp_point_code());
|
||||
taskParam.put("point_code3", actualDevice.getUp_point_code());
|
||||
@@ -827,7 +825,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
taskParam2.put("up_roll", nextDownPlans.stream().map(PdmBiSlittingproductionplan::getContainer_name).collect(Collectors.toList()));
|
||||
taskParam2.put("flag", "3");
|
||||
taskParam2.put("to_Task1_Axis_Type", nextDownPlan.getQzz_size());
|
||||
}else {
|
||||
} else {
|
||||
taskParam.put("point_code1", ivt1.getPoint_code());
|
||||
taskParam.put("point_code2", actualDevice.getDown_point_code());
|
||||
taskParam.put("point_code3", actualDevice.getDown_point_code());
|
||||
@@ -1588,8 +1586,8 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
}
|
||||
//校验对应分切计划是否已经创建过任务搬运到拔轴区进行拔轴
|
||||
List<PdmBiSlittingproductionplan> error_plans = plans.stream().filter(plan -> "1".equals(plan.getSysdeptid())).collect(Collectors.toList());
|
||||
if (error_plans.size() > 0){
|
||||
throw new BadRequestException("操作失败,子卷【"+error_plans.get(0).getContainer_name()+"】已经创建过任务搬运至拔轴区,请核对子卷号是否正确!");
|
||||
if (error_plans.size() > 0) {
|
||||
throw new BadRequestException("操作失败,子卷【" + error_plans.get(0).getContainer_name() + "】已经创建过任务搬运至拔轴区,请核对子卷号是否正确!");
|
||||
}
|
||||
|
||||
taskParam.put("containers", collect);
|
||||
@@ -1638,6 +1636,10 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
@Override
|
||||
public JSONObject toCleanCutCacheInventory(JSONObject param) {
|
||||
log.info("手持清理分切暂存位参数:{}", param);
|
||||
|
||||
JSONObject res = new JSONObject();
|
||||
res.put("status", HttpStatus.HTTP_OK);
|
||||
res.put("message", "库存清除成功!");
|
||||
// param: point_code
|
||||
String pointCode = param.getString("point_code");
|
||||
RLock open = redissonClient.getLock(pointCode);
|
||||
@@ -1651,6 +1653,23 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
if (openLock) {
|
||||
BstIvtCutpointivt agvCode = bcutpointivtService.getPintByTrussCode(pointCode, false);
|
||||
if (ObjectUtil.isEmpty(agvCode)) {
|
||||
// 可能是分切缓存架子
|
||||
Deliverycachepointivt deliverycachepointivt = deliverycachepointivtService.getPintByCode(pointCode, false);
|
||||
if (ObjectUtil.isNotEmpty(deliverycachepointivt)) {
|
||||
// 删除对应的气胀轴信息
|
||||
if (ObjectUtil.isNotEmpty(deliverycachepointivt.getQzzno())) {
|
||||
List<PdmBiSlittingproductionplan> byQzzNoNotDeleted = slittingproductionplanService.getByQzzNoNotDeleted(deliverycachepointivt.getQzzno());
|
||||
if (!byQzzNoNotDeleted.isEmpty()) {
|
||||
slittingproductionplanService.deleteAll(byQzzNoNotDeleted.stream().map(PdmBiSlittingproductionplan::getWorkorder_id).collect(Collectors.toSet()));
|
||||
}
|
||||
}
|
||||
deliverycachepointivt.setQzzno("");
|
||||
deliverycachepointivt.setPoint_status("01");
|
||||
deliverycachepointivt.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
deliverycachepointivt.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
deliverycachepointivt.setUpdate_time(DateUtil.now());
|
||||
return res;
|
||||
}
|
||||
throw new BadRequestException("请输入正确的点位编码,未查询到该点位【" + pointCode + "】");
|
||||
}
|
||||
if (agvCode.getTruss_point_code1().equals(pointCode)) {
|
||||
@@ -1672,9 +1691,6 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
open.unlock();
|
||||
}
|
||||
}
|
||||
JSONObject res = new JSONObject();
|
||||
res.put("status", HttpStatus.HTTP_OK);
|
||||
res.put("message", "库存清除成功!");
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -2657,7 +2673,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
if (cutPointList.size() == 0 && cachePointList.size() == 0) {
|
||||
tips.add("没有为设备[" + deviceCode + "]套好轴的位置!或者已经创建任务!");
|
||||
} else {
|
||||
if (cutPointList.size() > 0){
|
||||
if (cutPointList.size() > 0) {
|
||||
String collect = timePlans.stream().map(PdmBiSlittingproductionplan::getContainer_name).collect(Collectors.joining("','"));
|
||||
// 找到该分切计划的点位
|
||||
tips.add("为设备[" + deviceCode + "]套好轴的位置在[" + cutPointList.stream().map(BstIvtCutpointivt::getPoint_code).collect(Collectors.joining("','")) + "], " +
|
||||
@@ -3901,8 +3917,8 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
// location, qzz_size, qzz_generation
|
||||
// 虚拟设备:A1_XNFQ_01
|
||||
String area = param.getString("area");
|
||||
String device_code = param.getString("device_code");
|
||||
Integer number = param.getInteger("qzz_num");
|
||||
String device_code = param.getString("location");
|
||||
Integer number = param.getInteger("qqz_num");
|
||||
String qzz_generation = param.getString("qzz_generation");
|
||||
StIvtCutpointivt xnDevice = cutpointivtService.getPintByPointCode(device_code, true);
|
||||
if (ObjectUtil.isEmpty(xnDevice)) {
|
||||
@@ -3910,19 +3926,19 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
}
|
||||
// mes的设备号
|
||||
String deviceCode = xnDevice.getExt_code();
|
||||
// todo: 判断位置是否够用
|
||||
// // 判断还有没有位置(没有就不给创建)
|
||||
// List<Deliverycachepointivt> canUsePoint = deliverycachepointivtService.list(new LambdaQueryWrapper<Deliverycachepointivt>()
|
||||
// .eq(Deliverycachepointivt::getProduct_area, area)
|
||||
// .eq(Deliverycachepointivt::getPoint_location, location)
|
||||
// .eq(Deliverycachepointivt::getIs_used, "1")
|
||||
// .eq(Deliverycachepointivt::getPoint_status, "01")
|
||||
// .like(Deliverycachepointivt::getCan_size, qzz_size));
|
||||
// // 获取当前区域、位置的分切计划
|
||||
// int planCount = pdmBiSlittingproductionplanService.getCountXN(area, location);
|
||||
// if (canUsePoint.size() < (number + planCount)) {
|
||||
// throw new BadRequestException("该半区该尺寸类型的位置剩余【" + canUsePoint.size() + "】个");
|
||||
// }
|
||||
// 判断还有没有位置(没有就不给创建)
|
||||
List<Deliverycachepointivt> canUsePoint = deliverycachepointivtService.list(new LambdaQueryWrapper<Deliverycachepointivt>()
|
||||
.eq(Deliverycachepointivt::getProduct_area, area)
|
||||
.eq(Deliverycachepointivt::getPlan, xnDevice.getPlan())
|
||||
.eq(Deliverycachepointivt::getIs_used, "1")
|
||||
.eq(Deliverycachepointivt::getPoint_status, "01"));
|
||||
// 获取当前区域、位置的分切计划
|
||||
int planCount = slittingproductionplanService.count(new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.eq(PdmBiSlittingproductionplan::getResource_name, xnDevice.getExt_code())
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, "0"));
|
||||
if (canUsePoint.size() < (number + planCount)) {
|
||||
throw new BadRequestException("该区域的位置不够,只剩" + canUsePoint.size() + "个空位可用");
|
||||
}
|
||||
// 当前轴需要的管芯名称 ...
|
||||
String upLeftSizeK = param.getString("up_left_size_k");
|
||||
String upRightSizeK = param.getString("up_right_size_k");
|
||||
@@ -4003,32 +4019,32 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
plan.setQzz_size(upLeftQzzSize);
|
||||
if (frp) {
|
||||
plan.setPaper_tube_or_FRP("2");
|
||||
plan.setPaper_tube_material(upLeftSizeV);
|
||||
plan.setPaper_tube_model(upLeftSizeK);
|
||||
plan.setPaper_tube_description(upLeftSizeK);
|
||||
} else {
|
||||
plan.setPaper_tube_or_FRP("1");
|
||||
plan.setFRP_material(upLeftSizeV);
|
||||
plan.setFRP_model(upLeftSizeK);
|
||||
plan.setFRP_description(upLeftSizeK);
|
||||
} else {
|
||||
plan.setPaper_tube_or_FRP("1");
|
||||
plan.setPaper_tube_material(upLeftSizeV);
|
||||
plan.setPaper_tube_model(upLeftSizeK);
|
||||
plan.setPaper_tube_description(upLeftSizeK);
|
||||
}
|
||||
plan.setUp_or_down("1");
|
||||
plan.setLeft_or_right("1");
|
||||
}
|
||||
if ( ObjectUtil.isNotEmpty(upRightSizeK) && j == 1) {
|
||||
if (ObjectUtil.isNotEmpty(upRightSizeK) && j == 1) {
|
||||
// 上右
|
||||
boolean frp = upRightSizeK.contains("FRP");
|
||||
plan.setQzz_size(upRightQzzSize);
|
||||
if (frp) {
|
||||
plan.setPaper_tube_or_FRP("2");
|
||||
plan.setPaper_tube_material(upRightSizeV);
|
||||
plan.setPaper_tube_model(upRightSizeK);
|
||||
plan.setPaper_tube_description(upRightSizeK);
|
||||
} else {
|
||||
plan.setPaper_tube_or_FRP("1");
|
||||
plan.setFRP_material(upRightSizeV);
|
||||
plan.setFRP_model(upRightSizeK);
|
||||
plan.setFRP_description(upRightSizeK);
|
||||
} else {
|
||||
plan.setPaper_tube_or_FRP("1");
|
||||
plan.setPaper_tube_material(upRightSizeV);
|
||||
plan.setPaper_tube_model(upRightSizeK);
|
||||
plan.setPaper_tube_description(upRightSizeK);
|
||||
}
|
||||
plan.setUp_or_down("1");
|
||||
plan.setLeft_or_right("2");
|
||||
@@ -4064,20 +4080,38 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject doBindPlanDevice(JSONObject param) {
|
||||
log.info("{} 操作绑定分切计划与气胀轴,请求参数:{}", SecurityUtils.getCurrentNickName(), param.toJSONString());
|
||||
String upShelf = param.getString("upShelf");
|
||||
String upPlanCode = param.getString("upPlanCode");
|
||||
String downShelf = param.getString("downShelf");
|
||||
String downPlanCode = param.getString("downPlanCode");
|
||||
String force = param.getString("force");
|
||||
String device = param.getString("device");
|
||||
if (upPlanCode.equals(downPlanCode)) {
|
||||
throw new BadRequestException("不能绑定相同的两个计划");
|
||||
RLock open = redissonClient.getLock("lockDoBindPlanDevice");
|
||||
boolean openLock;
|
||||
try {
|
||||
openLock = open.tryLock(0, TimeUnit.SECONDS);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(upShelf)) {
|
||||
doBindNewPlanInfo(upShelf, upPlanCode, force, device);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(downShelf)) {
|
||||
doBindNewPlanInfo(downShelf, downPlanCode, force, device);
|
||||
try {
|
||||
if (openLock) {
|
||||
String upShelf = param.getString("upShelf");
|
||||
String upPlanCode = param.getString("upPlanCode");
|
||||
String downShelf = param.getString("downShelf");
|
||||
String downPlanCode = param.getString("downPlanCode");
|
||||
String force = param.getString("force");
|
||||
String device = param.getString("device");
|
||||
if (upPlanCode.equals(downPlanCode)) {
|
||||
throw new BadRequestException("不能绑定相同的两个计划");
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(upShelf)) {
|
||||
doBindNewPlanInfo(upShelf, upPlanCode, force, device);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(downShelf)) {
|
||||
doBindNewPlanInfo(downShelf, downPlanCode, force, device);
|
||||
}
|
||||
|
||||
} else {
|
||||
throw new BadRequestException("系统繁忙,稍后在试!!");
|
||||
}
|
||||
} finally {
|
||||
if (open.isLocked() && open.isHeldByCurrentThread()) {
|
||||
open.unlock();
|
||||
}
|
||||
}
|
||||
JSONObject res = new JSONObject();
|
||||
res.put("status", HttpStatus.HTTP_OK);
|
||||
@@ -4085,7 +4119,9 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
return res;
|
||||
}
|
||||
|
||||
/** 绑定新计划信息 */
|
||||
/**
|
||||
* 绑定新计划信息
|
||||
*/
|
||||
private void doBindNewPlanInfo(String shelfCode, String containerName, String force, String device) {
|
||||
Deliverycachepointivt shelf = deliverycachepointivtService.getPintByCode(shelfCode, true);
|
||||
StIvtCutpointivt cutDevice = cutpointivtService.getPintByExtCode(device, false);
|
||||
@@ -4103,14 +4139,15 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
throw new BadRequestException("子卷:" + containerName + " 计划信息不存在!");
|
||||
}
|
||||
// 判断子卷有没有绑定到分切对接位上
|
||||
List<BstIvtCutpointivt> alreadBindPlans = bcutpointivtService.list(new LambdaQueryWrapper<BstIvtCutpointivt>()
|
||||
List<BstIvtCutpointivt> alreadyBindPlans = bcutpointivtService.list(new LambdaQueryWrapper<BstIvtCutpointivt>()
|
||||
.eq(BstIvtCutpointivt::getIs_used, true)
|
||||
.and(l -> l.eq(BstIvtCutpointivt::getQzz_no1, planOne.getQzzno()).or()
|
||||
.eq(BstIvtCutpointivt::getQzz_no2, planOne.getQzzno()))
|
||||
);
|
||||
if (!alreadBindPlans.isEmpty()) {
|
||||
if (!alreadyBindPlans.isEmpty()) {
|
||||
throw new BadRequestException("子卷:" + containerName + " 已经绑定过子卷到暂存架上!");
|
||||
}
|
||||
// todo: 这台分切机已经绑定过其他子卷???
|
||||
|
||||
if (ObjectUtil.isNotEmpty(planOne.getQzzno())) {
|
||||
// 判断是不是绑定过的,就查一下这个气胀轴编码在缓存架子上存不存在
|
||||
@@ -4347,7 +4384,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
* 尝试拼单逻辑
|
||||
*/
|
||||
private String tryCombineOrder(PdmBiSlittingproductionplan demoPlan, String deviceCode,
|
||||
BstIvtShafttubeivt startPoint, String qzzNo) {
|
||||
BstIvtShafttubeivt startPoint, String qzzNo) {
|
||||
Param codParam = paramService.findByCode(IS_COMBINED_ORDER);
|
||||
// 判断是否有同组(判断自己能不能拼单)
|
||||
Integer sameNumber = slittingproductionplanService.getSameTripParentContainerPlanCount(demoPlan);
|
||||
@@ -4377,7 +4414,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
.device(resourceName)
|
||||
.area(deviceInfo.getProduct_area())
|
||||
.build());
|
||||
if (ObjectUtil.isEmpty(emptyNotTaskPoint)){
|
||||
if (ObjectUtil.isEmpty(emptyNotTaskPoint)) {
|
||||
return null;
|
||||
}
|
||||
BstIvtCutpointivt cutPoint = emptyNotTaskPoint.get(0);
|
||||
@@ -4387,7 +4424,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
|
||||
// 如果找到可拼单点位,创建任务
|
||||
if (!StrUtil.isEmpty(end_point)) {
|
||||
createCombinedOrderTask(startPoint, demoPlan, qzzNo,end_point);
|
||||
createCombinedOrderTask(startPoint, demoPlan, qzzNo, end_point);
|
||||
return end_point;
|
||||
}
|
||||
|
||||
@@ -4398,7 +4435,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
* 尝试与运行中的任务拼单
|
||||
*/
|
||||
private String tryMatchRunningTask(PdmBiSlittingproductionplan demoPlan,
|
||||
String deviceCode, StIvtCutpointivt deviceInfo) {
|
||||
String deviceCode, StIvtCutpointivt deviceInfo) {
|
||||
SchBaseTask runningTask = taskService.getOne(new LambdaQueryWrapper<SchBaseTask>()
|
||||
.eq(SchBaseTask::getHandle_class, "org.nl.b_lms.sch.tasks.slitter.TrussSendAirShaftTask")
|
||||
.lt(SchBaseTask::getTask_status, "07")
|
||||
@@ -4410,7 +4447,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
}
|
||||
|
||||
List<String> qzzNoList = Stream.of(runningTask.getVehicle_code(), runningTask.getVehicle_code2())
|
||||
.filter(s -> s != null && StrUtil.isNotEmpty(s)) // 过滤 null 和空字符串
|
||||
.filter(StrUtil::isNotEmpty) // 过滤 null 和空字符串
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<PdmBiSlittingproductionplan> runningShafts = slittingproductionplanService.getByQzzNos(qzzNoList);
|
||||
@@ -4431,8 +4468,8 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
.eq(BstIvtCutpointivt::getTruss_point_code1, runningTask.getPoint_code2()).or()
|
||||
.eq(BstIvtCutpointivt::getTruss_point_code2, runningTask.getPoint_code2()));
|
||||
|
||||
if (one != null && StrUtil.isNotEmpty(canCombineWithRunningTask(one, runningTask)) ) {
|
||||
return canCombineWithRunningTask(one,runningTask);
|
||||
if (one != null && StrUtil.isNotEmpty(canCombineWithRunningTask(one, runningTask))) {
|
||||
return canCombineWithRunningTask(one, runningTask);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4554,6 +4591,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
private void createNormalTask(BstIvtCutpointivt cutPoint, BstIvtShafttubeivt startPoint,
|
||||
PdmBiSlittingproductionplan demoPlan, String qzzNo,
|
||||
List<String> containerNames) {
|
||||
Param xnParam = paramService.findByCode(USE_XN);
|
||||
JSONObject taskParam = new JSONObject();
|
||||
taskParam.put("point_code1", startPoint.getPoint_code());
|
||||
taskParam.put("point_code2", SlitterConstant.SLITTER_SHAFT_UP.equals(demoPlan.getUp_or_down())
|
||||
@@ -4566,7 +4604,9 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
taskParam.put("qzz_size", demoPlan.getQzz_size());
|
||||
taskParam.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
taskParam.put("immediateNotifyAcs", "1");
|
||||
|
||||
if (ObjectUtil.isNotEmpty(xnParam) && "1".equals(xnParam.getValue())) {
|
||||
taskParam.put("flag", "1");
|
||||
}
|
||||
trussSendAirShaftTask.createTask(taskParam);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -353,6 +353,10 @@ public class SlitterTaskUtil {
|
||||
return "1";
|
||||
}
|
||||
|
||||
public static String getPointLocationInCutDeviceXn(int num) {
|
||||
return num <= 2 ? "0" : "1";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询是否包含在内
|
||||
* @param names 数组
|
||||
|
||||
Reference in New Issue
Block a user