fix: 呼叫气胀轴校验长度

This commit is contained in:
2025-03-16 22:07:43 +08:00
parent 1b16beb7b1
commit f4b61a103d
2 changed files with 15 additions and 0 deletions

View File

@@ -1928,6 +1928,10 @@ public class SlitterServiceImpl implements SlitterService {
// down_left_size_k,down_right_size_k, down_left_size_v,down_right_size_v // down_left_size_k,down_right_size_k, down_left_size_v,down_right_size_v
log.info("创建虚拟分切计划呼叫气胀轴 - {}", param); log.info("创建虚拟分切计划呼叫气胀轴 - {}", param);
String area = param.getString("area"); String area = param.getString("area");
int uLeftLen = 0;
int uRightLen = 0;
int dLeftLen = 0;
int dRightLen = 0;
if (!area.startsWith("B")) { if (!area.startsWith("B")) {
throw new BadRequestException("该功能只对二期有用!"); throw new BadRequestException("该功能只对二期有用!");
} }
@@ -2009,6 +2013,7 @@ public class SlitterServiceImpl implements SlitterService {
} }
plan.setUp_or_down("1"); plan.setUp_or_down("1");
plan.setLeft_or_right("1"); plan.setLeft_or_right("1");
uLeftLen = SlitterTaskUtil.getPaperLengthInt(plan);
} }
if (i==1 && ObjectUtil.isNotEmpty(upRightSizeK)) { if (i==1 && ObjectUtil.isNotEmpty(upRightSizeK)) {
// 上右 // 上右
@@ -2031,6 +2036,7 @@ public class SlitterServiceImpl implements SlitterService {
} else { } else {
plan.setQzz_generation("5"); plan.setQzz_generation("5");
} }
uRightLen = SlitterTaskUtil.getPaperLengthInt(plan);
} }
if (i==2 && ObjectUtil.isNotEmpty(downLeftSizeK)) { if (i==2 && ObjectUtil.isNotEmpty(downLeftSizeK)) {
// 下左 // 下左
@@ -2053,6 +2059,7 @@ public class SlitterServiceImpl implements SlitterService {
} else { } else {
plan.setQzz_generation("5"); plan.setQzz_generation("5");
} }
dLeftLen = SlitterTaskUtil.getPaperLengthInt(plan);
} }
if (i==4 && ObjectUtil.isNotEmpty(downRightSizeK)) { if (i==4 && ObjectUtil.isNotEmpty(downRightSizeK)) {
// 下右 // 下右
@@ -2075,6 +2082,7 @@ public class SlitterServiceImpl implements SlitterService {
} else { } else {
plan.setQzz_generation("5"); plan.setQzz_generation("5");
} }
dRightLen = SlitterTaskUtil.getPaperLengthInt(plan);
} }
if (i==0 && ObjectUtil.isEmpty(upLeftSizeK)) { if (i==0 && ObjectUtil.isEmpty(upLeftSizeK)) {
plan.setIs_delete("1"); plan.setIs_delete("1");
@@ -2090,6 +2098,9 @@ public class SlitterServiceImpl implements SlitterService {
} }
plans.add(plan); plans.add(plan);
} }
if (uLeftLen + uRightLen > 1700 || dLeftLen + dRightLen > 1700) {
throw new BadRequestException("同一根轴长度不能超过气胀轴长度,请确认是否选择正确!");
}
slittingproductionplanService.saveOrUpdateBatch(plans); slittingproductionplanService.saveOrUpdateBatch(plans);
// 机台打开 // 机台打开
LambdaUpdateWrapper<StIvtCutpointivt> lamu = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<StIvtCutpointivt> lamu = new LambdaUpdateWrapper<>();

View File

@@ -335,6 +335,10 @@ public class SlitterTaskUtil {
return split[split.length - 1]; return split[split.length - 1];
} }
public static Integer getPaperLengthInt(PdmBiSlittingproductionplan plan) {
return Integer.valueOf(getPaperLength(plan));
}
/** /**
* 设置重量 * 设置重量
* @param plans 分切计划 * @param plans 分切计划