Przeglądaj źródła

首页一级汇总

longw 1 rok temu
rodzic
commit
de82278fca

+ 28 - 18
module_kzks/src/main/java/org/jeecg/modules/Index/controller/IndexController.java

@@ -4,12 +4,8 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
-import org.jeecg.modules.Index.entity.vo.ProjectZhiChu;
 import org.jeecg.modules.Index.entity.dto.IndexInfoParamDto;
-import org.jeecg.modules.Index.entity.vo.ContractDataInfoVo;
-import org.jeecg.modules.Index.entity.vo.IncomeDataInfoVo;
 import org.jeecg.modules.Index.entity.vo.IndexChartInfoVo;
-import org.jeecg.modules.Index.entity.vo.ReceivedDataInfoVo;
 import org.jeecg.modules.Index.entity.vo.*;
 import org.jeecg.modules.Index.service.IndexService;
 import org.jeecg.modules.Index.service.IndexZcbService;
@@ -19,7 +15,7 @@ import org.springframework.web.bind.annotation.*;
 import javax.servlet.http.HttpServletRequest;
 import java.math.BigDecimal;
 
-import java.util.List;
+import java.util.*;
 
 @Api(tags = "首页")
 @RestController
@@ -32,24 +28,38 @@ public class IndexController {
     @Autowired
     private IndexZcbService indexZcbService;
 
-    @ApiOperation(value="计算合同额", notes="计算合同额")
-    @GetMapping("getTotalIncome")
-    public Result<IncomeDataInfoVo> getTotalIncome(HttpServletRequest request) {
-        IncomeDataInfoVo reslut = indexService.getTotalIncome(request);
-        return Result.ok(reslut);
+    @ApiOperation(value="首页一层汇总", notes="首页一层汇总")
+    @GetMapping("getCollect")
+    public Result<Map<String,IndexTotalVo>> getCollect(HttpServletRequest request) {
+        //合同额
+        IndexTotalVo hte = indexService.getTotalIncome(request);
+        //收款额
+        IndexTotalVo ske = indexService.getTotalReceived(request);
+        //利润额
+        IndexTotalVo lre = indexService.countLre();
+        //支出额
+        IndexTotalVo zce = indexZcbService.getZhiChuTotalList().get(0);
+
+        HashMap<String, IndexTotalVo> resultMap = new HashMap<>();
+        resultMap.put("hte",hte);
+        resultMap.put("ske",ske);
+        resultMap.put("lre",lre);
+        resultMap.put("zce",zce);
+        return Result.ok(resultMap);
     }
 
+
     @ApiOperation(value="计算合同数量", notes="计算合同数量")
     @GetMapping("getTotalContract")
-    public Result<ContractDataInfoVo> getTotalContract(HttpServletRequest request) {
-        ContractDataInfoVo reslut = indexService.getTotalContract(request);
+    public Result<IndexTotalVo> getTotalContract(HttpServletRequest request) {
+        IndexTotalVo reslut = indexService.getTotalContract(request);
         return Result.ok(reslut);
     }
 
     @ApiOperation(value="计算已收款", notes="计算已收款")
     @GetMapping("getTotalReceived")
-    public Result<ReceivedDataInfoVo> getTotalReceived(HttpServletRequest request) {
-        ReceivedDataInfoVo reslut = indexService.getTotalReceived(request);
+    public Result<IndexTotalVo> getTotalReceived(HttpServletRequest request) {
+        IndexTotalVo reslut = indexService.getTotalReceived(request);
         return Result.ok(reslut);
     }
 
@@ -62,8 +72,8 @@ public class IndexController {
 
     @ApiOperation("领导驾驶舱---支出模块")
     @GetMapping("/getZcb")
-    public List<ProjectZhiChu> getZhiChuTotalList(){
-        List<ProjectZhiChu> zhiChuTotalList = indexZcbService.getZhiChuTotalList();
+    public List<IndexTotalVo> getZhiChuTotalList(){
+        List<IndexTotalVo> zhiChuTotalList = indexZcbService.getZhiChuTotalList();
         return zhiChuTotalList;
     }
 
@@ -81,8 +91,8 @@ public class IndexController {
      */
     @ApiOperation(value="计算总利润额以及同比环比", notes="计算总利润额以及同比环比")
     @GetMapping(value = "/countLre")
-    public Result<LreDataInfoVo> countLre() {
-        return indexService.countLre();
+    public Result<IndexTotalVo> countLre() {
+        return Result.ok(indexService.countLre());
     }
 
     /**

+ 0 - 16
module_kzks/src/main/java/org/jeecg/modules/Index/entity/vo/ContractAmountVo.java

@@ -1,16 +0,0 @@
-package org.jeecg.modules.Index.entity.vo;
-
-import lombok.Data;
-
-import java.math.BigDecimal;
-
-/*首页图表合同纵轴数据*/
-@Data
-public class ContractAmountVo {
-
-    /*合同额*/
-    private BigDecimal contractAmount;
-
-    /*合同数*/
-    private Long contractTotal;
-}

+ 0 - 21
module_kzks/src/main/java/org/jeecg/modules/Index/entity/vo/ContractDataInfoVo.java

@@ -1,21 +0,0 @@
-package org.jeecg.modules.Index.entity.vo;
-
-import lombok.Data;
-
-import java.math.BigDecimal;
-
-@Data
-public class ContractDataInfoVo {
-    /*年总收入*/
-    private BigDecimal ContractYearTotal;
-    /*上年同期总收入*/
-    private BigDecimal ContractYearTq;
-    /*同比增长率*/
-    private BigDecimal ContractYearTb;
-    /*当月收入*/
-    private BigDecimal ContractMonthTotal;
-    /*当月同比*/
-    private BigDecimal ContractMonthTb;
-    /*当月环比*/
-    private BigDecimal ContractMonthHb;
-}

+ 0 - 22
module_kzks/src/main/java/org/jeecg/modules/Index/entity/vo/IncomeDataInfoVo.java

@@ -1,22 +0,0 @@
-package org.jeecg.modules.Index.entity.vo;
-
-import lombok.Data;
-
-import java.math.BigDecimal;
-
-@Data
-public class IncomeDataInfoVo {
-
-    /*年总收入*/
-    private BigDecimal IncomeYearTotal;
-    /*上年同期总收入*/
-    private BigDecimal IncomeYearTq;
-    /*同比增长率*/
-    private BigDecimal IncomeYearTb;
-    /*当月收入*/
-    private BigDecimal IncomeMonthTotal;
-    /*当月同比*/
-    private BigDecimal IncomeMonthTb;
-    /*当月环比*/
-    private BigDecimal IncomeMonthHb;
-}

+ 23 - 0
module_kzks/src/main/java/org/jeecg/modules/Index/entity/vo/IndexTotalVo.java

@@ -0,0 +1,23 @@
+package org.jeecg.modules.Index.entity.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class IndexTotalVo {
+
+    /*年总*/
+    private BigDecimal yearTotal;
+    /*上年同期总*/
+    private BigDecimal yearTq;
+    /*同比增长率*/
+    private BigDecimal yearTb;
+    /*当月收入*/
+    private BigDecimal monthTotal;
+    /*当月同比*/
+    private BigDecimal monthTb;
+    /*当月环比*/
+    private BigDecimal monthHb;
+
+}

+ 0 - 33
module_kzks/src/main/java/org/jeecg/modules/Index/entity/vo/LreDataInfoVo.java

@@ -1,33 +0,0 @@
-package org.jeecg.modules.Index.entity.vo;
-
-import lombok.Data;
-
-import java.math.BigDecimal;
-import java.util.List;
-
-/**
- * ClassName: LreDataInfoVO
- * Package: org.jeecg.modules.Index.entity
- * Description:
- *
- * @Author sl
- * @Create 2023/9/22 11:53
- * @Version 1.0
- */
-@Data
-public class LreDataInfoVo {
-    /*年总利润*/
-    private BigDecimal lreYearTotal;
-    /*上年同期总利润*/
-    private BigDecimal lreYearTq;
-    /*同比增长率*/
-    private BigDecimal lreYearTb;
-    /*当月利润*/
-    private BigDecimal lreMonthTotal;
-    /*当月同比*/
-    private BigDecimal lreMonthTb;
-    /*当月环比*/
-    private BigDecimal lreMonthHb;
-    /*某个时间段的利润*/
-    private List<BigDecimal> lreByDate;
-}

+ 0 - 38
module_kzks/src/main/java/org/jeecg/modules/Index/entity/vo/ProjectZhiChu.java

@@ -1,38 +0,0 @@
-package org.jeecg.modules.Index.entity.vo;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.annotations.ApiModel;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-
-/**
- * @author dzc
- * @date 2023/9/21 10:30
- * @package org.jeecg.modules.Index.entity
- * @project yecai_server
- * @des 领导驾驶舱支出模块实体
- */
-@Data
-@Accessors(chain = true)
-@EqualsAndHashCode(callSuper = false)
-public class ProjectZhiChu implements Serializable {
-
-    private final static long serialVersionUID = 1L;
-
-    /** 年总支出 */
-    private BigDecimal ZhiChuYearTotal;
-    /** 上年同期总支出 */
-    private BigDecimal ZhiChuYearTq;
-    /** 同比增长率 */
-    private BigDecimal ZhiChuYearTb;
-    /** 当月支出 */
-    private BigDecimal ZhiChuMonthTotal;
-    /** 当月同比 */
-    private BigDecimal ZhiChuMonthTb;
-    /** 当月环比 */
-    private BigDecimal ZhiChuMonthHb;
-}

+ 0 - 23
module_kzks/src/main/java/org/jeecg/modules/Index/entity/vo/ReceivedDataInfoVo.java

@@ -1,23 +0,0 @@
-package org.jeecg.modules.Index.entity.vo;
-
-import lombok.Data;
-
-import java.math.BigDecimal;
-
-/*首页已收款*/
-@Data
-public class ReceivedDataInfoVo {
-
-    /*年总收款*/
-    private BigDecimal ReceivedYearTotal;
-    /*上年同期总收款*/
-    private BigDecimal ReceivedYearTq;
-    /*同比增长率*/
-    private BigDecimal ReceivedYearTb;
-    /*当月收入*/
-    private BigDecimal ReceivedMonthTotal;
-    /*当月同比*/
-    private BigDecimal ReceivedMonthTb;
-    /*当月环比*/
-    private BigDecimal ReceivedMonthHb;
-}

+ 4 - 4
module_kzks/src/main/java/org/jeecg/modules/Index/service/IndexService.java

@@ -9,11 +9,11 @@ import java.math.BigDecimal;
 import java.util.List;
 
 public interface IndexService {
-    IncomeDataInfoVo getTotalIncome(HttpServletRequest request);
+    IndexTotalVo getTotalIncome(HttpServletRequest request);
 
-    ContractDataInfoVo getTotalContract(HttpServletRequest request);
+    IndexTotalVo getTotalContract(HttpServletRequest request);
 
-    ReceivedDataInfoVo getTotalReceived(HttpServletRequest request);
+    IndexTotalVo getTotalReceived(HttpServletRequest request);
 
     ContractChartInfoVo getContractAmountInfo(HttpServletRequest request, IndexInfoParamDto indexInfoParamDto);
 
@@ -43,7 +43,7 @@ public interface IndexService {
      *
      * @return
      */
-    Result<LreDataInfoVo> countLre();
+    IndexTotalVo countLre();
 
     /**
      * 首页二层:前端传送IndexInfoParamDto  有三个参数,都是string类型  time 年/月 beginDate 开始日期  endDate结束日期

+ 2 - 2
module_kzks/src/main/java/org/jeecg/modules/Index/service/IndexZcbService.java

@@ -1,7 +1,7 @@
 package org.jeecg.modules.Index.service;
 
 import org.jeecg.modules.Index.entity.vo.EightCosts;
-import org.jeecg.modules.Index.entity.vo.ProjectZhiChu;
+import org.jeecg.modules.Index.entity.vo.IndexTotalVo;
 import org.jeecg.modules.Index.entity.dto.IndexInfoParamDto;
 import org.jeecg.modules.Index.entity.vo.IndexChartInfoVo;
 
@@ -24,7 +24,7 @@ public interface IndexZcbService {
     *   des: 获取 支出相关信息(给前端的数据) 的service方法
     *   date: 2023/9/22
     */
-    public List<ProjectZhiChu> getZhiChuTotalList();
+    public List<IndexTotalVo> getZhiChuTotalList();
 
 
     /**

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

@@ -29,7 +29,7 @@ import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.time.Year;
+
 import java.util.*;
 import java.util.concurrent.CompletableFuture;
 
@@ -94,16 +94,16 @@ public class IndexServiceImpl implements IndexService {
 
     /*合同额一层*/
     @Override
-    public IncomeDataInfoVo getTotalIncome(HttpServletRequest request) {
+    public IndexTotalVo getTotalIncome(HttpServletRequest request) {
         //首页收入渲染对象
         BigDecimal initValue = BigDecimal.valueOf(0);
-        IncomeDataInfoVo incomeDataInfoVO = new IncomeDataInfoVo();
-        incomeDataInfoVO.setIncomeYearTotal(initValue);
-        incomeDataInfoVO.setIncomeYearTq(initValue);
-        incomeDataInfoVO.setIncomeYearTb(initValue);
-        incomeDataInfoVO.setIncomeMonthTotal(initValue);
-        incomeDataInfoVO.setIncomeMonthHb(initValue);
-        incomeDataInfoVO.setIncomeMonthTb(initValue);
+        IndexTotalVo incomeDataInfoVO = new IndexTotalVo();
+        incomeDataInfoVO.setYearTotal(initValue);
+        incomeDataInfoVO.setYearTq(initValue);
+        incomeDataInfoVO.setYearTb(initValue);
+        incomeDataInfoVO.setMonthTotal(initValue);
+        incomeDataInfoVO.setMonthHb(initValue);
+        incomeDataInfoVO.setMonthTb(initValue);
 
         String userNameByToken = JwtUtil.getUserNameByToken(request);
         LoginUser sysUser = sysBaseApi.getUserByName(userNameByToken);
@@ -116,7 +116,7 @@ public class IndexServiceImpl implements IndexService {
             stringBuilder.append(departName).append("|");
         }
         String depart = stringBuilder.toString();
-        IncomeDataInfoVo cacheObject = (IncomeDataInfoVo) redisUtil.get(INCOME_DATA_REDIS_KEY + depart);
+        IndexTotalVo cacheObject = (IndexTotalVo) redisUtil.get(INCOME_DATA_REDIS_KEY + depart);
         if (ObjectUtils.isNotEmpty(cacheObject)) {
             incomeDataInfoVO = cacheObject;
             return incomeDataInfoVO;
@@ -137,12 +137,12 @@ public class IndexServiceImpl implements IndexService {
         Date currentYearBeginDate = instance.getTime();
 
         List<BigDecimal> currentYearIncomeList = new ArrayList<>();
-        IncomeDataInfoVo finalIncomeDataInfoVo = incomeDataInfoVO;
+        IndexTotalVo finalIncomeDataInfoVo = incomeDataInfoVO;
         CompletableFuture.runAsync(() -> {
             //根据年份和当前部门对应的任务号查询,部门当前年的年收入
             BigDecimal currentYearTotal = exchangeMapper.getIncomeYearTotalByTasknoListAndByQsrqRange(tasknoList, currentYearBeginDate, currentYearEndDate);
             if (ObjectUtils.isEmpty(currentYearTotal)) currentYearTotal = BigDecimal.valueOf(0);
-            finalIncomeDataInfoVo.setIncomeYearTotal(currentYearTotal);
+            finalIncomeDataInfoVo.setYearTotal(currentYearTotal);
             currentYearIncomeList.add(currentYearTotal);
         }).join();
 
@@ -158,7 +158,7 @@ public class IndexServiceImpl implements IndexService {
         CompletableFuture.runAsync(() -> {
             BigDecimal lastYearTqTotal = exchangeMapper.getIncomeYearTotalByTasknoListAndByQsrqRange(tasknoList, LastYearBeginDate, LastTqEndDate);
             if (ObjectUtils.isEmpty(lastYearTqTotal)) lastYearTqTotal = BigDecimal.valueOf(0);
-            finalIncomeDataInfoVo.setIncomeYearTq(lastYearTqTotal);
+            finalIncomeDataInfoVo.setYearTq(lastYearTqTotal);
             lastYearTqIncomeList.add(lastYearTqTotal);
         }).join();
 
@@ -173,7 +173,7 @@ public class IndexServiceImpl implements IndexService {
         CompletableFuture.runAsync(() -> {
             BigDecimal currentMonthTotal = exchangeMapper.getIncomeYearTotalByTasknoListAndByQsrqRange(tasknoList, currentMothBginDate, currentMothEndDate);
             if (ObjectUtils.isEmpty(currentMonthTotal)) currentMonthTotal = BigDecimal.valueOf(0);
-            finalIncomeDataInfoVo.setIncomeMonthTotal(currentMonthTotal);
+            finalIncomeDataInfoVo.setMonthTotal(currentMonthTotal);
             currentMonthTotalList.add(currentMonthTotal);
         }).join();
 
@@ -214,7 +214,7 @@ public class IndexServiceImpl implements IndexService {
             BigDecimal incomeYearTb = BigDecimal.valueOf(1);
             if (lastYearTqTotal.compareTo(BigDecimal.valueOf(0)) != 0)
                 incomeYearTb = YearDifference.divide(lastYearTqTotal, 2, RoundingMode.HALF_UP);
-            finalIncomeDataInfoVo.setIncomeYearTb(incomeYearTb);
+            finalIncomeDataInfoVo.setYearTb(incomeYearTb);
         }).join();
 
         CompletableFuture.runAsync(() -> {
@@ -224,7 +224,7 @@ public class IndexServiceImpl implements IndexService {
             BigDecimal incomeMothHb = BigDecimal.valueOf(1);
             if (lastMothTqTotal.compareTo(BigDecimal.valueOf(0)) != 0)
                 incomeMothHb = MothDifference.divide(lastMothTqTotal, 2, RoundingMode.HALF_UP);
-            finalIncomeDataInfoVo.setIncomeMonthHb(incomeMothHb);
+            finalIncomeDataInfoVo.setMonthHb(incomeMothHb);
         }).join();
 
         CompletableFuture.runAsync(() -> {
@@ -234,7 +234,7 @@ public class IndexServiceImpl implements IndexService {
             BigDecimal incomeYearMothTb = BigDecimal.valueOf(1);
             if (lastYearMonthTqTotal.compareTo(BigDecimal.valueOf(0)) != 0)
                 incomeYearMothTb = yearMothDifference.divide(lastYearMonthTqTotal, 2, RoundingMode.HALF_UP);
-            finalIncomeDataInfoVo.setIncomeMonthTb(incomeYearMothTb);
+            finalIncomeDataInfoVo.setMonthTb(incomeYearMothTb);
         }).join();
 
         redisUtil.set(INCOME_DATA_REDIS_KEY + depart, finalIncomeDataInfoVo, 1000L * 60 * 60 * 2);
@@ -245,16 +245,16 @@ public class IndexServiceImpl implements IndexService {
 
     /*合同数量一层*/
     @Override
-    public ContractDataInfoVo getTotalContract(HttpServletRequest request) {
+    public IndexTotalVo getTotalContract(HttpServletRequest request) {
         //首页合同渲染对象
         BigDecimal initValue = BigDecimal.valueOf(0);
-        ContractDataInfoVo contractDataInfoVo = new ContractDataInfoVo();
-        contractDataInfoVo.setContractYearTotal(initValue);
-        contractDataInfoVo.setContractYearTq(initValue);
-        contractDataInfoVo.setContractYearTb(initValue);
-        contractDataInfoVo.setContractMonthTotal(initValue);
-        contractDataInfoVo.setContractMonthHb(initValue);
-        contractDataInfoVo.setContractMonthTb(initValue);
+        IndexTotalVo contractDataInfoVo = new IndexTotalVo();
+        contractDataInfoVo.setYearTotal(initValue);
+        contractDataInfoVo.setYearTq(initValue);
+        contractDataInfoVo.setYearTb(initValue);
+        contractDataInfoVo.setMonthTotal(initValue);
+        contractDataInfoVo.setMonthHb(initValue);
+        contractDataInfoVo.setMonthTb(initValue);
 
         String userNameByToken = JwtUtil.getUserNameByToken(request);
         LoginUser sysUser = sysBaseApi.getUserByName(userNameByToken);
@@ -267,7 +267,7 @@ public class IndexServiceImpl implements IndexService {
             stringBuilder.append(departName).append("|");
         }
         String depart = stringBuilder.toString();
-        ContractDataInfoVo cacheObject = (ContractDataInfoVo) redisUtil.get(CONTRACT_DATA_REDIS_KEY + depart);
+        IndexTotalVo cacheObject = (IndexTotalVo) redisUtil.get(CONTRACT_DATA_REDIS_KEY + depart);
         if (ObjectUtils.isNotEmpty(cacheObject)) {
             contractDataInfoVo = cacheObject;
             return contractDataInfoVo;
@@ -287,12 +287,12 @@ public class IndexServiceImpl implements IndexService {
         Date currentYearBeginDate = instance.getTime();
 
         List<BigDecimal> currentYearIncomeList = new ArrayList<>();
-        ContractDataInfoVo finalContractDataInfoVo = contractDataInfoVo;
+        IndexTotalVo finalContractDataInfoVo = contractDataInfoVo;
         CompletableFuture.runAsync(() -> {
             //根据年份和当前部门对应的任务号查询,部门当前年的年收入
             BigDecimal currentYearTotal = exchangeMapper.getContractNumYearTotalByTasknoListAndByQsrqRange(tasknoList, currentYearBeginDate, currentYearEndDate);
             if (ObjectUtils.isEmpty(currentYearTotal)) currentYearTotal = BigDecimal.valueOf(0);
-            finalContractDataInfoVo.setContractYearTotal(currentYearTotal);
+            finalContractDataInfoVo.setYearTotal(currentYearTotal);
             currentYearIncomeList.add(currentYearTotal);
         }).join();
 
@@ -308,7 +308,7 @@ public class IndexServiceImpl implements IndexService {
         CompletableFuture.runAsync(() -> {
             BigDecimal lastYearTqTotal = exchangeMapper.getContractNumYearTotalByTasknoListAndByQsrqRange(tasknoList, LastYearBeginDate, LastTqEndDate);
             if (ObjectUtils.isEmpty(lastYearTqTotal)) lastYearTqTotal = BigDecimal.valueOf(0);
-            finalContractDataInfoVo.setContractYearTq(lastYearTqTotal);
+            finalContractDataInfoVo.setYearTq(lastYearTqTotal);
             lastYearTqIncomeList.add(lastYearTqTotal);
         }).join();
 
@@ -322,7 +322,7 @@ public class IndexServiceImpl implements IndexService {
         CompletableFuture.runAsync(() -> {
             BigDecimal currentMonthTotal = exchangeMapper.getContractNumYearTotalByTasknoListAndByQsrqRange(tasknoList, currentMothBginDate, currentMothEndDate);
             if (ObjectUtils.isEmpty(currentMonthTotal)) currentMonthTotal = BigDecimal.valueOf(0);
-            finalContractDataInfoVo.setContractMonthTotal(currentMonthTotal);
+            finalContractDataInfoVo.setMonthTotal(currentMonthTotal);
             currentMonthTotalList.add(currentMonthTotal);
         }).join();
 
@@ -362,7 +362,7 @@ public class IndexServiceImpl implements IndexService {
             BigDecimal contractYearTb = BigDecimal.valueOf(1);
             if (lastYearTqTotal.compareTo(BigDecimal.valueOf(0)) != 0)
                 contractYearTb = YearDifference.divide(lastYearTqTotal, 2, RoundingMode.HALF_UP);
-            finalContractDataInfoVo.setContractYearTb(contractYearTb);
+            finalContractDataInfoVo.setYearTb(contractYearTb);
         }).join();
 
         CompletableFuture.runAsync(() -> {
@@ -372,7 +372,7 @@ public class IndexServiceImpl implements IndexService {
             BigDecimal contractMothHb = BigDecimal.valueOf(1);
             if (lastMothTqTotal.compareTo(BigDecimal.valueOf(0)) != 0)
                 contractMothHb = MothDifference.divide(lastMothTqTotal, 2, RoundingMode.HALF_UP);
-            finalContractDataInfoVo.setContractMonthHb(contractMothHb);
+            finalContractDataInfoVo.setMonthHb(contractMothHb);
         }).join();
 
         CompletableFuture.runAsync(() -> {
@@ -382,7 +382,7 @@ public class IndexServiceImpl implements IndexService {
             BigDecimal contractYearMothTb = BigDecimal.valueOf(1);
             if (lastYearMonthTqTotal.compareTo(BigDecimal.valueOf(0)) != 0)
                 contractYearMothTb = yearMothDifference.divide(lastYearMonthTqTotal, 2, RoundingMode.HALF_UP);
-            finalContractDataInfoVo.setContractMonthTb(contractYearMothTb);
+            finalContractDataInfoVo.setMonthTb(contractYearMothTb);
         }).join();
 
         redisUtil.set(CONTRACT_DATA_REDIS_KEY + depart, finalContractDataInfoVo, 1000L * 60 * 60 * 2);
@@ -392,17 +392,17 @@ public class IndexServiceImpl implements IndexService {
     }
 
 
-    /*已收款*/
+    /*已收款一层*/
     @Override
-    public ReceivedDataInfoVo getTotalReceived(HttpServletRequest request) {
+    public IndexTotalVo getTotalReceived(HttpServletRequest request) {
         BigDecimal initValue = BigDecimal.valueOf(0);
-        ReceivedDataInfoVo receivedDataInfoVo = new ReceivedDataInfoVo();
-        receivedDataInfoVo.setReceivedYearTotal(initValue);
-        receivedDataInfoVo.setReceivedYearTq(initValue);
-        receivedDataInfoVo.setReceivedYearTb(initValue);
-        receivedDataInfoVo.setReceivedMonthTotal(initValue);
-        receivedDataInfoVo.setReceivedMonthHb(initValue);
-        receivedDataInfoVo.setReceivedMonthTb(initValue);
+        IndexTotalVo receivedDataInfoVo = new IndexTotalVo();
+        receivedDataInfoVo.setYearTotal(initValue);
+        receivedDataInfoVo.setYearTq(initValue);
+        receivedDataInfoVo.setYearTb(initValue);
+        receivedDataInfoVo.setMonthTotal(initValue);
+        receivedDataInfoVo.setMonthHb(initValue);
+        receivedDataInfoVo.setMonthTb(initValue);
 
         String userNameByToken = JwtUtil.getUserNameByToken(request);
         LoginUser sysUser = sysBaseApi.getUserByName(userNameByToken);
@@ -415,7 +415,7 @@ public class IndexServiceImpl implements IndexService {
             stringBuilder.append(departName).append("|");
         }
         String depart = stringBuilder.toString();
-        ReceivedDataInfoVo cacheObject = (ReceivedDataInfoVo) redisUtil.get(RECEIVED_DATA_REDIS_KEY + depart);
+        IndexTotalVo cacheObject = (IndexTotalVo) redisUtil.get(RECEIVED_DATA_REDIS_KEY + depart);
         if (ObjectUtils.isNotEmpty(cacheObject)) {
             receivedDataInfoVo = cacheObject;
             return receivedDataInfoVo;
@@ -436,12 +436,12 @@ public class IndexServiceImpl implements IndexService {
         Date currentYearBeginDate = instance.getTime();
 
         List<BigDecimal> currentYearIncomeList = new ArrayList<>();
-        ReceivedDataInfoVo finalIncomeDataInfoVo = receivedDataInfoVo;
+        IndexTotalVo finalIncomeDataInfoVo = receivedDataInfoVo;
         CompletableFuture.runAsync(() -> {
             //根据年份和当前部门对应的任务号查询,部门当前年的年收入
             BigDecimal currentYearTotal = exchangeMapper.getReceivedYearTotalByTasknoListAndByQsrqRange(tasknoList, currentYearBeginDate, currentYearEndDate);
             if (ObjectUtils.isEmpty(currentYearTotal)) currentYearTotal = BigDecimal.valueOf(0);
-            finalIncomeDataInfoVo.setReceivedYearTotal(currentYearTotal);
+            finalIncomeDataInfoVo.setYearTotal(currentYearTotal);
             currentYearIncomeList.add(currentYearTotal);
         }).join();
 
@@ -457,7 +457,7 @@ public class IndexServiceImpl implements IndexService {
         CompletableFuture.runAsync(() -> {
             BigDecimal lastYearTqTotal = exchangeMapper.getReceivedYearTotalByTasknoListAndByQsrqRange(tasknoList, LastYearBeginDate, LastTqEndDate);
             if (ObjectUtils.isEmpty(lastYearTqTotal)) lastYearTqTotal = BigDecimal.valueOf(0);
-            finalIncomeDataInfoVo.setReceivedYearTq(lastYearTqTotal);
+            finalIncomeDataInfoVo.setYearTq(lastYearTqTotal);
             lastYearTqIncomeList.add(lastYearTqTotal);
         }).join();
 
@@ -472,7 +472,7 @@ public class IndexServiceImpl implements IndexService {
         CompletableFuture.runAsync(() -> {
             BigDecimal currentMonthTotal = exchangeMapper.getReceivedYearTotalByTasknoListAndByQsrqRange(tasknoList, currentMothBginDate, currentMothEndDate);
             if (ObjectUtils.isEmpty(currentMonthTotal)) currentMonthTotal = BigDecimal.valueOf(0);
-            finalIncomeDataInfoVo.setReceivedMonthTotal(currentMonthTotal);
+            finalIncomeDataInfoVo.setMonthTotal(currentMonthTotal);
             currentMonthTotalList.add(currentMonthTotal);
         }).join();
 
@@ -513,7 +513,7 @@ public class IndexServiceImpl implements IndexService {
             BigDecimal incomeYearTb = BigDecimal.valueOf(1);
             if (lastYearTqTotal.compareTo(BigDecimal.valueOf(0)) != 0)
                 incomeYearTb = YearDifference.divide(lastYearTqTotal, 2, RoundingMode.HALF_UP);
-            finalIncomeDataInfoVo.setReceivedYearTb(incomeYearTb);
+            finalIncomeDataInfoVo.setYearTb(incomeYearTb);
         }).join();
 
         CompletableFuture.runAsync(() -> {
@@ -523,7 +523,7 @@ public class IndexServiceImpl implements IndexService {
             BigDecimal incomeMothHb = BigDecimal.valueOf(1);
             if (lastMothTqTotal.compareTo(BigDecimal.valueOf(0)) != 0)
                 incomeMothHb = MothDifference.divide(lastMothTqTotal, 2, RoundingMode.HALF_UP);
-            finalIncomeDataInfoVo.setReceivedMonthHb(incomeMothHb);
+            finalIncomeDataInfoVo.setMonthHb(incomeMothHb);
         }).join();
 
         CompletableFuture.runAsync(() -> {
@@ -533,7 +533,7 @@ public class IndexServiceImpl implements IndexService {
             BigDecimal incomeYearMothTb = BigDecimal.valueOf(1);
             if (lastYearMonthTqTotal.compareTo(BigDecimal.valueOf(0)) != 0)
                 incomeYearMothTb = yearMothDifference.divide(lastYearMonthTqTotal, 2, RoundingMode.HALF_UP);
-            finalIncomeDataInfoVo.setReceivedMonthTb(incomeYearMothTb);
+            finalIncomeDataInfoVo.setMonthTb(incomeYearMothTb);
         }).join();
 
         redisUtil.set(RECEIVED_DATA_REDIS_KEY + depart, finalIncomeDataInfoVo, 1000L * 60 * 60 * 2);
@@ -633,7 +633,7 @@ public class IndexServiceImpl implements IndexService {
         tasknoList.addAll(XdbmTasknoList);
         if (tasknoList.isEmpty()) return resVo;
 
-        List<ContractAmount> contractAmountList = null;
+        List<ContractAmount> contractAmountList;
         if (YEAR.equals(Time)) {
             contractAmountList = exchangeMapper.getContractAmountandNumByYear(tasknoList, beginDate, endDate);
         }else {
@@ -902,15 +902,15 @@ public class IndexServiceImpl implements IndexService {
      *
      * @return
      */
-    public Result<LreDataInfoVo> countLre() {
+    public IndexTotalVo countLre() {
         BigDecimal initValue = BigDecimal.valueOf(0);
-        LreDataInfoVo lreDataInfoVO = new LreDataInfoVo();
-        lreDataInfoVO.setLreYearTotal(initValue);
-        lreDataInfoVO.setLreYearTq(initValue);
-        lreDataInfoVO.setLreYearTb(initValue);
-        lreDataInfoVO.setLreMonthTotal(initValue);
-        lreDataInfoVO.setLreMonthTb(initValue);
-        lreDataInfoVO.setLreMonthHb(initValue);
+        IndexTotalVo lreDataInfoVo = new IndexTotalVo();
+        lreDataInfoVo.setYearTotal(initValue);
+        lreDataInfoVo.setYearTq(initValue);
+        lreDataInfoVo.setYearTb(initValue);
+        lreDataInfoVo.setMonthTotal(initValue);
+        lreDataInfoVo.setMonthTb(initValue);
+        lreDataInfoVo.setMonthHb(initValue);
 
         BigDecimal eValue = new BigDecimal("1");
 
@@ -923,7 +923,7 @@ public class IndexServiceImpl implements IndexService {
         BigDecimal sumLreYear = countLre(taskNoListNew);
         System.out.println("当年的利润额为:");
         System.out.println(sumLreYear);
-        lreDataInfoVO.setLreYearTotal(sumLreYear);
+        lreDataInfoVo.setYearTotal(sumLreYear);
         System.out.println("----------------------------------------------------");
 
         //2.计算上一年的总利润额
@@ -933,18 +933,18 @@ public class IndexServiceImpl implements IndexService {
         BigDecimal sumLreLastYear = countLre(taskNoListNew2);
         System.out.println("上一年的利润额为:");
         System.out.println(sumLreLastYear);
-        lreDataInfoVO.setLreYearTq(sumLreLastYear);
+        lreDataInfoVo.setYearTq(sumLreLastYear);
         System.out.println("----------------------------------------------------");
 
         //2.计算年同比增长率
         try {
             BigDecimal tbGrowthYear = ((sumLreYear.subtract(sumLreLastYear)).divide(sumLreLastYear, 2, RoundingMode.HALF_UP));
-            lreDataInfoVO.setLreYearTb(tbGrowthYear);
+            lreDataInfoVo.setYearTb(tbGrowthYear);
             System.out.println("年利润同比增长率为:");
             System.out.println(tbGrowthYear);
             System.out.println("----------------------------------------------------");
         } catch (Exception e) {
-            lreDataInfoVO.setLreYearTb(eValue);
+            lreDataInfoVo.setYearTb(eValue);
         }
 
         //2.计算当月的总利润额
@@ -954,7 +954,7 @@ public class IndexServiceImpl implements IndexService {
         BigDecimal sumLreCurrMonth = countLre(taskNoListNew3);
         System.out.println("当月的利润额为:");
         System.out.println(sumLreCurrMonth);
-        lreDataInfoVO.setLreMonthTotal(sumLreCurrMonth);
+        lreDataInfoVo.setMonthTotal(sumLreCurrMonth);
         System.out.println("----------------------------------------------------");
 
         //2.计算上个月的总利润额
@@ -969,12 +969,12 @@ public class IndexServiceImpl implements IndexService {
         //2.计算月环比增长率
         try {
             BigDecimal hbGrowthMonth = ((sumLreCurrMonth.subtract(sumLreLastMonth)).divide(sumLreLastMonth, 2, RoundingMode.HALF_UP));
-            lreDataInfoVO.setLreMonthHb(hbGrowthMonth);
+            lreDataInfoVo.setMonthHb(hbGrowthMonth);
             System.out.println("月环比为:");
             System.out.println(hbGrowthMonth);
             System.out.println("----------------------------------------------------");
         } catch (Exception e) {
-            lreDataInfoVO.setLreMonthHb(eValue);
+            lreDataInfoVo.setMonthHb(eValue);
         }
 
         //2.计算去年同期月份的总利润额
@@ -989,14 +989,14 @@ public class IndexServiceImpl implements IndexService {
         //2.计算月同比增长率
         try {
             BigDecimal tbGrowthMonth = ((sumLreCurrMonth.subtract(sumLreTqMonth)).divide(sumLreTqMonth, 2, RoundingMode.HALF_UP));
-            lreDataInfoVO.setLreMonthTb(tbGrowthMonth);
+            lreDataInfoVo.setMonthTb(tbGrowthMonth);
             System.out.println("月同比为:");
             System.out.println(tbGrowthMonth);
             System.out.println("----------------------------------------------------");
         } catch (Exception e) {
-            lreDataInfoVO.setLreMonthTb(eValue);
+            lreDataInfoVo.setMonthTb(eValue);
         }
-        return Result.OK(lreDataInfoVO);
+        return lreDataInfoVo;
     }
 
     /**

+ 10 - 10
module_kzks/src/main/java/org/jeecg/modules/Index/service/impl/IndexZcbServiceImpl.java

@@ -6,7 +6,7 @@ import org.apache.shiro.subject.Subject;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.modules.Index.entity.vo.EightCosts;
-import org.jeecg.modules.Index.entity.vo.ProjectZhiChu;
+import org.jeecg.modules.Index.entity.vo.IndexTotalVo;
 import org.jeecg.modules.Index.entity.dto.IndexInfoParamDto;
 import org.jeecg.modules.Index.entity.vo.IndexChartInfoVo;
 import org.jeecg.modules.Index.mapper.IndexZcbMapper;
@@ -50,15 +50,15 @@ public class IndexZcbServiceImpl implements IndexZcbService {
      *   date: 2023/9/22
      */
     @Override
-    public List<ProjectZhiChu> getZhiChuTotalList() {
+    public List<IndexTotalVo> getZhiChuTotalList() {
 
         /**
          * todo : (未做)需要剔除掉 redis缓存中存储的 组批任务的相关金额,查询出组批任务的任务号的list集合 在sql上用not in来实现
          * */
 
         //redisTemplate.opsForList().range("getZuPiList",0,-1);
-        ArrayList<ProjectZhiChu> projectZhiChusList = new ArrayList<>();
-        ProjectZhiChu projectZhiChu = new ProjectZhiChu();
+        ArrayList<IndexTotalVo> projectZhiChusList = new ArrayList<>();
+        IndexTotalVo projectZhiChu = new IndexTotalVo();
         //获取当前登录的用户名,根据用户名查询对应的部门
         Subject subject = SecurityUtils.getSubject();
         LoginUser loginUser = (LoginUser)subject.getPrincipal();
@@ -202,12 +202,12 @@ public class IndexZcbServiceImpl implements IndexZcbService {
         }
 
 
-        projectZhiChu.setZhiChuYearTotal(sumZcb);//当年总收入
-        projectZhiChu.setZhiChuYearTq(sumZcbTq); //去年同期
-        projectZhiChu.setZhiChuMonthTotal(sumZcbMonth); //当月支出
-        projectZhiChu.setZhiChuMonthTb(zcbMonthTb); //当月同比
-        projectZhiChu.setZhiChuMonthHb(zcbMonthHb); //当月环比
-        projectZhiChu.setZhiChuYearTb(zcbYearTb); //同比增长率
+        projectZhiChu.setYearTotal(sumZcb);//当年总收入
+        projectZhiChu.setYearTq(sumZcbTq); //去年同期
+        projectZhiChu.setMonthTotal(sumZcbMonth); //当月支出
+        projectZhiChu.setMonthTb(zcbMonthTb); //当月同比
+        projectZhiChu.setMonthHb(zcbMonthHb); //当月环比
+        projectZhiChu.setYearTb(zcbYearTb); //同比增长率
         projectZhiChusList.add(projectZhiChu);
         return projectZhiChusList;
     }