Browse Source

index首页部门收入(修正)

longw 1 year ago
parent
commit
0563519add

+ 3 - 8
module_kzks/src/main/java/org/jeecg/modules/Index/service/impl/IndexServiceImpl.java

@@ -6,7 +6,6 @@ import org.jeecg.common.system.util.JwtUtil;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.RedisUtil;
 import org.jeecg.modules.Index.entity.IncomeDataInfoVO;
-import org.jeecg.modules.Index.mapper.IndexMapper;
 import org.jeecg.modules.Index.service.IndexService;
 import org.jeecg.modules.projectCost.mapper.ProjectCostMapper;
 import org.jeecg.modules.system.mapper.SysDepartMapper;
@@ -17,7 +16,6 @@ import org.springframework.stereotype.Service;
 import javax.servlet.http.HttpServletRequest;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
-import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.concurrent.CompletableFuture;
 
@@ -25,9 +23,6 @@ import java.util.concurrent.CompletableFuture;
 public class IndexServiceImpl implements IndexService {
 
     @Autowired
-    private IndexMapper indexMapper;
-
-    @Autowired
     private ISysBaseAPI sysBaseApi;
 
     @Autowired
@@ -162,7 +157,7 @@ public class IndexServiceImpl implements IndexService {
             BigDecimal lastYearTqTotal = lastYearTqIncomeList.get(0);
             //去年同比
             BigDecimal YearDifference = currentYearTotal.subtract(lastYearTqTotal);
-            BigDecimal incomeYearTb = BigDecimal.valueOf(0);
+            BigDecimal incomeYearTb = BigDecimal.valueOf(1);
             if (lastYearTqTotal.compareTo(BigDecimal.valueOf(0)) != 0)
                 incomeYearTb = YearDifference.divide(lastYearTqTotal, 2, RoundingMode.HALF_UP);
             finalIncomeDataInfoVO.setIncomeYearTb(incomeYearTb);
@@ -172,7 +167,7 @@ public class IndexServiceImpl implements IndexService {
             BigDecimal currentMonthTotal = currentMonthTotalList.get(0);
             BigDecimal lastMothTqTotal = lastMothTqTotalList.get(0);
             BigDecimal MothDifference = currentMonthTotal.subtract(lastMothTqTotal);
-            BigDecimal incomeMothHb = BigDecimal.valueOf(0);
+            BigDecimal incomeMothHb = BigDecimal.valueOf(1);
             if (lastMothTqTotal.compareTo(BigDecimal.valueOf(0)) != 0)
                 incomeMothHb = MothDifference.divide(lastMothTqTotal, 2, RoundingMode.HALF_UP);
             finalIncomeDataInfoVO.setIncomeMonthHb(incomeMothHb);
@@ -182,7 +177,7 @@ public class IndexServiceImpl implements IndexService {
             BigDecimal currentMonthTotal = currentMonthTotalList.get(0);
             BigDecimal lastYearMonthTqTotal = lastYearMonthTqTotalList.get(0);
             BigDecimal yearMothDifference = currentMonthTotal.subtract(lastYearMonthTqTotal);
-            BigDecimal incomeYearMothTb = BigDecimal.valueOf(0);
+            BigDecimal incomeYearMothTb = BigDecimal.valueOf(1);
             if (lastYearMonthTqTotal.compareTo(BigDecimal.valueOf(0)) != 0)
                 incomeYearMothTb = yearMothDifference.divide(lastYearMonthTqTotal, 2, RoundingMode.HALF_UP);
             finalIncomeDataInfoVO.setIncomeMonthTb(incomeYearMothTb);