MDM 新物料上线,物料规格信息解析相关方法调整。
This commit is contained in:
@@ -2,6 +2,7 @@ package org.nl.b_lms.bst.ivt.stockingivt.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import org.nl.b_lms.sch.tasks.slitter.util.MdmDescriptionParseUtils;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -158,8 +159,12 @@ public class BstIvtStockingivtServiceImpl extends ServiceImpl<BstIvtStockingivtM
|
||||
// for (String cleanedLine : cleanedLines) {
|
||||
// System.out.println(cleanedLine);
|
||||
// }
|
||||
String material_name = "玻璃纤维及其制品|FRP管|6英寸|15-20|1100|阶梯";
|
||||
String[] tubeArray = material_name.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
// String material_name = "玻璃纤维及其制品|FRP管|6英寸|15-20|1100|阶梯";
|
||||
// String[] tubeArray = material_name.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
|
||||
String material_name = "平包树脂管\\3.12''\\1380mm*15mm\\";
|
||||
String[] tubeArray = MdmDescriptionParseUtils.extractPaperTubeSpecs(material_name);
|
||||
System.out.println(tubeArray[0]);
|
||||
System.out.println(tubeArray);
|
||||
}
|
||||
|
||||
@@ -207,10 +212,12 @@ public class BstIvtStockingivtServiceImpl extends ServiceImpl<BstIvtStockingivtM
|
||||
|
||||
//获取当前纸管的高度
|
||||
// 解析描述数组
|
||||
String[] tubeArray = material_name.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
|
||||
int currLength = Integer.parseInt(tubeArray[tubeArray.length - 1]);
|
||||
|
||||
// String[] tubeArray = material_name.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
// int currLength = Integer.parseInt(tubeArray[tubeArray.length - 1]);
|
||||
// todo 88549333 2026年5月19日19:55:53 这个地方获取纸管高度,会不会有FRP 管相关操作 需要进一步确认,因为两个类型的物料描述差异导致获取高度的方法不一致
|
||||
String[] tubeArray = MdmDescriptionParseUtils.extractPaperTubeSpecs(material_name);
|
||||
int currLength = Integer.parseInt(tubeArray[0]);
|
||||
//校验高度差要大于50MM,否则不允许进行绑定
|
||||
int num = Integer.parseInt(row_num);
|
||||
if (num == 1) {
|
||||
@@ -221,8 +228,11 @@ public class BstIvtStockingivtServiceImpl extends ServiceImpl<BstIvtStockingivtM
|
||||
if (ObjectUtil.isNotEmpty(nextPaper)) {
|
||||
//获取第二排的纸管高度和纸管类型
|
||||
String nextMaterialName = nextPaper.getMaterial_name();
|
||||
String[] nextArray = nextMaterialName.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
int nextLength = Integer.parseInt(nextArray[nextArray.length - 1]);
|
||||
// String[] nextArray = nextMaterialName.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
// int nextLength = Integer.parseInt(nextArray[nextArray.length - 1]);
|
||||
// todo 88549333 2026年5月19日19:55:53 这个地方获取纸管高度,会不会有FRP 管相关操作 需要进一步确认,因为两个类型的物料描述差异导致获取高度的方法不一致
|
||||
String[] nextArray = MdmDescriptionParseUtils.extractPaperTubeSpecs(nextMaterialName);
|
||||
int nextLength = Integer.parseInt(nextArray[0]);
|
||||
if (Math.abs(nextLength - currLength) <= 50 && !material_code.equals(nextPaper.getMaterial_code())) {
|
||||
throw new BadRequestException("相邻排的纸管高度差要大于等于50MM!");
|
||||
}
|
||||
@@ -235,8 +245,11 @@ public class BstIvtStockingivtServiceImpl extends ServiceImpl<BstIvtStockingivtM
|
||||
if (ObjectUtil.isNotEmpty(nextPaper)) {
|
||||
//获取后一排的纸管高度和纸管类型
|
||||
String nextMaterialName = nextPaper.getMaterial_name();
|
||||
String[] nextArray = nextMaterialName.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
int nextLength = Integer.parseInt(nextArray[nextArray.length - 1]);
|
||||
// String[] nextArray = nextMaterialName.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
// int nextLength = Integer.parseInt(nextArray[nextArray.length - 1]);
|
||||
// todo 88549333 2026年5月19日19:55:53 这个地方获取纸管高度,会不会有FRP 管相关操作 需要进一步确认,因为两个类型的物料描述差异导致获取高度的方法不一致
|
||||
String[] nextArray = MdmDescriptionParseUtils.extractPaperTubeSpecs(nextMaterialName);
|
||||
int nextLength = Integer.parseInt(nextArray[0]);
|
||||
if (Math.abs(nextLength - currLength) <= 50 && !material_code.equals(nextPaper.getMaterial_code())) {
|
||||
throw new BadRequestException("相邻排的纸管高度差要大于等于50MM!");
|
||||
}
|
||||
@@ -249,8 +262,11 @@ public class BstIvtStockingivtServiceImpl extends ServiceImpl<BstIvtStockingivtM
|
||||
if (ObjectUtil.isNotEmpty(prePaper)) {
|
||||
//获取后一排的纸管高度和纸管类型
|
||||
String preMaterialName = prePaper.getMaterial_name();
|
||||
String[] preArray = preMaterialName.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
int preLength = Integer.parseInt(preArray[preArray.length - 1]);
|
||||
// String[] preArray = preMaterialName.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
// int preLength = Integer.parseInt(preArray[preArray.length - 1]);
|
||||
// todo 88549333 2026年5月19日19:55:53 这个地方获取纸管高度,会不会有FRP 管相关操作 需要进一步确认,因为两个类型的物料描述差异导致获取高度的方法不一致
|
||||
String[] preArray = MdmDescriptionParseUtils.extractPaperTubeSpecs(preMaterialName);
|
||||
int preLength = Integer.parseInt(preArray[0]);
|
||||
if (Math.abs(preLength - currLength) <= 50 && !material_code.equals(prePaper.getMaterial_code())) {
|
||||
throw new BadRequestException("相邻排的纸管高度差要大于等于50MM!");
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.nl.b_lms.sch.tasks.slitter.util.MdmDescriptionParseUtils;
|
||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
@@ -259,23 +260,41 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
}
|
||||
|
||||
}
|
||||
// todo 88549333 正式库bst_ivt_shafttubeivt 2026年5月19日22:13:51
|
||||
con.put("left", point.getTube_code1());
|
||||
con.put("leftSize", ObjectUtil.isNotEmpty(point.getTube_name1())
|
||||
? point.getTube_name1().split("\\|")[2].charAt(0) : "");
|
||||
con.put("leftSpec", ObjectUtil.isNotEmpty(point.getTube_code1())
|
||||
? SlitterTaskUtil.getComposePaperTubeInformation(point.getTube_name1(),
|
||||
point.getTube_code1().startsWith("4") ? "1" : "2")
|
||||
: "");
|
||||
String leftSize = "";
|
||||
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")){
|
||||
leftSize = MdmDescriptionParseUtils.extractPaperTubeSize(point.getTube_name1());
|
||||
}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_name2())){
|
||||
String isFrpOrPaper =point.getTube_name2().contains("FRP")?"2":"1";
|
||||
if(isFrpOrPaper.equals("1")){
|
||||
rightSize = MdmDescriptionParseUtils.extractPaperTubeSize(point.getTube_name2());
|
||||
}else{
|
||||
rightSize = MdmDescriptionParseUtils.extractFRPTubeSizeTrans(point.getTube_name2());
|
||||
}
|
||||
if(ObjectUtil.isNotEmpty(point.getTube_code2())){
|
||||
rightSpec = SlitterTaskUtil.getComposePaperTubeInformation(point.getTube_name2(),isFrpOrPaper);
|
||||
}
|
||||
}
|
||||
con.put("leftSize", leftSize);
|
||||
con.put("leftSpec", leftSpec);
|
||||
con.put("right", point.getTube_code2());
|
||||
con.put("rightSize", ObjectUtil.isNotEmpty(point.getTube_name2())
|
||||
? point.getTube_name2().split("\\|")[2].charAt(0) : "");
|
||||
con.put("rightSpec", ObjectUtil.isNotEmpty(point.getTube_code2())
|
||||
? SlitterTaskUtil.getComposePaperTubeInformation(point.getTube_name1(),
|
||||
point.getTube_code2().startsWith("4") ? "1" : "2")
|
||||
: "");
|
||||
con.put("rightSize", rightSize);
|
||||
con.put("rightSpec", rightSpec);
|
||||
con.put("number", ObjectUtil.isNotEmpty(point.getTube_code1()) && ObjectUtil.isNotEmpty(point.getTube_code2())
|
||||
? "2" : "1");
|
||||
|
||||
String containers = Stream.of(point.getContainer_name1(), point.getContainer_name2())
|
||||
.filter(ObjectUtil::isNotEmpty)
|
||||
.collect(Collectors.joining(","));
|
||||
@@ -2360,9 +2379,11 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
// 区分位置创建
|
||||
if (i == 0 && ObjectUtil.isNotEmpty(upLeftSizeK)) {
|
||||
// 上左
|
||||
plan.setPaper_tube_or_FRP(upLeftSizeV.startsWith("48") ? "1" : "2");
|
||||
String[] split = upLeftSizeK.split("\\|");
|
||||
plan.setQzz_size(String.valueOf(split[2].charAt(0)));
|
||||
// plan.setPaper_tube_or_FRP(upLeftSizeV.startsWith("48") ? "1" : "2");
|
||||
// String[] split = upLeftSizeK.split("\\|");
|
||||
// plan.setQzz_size(String.valueOf(split[2].charAt(0)));
|
||||
// todo 88549333 判断是那种类型纸管还是FRP管 ,然后取到 3 或者6 2026年5月20日15:37:09
|
||||
plan.setQzz_size(MdmDescriptionParseUtils.extractCommonTubeSize(upLeftSizeK));
|
||||
if ("1".equals(plan.getPaper_tube_or_FRP())) {
|
||||
plan.setPaper_tube_material(upLeftSizeV);
|
||||
plan.setPaper_tube_model(upLeftSizeK);
|
||||
@@ -2383,9 +2404,11 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
}
|
||||
if (i == 1 && ObjectUtil.isNotEmpty(upRightSizeK)) {
|
||||
// 上右
|
||||
plan.setPaper_tube_or_FRP(upRightSizeV.startsWith("48") ? "1" : "2");
|
||||
String[] split = upRightSizeK.split("\\|");
|
||||
plan.setQzz_size(String.valueOf(split[2].charAt(0)));
|
||||
// plan.setPaper_tube_or_FRP(upRightSizeV.startsWith("48") ? "1" : "2");
|
||||
// String[] split = upRightSizeK.split("\\|");
|
||||
// plan.setQzz_size(String.valueOf(split[2].charAt(0)));
|
||||
// todo 88549333 判断是那种类型纸管还是FRP管 ,然后取到 3 或者6 2026年5月20日15:37:09
|
||||
plan.setQzz_size(MdmDescriptionParseUtils.extractCommonTubeSize(upRightSizeK));
|
||||
if ("1".equals(plan.getPaper_tube_or_FRP())) {
|
||||
plan.setPaper_tube_material(upRightSizeV);
|
||||
plan.setPaper_tube_model(upRightSizeK);
|
||||
@@ -2406,9 +2429,11 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
}
|
||||
if (i == 2 && ObjectUtil.isNotEmpty(downLeftSizeK)) {
|
||||
// 下左
|
||||
plan.setPaper_tube_or_FRP(downLeftSizeV.startsWith("48") ? "1" : "2");
|
||||
String[] split = downLeftSizeK.split("\\|");
|
||||
plan.setQzz_size(String.valueOf(split[2].charAt(0)));
|
||||
// plan.setPaper_tube_or_FRP(downLeftSizeV.startsWith("48") ? "1" : "2");
|
||||
// String[] split = downLeftSizeK.split("\\|");
|
||||
// plan.setQzz_size(String.valueOf(split[2].charAt(0)));
|
||||
// todo 88549333 判断是那种类型纸管还是FRP管 ,然后取到 3 或者6 2026年5月20日15:37:09
|
||||
plan.setQzz_size(MdmDescriptionParseUtils.extractCommonTubeSize(downLeftSizeK));
|
||||
if ("1".equals(plan.getPaper_tube_or_FRP())) {
|
||||
plan.setPaper_tube_material(downLeftSizeV);
|
||||
plan.setPaper_tube_model(downLeftSizeK);
|
||||
@@ -2429,9 +2454,11 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
}
|
||||
if (i == 4 && ObjectUtil.isNotEmpty(downRightSizeK)) {
|
||||
// 下右
|
||||
plan.setPaper_tube_or_FRP(downRightSizeV.startsWith("48") ? "1" : "2");
|
||||
String[] split = downRightSizeK.split("\\|");
|
||||
plan.setQzz_size(String.valueOf(split[2].charAt(0)));
|
||||
// plan.setPaper_tube_or_FRP(downRightSizeV.startsWith("48") ? "1" : "2");
|
||||
// String[] split = downRightSizeK.split("\\|");
|
||||
// plan.setQzz_size(String.valueOf(split[2].charAt(0)));
|
||||
// todo 88549333 判断是那种类型纸管还是FRP管 ,然后取到 3 或者6 2026年5月20日15:37:09
|
||||
plan.setQzz_size(MdmDescriptionParseUtils.extractCommonTubeSize(downLeftSizeK));
|
||||
if ("1".equals(plan.getPaper_tube_or_FRP())) {
|
||||
plan.setPaper_tube_material(downRightSizeV);
|
||||
plan.setPaper_tube_model(downRightSizeK);
|
||||
@@ -2852,9 +2879,11 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
// 区分位置创建
|
||||
if (i == 0 && ObjectUtil.isNotEmpty(left_spec) && "1".equals(up_or_down)) {
|
||||
// 上左
|
||||
plan.setPaper_tube_or_FRP(left_spec_value.startsWith("48") ? "1" : "2");
|
||||
String[] split = left_spec.split("\\|");
|
||||
plan.setQzz_size(String.valueOf(split[2].charAt(0)));
|
||||
// plan.setPaper_tube_or_FRP(left_spec_value.startsWith("48") ? "1" : "2");
|
||||
// String[] split = left_spec.split("\\|");
|
||||
// plan.setQzz_size(String.valueOf(split[2].charAt(0)));
|
||||
// todo 88549333 判断是那种类型纸管还是FRP管 ,然后取到 3 或者6 2026年5月20日16:37:09
|
||||
plan.setQzz_size(MdmDescriptionParseUtils.extractCommonTubeSize(left_spec));
|
||||
if ("1".equals(plan.getPaper_tube_or_FRP())) {
|
||||
plan.setPaper_tube_material(left_spec_value);
|
||||
plan.setPaper_tube_model(left_spec);
|
||||
@@ -2874,9 +2903,11 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
}
|
||||
if (i == 1 && ObjectUtil.isNotEmpty(right_spec) && "1".equals(up_or_down)) {
|
||||
// 上右
|
||||
plan.setPaper_tube_or_FRP(right_spec_value.startsWith("48") ? "1" : "2");
|
||||
String[] split = right_spec.split("\\|");
|
||||
plan.setQzz_size(String.valueOf(split[2].charAt(0)));
|
||||
// plan.setPaper_tube_or_FRP(right_spec_value.startsWith("48") ? "1" : "2");
|
||||
// String[] split = right_spec.split("\\|");
|
||||
// plan.setQzz_size(String.valueOf(split[2].charAt(0)));
|
||||
// todo 88549333 判断是那种类型纸管还是FRP管 ,然后取到 3 或者6 2026年5月20日16:37:09
|
||||
plan.setQzz_size(MdmDescriptionParseUtils.extractCommonTubeSize(right_spec));
|
||||
if ("1".equals(plan.getPaper_tube_or_FRP())) {
|
||||
plan.setPaper_tube_material(right_spec_value);
|
||||
plan.setPaper_tube_model(right_spec);
|
||||
@@ -2896,9 +2927,11 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
}
|
||||
if (i == 0 && ObjectUtil.isNotEmpty(left_spec) && "2".equals(up_or_down)) {
|
||||
// 下左
|
||||
plan.setPaper_tube_or_FRP(left_spec_value.startsWith("48") ? "1" : "2");
|
||||
String[] split = left_spec.split("\\|");
|
||||
plan.setQzz_size(String.valueOf(split[2].charAt(0)));
|
||||
// plan.setPaper_tube_or_FRP(left_spec_value.startsWith("48") ? "1" : "2");
|
||||
// String[] split = left_spec.split("\\|");
|
||||
// plan.setQzz_size(String.valueOf(split[2].charAt(0)));
|
||||
// todo 88549333 判断是那种类型纸管还是FRP管 ,然后取到 3 或者6 2026年5月20日16:37:09
|
||||
plan.setQzz_size(MdmDescriptionParseUtils.extractCommonTubeSize(left_spec));
|
||||
if ("1".equals(plan.getPaper_tube_or_FRP())) {
|
||||
plan.setPaper_tube_material(left_spec_value);
|
||||
plan.setPaper_tube_model(left_spec);
|
||||
@@ -2918,9 +2951,11 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
}
|
||||
if (i == 1 && ObjectUtil.isNotEmpty(right_spec) && "2".equals(up_or_down)) {
|
||||
// 下右
|
||||
plan.setPaper_tube_or_FRP(right_spec_value.startsWith("48") ? "1" : "2");
|
||||
String[] split = right_spec.split("\\|");
|
||||
plan.setQzz_size(String.valueOf(split[2].charAt(0)));
|
||||
// plan.setPaper_tube_or_FRP(right_spec_value.startsWith("48") ? "1" : "2");
|
||||
// String[] split = right_spec.split("\\|");
|
||||
// plan.setQzz_size(String.valueOf(split[2].charAt(0)));
|
||||
// todo 88549333 判断是那种类型纸管还是FRP管 ,然后取到 3 或者6 2026年5月20日16:37:09
|
||||
plan.setQzz_size(MdmDescriptionParseUtils.extractCommonTubeSize(right_spec));
|
||||
if ("1".equals(plan.getPaper_tube_or_FRP())) {
|
||||
plan.setPaper_tube_material(right_spec_value);
|
||||
plan.setPaper_tube_model(right_spec);
|
||||
|
||||
@@ -0,0 +1,320 @@
|
||||
package org.nl.b_lms.sch.tasks.slitter.util;
|
||||
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* @author ManMan.Yang
|
||||
* @version V1.1
|
||||
* @date 2026/5/19
|
||||
* @description MDM 新物料描述解析公共工具类
|
||||
*/
|
||||
@Slf4j
|
||||
public class MdmDescriptionParseUtils {
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// //frp
|
||||
// String s1 = "FRP管\\玻璃纤维+环氧树脂\\Φ152.4mm*1700mm*15mm\\";
|
||||
// //paper
|
||||
// String s2= "平包树脂管\\6''\\850mm*15mm\\";
|
||||
//
|
||||
// System.out.println("FRP 的尺寸" + extractCommonTubeSize(s1));
|
||||
// System.out.println("纸管 的尺寸" + extractCommonTubeSize(s2));
|
||||
// }
|
||||
|
||||
// ==================================================
|
||||
//====通用公共方法 用来解析纸管或者frp管尺寸 ==============
|
||||
//===================================================
|
||||
/**
|
||||
* 智能提取管件尺寸(自动识别纸管或FRP管)
|
||||
* @param tubeModel 管件型号描述
|
||||
* - 纸管示例: 平包树脂管\3''\500mm*15mm\
|
||||
* - FRP管示例: FRP管\玻璃纤维+环氧树脂\Φ152.4mm*1100mm*15/20mm\
|
||||
* @return 尺寸字符串(英寸)
|
||||
* - 纸管返回: "3.0"
|
||||
* - FRP管返回: "6.0" (152.4mm / 25.4)
|
||||
*/
|
||||
public static String extractCommonTubeSize(String tubeModel) {
|
||||
if (ObjectUtil.isEmpty(tubeModel)) {
|
||||
return "0";
|
||||
}
|
||||
|
||||
try {
|
||||
// 判断是纸管还是FRP管
|
||||
if (tubeModel.contains("FRP")) {
|
||||
// FRP管:转换为英寸
|
||||
return extractFRPTubeSizeTrans(tubeModel);
|
||||
} else {
|
||||
// 纸管:直接提取英寸值
|
||||
return extractPaperTubeSize(tubeModel);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("智能提取管件尺寸失败: {}", tubeModel, e);
|
||||
return "0";
|
||||
}
|
||||
}
|
||||
|
||||
// ==================================================
|
||||
//==================== FRP管解析方法 ===================
|
||||
//===================================================
|
||||
|
||||
/**
|
||||
* 解析尺寸字符串,提取外径、长度、壁厚
|
||||
* @param sizeInfo 尺寸信息,如 Φ152.4mm*1100mm*15/20mm
|
||||
* @return String数组 [外径, 长度, 壁厚],如 ["152.4", "1100", "15/20"]
|
||||
*/
|
||||
public static String[] parseFRPSizeInfo(String sizeInfo) {
|
||||
String[] result = new String[]{"0", "0", "0"};
|
||||
|
||||
if (ObjectUtil.isEmpty(sizeInfo)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
try {
|
||||
// 按 * 号分割
|
||||
String[] parts = sizeInfo.split("\\*");
|
||||
|
||||
if (parts.length >= 3) {
|
||||
// 清理特殊字符:移除 Φ 和 mm
|
||||
result[0] = cleanSizeValue(parts[0]); // Φ152.4mm → 152.4
|
||||
result[1] = cleanSizeValue(parts[1]); // 1100mm → 1100
|
||||
result[2] = cleanSizeValue(parts[2]); // 15/20mm → 15/20
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.warn("解析尺寸信息失败: {}", sizeInfo, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 清理尺寸值中的特殊字符
|
||||
* @param value 原始值,如 Φ152.4mm、1100mm、15/20mm
|
||||
* @return 清理后的纯数值,如 152.4、1100、15/20
|
||||
*/
|
||||
public static String cleanSizeValue(String value) {
|
||||
if (ObjectUtil.isEmpty(value)) {
|
||||
return "0";
|
||||
}
|
||||
|
||||
// 移除 Φ、mm 等特殊字符,保留数字、小数点、斜杠
|
||||
return value.trim()
|
||||
.replace("Φ", "")
|
||||
.replace("mm", "")
|
||||
.replace("MM", "")
|
||||
.replace("''", "")
|
||||
.trim();
|
||||
}
|
||||
/**
|
||||
* 从 FRP 管型号中提取长度(mm)
|
||||
* @param frpModel FRP管型号描述,如 FRP管\玻璃纤维+环氧树脂\Φ152.4mm*1100mm*15/20mm\
|
||||
* @return 长度字符串,如 "1100"
|
||||
*/
|
||||
public static String extractFRPLength(String frpModel) {
|
||||
if (ObjectUtil.isEmpty(frpModel)) {
|
||||
return "0";
|
||||
}
|
||||
|
||||
try {
|
||||
String[] sizeParams = parseFRPSizeInfo(frpModel);
|
||||
return sizeParams[1]; // 返回长度
|
||||
} catch (Exception e) {
|
||||
log.warn("提取FRP管长度失败: {}", frpModel, e);
|
||||
return "0";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 从 FRP 管型号中提取壁厚
|
||||
* @param frpModel FRP管型号描述,如 FRP管\玻璃纤维+环氧树脂\Φ152.4mm*1100mm*15/20mm\
|
||||
* @return 壁厚字符串,单壁厚如 "15",双壁厚如 "15/20"
|
||||
*/
|
||||
public static String extractFRPWallThickness(String frpModel) {
|
||||
if (ObjectUtil.isEmpty(frpModel)) {
|
||||
return "0";
|
||||
}
|
||||
|
||||
try {
|
||||
String[] sizeParams = parseFRPSizeInfo(frpModel);
|
||||
return sizeParams[2]; // 返回壁厚
|
||||
} catch (Exception e) {
|
||||
log.warn("提取FRP管壁厚失败: {}", frpModel, e);
|
||||
return "0";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 从 FRP 管型号中提取外径(mm)
|
||||
* @param frpModel FRP管型号描述,如 FRP管\玻璃纤维+环氧树脂\Φ152.4mm*1100mm*15/20mm\
|
||||
* @return 外径字符串,如 "152.4"
|
||||
*/
|
||||
public static String extractFRPTubeSizeOrag(String frpModel) {
|
||||
if (ObjectUtil.isEmpty(frpModel)) {
|
||||
return "0";
|
||||
}
|
||||
|
||||
try {
|
||||
String[] sizeParams = parseFRPSizeInfo(frpModel);
|
||||
return sizeParams[0];
|
||||
} catch (Exception e) {
|
||||
log.warn("提取FRP管外径失败: {}", frpModel, e);
|
||||
return "0";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 从 FRP 管型号中提取外径(mm)
|
||||
* @param tubeModel FRP管型号描述,如 FRP管\玻璃纤维+环氧树脂\Φ152.4mm*1100mm*15/20mm\
|
||||
* @return 外径字符串,如 "152.4 / 25.4 = 6"
|
||||
*/
|
||||
public static String extractFRPTubeSizeTrans(String tubeModel) {
|
||||
if (ObjectUtil.isEmpty(tubeModel)) {
|
||||
return "";
|
||||
}
|
||||
try {
|
||||
// 清理末尾反斜杠
|
||||
String cleanStr = tubeModel.trim().replaceAll("\\\\+$", "");
|
||||
String[] parts = cleanStr.split("\\\\");
|
||||
|
||||
if (parts.length >= 3) {
|
||||
// 解析尺寸信息:[外径, 长度, 壁厚]
|
||||
String sizeInfo = parts[2];
|
||||
String[] sizeParams = parseFRPSizeInfo(sizeInfo);
|
||||
// 外径mm,如 "152.4"
|
||||
String externalDiameter = sizeParams[0];
|
||||
// 将毫米转换为英寸
|
||||
if (ObjectUtil.isNotEmpty(externalDiameter) && !"0".equals(externalDiameter)) {
|
||||
double diameterMm = Double.parseDouble(externalDiameter);
|
||||
double diameterInch = diameterMm / 25.4;
|
||||
// 保留整数或一位小数
|
||||
return String.valueOf(NumberUtil.round(diameterInch, 1).doubleValue());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("提取纸管尺寸失败: {}", tubeModel, e);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
// ==================================================
|
||||
//==================== 纸管解析方法 ===================
|
||||
//===================================================
|
||||
/**
|
||||
* 从纸管型号中提取尺寸(英寸)
|
||||
* @param paperTubeModel 纸管型号描述,如 平包树脂管\3''\500mm*15mm\
|
||||
* @return 英寸数值字符串,如 "3"
|
||||
*/
|
||||
public static String extractPaperTubeSize(String paperTubeModel) {
|
||||
if (ObjectUtil.isEmpty(paperTubeModel)) {
|
||||
return "0";
|
||||
}
|
||||
|
||||
try {
|
||||
// 清理末尾反斜杠
|
||||
String cleanStr = paperTubeModel.trim().replaceAll("\\\\+$", "");
|
||||
String[] parts = cleanStr.split("\\\\");
|
||||
|
||||
if (parts.length >= 2) {
|
||||
// 第二部分是尺寸:3''
|
||||
String sizePart = parts[1];
|
||||
// 移除 '' 符号
|
||||
String cleaned =cleanSizeValue(sizePart);
|
||||
double num = Double.parseDouble(cleaned);
|
||||
// 四舍五入取整数
|
||||
long rounded = Math.round(num);
|
||||
return rounded + ".0";
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("提取纸管尺寸失败: {}", paperTubeModel, e);
|
||||
}
|
||||
|
||||
return "0";
|
||||
}
|
||||
|
||||
/**
|
||||
* 从纸管型号中提取长度和壁厚
|
||||
* @param paperTubeModel 纸管型号描述,如 平包树脂管\3''\500mm*15mm\
|
||||
* @return String数组 [长度, 壁厚],如 ["500", "15"]
|
||||
*/
|
||||
public static String[] extractPaperTubeSpecs(String paperTubeModel) {
|
||||
String[] result = new String[]{"0", "0"};
|
||||
|
||||
if (ObjectUtil.isEmpty(paperTubeModel)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
try {
|
||||
// 清理末尾反斜杠
|
||||
String cleanStr = paperTubeModel.trim().replaceAll("\\\\+$", "");
|
||||
String[] parts = cleanStr.split("\\\\");
|
||||
|
||||
if (parts.length >= 3) {
|
||||
// 第三部分是规格:500mm*15mm
|
||||
String specPart = parts[2];
|
||||
String[] specs = specPart.split("\\*");
|
||||
|
||||
if (specs.length >= 2) {
|
||||
result[0] = cleanSizeValue(specs[0]); // 长度:500
|
||||
result[1] = cleanSizeValue(specs[1]); // 壁厚:15
|
||||
} else if (specs.length == 1) {
|
||||
result[0] = cleanSizeValue(specs[0]); // 只有长度
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("提取纸管规格失败: {}", paperTubeModel, e);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// ==================================================
|
||||
//==================== 木箱解析方法 ===================
|
||||
//===================================================
|
||||
/**
|
||||
* 从木箱型号中提取关键信息
|
||||
* @param woodenBoxModel 木箱型号描述,如 铜箔木箱\1100/1/6\1148mm*636mm*690mm\非熏蒸\U60
|
||||
* @return String数组 [数量/层数/其他],如 ["1100", "1", "6"]
|
||||
*/
|
||||
public static String[] parseMxBoxDetailInfo(String woodenBoxModel) {
|
||||
String[] result = new String[]{"0", "0", "0"};
|
||||
|
||||
if (ObjectUtil.isEmpty(woodenBoxModel)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
try {
|
||||
// 清理末尾反斜杠
|
||||
String cleanStr = woodenBoxModel.trim().replaceAll("\\\\+$", "");
|
||||
String[] parts = cleanStr.split("\\\\");
|
||||
|
||||
if (parts.length >= 2) {
|
||||
// 第二部分是关键信息:1100/1/6
|
||||
String keyInfo = parts[1];
|
||||
// 按 / 分割
|
||||
String[] infoParts = keyInfo.split("/");
|
||||
|
||||
if (infoParts.length >= 3) {
|
||||
result[0] = infoParts[0].trim(); // 1100
|
||||
result[1] = infoParts[1].trim(); // 1
|
||||
result[2] = infoParts[2].trim(); // 6
|
||||
} else if (infoParts.length == 2) {
|
||||
result[0] = infoParts[0].trim();
|
||||
result[1] = infoParts[1].trim();
|
||||
result[2] = "";
|
||||
} else if (infoParts.length == 1) {
|
||||
result[0] = infoParts[0].trim();
|
||||
result[1] = "";
|
||||
result[2] = "";
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("解析木箱信息失败: {}", woodenBoxModel, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -52,6 +52,19 @@ public class SlitterTaskUtil {
|
||||
return getComposePaperTubeInformation(tubeDescription, plan.getPaper_tube_or_FRP());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取组成信息
|
||||
* @param tubeDescription 纸管信息
|
||||
* @param paperOrFrp 材质(1纸管,2FRP管)
|
||||
* @return 长*外径*内径*壁厚*重量*薄壁厚*阶梯长度*材质(1纸管,2FRP管)
|
||||
*/
|
||||
public static String getComposePaperTubeInformationOld(String tubeDescription, String paperOrFrp) {
|
||||
if (ObjectUtil.isEmpty(tubeDescription)) {
|
||||
return "";
|
||||
}
|
||||
return getComposePaperTubeInformationOld(tubeDescription) + "*" + paperOrFrp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取组成信息
|
||||
* @param tubeDescription 纸管信息
|
||||
@@ -74,6 +87,109 @@ public class SlitterTaskUtil {
|
||||
if (ObjectUtil.isEmpty(tubeDescription)) {
|
||||
return "";
|
||||
}
|
||||
try {
|
||||
tubeDescription = tubeDescription.trim().replaceAll("\\\\+$", "");
|
||||
// 解析描述数组
|
||||
String[] tubeArray = tubeDescription.split("\\\\");
|
||||
if (tubeArray.length < 3) {
|
||||
log.warn("管件描述格式错误: {}", tubeDescription);
|
||||
return "";
|
||||
}
|
||||
String length = "0";
|
||||
double externalDiameter = 0;
|
||||
double internalDiameter= 0;
|
||||
String th ; // 主壁厚
|
||||
String th2 ; // 薄壁厚
|
||||
String jtLen = "0";;
|
||||
// 区分是纸管还是FRP管
|
||||
if(tubeDescription.contains("FRP管")){
|
||||
// 获取尺寸信息部分(第3段)
|
||||
String sizeInfo = tubeArray[2];
|
||||
//解析尺寸:[外径, 长度, 壁厚]
|
||||
String[] sizeParams = MdmDescriptionParseUtils.parseFRPSizeInfo(sizeInfo);
|
||||
// 152.4
|
||||
String externalDiameterStr = sizeParams[0];
|
||||
// 1100
|
||||
length = sizeParams[1];
|
||||
// 15/20 或 15
|
||||
String wallThickness = sizeParams[2]; // 15/20 或 15
|
||||
|
||||
// //是否为阶梯
|
||||
boolean flag = wallThickness.contains("/");
|
||||
if (ObjectUtil.isEmpty(wallThickness) || "0".equals(wallThickness)) {
|
||||
th = "15";
|
||||
th2 = "0";
|
||||
} else if (flag) {
|
||||
// 双壁厚格式:15/20 → th2=15(薄), th=20(厚)
|
||||
String[] thicknessArray = wallThickness.split("/");
|
||||
th2 = thicknessArray[0].trim(); // 15
|
||||
th = thicknessArray[1].trim(); // 20
|
||||
} else {
|
||||
// 单壁厚格式:15 → th=15, th2=0
|
||||
th = wallThickness.trim();
|
||||
th2 = "0";
|
||||
}
|
||||
// 计算外径和内径
|
||||
double diaOrg = ObjectUtil.isNotEmpty(externalDiameterStr) && !"0".equals(externalDiameterStr)
|
||||
? Double.parseDouble(externalDiameterStr) : 0;
|
||||
double wallTh = Double.parseDouble(th);
|
||||
|
||||
// 判断阶梯长度
|
||||
if (flag) {
|
||||
switch (length) {
|
||||
case "1400":
|
||||
case "1700":
|
||||
jtLen = "75";
|
||||
break;
|
||||
case "1500":
|
||||
case "1600":
|
||||
jtLen = "150";
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 计算外径和内径
|
||||
externalDiameter = diaOrg + (wallTh * 2);
|
||||
internalDiameter = diaOrg;
|
||||
}else{
|
||||
// 定义尺寸与长度
|
||||
String diaStr =MdmDescriptionParseUtils.extractPaperTubeSize(tubeDescription);
|
||||
double dia = Double.parseDouble(diaStr);
|
||||
|
||||
// 假设壁厚默认值为15,如果描述数组长度为4,则重新赋值
|
||||
String[] strings = MdmDescriptionParseUtils.extractPaperTubeSpecs(tubeDescription);
|
||||
length = strings[0];
|
||||
th = strings[1];
|
||||
th2 = "0";
|
||||
// 计算外径和内径
|
||||
externalDiameter = dia * 25.4 + Double.parseDouble(th) * 2;
|
||||
internalDiameter = dia * 25.4;
|
||||
}
|
||||
|
||||
//构建结果:长*外径*内径*壁厚*重量*薄壁厚*阶梯长度
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(length).append("*");
|
||||
sb.append(NumberUtil.round(externalDiameter, 1).doubleValue()).append("*");
|
||||
sb.append(NumberUtil.round(internalDiameter, 1).doubleValue()).append("*");
|
||||
sb.append(th).append("*");
|
||||
sb.append(0).append("*");
|
||||
sb.append(th2).append("*");
|
||||
sb.append(jtLen);
|
||||
return sb.toString();
|
||||
}catch (Exception e){
|
||||
log.error("解析纸管描述异常: {}", tubeDescription, e);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取组成信息
|
||||
* @param tubeDescription 纸管信息
|
||||
* @return 长*外径*内径*壁厚*重量*薄壁厚*阶梯长度
|
||||
*/
|
||||
public static String getComposePaperTubeInformationOld(String tubeDescription) {
|
||||
if (ObjectUtil.isEmpty(tubeDescription)) {
|
||||
return "";
|
||||
}
|
||||
boolean flag = tubeDescription.contains("阶梯");
|
||||
tubeDescription = tubeDescription.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "");
|
||||
// 解析描述数组
|
||||
@@ -134,12 +250,17 @@ public class SlitterTaskUtil {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// 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("【测试1】单壁厚:");
|
||||
System.out.println("old: "+getComposePaperTubeInformationOld("纸制筒管|纸管|3.15英寸|1500", "1"));
|
||||
System.out.println("new: "+getComposePaperTubeInformation("平包树脂管\\3.15''\\1500mm*15mm\\", "1"));
|
||||
System.out.println("【测试2】阶梯1:");
|
||||
System.out.println("old: "+getComposePaperTubeInformationOld("玻璃纤维及其制品|FRP管|6英寸|15-20|1100|阶梯", "1"));
|
||||
System.out.println("new: "+getComposePaperTubeInformation("FRP管\\玻璃纤维+环氧树脂\\Φ152.4mm*1100mm*15/20mm\\", "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);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -150,23 +271,24 @@ public class SlitterTaskUtil {
|
||||
public static void putNeedPaperSpec(JSONObject param, List<PdmBiSlittingproductionplan> needPlans) {
|
||||
log.info("正在设置所需的套管纸管信息...");
|
||||
// 纸制筒管|纸管|6英寸|1300 or 纸制筒管|纸管|3英寸|12|650
|
||||
// todo 88549333 因为新物料描述 纸管和 frp管的尺寸位置不一致,所以之前的取数组第三位的写法就存在问题,现修改为根据不同的类型分别获取。 2026年05月19日 21:26
|
||||
for (PdmBiSlittingproductionplan plan : needPlans) {
|
||||
if (SlitterConstant.SLITTER_SUB_VOLUME_LEFT.equals(plan.getLeft_or_right())) {
|
||||
if (SlitterConstant.SLITTER_TYPE_PAPER.equals(plan.getPaper_tube_or_FRP())) {
|
||||
param.put("left", plan.getPaper_tube_material());
|
||||
param.put("leftSize", plan.getPaper_tube_model().split("\\|")[2].charAt(0));
|
||||
param.put("leftSize", MdmDescriptionParseUtils.extractPaperTubeSize(plan.getPaper_tube_model()));
|
||||
} else {
|
||||
param.put("left", plan.getFRP_material());
|
||||
param.put("leftSize", plan.getFRP_model().split("\\|")[2].charAt(0));
|
||||
param.put("leftSize",MdmDescriptionParseUtils.extractFRPTubeSizeTrans(plan.getFRP_model()));
|
||||
}
|
||||
param.put("leftSpec", SlitterTaskUtil.getPaperTubeInformation(plan));
|
||||
} else {
|
||||
if (SlitterConstant.SLITTER_TYPE_PAPER.equals(plan.getPaper_tube_or_FRP())) {
|
||||
param.put("right", plan.getPaper_tube_material());
|
||||
param.put("rightSize", plan.getPaper_tube_model().split("\\|")[2].charAt(0));
|
||||
param.put("rightSize", MdmDescriptionParseUtils.extractPaperTubeSize(plan.getPaper_tube_model()));
|
||||
} else {
|
||||
param.put("right", plan.getFRP_material());
|
||||
param.put("rightSize", plan.getFRP_model().split("\\|")[2].charAt(0));
|
||||
param.put("rightSize", MdmDescriptionParseUtils.extractFRPTubeSizeTrans(plan.getFRP_model()));
|
||||
}
|
||||
param.put("rightSpec", SlitterTaskUtil.getPaperTubeInformation(plan));
|
||||
}
|
||||
@@ -179,23 +301,24 @@ public class SlitterTaskUtil {
|
||||
* @param oldPlans 老的分切计划
|
||||
*/
|
||||
public static void putCurrentPaperSpec(JSONObject param, List<PdmBiSlittingproductionplan> oldPlans) {
|
||||
// todo 88549333 因为新物料描述 纸管和 frp管的尺寸位置不一致,所以之前的取数组第三位的写法就存在问题,现修改为根据不同的类型分别获取。 2026年05月19日 21:26
|
||||
for (PdmBiSlittingproductionplan plan : oldPlans) {
|
||||
if (SlitterConstant.SLITTER_SUB_VOLUME_LEFT.equals(plan.getLeft_or_right())) {
|
||||
if (SlitterConstant.SLITTER_TYPE_PAPER.equals(plan.getPaper_tube_or_FRP())) {
|
||||
param.put("currentLeft", plan.getPaper_tube_material());
|
||||
param.put("currentLeftSize", plan.getPaper_tube_model().split("\\|")[2].charAt(0));
|
||||
param.put("currentLeftSize", MdmDescriptionParseUtils.extractPaperTubeSize(plan.getPaper_tube_model()));
|
||||
} else {
|
||||
param.put("currentLeft", plan.getFRP_material());
|
||||
param.put("currentLeftSize", plan.getFRP_model().split("\\|")[2].charAt(0));
|
||||
param.put("currentLeftSize", MdmDescriptionParseUtils.extractFRPTubeSizeTrans(plan.getFRP_model()));
|
||||
}
|
||||
param.put("currentLeftSpec", SlitterTaskUtil.getPaperTubeInformation(plan));
|
||||
} else {
|
||||
if (SlitterConstant.SLITTER_TYPE_PAPER.equals(plan.getPaper_tube_or_FRP())) {
|
||||
param.put("currentRight", plan.getPaper_tube_material());
|
||||
param.put("currentRightSize", plan.getPaper_tube_model().split("\\|")[2].charAt(0));
|
||||
param.put("currentRightSize", MdmDescriptionParseUtils.extractPaperTubeSize(plan.getPaper_tube_model()));
|
||||
} else {
|
||||
param.put("currentRight", plan.getFRP_material());
|
||||
param.put("currentRightSize", plan.getFRP_model().split("\\|")[2].charAt(0));
|
||||
param.put("currentRightSize", MdmDescriptionParseUtils.extractFRPTubeSizeTrans(plan.getFRP_model()));
|
||||
}
|
||||
param.put("currentRightSpec", SlitterTaskUtil.getPaperTubeInformation(plan));
|
||||
}
|
||||
@@ -289,14 +412,15 @@ public class SlitterTaskUtil {
|
||||
int index = getIndex(material_codes, materialCode);
|
||||
qtys[index] += qty;
|
||||
} else {
|
||||
// todo 88549333 这个地方的判断也有问题,新物料没有4开头的,所以不采用编码是不是4 开头判断 而是采用,描述中是否有frp管字样 2026年05月19日 22:01
|
||||
material_codes[i] = vehicle.getMaterial_code();
|
||||
String spec = getComposePaperTubeInformation(vehicle.getMaterial_name(), vehicle.getMaterial_code().startsWith("4") ? "1" : "2");
|
||||
String spec = getComposePaperTubeInformation(vehicle.getMaterial_name(), vehicle.getMaterial_name().contains("FRP") ? "2" : "1");
|
||||
material_specs[i] = spec;
|
||||
qtys[i] = qty;
|
||||
}
|
||||
//新规格数据处理
|
||||
int row_num = Integer.parseInt(vehicle.getRow_num());
|
||||
String spec = getComposePaperTubeInformation(vehicle.getMaterial_name(), vehicle.getMaterial_code().startsWith("4") ? "1" : "2");
|
||||
String spec = getComposePaperTubeInformation(vehicle.getMaterial_name(), vehicle.getMaterial_name().contains("FRP") ? "2" : "1");
|
||||
material_codes1[row_num-1] = materialCode;
|
||||
material_specs1[row_num-1] = spec;
|
||||
qtys1[row_num-1] = qty;
|
||||
@@ -354,15 +478,19 @@ public class SlitterTaskUtil {
|
||||
* @return /
|
||||
*/
|
||||
public static String getPaperLength(PdmBiSlittingproductionplan plan) {
|
||||
// String s = "玻璃纤维及其制品|FRP管|6英寸|15|1700";
|
||||
// String s = "玻璃纤维及其制品|FRP管|6英寸|15-20|1100|阶梯";
|
||||
// todo 88549333 因为新物料描述 纸管和 frp管的尺寸位置不一致,所以之前的取数组第三位的写法就存在问题,现修改为根据不同的类型分别获取。 2026年05月19日 20:26
|
||||
String paperStr = "";
|
||||
String length = "";
|
||||
if (plan.getPaper_tube_or_FRP().equals(SlitterConstant.SLITTER_TYPE_PAPER)) {
|
||||
paperStr = plan.getPaper_tube_model();
|
||||
String spec [] = MdmDescriptionParseUtils.extractPaperTubeSpecs(paperStr);
|
||||
length = spec[0];
|
||||
} else {
|
||||
paperStr = plan.getFRP_model();
|
||||
length = MdmDescriptionParseUtils.extractFRPLength(paperStr);
|
||||
}
|
||||
String[] split = paperStr.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
return split[split.length - 1];
|
||||
return length;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -383,17 +511,24 @@ public class SlitterTaskUtil {
|
||||
|
||||
/**
|
||||
* 获取纸管长度
|
||||
* @param plan 分切计划
|
||||
* @param name 描述
|
||||
* @return /
|
||||
*/
|
||||
public static String getPaperLengthByCode(String name) {
|
||||
// String name = "玻璃纤维及其制品|FRP管|6英寸|15|1700";
|
||||
String[] split = name.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
return split[split.length - 1];
|
||||
// todo 88549333 因为新物料描述 纸管和 frp管的尺寸位置不一致,所以之前的取数组第三位的写法就存在问题,现修改为根据不同的类型分别获取。 2026年05月19日 21:26
|
||||
String length = "";
|
||||
if(name.contains("FRP管")){
|
||||
length = MdmDescriptionParseUtils.extractFRPLength( name);
|
||||
}else{
|
||||
String spec [] = MdmDescriptionParseUtils.extractPaperTubeSpecs(name);
|
||||
length = spec[0];
|
||||
}
|
||||
return length;
|
||||
}
|
||||
/**
|
||||
* 获取纸管长度
|
||||
* @param plan 分切计划
|
||||
* @param name 描述
|
||||
* @return /
|
||||
*/
|
||||
public static Integer getPaperLengthByCodeInt(String name) {
|
||||
@@ -402,14 +537,17 @@ public class SlitterTaskUtil {
|
||||
}
|
||||
public static String getPaperSize(PdmBiSlittingproductionplan plan) {
|
||||
// String s = "玻璃纤维及其制品|FRP管|6英寸|15|1700";
|
||||
String paperStr = "";
|
||||
// todo 88549333 因为新物料描述 纸管和 frp管的尺寸位置不一致,所以之前的取数组第三位的写法就存在问题,现修改为根据不同的类型分别获取。 2026年05月19日 21:26
|
||||
String paperStr ;
|
||||
String cc;
|
||||
if (plan.getPaper_tube_or_FRP().equals(SlitterConstant.SLITTER_TYPE_PAPER)) {
|
||||
paperStr = plan.getPaper_tube_model();
|
||||
cc = MdmDescriptionParseUtils.extractPaperTubeSize(paperStr);
|
||||
} else {
|
||||
paperStr = plan.getFRP_model();
|
||||
cc = MdmDescriptionParseUtils.extractFRPTubeSizeTrans(paperStr);
|
||||
}
|
||||
String[] split = paperStr.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
return split[2].replaceAll("英寸","");
|
||||
return cc;
|
||||
}
|
||||
|
||||
public static Integer getPaperLengthInt(PdmBiSlittingproductionplan plan) {
|
||||
|
||||
@@ -1,707 +0,0 @@
|
||||
package org.nl.b_lms.sch.tasks.slitter.util;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.bst.ivt.papervehicle.service.dao.MdPbPapervehicle;
|
||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingproductionplan;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 分切部分的任务工具类
|
||||
* @Date: 2024/4/12
|
||||
*/
|
||||
@Slf4j
|
||||
public class SlitterTaskUtilBakup0519 {
|
||||
|
||||
/** B1区域 */
|
||||
public final static String B1_AREA_CODE = "B1";
|
||||
/** B2区域 */
|
||||
public final static String B2_AREA_CODE = "B2";
|
||||
/**
|
||||
* 组成纸管信息
|
||||
* @param plan 对应的分切计划数组
|
||||
* @return 组成的纸管信息
|
||||
* <p>纸制筒管|纸管|6英寸|1300 or 纸制筒管|纸管|3英寸|12|650 or 玻璃纤维及其制品|FRP管|6英寸|15-20|1700|阶梯
|
||||
* 长度:1300mm
|
||||
* 外径:6*25.4mm+15*2mm=182.4mm
|
||||
* 内径:6英寸(25.4mm/英寸)
|
||||
* 壁厚:15mm(常规)、特殊12mm
|
||||
* 材质:纸管</p>
|
||||
*/
|
||||
public static String getPaperTubeInformation(PdmBiSlittingproductionplan plan) {
|
||||
// 纸管描述
|
||||
String tubeDescription;
|
||||
if (SlitterConstant.SLITTER_TYPE_PAPER.equals(plan.getPaper_tube_or_FRP())) {
|
||||
tubeDescription = plan.getPaper_tube_description();
|
||||
} else {
|
||||
tubeDescription = plan.getFRP_description();
|
||||
}
|
||||
// 材质
|
||||
return getComposePaperTubeInformation(tubeDescription, plan.getPaper_tube_or_FRP());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取组成信息
|
||||
* @param tubeDescription 纸管信息
|
||||
* @param paperOrFrp 材质(1纸管,2FRP管)
|
||||
* @return 长*外径*内径*壁厚*重量*薄壁厚*阶梯长度*材质(1纸管,2FRP管)
|
||||
*/
|
||||
public static String getComposePaperTubeInformation(String tubeDescription, String paperOrFrp) {
|
||||
if (ObjectUtil.isEmpty(tubeDescription)) {
|
||||
return "";
|
||||
}
|
||||
return getComposePaperTubeInformation(tubeDescription) + "*" + paperOrFrp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取组成信息
|
||||
* @param tubeDescription 纸管信息
|
||||
* @return 长*外径*内径*壁厚*重量*薄壁厚*阶梯长度
|
||||
*/
|
||||
public static String getComposePaperTubeInformation(String tubeDescription) {
|
||||
if (ObjectUtil.isEmpty(tubeDescription)) {
|
||||
return "";
|
||||
}
|
||||
boolean flag = tubeDescription.contains("阶梯");
|
||||
tubeDescription = tubeDescription.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "");
|
||||
// 解析描述数组
|
||||
String[] tubeArray = tubeDescription.split("\\|");
|
||||
// 定义尺寸与长度
|
||||
double dia = Double.parseDouble(Character.toString(tubeArray[2].charAt(0)));
|
||||
|
||||
// 假设壁厚默认值为15,如果描述数组长度为4,则重新赋值
|
||||
String th = tubeArray.length == 5 ? tubeArray[3] : "15";
|
||||
String th2 = "0";
|
||||
String jtLen = "0";
|
||||
if (tubeArray[3].contains("-")) {
|
||||
th = tubeArray[3].split("-")[1];
|
||||
th2 = tubeArray[3].split("-")[0];
|
||||
}
|
||||
if (flag) {
|
||||
switch (tubeArray[tubeArray.length - 1]) {
|
||||
case "1400":
|
||||
case "1700":
|
||||
jtLen = "75";
|
||||
break;
|
||||
case "1500":
|
||||
case "1600":
|
||||
jtLen = "150";
|
||||
break;
|
||||
default:
|
||||
jtLen = "0";
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 计算外径和内径
|
||||
double externalDiameter = dia * 25.4 + Double.parseDouble(th) * 2;
|
||||
double internalDiameter = dia * 25.4;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
// 长*外径*内径*壁厚*重量*材质(1纸管,2FRP管)
|
||||
// 长
|
||||
sb.append(tubeArray[tubeArray.length - 1]);
|
||||
sb.append("*");
|
||||
// 外径
|
||||
sb.append(NumberUtil.round(externalDiameter, 1).doubleValue());
|
||||
sb.append("*");
|
||||
// 内径
|
||||
sb.append(NumberUtil.round(internalDiameter, 1).doubleValue());
|
||||
sb.append("*");
|
||||
// 壁厚
|
||||
sb.append(th);
|
||||
sb.append("*");
|
||||
// 重量
|
||||
sb.append(0);
|
||||
sb.append("*");
|
||||
// 薄壁厚
|
||||
sb.append(th2);
|
||||
sb.append("*");
|
||||
// 阶梯长度
|
||||
sb.append(jtLen);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// 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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置所需的套管纸管信息
|
||||
* @param param 任务参数
|
||||
* @param needPlans 所需的分切计划
|
||||
*/
|
||||
public static void putNeedPaperSpec(JSONObject param, List<PdmBiSlittingproductionplan> needPlans) {
|
||||
log.info("正在设置所需的套管纸管信息...");
|
||||
// 纸制筒管|纸管|6英寸|1300 or 纸制筒管|纸管|3英寸|12|650
|
||||
for (PdmBiSlittingproductionplan plan : needPlans) {
|
||||
if (SlitterConstant.SLITTER_SUB_VOLUME_LEFT.equals(plan.getLeft_or_right())) {
|
||||
if (SlitterConstant.SLITTER_TYPE_PAPER.equals(plan.getPaper_tube_or_FRP())) {
|
||||
param.put("left", plan.getPaper_tube_material());
|
||||
param.put("leftSize", plan.getPaper_tube_model().split("\\|")[2].charAt(0));
|
||||
} else {
|
||||
param.put("left", plan.getFRP_material());
|
||||
param.put("leftSize", plan.getFRP_model().split("\\|")[2].charAt(0));
|
||||
}
|
||||
param.put("leftSpec", SlitterTaskUtilBakup0519.getPaperTubeInformation(plan));
|
||||
} else {
|
||||
if (SlitterConstant.SLITTER_TYPE_PAPER.equals(plan.getPaper_tube_or_FRP())) {
|
||||
param.put("right", plan.getPaper_tube_material());
|
||||
param.put("rightSize", plan.getPaper_tube_model().split("\\|")[2].charAt(0));
|
||||
} else {
|
||||
param.put("right", plan.getFRP_material());
|
||||
param.put("rightSize", plan.getFRP_model().split("\\|")[2].charAt(0));
|
||||
}
|
||||
param.put("rightSpec", SlitterTaskUtilBakup0519.getPaperTubeInformation(plan));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置当前的拔管纸管信息
|
||||
* @param param 任务参数
|
||||
* @param oldPlans 老的分切计划
|
||||
*/
|
||||
public static void putCurrentPaperSpec(JSONObject param, List<PdmBiSlittingproductionplan> oldPlans) {
|
||||
for (PdmBiSlittingproductionplan plan : oldPlans) {
|
||||
if (SlitterConstant.SLITTER_SUB_VOLUME_LEFT.equals(plan.getLeft_or_right())) {
|
||||
if (SlitterConstant.SLITTER_TYPE_PAPER.equals(plan.getPaper_tube_or_FRP())) {
|
||||
param.put("currentLeft", plan.getPaper_tube_material());
|
||||
param.put("currentLeftSize", plan.getPaper_tube_model().split("\\|")[2].charAt(0));
|
||||
} else {
|
||||
param.put("currentLeft", plan.getFRP_material());
|
||||
param.put("currentLeftSize", plan.getFRP_model().split("\\|")[2].charAt(0));
|
||||
}
|
||||
param.put("currentLeftSpec", SlitterTaskUtilBakup0519.getPaperTubeInformation(plan));
|
||||
} else {
|
||||
if (SlitterConstant.SLITTER_TYPE_PAPER.equals(plan.getPaper_tube_or_FRP())) {
|
||||
param.put("currentRight", plan.getPaper_tube_material());
|
||||
param.put("currentRightSize", plan.getPaper_tube_model().split("\\|")[2].charAt(0));
|
||||
} else {
|
||||
param.put("currentRight", plan.getFRP_material());
|
||||
param.put("currentRightSize", plan.getFRP_model().split("\\|")[2].charAt(0));
|
||||
}
|
||||
param.put("currentRightSpec", SlitterTaskUtilBakup0519.getPaperTubeInformation(plan));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备号
|
||||
* @param resourceCode /
|
||||
* @return /
|
||||
*/
|
||||
public static int getNumberByResourceCode(String resourceCode) {
|
||||
if (ObjectUtil.isEmpty(resourceCode)) {
|
||||
throw new BadRequestException("输入的设备号编码不能为空!");
|
||||
}
|
||||
String trimStr = resourceCode.trim();
|
||||
// 提取最后两位作为字符串
|
||||
String lastTwoDigitsString = trimStr.substring(trimStr.length() - 2);
|
||||
// 将整数再转换回字符串以供返回
|
||||
return Integer.parseInt(lastTwoDigitsString);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取上下区域
|
||||
* @param num 编码
|
||||
* @param area 区域
|
||||
* @return /
|
||||
*/
|
||||
public static String getPointLocationInCutDevice(int num, String area) {
|
||||
if (area.equals(B1_AREA_CODE)) {
|
||||
if (num >= 1 && num <= 6) {
|
||||
return "0";
|
||||
}
|
||||
}
|
||||
if (area.equals(B2_AREA_CODE)) {
|
||||
if (num >= 1 && num <= 5) {
|
||||
return "0";
|
||||
}
|
||||
}
|
||||
return "1";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询是否包含在内
|
||||
* @param names 数组
|
||||
* @param name 自负床
|
||||
* @return Boolean 是 {@code true} or 否{@code false}
|
||||
*/
|
||||
public static boolean containscode(String[] names, String name) {
|
||||
for (String n : names) {
|
||||
if (name.equals(n)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取name在数组中的索引
|
||||
* @param names 数组
|
||||
* @param name 校验字符
|
||||
* @return 索引
|
||||
*/
|
||||
public static int getIndex(String[] names, String name) {
|
||||
for (int i = 0; i < names.length; i++) {
|
||||
if (name.equals(names[i])) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
// 如果找不到返回-1
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 业务:备货区送纸管托盘时候,将纸管信息带给任务中的参数
|
||||
* @param paperList 备货区纸管信息
|
||||
* @param param 任务参数json
|
||||
*/
|
||||
public static void doSavePaperInfos(List<MdPbPapervehicle> paperList, JSONObject param) {
|
||||
String[] material_codes = new String[paperList.size()];
|
||||
String[] material_specs = new String[paperList.size()];
|
||||
int[] qtys = new int[paperList.size()];
|
||||
String[] material_codes1 = {null,null,null,null,null};
|
||||
String[] material_specs1 = {null,null,null,null,null};
|
||||
int[] qtys1 = {0,0,0,0,0};
|
||||
for (int i = 0; i < paperList.size(); i++) {
|
||||
MdPbPapervehicle vehicle = paperList.get(i);
|
||||
String materialCode = vehicle.getMaterial_code();
|
||||
int qty = vehicle.getQty().intValue();
|
||||
if (containscode(material_codes, materialCode)) {
|
||||
int index = getIndex(material_codes, materialCode);
|
||||
qtys[index] += qty;
|
||||
} else {
|
||||
material_codes[i] = vehicle.getMaterial_code();
|
||||
String spec = getComposePaperTubeInformation(vehicle.getMaterial_name(), vehicle.getMaterial_code().startsWith("4") ? "1" : "2");
|
||||
material_specs[i] = spec;
|
||||
qtys[i] = qty;
|
||||
}
|
||||
//新规格数据处理
|
||||
int row_num = Integer.parseInt(vehicle.getRow_num());
|
||||
String spec = getComposePaperTubeInformation(vehicle.getMaterial_name(), vehicle.getMaterial_code().startsWith("4") ? "1" : "2");
|
||||
material_codes1[row_num-1] = materialCode;
|
||||
material_specs1[row_num-1] = spec;
|
||||
qtys1[row_num-1] = qty;
|
||||
}
|
||||
// 转成String
|
||||
String[] qtysStr = Arrays.stream(qtys)
|
||||
.mapToObj(String::valueOf)
|
||||
.toArray(String[]::new);
|
||||
// 转成String
|
||||
String[] qtysStr1 = Arrays.stream(qtys1)
|
||||
.mapToObj(String::valueOf)
|
||||
.toArray(String[]::new);
|
||||
param.put("to_material", String.join(",", material_codes));
|
||||
param.put("to_spec", String.join(",", material_specs));
|
||||
param.put("to_qty", String.join(",", qtysStr));
|
||||
|
||||
param.put("to_material1", String.join(",", material_codes1));
|
||||
param.put("to_spec1", String.join(",", material_specs1));
|
||||
param.put("to_qty1", String.join(",", qtysStr1));
|
||||
param.put("device_code", material_specs);
|
||||
}
|
||||
|
||||
/**
|
||||
* 传入JSONArray返回筛选字符串
|
||||
* @param array /
|
||||
* @param name /
|
||||
* @return /
|
||||
*/
|
||||
public static List<String> getAllStringByName(JSONArray array, String name) {
|
||||
List<String> res = new ArrayList<>();
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
JSONObject jsonObject = array.getJSONObject(i);
|
||||
res.add(jsonObject.getString(name));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过分切计划的上下轴返回对应的气胀轴编码
|
||||
* todo: 是否存在问题?
|
||||
* @param plan 分切机
|
||||
* @return 气胀轴编码或者"-"
|
||||
*/
|
||||
public static String getQzzNoByUpOrDown(PdmBiSlittingproductionplan plan) {
|
||||
if (SlitterConstant.SLITTER_SHAFT_UP.equals(plan.getUp_or_down())) {
|
||||
return plan.getQzzno();
|
||||
} else {
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取纸管长度
|
||||
* @param plan 分切计划
|
||||
* @return /
|
||||
*/
|
||||
public static String getPaperLength(PdmBiSlittingproductionplan plan) {
|
||||
// String s = "玻璃纤维及其制品|FRP管|6英寸|15|1700";
|
||||
String paperStr = "";
|
||||
if (plan.getPaper_tube_or_FRP().equals(SlitterConstant.SLITTER_TYPE_PAPER)) {
|
||||
paperStr = plan.getPaper_tube_model();
|
||||
} else {
|
||||
paperStr = plan.getFRP_model();
|
||||
}
|
||||
String[] split = paperStr.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
return split[split.length - 1];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取: 长*外径*内径*壁厚*重量*薄壁厚*阶梯长度
|
||||
* @param plan
|
||||
* @return
|
||||
*/
|
||||
public static String getTubeConvertInfo(PdmBiSlittingproductionplan plan) {
|
||||
// String s = "玻璃纤维及其制品|FRP管|6英寸|15|1700";
|
||||
String paperStr = "";
|
||||
if (plan.getPaper_tube_or_FRP().equals(SlitterConstant.SLITTER_TYPE_PAPER)) {
|
||||
paperStr = plan.getPaper_tube_model();
|
||||
} else {
|
||||
paperStr = plan.getFRP_model();
|
||||
}
|
||||
return getComposePaperTubeInformation(paperStr);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取纸管长度
|
||||
* @param plan 分切计划
|
||||
* @return /
|
||||
*/
|
||||
public static String getPaperLengthByCode(String name) {
|
||||
// String name = "玻璃纤维及其制品|FRP管|6英寸|15|1700";
|
||||
String[] split = name.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
return split[split.length - 1];
|
||||
}
|
||||
/**
|
||||
* 获取纸管长度
|
||||
* @param plan 分切计划
|
||||
* @return /
|
||||
*/
|
||||
public static Integer getPaperLengthByCodeInt(String name) {
|
||||
// String name = "玻璃纤维及其制品|FRP管|6英寸|15|1700";
|
||||
return Integer.valueOf(getPaperLengthByCode(name));
|
||||
}
|
||||
public static String getPaperSize(PdmBiSlittingproductionplan plan) {
|
||||
// String s = "玻璃纤维及其制品|FRP管|6英寸|15|1700";
|
||||
String paperStr = "";
|
||||
if (plan.getPaper_tube_or_FRP().equals(SlitterConstant.SLITTER_TYPE_PAPER)) {
|
||||
paperStr = plan.getPaper_tube_model();
|
||||
} else {
|
||||
paperStr = plan.getFRP_model();
|
||||
}
|
||||
String[] split = paperStr.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
return split[2].replaceAll("英寸","");
|
||||
}
|
||||
|
||||
public static Integer getPaperLengthInt(PdmBiSlittingproductionplan plan) {
|
||||
return Integer.valueOf(getPaperLength(plan));
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置重量
|
||||
* @param plans 分切计划
|
||||
* @return 0,0,0,0
|
||||
*/
|
||||
public static void setPaperWeightStr(String weightStr, List<PdmBiSlittingproductionplan> plans) {
|
||||
// 1. 校验输入格式
|
||||
String[] parts = weightStr.split(",");
|
||||
if (parts.length != 4) {
|
||||
// 没有数据则不修改
|
||||
return;
|
||||
}
|
||||
|
||||
// 2. 遍历四个位置
|
||||
for (int index = 0; index < 4; index++) {
|
||||
// 解析重量值(自动四舍五入到两位小数)
|
||||
String strValue = parts[index];
|
||||
BigDecimal value;
|
||||
try {
|
||||
value = new BigDecimal(strValue).setScale(2, RoundingMode.HALF_UP);
|
||||
} catch (NumberFormatException e) {
|
||||
continue; // 跳过无效数值
|
||||
}
|
||||
|
||||
// 3. 根据索引确定位置规则
|
||||
String expectedUp, expectedLeft;
|
||||
switch (index) {
|
||||
case 0: // 上左
|
||||
expectedUp = "1";
|
||||
expectedLeft = "1";
|
||||
break;
|
||||
case 1: // 上右
|
||||
expectedUp = "1";
|
||||
expectedLeft = "2";
|
||||
break;
|
||||
case 2: // 下左
|
||||
expectedUp = "2";
|
||||
expectedLeft = "1";
|
||||
break;
|
||||
case 3: // 下右
|
||||
expectedUp = "2";
|
||||
expectedLeft = "2";
|
||||
break;
|
||||
default:
|
||||
throw new IllegalStateException("非法索引: " + index);
|
||||
}
|
||||
|
||||
// 4. 在集合中查找匹配项并更新
|
||||
for (PdmBiSlittingproductionplan plan : plans) {
|
||||
if (expectedUp.equals(plan.getUp_or_down()) &&
|
||||
expectedLeft.equals(plan.getLeft_or_right())) {
|
||||
plan.setPaper_weight(value.toString());
|
||||
break; // 找到后跳出循环
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取重量
|
||||
* @param plans 分切计划
|
||||
* @return 0,0,0,0
|
||||
*/
|
||||
public static String getPaperWeightStr(List<PdmBiSlittingproductionplan> plans) {
|
||||
String[] weights = new String[4];
|
||||
Arrays.fill(weights, "0");
|
||||
|
||||
for (PdmBiSlittingproductionplan plan : plans) {
|
||||
// 1. 获取重量并四舍五入
|
||||
String weightStr = plan.getPaper_weight();
|
||||
BigDecimal weight;
|
||||
try {
|
||||
weight = new BigDecimal(weightStr);
|
||||
} catch (Exception e) {
|
||||
continue;
|
||||
}
|
||||
BigDecimal rounded = weight.setScale(2, RoundingMode.HALF_UP);
|
||||
|
||||
// 2. 根据位置确定数组索引
|
||||
String upDown = plan.getUp_or_down();
|
||||
String leftRight = plan.getLeft_or_right();
|
||||
int index = -1;
|
||||
|
||||
if ("1".equals(upDown)) {
|
||||
index = ("1".equals(leftRight)) ? 0 : 1;
|
||||
} else {
|
||||
index = ("1".equals(leftRight)) ? 2 : 3;
|
||||
}
|
||||
|
||||
// 3. 更新对应位置的重量(格式化为两位小数)
|
||||
if (index >= 0 && index < 4) {
|
||||
weights[index] = rounded.toString();
|
||||
}
|
||||
}
|
||||
|
||||
// 4. 拼接结果字符串
|
||||
return String.join(",", weights);
|
||||
}
|
||||
|
||||
/**
|
||||
* 固定输入与输出气胀轴库点位
|
||||
* @param input
|
||||
* @return
|
||||
*/
|
||||
public static String getQzzkMappedValue(String input) {
|
||||
switch (input) {
|
||||
case "B_QZZK01": return "B_QZZK02";
|
||||
case "B_QZZK02": return "B_QZZK01";
|
||||
case "B_QZZK03": return "B_QZZK04";
|
||||
case "B_QZZK04": return "B_QZZK03";
|
||||
default: throw new BadRequestException("站点输入错误: " + input);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 下卷前置校验,判断卷的上下轴属性与实际是否一致 - 校验子卷属性
|
||||
* @param jsonArray 子卷数组
|
||||
* @param plans 计划
|
||||
*/
|
||||
public static void validateConsistency(JSONArray jsonArray, List<PdmBiSlittingproductionplan> plans) {
|
||||
if (plans.size() == 0) {
|
||||
throw new BadRequestException("计划未找到,请确保MES已推送。");
|
||||
}
|
||||
// 1. 将 List<PdmBiSlittingproductionplan> 转为 Map<container_name, up_or_down>
|
||||
Map<String, String> planMap = plans.stream()
|
||||
.collect(Collectors.toMap(
|
||||
p -> p.getContainer_name(),
|
||||
p -> p.getUp_or_down(),
|
||||
// 如果有重复 key,保留第一个(按需调整)
|
||||
(existing, replacement) -> existing
|
||||
));
|
||||
|
||||
// 2. 遍历 JSONArray
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
JSONObject item = jsonArray.getJSONObject(i);
|
||||
String containerName = item.getString("container_name");
|
||||
String site = item.getString("site");
|
||||
|
||||
// 3. 检查 Plan 中是否存在对应的 container_name
|
||||
if (!planMap.containsKey(containerName)) {
|
||||
throw new BadRequestException("校验失败: container_name " + containerName + " 在计划列表中不存在");
|
||||
}
|
||||
|
||||
// 4. 比较 site 和 up_or_down 是否一致
|
||||
String expectedUpDown = planMap.get(containerName);
|
||||
if (!expectedUpDown.equals(site)) {
|
||||
throw new BadRequestException("校验失败: 子卷号 " + containerName
|
||||
+ " 的上下轴位置"
|
||||
+ "与MES分切计划中的上下轴位置" + expectedUpDown + "不一致!");
|
||||
}
|
||||
}
|
||||
log.info("分切下卷计划位置校验通过!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断管芯行家对接位是否有所需的管芯、并且数量是符合的。
|
||||
* @param tubeCodes
|
||||
* @param needTubes
|
||||
* @param papers
|
||||
* @return
|
||||
*/
|
||||
public static boolean containsAllTubes(List<String> tubeCodes, List<String> needTubes, List<MdPbPapervehicle> papers) {
|
||||
Set<String> tubeSet = new HashSet<>(tubeCodes);
|
||||
for (String tube : needTubes) {
|
||||
if (!tubeSet.contains(tube)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
int num = 0;
|
||||
for (String needTube : needTubes) {
|
||||
for (MdPbPapervehicle paper : papers) {
|
||||
if (needTube.equals(paper.getMaterial_code())) {
|
||||
num += paper.getQty().intValue();
|
||||
}
|
||||
}
|
||||
if (num == 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 组成映射Map
|
||||
* @param tubes
|
||||
* @return
|
||||
*/
|
||||
public static Map<String, Integer> countTubes(List<String> tubes) {
|
||||
if (tubes == null) {
|
||||
return new HashMap<>();
|
||||
}
|
||||
return tubes.stream()
|
||||
.filter(tube -> tube != null)
|
||||
.collect(Collectors.toMap(
|
||||
Function.identity(),
|
||||
value -> 1,
|
||||
Integer::sum
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
public static <T, U> List<U> mapList(Collection<T> from, Function<T, U> func) {
|
||||
if (CollUtil.isEmpty(from)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return from.stream().map(func).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换List<String>
|
||||
* @param obj
|
||||
* @return
|
||||
*/
|
||||
public static List<String> objectToList(Object obj) {
|
||||
// 安全转换为List<String>
|
||||
List<String> errorList = new ArrayList<>();
|
||||
if (obj instanceof List) {
|
||||
for (Object item : (List<?>) obj) {
|
||||
if (item instanceof String) {
|
||||
errorList.add((String) item);
|
||||
} else {
|
||||
// 非字符串元素处理(按需调整)
|
||||
errorList.add(item.toString());
|
||||
}
|
||||
}
|
||||
} else if (obj != null) {
|
||||
// 如果存储的不是List(如JSON字符串),需额外处理
|
||||
throw new IllegalStateException("Expected List type from Redis, but got: " + obj.getClass());
|
||||
}
|
||||
return errorList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断字符串是否为数字(整数、小数、负数)
|
||||
*/
|
||||
public static boolean isNumeric(String str) {
|
||||
if (str == null || str.isEmpty() || str.trim().isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
String s = str.trim();
|
||||
return s.matches("-?\\d+(\\.\\d+)?");
|
||||
}
|
||||
|
||||
/**
|
||||
* 单根轴的数据判断:根据指定的尺寸类型,校验左侧或右侧电流数据是否完整。
|
||||
* 当 size 为 1 时,只需一侧数据完整即返回 true;
|
||||
* 当 size 为 2 时,要求左右两侧数据均完整才返回 true。
|
||||
*
|
||||
* @param param 包含相关字段的 JSON 对象,必须包含以下键:
|
||||
* "currentLeft", "currentLeftSize", "currentLeftSpec",
|
||||
* "currentRight", "currentRightSize", "currentRightSpec"
|
||||
* @param size 校验模式大小,决定校验逻辑:
|
||||
* - 1:表示任一轴(左或右)数据完整即可(逻辑或)
|
||||
* - 2:表示左右两轴数据都必须完整(逻辑与)
|
||||
* @return 符合校验规则时返回 true,否则返回 false
|
||||
*/
|
||||
public static boolean singleShaftCheck(JSONObject param, int size) {
|
||||
String currentLeft = param.getString("currentLeft");
|
||||
String currentLeftSize = param.getString("currentLeftSize");
|
||||
String currentLeftSpec = param.getString("currentLeftSpec");
|
||||
String currentRight = param.getString("currentRight");
|
||||
String currentRightSize = param.getString("currentRightSize");
|
||||
String currentRightSpec = param.getString("currentRightSpec");
|
||||
|
||||
// 根据 size 值执行不同的校验策略:1 表示任一轴有效即可,2 表示双轴均需有效
|
||||
switch (size) {
|
||||
case 1:
|
||||
return checkComplete(currentLeft, currentLeftSpec, currentLeftSize)
|
||||
|| checkComplete(currentRight, currentRightSpec, currentRightSize);
|
||||
case 2:
|
||||
return checkComplete(currentLeft, currentLeftSpec, currentLeftSize)
|
||||
&& checkComplete(currentRight, currentRightSpec, currentRightSize);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public static boolean checkComplete(String... checks) {
|
||||
if (checks == null) {
|
||||
return false;
|
||||
}
|
||||
for (String check : checks) {
|
||||
if (ObjectUtil.isEmpty(check)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package org.nl.wms.ext.acs.service.impl;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import org.nl.b_lms.sch.point.dao.mapper.BstIvtPackageinfoivtMapper;
|
||||
import org.nl.b_lms.sch.tasks.slitter.util.MdmDescriptionParseUtils;
|
||||
import org.nl.b_lms.storage_manage.database.service.dao.mapper.BstIvtBoxinfoMapper;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
@@ -1190,13 +1191,16 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
JSONObject plan_jo = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("container_name = '" + resq_jo.getString("container_name1") + "'").uniqueResult(0);
|
||||
String paper_tube_or_FRP = plan_jo.getString("paper_tube_or_frp");
|
||||
String paper_name;
|
||||
String need_size;
|
||||
// todo 88549333 因为新物料描述 纸管和 frp管的尺寸位置不一致,所以之前的取数组第三位的写法就存在问题,现修改为根据不同的类型分别获取。 2026年05月19日 18:55
|
||||
if ("1".equals(paper_tube_or_FRP)) {
|
||||
paper_name = plan_jo.getString("paper_tube_description");
|
||||
need_size = MdmDescriptionParseUtils.extractPaperTubeSize(paper_name);
|
||||
} else {
|
||||
paper_name = plan_jo.getString("frp_description");
|
||||
need_size = MdmDescriptionParseUtils.extractFRPTubeSizeTrans(paper_name);
|
||||
}
|
||||
// mark: 分切计划规格拆分数据
|
||||
String need_size = String.valueOf(paper_name.split("\\|")[2].charAt(0));
|
||||
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("ext_code = '" + plan_jo.getString("resource_name") + "'").uniqueResult(0);
|
||||
//获取分切机维护的气涨轴代数
|
||||
String need_generation = cut_jo.getString("qzz_generation");
|
||||
|
||||
@@ -7,9 +7,12 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.sch.tasks.slitter.util.MdmDescriptionParseUtils;
|
||||
import org.nl.b_lms.sch.tasks.slitter.util.SlitterTaskUtil;
|
||||
import org.nl.modules.logging.annotation.ApiLog;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.wms.ext.mdm.entity.CommonResponseDto;
|
||||
import org.nl.wms.ext.mdm.entity.ResponseItemsData;
|
||||
import org.nl.wms.ext.mdm.service.MdmToLmsService;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -35,7 +38,6 @@ public class MdmToLmsController {
|
||||
private MdmToLmsService mdmToLmsService;
|
||||
|
||||
@PostMapping("/transCustomerInfo")
|
||||
// @Log("MDM给LMS推送客户信息")
|
||||
@ApiLog(
|
||||
bizCode = "/mdm/transCustomerInfo",
|
||||
bizDesc = "MDM给LMS推送客户信息",
|
||||
@@ -48,7 +50,6 @@ public class MdmToLmsController {
|
||||
|
||||
|
||||
@PostMapping("/transSupplierInfo")
|
||||
// @Log("MDM给LMS推送供应商信息")
|
||||
@ApiLog(
|
||||
bizCode = "/mdm/transSupplierInfo",
|
||||
bizDesc = "MDM给LMS推送供应商信息",
|
||||
@@ -60,7 +61,6 @@ public class MdmToLmsController {
|
||||
}
|
||||
|
||||
@PostMapping("/transMaterialInfo")
|
||||
// @Log("MDM给LMS推送物料主数据信息")
|
||||
@ApiLog(
|
||||
bizCode = "/mdm/transMaterialInfo",
|
||||
bizDesc = "MDM给LMS推送物料主数据信息",
|
||||
@@ -71,4 +71,12 @@ public class MdmToLmsController {
|
||||
return mdmToLmsService.transMaterialInfo(jsonData);
|
||||
}
|
||||
|
||||
@PostMapping("/transMaterialTest")
|
||||
@SaIgnore
|
||||
public void transMaterialTest(@RequestBody JSONObject jsonData){
|
||||
String materialName = jsonData.get("material_name") + "";
|
||||
String composePaperTubeInformation = SlitterTaskUtil.getComposePaperTubeInformation(materialName);
|
||||
log.info("composePaperTubeInformation:{}",composePaperTubeInformation);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.nl.wms.ext.mes.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.nl.b_lms.sch.tasks.slitter.util.MdmDescriptionParseUtils;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
@@ -645,11 +646,9 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
} else {
|
||||
qzz_generation = "4";
|
||||
}
|
||||
|
||||
// 解析描述数组
|
||||
String[] tubeArray = param.getString("PaperTubeDescription").split("\\|");
|
||||
// 定义尺寸与长度
|
||||
qzz_size = Character.toString(tubeArray[2].charAt(0));
|
||||
//定义尺寸与长度
|
||||
// todo 88549333 修改 采用公共处理方法获取纸管的规格 2026年05月19日 18:05
|
||||
qzz_size = MdmDescriptionParseUtils.extractPaperTubeSize(param.getString("PaperTubeDescription"));
|
||||
} else {
|
||||
if (ObjectUtil.isEmpty(param.getString("FRPMaterial"))) {
|
||||
throw new BadRequestException("FRP管物料编码不能为空");
|
||||
@@ -667,11 +666,9 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
} else {
|
||||
qzz_generation = "4";
|
||||
}
|
||||
|
||||
// 解析描述数组
|
||||
String[] tubeArray = param.getString("FRPDescription").split("\\|");
|
||||
// 定义尺寸与长度
|
||||
qzz_size = Character.toString(tubeArray[2].charAt(0));
|
||||
// todo 88549333 修改 采用公共处理方法获取FRP管的规格 2026年05月19日 18:25
|
||||
qzz_size = MdmDescriptionParseUtils.extractFRPTubeSizeTrans(param.getString("FRPDescription"));
|
||||
}
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.pda.mps.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import org.nl.b_lms.sch.tasks.slitter.util.MdmDescriptionParseUtils;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
@@ -337,9 +338,11 @@ public class PaperTubeServiceImpl implements PaperTubeService {
|
||||
// 区分位置创建
|
||||
if (ObjectUtil.isNotEmpty(upLeftSizeK) && j == 0) {
|
||||
// 上左
|
||||
plan.setPaper_tube_or_FRP(upLeftSizeV.startsWith("48") ? "1" : "2");
|
||||
String[] split = upLeftSizeK.split("\\|");
|
||||
plan.setQzz_size(String.valueOf(split[2].charAt(0)));
|
||||
//设置是纸管还是frp管
|
||||
//plan.setPaper_tube_or_FRP(upLeftSizeV.startsWith("48") ? "1" : "2");
|
||||
//String[] split = upLeftSizeK.split("\\|");
|
||||
// todo 88549333 判断是那种类型纸管还是FRP管 ,然后取到 3 或者6 2026年5月20日15:37:09
|
||||
plan.setQzz_size(MdmDescriptionParseUtils.extractCommonTubeSize(upLeftSizeK));
|
||||
if ("1".equals(plan.getPaper_tube_or_FRP())) {
|
||||
plan.setPaper_tube_material(upLeftSizeV);
|
||||
plan.setPaper_tube_model(upLeftSizeK);
|
||||
@@ -354,9 +357,11 @@ public class PaperTubeServiceImpl implements PaperTubeService {
|
||||
}
|
||||
if ( ObjectUtil.isNotEmpty(upRightSizeK) && j == 1) {
|
||||
// 上右
|
||||
plan.setPaper_tube_or_FRP(upRightSizeV.startsWith("48") ? "1" : "2");
|
||||
String[] split = upRightSizeK.split("\\|");
|
||||
plan.setQzz_size(String.valueOf(split[2].charAt(0)));
|
||||
// plan.setPaper_tube_or_FRP(upRightSizeV.startsWith("48") ? "1" : "2");
|
||||
// String[] split = upRightSizeK.split("\\|");
|
||||
// plan.setQzz_size(String.valueOf(split[2].charAt(0)));
|
||||
// todo 88549333 判断是那种类型纸管还是FRP管 ,然后取到 3 或者6 2026年5月20日15:37:09
|
||||
plan.setQzz_size(MdmDescriptionParseUtils.extractCommonTubeSize(upRightSizeK));
|
||||
if ("1".equals(plan.getPaper_tube_or_FRP())) {
|
||||
plan.setPaper_tube_material(upRightSizeV);
|
||||
plan.setPaper_tube_model(upRightSizeK);
|
||||
|
||||
@@ -14,6 +14,7 @@ import org.nl.b_lms.sch.point.dao.StIvtShaftivt;
|
||||
import org.nl.b_lms.sch.point.service.IstIvtShaftivtService;
|
||||
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.slitter.util.MdmDescriptionParseUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
@@ -562,17 +563,20 @@ public class AutoCallEmptyVehicle {
|
||||
.getString("pcsn") + "'").uniqueResult(0);
|
||||
String paper_tube_or_FRP = plan_jo.getString("paper_tube_or_frp");
|
||||
String paper_name;
|
||||
String need_size;
|
||||
//todo 88549333 因为新物料描述 纸管和 frp管的尺寸位置不一致,所以之前的取数组第三位的写法就存在问题,现修改为根据不同的类型分别获取。 2026年05月19日 18:55
|
||||
if ("1".equals(paper_tube_or_FRP)) {
|
||||
paper_name = plan_jo.getString("paper_tube_description");
|
||||
need_size = MdmDescriptionParseUtils.extractPaperTubeSize(paper_name);
|
||||
} else {
|
||||
paper_name = plan_jo.getString("frp_description");
|
||||
need_size = MdmDescriptionParseUtils.extractFRPTubeSizeTrans(paper_name);
|
||||
}
|
||||
if (StrUtil.isEmpty(paper_name)) {
|
||||
//todo:提醒分切计划存在问题无法进行套轴
|
||||
return;
|
||||
}
|
||||
|
||||
String need_size = String.valueOf(paper_name.split("\\|")[2].charAt(0));
|
||||
//获取尺寸 改到上面处理
|
||||
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt")
|
||||
.query("ext_code = '" + plan_jo.getString("resource_name") + "'")
|
||||
.uniqueResult(0);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.sch.tasks;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import org.nl.b_lms.sch.tasks.slitter.util.MdmDescriptionParseUtils;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
@@ -102,10 +103,14 @@ public class PaperTubeTask extends AbstractAcsTask {
|
||||
JSONObject plan_jo = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("container_name = '" + req_param.getString("container_name1") + "' AND is_delete = '0'").uniqueResult(0);
|
||||
String paper_tube_or_FRP = plan_jo.getString("paper_tube_or_frp");
|
||||
String paper_name;
|
||||
String need_size;
|
||||
// todo 88549333 因为新物料描述 纸管和 frp管的尺寸位置不一致,所以之前的取数组第三位的写法就存在问题,现修改为根据不同的类型分别获取。 2026年05月05日 19:10
|
||||
if ("1".equals(paper_tube_or_FRP)) {
|
||||
paper_name = plan_jo.getString("paper_tube_description");
|
||||
need_size = MdmDescriptionParseUtils.extractPaperTubeSize(paper_name);
|
||||
} else {
|
||||
paper_name = plan_jo.getString("frp_description");
|
||||
need_size = MdmDescriptionParseUtils.extractFRPTubeSizeTrans(paper_name);
|
||||
}
|
||||
|
||||
if (StrUtil.isEmpty(paper_name)) {
|
||||
@@ -114,7 +119,7 @@ public class PaperTubeTask extends AbstractAcsTask {
|
||||
}
|
||||
|
||||
// mark: 此处为对分切计划的纸管规格进行拆解取值
|
||||
String need_size = String.valueOf(paper_name.split("\\|")[2].charAt(0));
|
||||
//解析值的操作在上方
|
||||
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("ext_code = '" + plan_jo.getString("resource_name") + "'").uniqueResult(0);
|
||||
|
||||
//获取分切机维护的气涨轴代数
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.sch.tasks.slitter.util.MdmDescriptionParseUtils;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.FileUtil;
|
||||
@@ -300,9 +301,11 @@ public class InBillQueryServiceImpl implements InBillQueryService {
|
||||
mp.put("实际尺寸(mm)(实际幅宽)", json.getString("width"));
|
||||
String box_name = json.getString("box_name");
|
||||
if (StrUtil.isNotEmpty(box_name)) {
|
||||
String[] s = box_name.split("木箱");
|
||||
String s1 = s[1];
|
||||
String[] split = s1.split("\\|");
|
||||
// todo 88549333 箱号规格解析 2026年5月20日16:05:45
|
||||
// String[] s = box_name.split("木箱");
|
||||
// String s1 = s[1];
|
||||
// String[] split = s1.split("\\|");
|
||||
String[] split = MdmDescriptionParseUtils.parseMxBoxDetailInfo(box_name);
|
||||
mp.put("木箱规格/尺寸", split[1] + "*" + split[2]);
|
||||
} else {
|
||||
mp.put("木箱规格/尺寸", "");
|
||||
@@ -480,9 +483,12 @@ public class InBillQueryServiceImpl implements InBillQueryService {
|
||||
mp.put("客户要求幅宽", json.getString("width_standard"));
|
||||
String box_name = json.getString("box_name");
|
||||
if (StrUtil.isNotEmpty(box_name)) {
|
||||
String[] s = box_name.split("木箱");
|
||||
String s1 = s[1];
|
||||
String[] split = s1.split("\\|");
|
||||
// todo 88549333 箱号规格解析 2026年5月20日16:05:45
|
||||
// String[] s = box_name.split("木箱");
|
||||
// String s1 = s[1];
|
||||
// String[] split = s1.split("\\|");
|
||||
// mp.put("木箱规格/尺寸", split[1] + "*" + split[2]);
|
||||
String[] split = MdmDescriptionParseUtils.parseMxBoxDetailInfo(box_name);
|
||||
mp.put("木箱规格/尺寸", split[1] + "*" + split[2]);
|
||||
} else {
|
||||
mp.put("木箱规格/尺寸", "");
|
||||
@@ -545,5 +551,4 @@ public class InBillQueryServiceImpl implements InBillQueryService {
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user