fix: 阶梯管数据
This commit is contained in:
@@ -53,7 +53,7 @@ public class SlitterTaskUtil {
|
|||||||
* 获取组成信息
|
* 获取组成信息
|
||||||
* @param tubeDescription 纸管信息
|
* @param tubeDescription 纸管信息
|
||||||
* @param paperOrFrp 材质(1纸管,2FRP管)
|
* @param paperOrFrp 材质(1纸管,2FRP管)
|
||||||
* @return 长*外径*内径*壁厚*重量*材质(1纸管,2FRP管)
|
* @return 长*外径*内径*壁厚*重量*薄壁厚*阶梯长度*材质(1纸管,2FRP管)
|
||||||
*/
|
*/
|
||||||
public static String getComposePaperTubeInformation(String tubeDescription, String paperOrFrp) {
|
public static String getComposePaperTubeInformation(String tubeDescription, String paperOrFrp) {
|
||||||
if (ObjectUtil.isEmpty(tubeDescription)) {
|
if (ObjectUtil.isEmpty(tubeDescription)) {
|
||||||
@@ -65,12 +65,13 @@ public class SlitterTaskUtil {
|
|||||||
/**
|
/**
|
||||||
* 获取组成信息
|
* 获取组成信息
|
||||||
* @param tubeDescription 纸管信息
|
* @param tubeDescription 纸管信息
|
||||||
* @return 长*外径*内径*壁厚*重量
|
* @return 长*外径*内径*壁厚*重量*薄壁厚*阶梯长度
|
||||||
*/
|
*/
|
||||||
public static String getComposePaperTubeInformation(String tubeDescription) {
|
public static String getComposePaperTubeInformation(String tubeDescription) {
|
||||||
if (ObjectUtil.isEmpty(tubeDescription)) {
|
if (ObjectUtil.isEmpty(tubeDescription)) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
boolean flag = tubeDescription.contains("阶梯");
|
||||||
tubeDescription = tubeDescription.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "");
|
tubeDescription = tubeDescription.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "");
|
||||||
// 解析描述数组
|
// 解析描述数组
|
||||||
String[] tubeArray = tubeDescription.split("\\|");
|
String[] tubeArray = tubeDescription.split("\\|");
|
||||||
@@ -79,10 +80,27 @@ public class SlitterTaskUtil {
|
|||||||
|
|
||||||
// 假设壁厚默认值为15,如果描述数组长度为4,则重新赋值
|
// 假设壁厚默认值为15,如果描述数组长度为4,则重新赋值
|
||||||
String th = tubeArray.length == 5 ? tubeArray[3] : "15";
|
String th = tubeArray.length == 5 ? tubeArray[3] : "15";
|
||||||
|
String th2 = "0";
|
||||||
|
String jtLen = "0";
|
||||||
if (tubeArray[3].contains("-")) {
|
if (tubeArray[3].contains("-")) {
|
||||||
th = tubeArray[3].split("-")[0];
|
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 externalDiameter = dia * 25.4 + Double.parseDouble(th) * 2;
|
||||||
double internalDiameter = dia * 25.4;
|
double internalDiameter = dia * 25.4;
|
||||||
@@ -103,6 +121,12 @@ public class SlitterTaskUtil {
|
|||||||
sb.append("*");
|
sb.append("*");
|
||||||
// 重量
|
// 重量
|
||||||
sb.append(0);
|
sb.append(0);
|
||||||
|
sb.append("*");
|
||||||
|
// 薄壁厚
|
||||||
|
sb.append(th2);
|
||||||
|
sb.append("*");
|
||||||
|
// 阶梯长度
|
||||||
|
sb.append(jtLen);
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -250,7 +274,7 @@ public class SlitterTaskUtil {
|
|||||||
qtys[index] += qty;
|
qtys[index] += qty;
|
||||||
} else {
|
} else {
|
||||||
material_codes[i] = vehicle.getMaterial_code();
|
material_codes[i] = vehicle.getMaterial_code();
|
||||||
String spec = getComposePaperTubeInformation(vehicle.getMaterial_name());
|
String spec = getComposePaperTubeInformation(vehicle.getMaterial_name(), vehicle.getMaterial_code().startsWith("4") ? "1" : "2");
|
||||||
material_specs[i] = spec;
|
material_specs[i] = spec;
|
||||||
qtys[i] = qty;
|
qtys[i] = qty;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user