webcad拆单板材库长宽可空处理

This commit is contained in:
gaoqr
2025-05-26 16:48:26 +08:00
parent 48d7cae31d
commit 7b957b929b
2 changed files with 14 additions and 4 deletions
@@ -446,8 +446,8 @@ public class WebCadOrderImportAsyncFactory {
.texture(materialReqVO.getTexture()) .texture(materialReqVO.getTexture())
.color(materialReqVO.getColor()) .color(materialReqVO.getColor())
.colorBlack(EMPTY_STRING) .colorBlack(EMPTY_STRING)
.width(BigDecimal.valueOf(materialReqVO.getWidth())) .width(BigDecimal.valueOf(getZeroDouble(materialReqVO.getWidth())))
.height(BigDecimal.valueOf(materialReqVO.getHeight())) .height(BigDecimal.valueOf(getZeroDouble(materialReqVO.getHeight())))
.thickness(BigDecimal.valueOf(materialReqVO.getThickness())) .thickness(BigDecimal.valueOf(materialReqVO.getThickness()))
.spec(materialReqVO.getSpec()) .spec(materialReqVO.getSpec())
.brand(materialReqVO.getBrand()) .brand(materialReqVO.getBrand())
@@ -1689,6 +1689,16 @@ public class WebCadOrderImportAsyncFactory {
return StringUtils.defaultIfEmpty(value, EMPTY_STRING); return StringUtils.defaultIfEmpty(value, EMPTY_STRING);
} }
/**
* value为空返回0.0
*
* @param value
* @return
*/
private double getZeroDouble(Double value) {
return ObjectUtil.defaultIfNull(value, 0.0);
}
/** /**
* value为空返回false * value为空返回false
* *
@@ -382,8 +382,8 @@ public class WebCadOrderImportFactory {
.texture(materialReqVO.getTexture()) .texture(materialReqVO.getTexture())
.color(materialReqVO.getColor()) .color(materialReqVO.getColor())
.colorBlack(EMPTY_STRING) .colorBlack(EMPTY_STRING)
.width(BigDecimal.valueOf(materialReqVO.getWidth())) .width(BigDecimal.valueOf(getZeroDouble(materialReqVO.getWidth())))
.height(BigDecimal.valueOf(materialReqVO.getHeight())) .height(BigDecimal.valueOf(getZeroDouble(materialReqVO.getHeight())))
.thickness(BigDecimal.valueOf(materialReqVO.getThickness())) .thickness(BigDecimal.valueOf(materialReqVO.getThickness()))
.spec(materialReqVO.getSpec()) .spec(materialReqVO.getSpec())
.brand(materialReqVO.getBrand()) .brand(materialReqVO.getBrand())