Procházet zdrojové kódy

首页一层当月合同额、收款额明细添加分页

sl před 1 rokem
rodič
revize
87385ee289

+ 17 - 6
module_kzks/src/main/java/org/jeecg/modules/Index/controller/IndexController.java

@@ -1,11 +1,15 @@
 package org.jeecg.modules.Index.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.ObjectUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.api.ISysBaseAPI;
+import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.util.JwtUtil;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.modules.Index.entity.dto.IndexInfoParamDto;
@@ -19,6 +23,7 @@ import org.jeecg.modules.Index.service.IndexService;
 import org.jeecg.modules.Index.service.IndexZcbService;
 import org.jeecg.modules.Index.util.AuthMark;
 import org.jeecg.modules.Index.util.CommonMethod;
+import org.jeecg.modules.costModelClPrice.entity.KzksCostModelClPrice;
 import org.jeecg.modules.dataSourceSwitch.annotation.TargetDataSource;
 import org.jeecg.modules.xmcbDetail.entity.ComContractInfoExchange;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -98,16 +103,22 @@ public class IndexController {
     @ApiOperation(value = "首页一层当月合同额明细", notes = "首页一层当月合同额明细")
     @PostMapping("getDetailIncome")
     @TargetDataSource
-    public Result<List<ComContractInfoExchange>> getDetailIncome(@RequestBody(required = false) List<String> departNameList, HttpServletRequest request){
-        List<ComContractInfoExchange> comContractInfoExchangeList = indexService.getDetailIncome(request, departNameList);
-        return Result.OK(comContractInfoExchangeList);
+    public Result<IPage<ComContractInfoExchange>> getDetailIncome(@RequestBody(required = false) List<String> departNameList, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+                                                                 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, HttpServletRequest request){
+        Page<ComContractInfoExchange> page = new Page<ComContractInfoExchange>(pageNo, pageSize);
+        List<ComContractInfoExchange> pageList = indexService.getDetailIncome(page, request, departNameList);
+        page.setRecords(pageList);
+        return Result.OK(page);
     }
     @ApiOperation(value = "首页一层当月收款额明细", notes = "首页一层当月收款额明细")
     @PostMapping("getDetailReceived")
     @TargetDataSource
-    public Result<List<ComContractInfoExchange>> getDetailReceived(@RequestBody(required = false) List<String> departNameList, HttpServletRequest request){
-        List<ComContractInfoExchange> comContractInfoExchangeList = indexService.getDetailReceived(request, departNameList);
-        return Result.OK(comContractInfoExchangeList);
+    public Result<IPage<ComContractInfoExchange>> getDetailReceived(@RequestBody(required = false) List<String> departNameList, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+                                                                    @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, HttpServletRequest request){
+        Page<ComContractInfoExchange> page = new Page<ComContractInfoExchange>(pageNo, pageSize);
+        List<ComContractInfoExchange> pageList = indexService.getDetailReceived(page, request, departNameList);
+        page.setRecords(pageList);
+        return Result.OK(page);
     }
 
     @ApiOperation(value = "计算已收款", notes = "计算已收款")

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

@@ -1,6 +1,7 @@
 package org.jeecg.modules.Index.service;
 
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.jeecg.modules.Index.entity.dto.IndexInfoParamDto;
 import org.jeecg.modules.Index.entity.vo.*;
 import org.jeecg.modules.xmcbDetail.entity.ComContractInfoExchange;
@@ -16,12 +17,12 @@ public interface IndexService {
     IndexTotalVo getTotalIncome(HttpServletRequest request,List<String> departNameList);
 
     /*合同额一层 当月合同额明细*/
-    List<ComContractInfoExchange> getDetailIncome(HttpServletRequest request, List<String> departNameList);
+    List<ComContractInfoExchange> getDetailIncome(Page<ComContractInfoExchange> page, HttpServletRequest request, List<String> departNameList);
 
     IndexTotalVo getTotalReceived(HttpServletRequest request,List<String> departNameList);
 
     /*已收款一层  当月收款额明细*/
-    List<ComContractInfoExchange> getDetailReceived(HttpServletRequest request, List<String> departNameList);
+    List<ComContractInfoExchange> getDetailReceived(Page<ComContractInfoExchange> page, HttpServletRequest request, List<String> departNameList);
 
     ContractChartInfoVo getContractAmountInfo(HttpServletRequest request, IndexInfoParamDto indexInfoParamDto,List<String> departNameList);
 

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

@@ -2,6 +2,7 @@ package org.jeecg.modules.Index.service.impl;
 
 import com.alibaba.fastjson2.JSONObject;
 import com.alibaba.fastjson2.TypeReference;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.ObjectUtils;
 import org.apache.shiro.SecurityUtils;
@@ -335,7 +336,7 @@ public class IndexServiceImpl implements IndexService {
 
     /*合同额一层 当月合同额明细*/
     @Override
-    public List<ComContractInfoExchange> getDetailIncome(HttpServletRequest request, List<String> departNameList) {
+    public List<ComContractInfoExchange> getDetailIncome(Page<ComContractInfoExchange> page, HttpServletRequest request, List<String> departNameList) {
         String userNameByToken = JwtUtil.getUserNameByToken(request);
         LoginUser sysUser = sysBaseApi.getUserByName(userNameByToken);
         String role = commonMethod.getRole(sysUser.getUsername());
@@ -392,9 +393,9 @@ public class IndexServiceImpl implements IndexService {
         Date currentMothEndDate = instance.getTime();
 
         if (AuthMark.DEPT_LEADER.equals(role)) {
-            comContractInfoExchangeList = exchangeMapper.getIncomeDetailByTasknoListAndByQsrqRange(tasknoList, currentMothBginDate, currentMothEndDate);
+            comContractInfoExchangeList = exchangeMapper.getIncomeDetailByTasknoListAndByQsrqRange(page, tasknoList, currentMothBginDate, currentMothEndDate);
         } else if (AuthMark.BOSS.equals(role)) {
-            comContractInfoExchangeList = exchangeMapper.getIncomeDetailByTasknoListAndByQsrqRangeIfBoss(tasknoList, currentMothBginDate, currentMothEndDate);
+            comContractInfoExchangeList = exchangeMapper.getIncomeDetailByTasknoListAndByQsrqRangeIfBoss(page, tasknoList, currentMothBginDate, currentMothEndDate);
         }
 
         redisUtil.set(CacheKey.INCOMEDETAIL_DATA_REDIS_KEY + ":" + depart + ":" + role, comContractInfoExchangeList, 1000L * 60 * 60 * 10);
@@ -619,7 +620,7 @@ public class IndexServiceImpl implements IndexService {
 
     /*已收款一层  当月收款额明细*/
     @Override
-    public List<ComContractInfoExchange> getDetailReceived(HttpServletRequest request, List<String> departNameList) {
+    public List<ComContractInfoExchange> getDetailReceived(Page<ComContractInfoExchange> page, HttpServletRequest request, List<String> departNameList) {
         String userNameByToken = JwtUtil.getUserNameByToken(request);
         LoginUser sysUser = sysBaseApi.getUserByName(userNameByToken);
         String role = commonMethod.getRole(userNameByToken);
@@ -675,9 +676,9 @@ public class IndexServiceImpl implements IndexService {
         Date currentMothEndDate = instance.getTime();
 
         if (AuthMark.DEPT_LEADER.equals(role)) {
-            comContractInfoExchangeList = exchangeMapper.getReceivedDetailByTasknoListAndByQsrqRange(tasknoList, currentMothBginDate, currentMothEndDate);
+            comContractInfoExchangeList = exchangeMapper.getReceivedDetailByTasknoListAndByQsrqRange(page, tasknoList, currentMothBginDate, currentMothEndDate);
         } else if (AuthMark.BOSS.equals(role)) {
-            comContractInfoExchangeList = exchangeMapper.getReceivedDetailByTasknoListAndByQsrqRangeIfBoss(tasknoList, currentMothBginDate, currentMothEndDate);
+            comContractInfoExchangeList = exchangeMapper.getReceivedDetailByTasknoListAndByQsrqRangeIfBoss(page, tasknoList, currentMothBginDate, currentMothEndDate);
         }
 
         redisUtil.set(CacheKey.RECEIVEDDETAIL_DATA_REDIS_KEY + ":" + depart + ":" + role, comContractInfoExchangeList, 1000L * 60 * 60 * 10);

+ 7 - 4
module_kzks/src/main/java/org/jeecg/modules/xmcbDetail/mapper/ComContractInfoExchangeMapper.java

@@ -1,6 +1,7 @@
 package org.jeecg.modules.xmcbDetail.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
@@ -47,12 +48,12 @@ public interface ComContractInfoExchangeMapper extends BaseMapper<ComContractInf
     BigDecimal getIncomeYearTotalByTasknoListAndByQsrqRange(@Param("tasknoList") List<String> tasknoList, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
 
     //获取首页当月合同额的明细
-    List<ComContractInfoExchange> getIncomeDetailByTasknoListAndByQsrqRange(@Param("tasknoList") List<String> tasknoList, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
+    List<ComContractInfoExchange> getIncomeDetailByTasknoListAndByQsrqRange(Page<ComContractInfoExchange> page, @Param("tasknoList") List<String> tasknoList, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
 
     BigDecimal getIncomeYearTotalByTasknoListAndByQsrqRangeIfBoss(@Param("tasknoList") List<String> tasknoList, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
 
     //获取首页当月合同额的明细
-    List<ComContractInfoExchange> getIncomeDetailByTasknoListAndByQsrqRangeIfBoss(@Param("tasknoList") List<String> tasknoList, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
+    List<ComContractInfoExchange> getIncomeDetailByTasknoListAndByQsrqRangeIfBoss(Page<ComContractInfoExchange> page, @Param("tasknoList") List<String> tasknoList, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
 
     BigDecimal getContractNumYearTotalByTasknoListAndByQsrqRange(@Param("tasknoList") List<String> tasknoList, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
 
@@ -61,11 +62,13 @@ public interface ComContractInfoExchangeMapper extends BaseMapper<ComContractInf
 
     BigDecimal getReceivedYearTotalByTasknoListAndByQsrqRange(@Param("tasknoList") List<String> tasknoList, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
 
-    List<ComContractInfoExchange> getReceivedDetailByTasknoListAndByQsrqRange(@Param("tasknoList") List<String> tasknoList, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
+    //获取首页当月收款额的明细
+    List<ComContractInfoExchange> getReceivedDetailByTasknoListAndByQsrqRange(Page<ComContractInfoExchange> page, @Param("tasknoList") List<String> tasknoList, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
 
     BigDecimal getReceivedYearTotalByTasknoListAndByQsrqRangeIfBoss(@Param("tasknoList") List<String> tasknoList, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
 
-    List<ComContractInfoExchange> getReceivedDetailByTasknoListAndByQsrqRangeIfBoss(@Param("tasknoList") List<String> tasknoList, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
+    //获取首页当月收款额的明细
+    List<ComContractInfoExchange> getReceivedDetailByTasknoListAndByQsrqRangeIfBoss(Page<ComContractInfoExchange> page, @Param("tasknoList") List<String> tasknoList, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
 
     List<ContractAmount> getContractAmountandNumByYear(@Param("tasknoList") List<String> tasknoList, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);