瀏覽代碼

修改费用精度问题;修改时间戳存储为字符串的问题

lixing 3 年之前
父節點
當前提交
73576de82f

+ 4 - 2
src/main/java/com/persagy/apm/energy/report/monthly/detail/business/model/Job.java

@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.Date;
+
 /**
  * @author lixing
  * @version V1.0 2021/5/17 3:15 下午
@@ -16,10 +18,10 @@ public class Job {
     private String item;
 
     @ApiModelProperty("起始日期")
-    private String startDate;
+    private Date startDate;
 
     @ApiModelProperty("完成日期")
-    private String endDate;
+    private Date endDate;
 
     @ApiModelProperty("总体进展")
     private String totalProgress;

+ 11 - 4
src/main/java/com/persagy/apm/energy/report/monthly/outline/service/impl/BusinessReportCostInfoServiceImpl.java

@@ -144,20 +144,23 @@ public class BusinessReportCostInfoServiceImpl implements IBusinessReportCostInf
     public CostItemVO getCostItemInfo(
             Date reportMonth, ReportProjectVO reportProjectInfo,
             Double totalCommercialArea, String functionId) {
+        // 费用展示为万元,定义一万元变量
+        Double tenThousand = 10000d;
         String projectId = reportProjectInfo.getProjectId();
         CostItemVO costItemVO = new CostItemVO();
         String currentMonthStr = functionValueService.getFunctionValue(functionId, reportMonth, projectId);
         Double currentMonth = null;
+
         if (StringUtils.isNotBlank(currentMonthStr)) {
             currentMonth = Double.valueOf(currentMonthStr);
-            costItemVO.setCurrentMonth(currentMonth);
+            costItemVO.setCurrentMonth(DataUtils.doubleDivide(currentMonth, tenThousand));
         }
         String lastMonthStr = functionValueService.getFunctionValue(
                 functionId, DateUtils.getFirstDayOfLastMonth(reportMonth), projectId);
         Double lastMonth = null;
         if (StringUtils.isNotBlank(lastMonthStr)) {
             lastMonth = Double.valueOf(lastMonthStr);
-            costItemVO.setLastMonth(lastMonth);
+            costItemVO.setLastMonth(DataUtils.doubleDivide(lastMonth, tenThousand));
         }
 
         // 统计去年同期的费用
@@ -178,7 +181,9 @@ public class BusinessReportCostInfoServiceImpl implements IBusinessReportCostInf
         CostItemVO lastYearSumItem = getCostSum(lastYearItems);
         if (lastYearSumItem != null) {
             lastYearCount = lastYearSumItem.getLastYearCount();
-            costItemVO.setLastYearCount(lastYearCount);
+            if (lastYearCount != null) {
+                costItemVO.setLastYearCount(DataUtils.doubleDivide(lastYearCount, tenThousand));
+            }
             if (totalCommercialArea != null && !totalCommercialArea.equals(zero) && lastYearCount != null) {
                 costItemVO.setLastYearPerCount(DataUtils.doubleDivide(lastYearCount, totalCommercialArea));
             }
@@ -202,7 +207,9 @@ public class BusinessReportCostInfoServiceImpl implements IBusinessReportCostInf
         CostItemVO yearSumItem = getCostSum(yearItems);
         if (yearSumItem != null) {
             yearCount = yearSumItem.getYearCount();
-            costItemVO.setYearCount(yearCount);
+            if (yearCount != null) {
+                costItemVO.setYearCount(DataUtils.doubleDivide(yearCount, tenThousand));
+            }
             if (totalCommercialArea != null && !totalCommercialArea.equals(zero) && yearCount != null) {
                 costItemVO.setYearPerCount(DataUtils.doubleDivide(yearCount, totalCommercialArea));
             }