|
|
|
@ -59,6 +59,7 @@ import org.springframework.util.StringUtils; |
|
|
|
|
|
|
|
import javax.naming.NamingException; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.text.DecimalFormat; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
@ -2233,10 +2234,17 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification |
|
|
|
String recordType = "TL"; |
|
|
|
PartSubPropertiesValueData valueData = technicalSpecificationMapper.getToolPropertiesValue(data.getSite(), tool.getToolId(), recordType, dictData.getDictValue()); |
|
|
|
if (valueData != null) { |
|
|
|
String numberStr = ""; |
|
|
|
if (valueData.getNumValue() != null) { |
|
|
|
// 使用 DecimalFormat 去掉小数点后无意义的0 |
|
|
|
numberStr = new DecimalFormat("0.#").format(valueData.getNumValue()); |
|
|
|
} else if (valueData.getTextValue() != null) { |
|
|
|
numberStr = valueData.getTextValue(); |
|
|
|
} |
|
|
|
if ("number_across".equals(dictData.getDictLabel())) { |
|
|
|
tool.setNumberAcross(valueData.getNumValue() != null ? valueData.getNumValue().toString() : valueData.getTextValue() != null ? valueData.getTextValue() : ""); |
|
|
|
tool.setNumberAcross(numberStr); |
|
|
|
} else if ("number_down".equals(dictData.getDictLabel())) { |
|
|
|
tool.setNumberDown(valueData.getNumValue() != null ? valueData.getNumValue().toString() : valueData.getTextValue() != null ? valueData.getTextValue() : ""); |
|
|
|
tool.setNumberDown(numberStr); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|