fix:分切重复子卷号限制不允许重复搬运至拔轴区
This commit is contained in:
@@ -112,7 +112,7 @@ public class PdmBiSlittingproductionplan implements Serializable {
|
||||
/** 修改时间 */
|
||||
private String update_time;
|
||||
|
||||
/** 部门ID */
|
||||
/** 部门ID(用于判断是否搬运过到穿拔轴区) */
|
||||
private String sysdeptid;
|
||||
|
||||
/** 公司ID */
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package org.nl.b_lms.sch.tasks.slitter;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.IPdmBiSlittingproductionplanService;
|
||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingproductionplan;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
@@ -25,6 +27,8 @@ 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: lyd
|
||||
@@ -39,6 +43,9 @@ public class SlitterDownAgvTask extends AbstractAcsTask {
|
||||
private IschBaseTaskService taskService;
|
||||
@Autowired
|
||||
private IBstIvtCutpointivtService bcutpointivtService;
|
||||
@Autowired
|
||||
private IPdmBiSlittingproductionplanService slittingproductionplanService;
|
||||
|
||||
@Override
|
||||
public List<AcsTaskDto> addTask() {
|
||||
/*
|
||||
@@ -113,6 +120,15 @@ public class SlitterDownAgvTask extends AbstractAcsTask {
|
||||
BstIvtCutpointivt endPointObj = bcutpointivtService.getPintByAgvCode(endPoint, false);
|
||||
TaskUtils.pointMaintenanceInventory(task, endPointObj, "3");
|
||||
bcutpointivtService.updateById(endPointObj);
|
||||
//更新子卷已经搬运至拔轴区
|
||||
// 将子卷信息存到任务中
|
||||
List<String> qzzNos = Stream.of(task.getVehicle_code(), task.getVehicle_code2()).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
|
||||
List<PdmBiSlittingproductionplan> plans = slittingproductionplanService.getByQzzNos(qzzNos);
|
||||
plans.forEach(plan -> {
|
||||
plan.setSysdeptid("1");
|
||||
slittingproductionplanService.update(plan);
|
||||
});
|
||||
|
||||
}
|
||||
// 取消
|
||||
if (status.equals(IOSEnum.IS_NOTANDYES.code("否"))) {
|
||||
@@ -174,6 +190,7 @@ public class SlitterDownAgvTask extends AbstractAcsTask {
|
||||
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
this.updateTaskStatus(taskObj, "0");
|
||||
}
|
||||
|
||||
//判断该点位是否存在未完成的任务
|
||||
public boolean isSingleTask(String point_code) {
|
||||
JSONObject task1 = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code1 = '" + point_code + "' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||
|
||||
@@ -1344,6 +1344,12 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
if (collect.size() == 0) {
|
||||
throw new BadRequestException("操作失败,点位[" + pointCode + "]未查到子卷分切计划,请先绑定子卷库存!");
|
||||
}
|
||||
//校验对应分切计划是否已经创建过任务搬运到拔轴区进行拔轴
|
||||
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()+"】已经创建过任务搬运至拔轴区,请核对子卷号是否正确!");
|
||||
}
|
||||
|
||||
taskParam.put("containers", collect);
|
||||
} else {
|
||||
throw new BadRequestException("操作失败,点位[" + pointCode + "]无气胀轴信息,请先绑定子卷库存!");
|
||||
|
||||
@@ -134,14 +134,96 @@ public class SlitterTaskUtil {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String a = "玻璃纤维及其制品|FRP管|6英寸|15-25|1700|阶梯";
|
||||
String b = "FRP管\\玻璃纤维+环氧树脂\\Φ152.4mm*1700mm*15/25mm\\";
|
||||
// System.out.println(getComposePaperTubeInformation("玻璃纤维及其制品|FRP管|6英寸|15|1100", "1"));
|
||||
System.out.println(isNumeric(",3000"));
|
||||
System.out.println(isNumeric("3000"));
|
||||
System.out.println(isNumeric("3000.32"));
|
||||
System.out.println(isNumeric("-3000.32"));
|
||||
boolean b = checkComplete("1", "2", null);
|
||||
System.out.println(test(b));
|
||||
System.out.println(getComposePaperTubeInformation(a));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 适配新格式:FRP管\玻璃纤维+环氧树脂\P152.4mm*1700mm*15/20mm\
|
||||
*/
|
||||
public static String test(String tubeDescription) {
|
||||
if (ObjectUtil.isEmpty(tubeDescription)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
// 1. 按 \ 分割
|
||||
String[] parts = tubeDescription.split("\\\\"); // 反斜杠需要转义
|
||||
if (parts.length < 3) {
|
||||
return "";
|
||||
}
|
||||
|
||||
// 2. 拿到规格段:P152.4mm*1700mm*15/20mm
|
||||
String spec = parts[2];
|
||||
// 去掉 P 和所有 mm 单位
|
||||
spec = spec.replace("Φ", "").replace("mm", "");
|
||||
// 按 * 分割 → [152.4, 1700, 15/20]
|
||||
String[] specArr = spec.split("\\*");
|
||||
if (specArr.length < 3) {
|
||||
return "";
|
||||
}
|
||||
|
||||
// 3. 提取核心参数
|
||||
String internalDiaStr = specArr[0]; // 内径 152.4
|
||||
String lengthStr = specArr[1]; // 长度 1700
|
||||
String thicknessStr = specArr[2]; // 壁厚 15/20
|
||||
|
||||
// 解析壁厚(15/25 → th=25, th2=15,和旧格式保持一致)
|
||||
String th = "15";
|
||||
String th2 = "0";
|
||||
if (thicknessStr.contains("/")) {
|
||||
String[] thArr = thicknessStr.split("/");
|
||||
if (thArr.length >= 2) {
|
||||
th2 = thArr[0]; // 薄壁厚
|
||||
th = thArr[1]; // 主壁厚
|
||||
}
|
||||
} else {
|
||||
th = thicknessStr;
|
||||
}
|
||||
|
||||
// 5. 计算外径 = 内径 + 壁厚*2
|
||||
double internalDiameter = Double.parseDouble(internalDiaStr);
|
||||
double externalDiameter = internalDiameter + Double.parseDouble(th) * 2;
|
||||
|
||||
// 6. 阶梯长度(根据长度判断)
|
||||
String jtLen = "0";
|
||||
switch (lengthStr) {
|
||||
case "1400":
|
||||
case "1700":
|
||||
jtLen = "75";
|
||||
break;
|
||||
case "1500":
|
||||
case "1600":
|
||||
jtLen = "150";
|
||||
break;
|
||||
default:
|
||||
jtLen = "0";
|
||||
break;
|
||||
}
|
||||
|
||||
// 7. 拼接输出(保持原来的输出格式不变)
|
||||
// 格式:长度*外径*内径*壁厚*重量*薄壁厚*阶梯长度
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(lengthStr); // 长度
|
||||
sb.append("*");
|
||||
sb.append(NumberUtil.round(externalDiameter, 1).doubleValue()); // 外径
|
||||
sb.append("*");
|
||||
sb.append(internalDiameter); // 内径
|
||||
sb.append("*");
|
||||
sb.append(th); // 壁厚
|
||||
sb.append("*");
|
||||
sb.append(0); // 重量
|
||||
sb.append("*");
|
||||
sb.append(th2); // 阶梯壁厚
|
||||
sb.append("*");
|
||||
sb.append(jtLen); // 阶梯长度
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置所需的套管纸管信息
|
||||
* @param param 任务参数
|
||||
|
||||
Reference in New Issue
Block a user