新增webcad生产单导入:cad拆单封边条宽度对应适配double类型

This commit is contained in:
gaoqr
2025-03-27 16:51:45 +08:00
parent da4e3e0b9c
commit 79d67c0091
@@ -1157,7 +1157,7 @@ public class WebCadOrderImportFactory {
private void sealEdgeWidthMatch(WebCadDataPartsReqVO.BlockObjectListDTO part) {
// 从spec中解析宽度、厚度
String spec = part.getSpec();
Integer widthFromSpec = getWidthFromSpec(spec);
Double widthFromSpec = getWidthFromSpec(spec);
part.setThickness(getThicknessFromSpec(spec));
if (ObjectUtil.isNull(widthFromSpec)) {
return;
@@ -1174,14 +1174,14 @@ public class WebCadOrderImportFactory {
/**
* 从规格中获取宽度,例:1mm-18mm
*/
private Integer getWidthFromSpec(String spec) {
private Double getWidthFromSpec(String spec) {
if (StringUtils.isNotEmpty(spec)) {
String[] specSplit = spec.split("-");
if (specSplit.length >= 2) {
String widthInSpec = specSplit[1];
String[] widthSplit = widthInSpec.split("mm");
if (widthSplit.length == 1) {
return Integer.parseInt(widthSplit[0]);
return NumberUtil.parseDouble(widthSplit[0]);
}
}
}