|
@@ -1,6 +1,7 @@
|
|
|
package com.malk.mc.service.impl;
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
+import cn.hutool.core.util.NumberUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.malk.core.McProject;
|
|
|
import com.malk.mc.service.McYdService;
|
|
@@ -165,7 +166,7 @@ public class McYdServiceImpl implements McYdService {
|
|
|
String[] numberFieldCodes=numberFieldCode.split(",");
|
|
|
String[] textFieldCodes=textFieldCode.split(",");
|
|
|
for (int i = 0; i < numberFieldCodes.length; i++) {
|
|
|
- BigDecimal number = (BigDecimal) item.get(numberFieldCodes[i]);
|
|
|
+ BigDecimal number = NumberUtil.toBigDecimal(UtilMap.getNumberStr(item,numberFieldCodes[i]));
|
|
|
// 创建一个 DecimalFormat 实例,指定千位分隔符模式
|
|
|
DecimalFormat df = new DecimalFormat("#,###.00");
|
|
|
|
|
@@ -180,7 +181,7 @@ public class McYdServiceImpl implements McYdService {
|
|
|
String[] mainNumKeys=UtilMap.getString(map,"mainNumKeys").split(",");
|
|
|
String[] mainTextKeys=UtilMap.getString(map,"mainTextKeys").split(",");
|
|
|
for (int i = 0; i < mainNumKeys.length; i++) {
|
|
|
- BigDecimal number = (BigDecimal) formData.get(mainNumKeys[i]);
|
|
|
+ BigDecimal number = NumberUtil.toBigDecimal(UtilMap.getNumberStr(formData,(mainNumKeys[i])));
|
|
|
// 创建一个 DecimalFormat 实例,指定千位分隔符模式
|
|
|
DecimalFormat df = new DecimalFormat("#,###.00");
|
|
|
// 格式化 double 数值
|
|
@@ -202,4 +203,5 @@ public class McYdServiceImpl implements McYdService {
|
|
|
private String getString(Object obj){
|
|
|
return obj == null ? "" : obj.toString();
|
|
|
}
|
|
|
+
|
|
|
}
|