Kaynağa Gözat

申请消息总条数

黄远 5 yıl önce
ebeveyn
işleme
03b82dee54

+ 6 - 2
lift-system-service/src/main/java/cn/com/ty/lift/system/settings/service/impl/MtCompanyAttestationServiceImpl.java

@@ -141,7 +141,7 @@ public class MtCompanyAttestationServiceImpl extends ServiceImpl<MtCompanyAttest
         );
         //封装申请消息
         ApplyPageResponse applyPageResponse = new ApplyPageResponse();
-        packCompanyApplyStatusCount(mtCompanyAttestationListResult, applyPageResponse);
+        packCompanyApplyStatusCount(mtCompanyAttestationListResult, applyPageResponse, companyAttestationRequest.getIsCertificated());
 
         //封装具体信息
         Long currentUserId = companyAttestationRequest.getCurrentUserId();
@@ -188,6 +188,7 @@ public class MtCompanyAttestationServiceImpl extends ServiceImpl<MtCompanyAttest
             mtCompanyAttestationPage.setRecords(companyAttestationResponseList);
         }
         applyPageResponse.setPage(mtCompanyAttestationPage);
+        applyPageResponse.setCount(mtCompanyAttestationPage.getTotal());
         return RestResponse.success(applyPageResponse, ApiConstants.RESULT_SUCCESS, "获取公司申请信息成功");
     }
 
@@ -197,7 +198,8 @@ public class MtCompanyAttestationServiceImpl extends ServiceImpl<MtCompanyAttest
      * @description 封装企业申请消息对应条数
      * @date 2020-01-06 23:17
      */
-    private void packCompanyApplyStatusCount(List<MtCompanyAttestation> mtCompanyAttestationListResult, ApplyPageResponse applyPageResponse) {
+    private void packCompanyApplyStatusCount(List<MtCompanyAttestation> mtCompanyAttestationListResult,
+                                             ApplyPageResponse applyPageResponse, int isCertificated) {
         Map<Integer, Long> statusToCount = userApplicationService.getApplyStatusToCountMap(mtCompanyAttestationListResult,
                 CommonConstants.COMPANY_ATTESTATION_STATUS, "isCertificated");
         //待审核
@@ -206,6 +208,8 @@ public class MtCompanyAttestationServiceImpl extends ServiceImpl<MtCompanyAttest
         applyPageResponse.setApplyPassCount(statusToCount.get(ApiConstants.CompanyConstants.MAINTENANCE_PASS));
         //审核未通过
         applyPageResponse.setApplyFailCount(statusToCount.get(ApiConstants.CompanyConstants.MAINTENANCE_FAIL));
+        //当前状态为筛选条数
+        applyPageResponse.setCount(statusToCount.get(isCertificated));
     }
 
     /***

+ 1 - 0
lift-system-service/src/main/java/cn/com/ty/lift/system/user/dao/entity/model/ApplyPageResponse.java

@@ -13,5 +13,6 @@ public class ApplyPageResponse {
     private long applyWaitCount;//待审核数量
     private long applyPassCount;//审核通过数量
     private long applyFailCount;//审核不通过数量
+    private long count;//查询后的总条数
     private IPage page;//分页数据
 }

+ 4 - 2
lift-system-service/src/main/java/cn/com/ty/lift/system/user/service/impl/UserApplicationService.java

@@ -125,7 +125,7 @@ public class UserApplicationService extends ServiceImpl<UserApplicationMapper, U
         );
         //封装不同状态的条数信息
         ApplyPageResponse applyPageResponse = new ApplyPageResponse();
-        packUserApplicationStatusCount(userApplicationListResult, applyPageResponse);
+        packUserApplicationStatusCount(userApplicationListResult, applyPageResponse, userApplyRequest.getStatus());
 
         //封装具体信息
         List<UserApplyResponse> userApplyResponseList = new ArrayList<>();
@@ -191,7 +191,7 @@ public class UserApplicationService extends ServiceImpl<UserApplicationMapper, U
      * @description 封装用户申请信息状态条数
      * @date 2020-01-06 23:12
      */
-    private void packUserApplicationStatusCount(List<UserApplication> userApplicationListResult, ApplyPageResponse applyPageResponse) {
+    private void packUserApplicationStatusCount(List<UserApplication> userApplicationListResult, ApplyPageResponse applyPageResponse, int CurrentStatus) {
         //获取状态对应的数量
         Map<Integer, Long> statusToApplyCount = this.getApplyStatusToCountMap(userApplicationListResult,
                 CommonConstants.USER_APPLICATION_STATUS, "status");
@@ -201,6 +201,8 @@ public class UserApplicationService extends ServiceImpl<UserApplicationMapper, U
         applyPageResponse.setApplyPassCount(statusToApplyCount.get(ApiConstants.ApplicationConstants.APPLY_PASS));
         //审核未通过
         applyPageResponse.setApplyFailCount(statusToApplyCount.get(ApiConstants.ApplicationConstants.APPLY_FAIL));
+        //设置未查询的总记录条数
+        applyPageResponse.setCount(statusToApplyCount.get(CurrentStatus));
     }
 
     /**