1 year ago
parent
commit
5aa6876988

+ 6 - 1
platform-common/src/main/java/com/platform/common/util/BigDecimalUtil.java

@@ -15,6 +15,11 @@ import java.text.DecimalFormat;
  */
 public class BigDecimalUtil {
 
+    public static double formatDouble4(double d){
+        DecimalFormat df = new DecimalFormat("#.00");
+        return Double.valueOf(df.format(d));
+    }
+
     /**
      * 默认精确的小数位
      */
@@ -337,4 +342,4 @@ public class BigDecimalUtil {
         DecimalFormat decimalFormat = new DecimalFormat(format);
         return decimalFormat.format(bigDecimal);
     }
-}
+}

+ 2 - 0
platform-rest/src/main/java/com/platform/rest/controller/repair/RepairFeeController.java

@@ -1,5 +1,6 @@
 package com.platform.rest.controller.repair;
 
+import com.platform.common.util.BigDecimalUtil;
 import com.platform.common.util.R;
 import com.platform.dao.dto.repair.RepairFeeDTO;
 import com.platform.dao.entity.repair.RepairFee;
@@ -167,6 +168,7 @@ public class RepairFeeController {
   @PreAuthorize("@pms.hasPermission('repair-fees-export')")
   public void exportSbsRepairFee(HttpServletResponse response,@RequestParam("sbIds") List<String> sbIds) {
     List<ExportRepairSumFeeVO> list = repairFeeService.getSbsRepairFee(sbIds);
+    list.forEach((s)->s.setFee(BigDecimalUtil.formatDouble4(s.getFee())));
     ExcelUtil.exportResponseDict(response, ExportRepairSumFeeVO.class, list, "历史费用单统计");
   }