소스 검색

首页总览

zhangjiansheng 10 달 전
부모
커밋
f5fc24e0a8

+ 8 - 15
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedHomePageController.java

@@ -43,22 +43,15 @@ public class PostCheckedHomePageController extends BaseController {
43 43
      * 4、岗检数量-未查:post_plan t1 inner join post_plan_info t2 两张表连接,t2.status(岗检状态:1-未检;2-已检;)
44 44
      */
45 45
     @ApiOperation("1-总览")
46
-//    @ApiImplicitParams({
47
-//            @ApiImplicitParam(name = "listCount", value = "责任制清单数量", dataType = "Integer", dataTypeClass = Integer.class),
48
-//            @ApiImplicitParam(name = "problemCount", value = "检查出的问题数量", dataType = "Integer", dataTypeClass = Integer.class),
49
-//            @ApiImplicitParam(name = "checkedPostCount", value = "岗检数量-已查", dataType = "Integer", dataTypeClass = Integer.class),
50
-//            @ApiImplicitParam(name = "uncheckedPostCount", value = "岗检数量-未查", dataType = "Integer", dataTypeClass = Integer.class),
51
-//    })
46
+    @ApiImplicitParams({
47
+            @ApiImplicitParam(name = "listCount", value = "责任制清单数量", dataType = "Integer", dataTypeClass = Integer.class),
48
+            @ApiImplicitParam(name = "problemCount", value = "检查出的问题数量", dataType = "Integer", dataTypeClass = Integer.class),
49
+            @ApiImplicitParam(name = "checkedPostCount", value = "岗检数量-已查", dataType = "Integer", dataTypeClass = Integer.class),
50
+            @ApiImplicitParam(name = "uncheckedPostCount", value = "岗检数量-未查", dataType = "Integer", dataTypeClass = Integer.class),
51
+    })
52 52
     @GetMapping("/totalView")
53
-    public AjaxResult totalView(PostTotalView postTotalView) {
54
-        List<PostTotalView> list = new ArrayList<>();
55
-        PostTotalView data = new PostTotalView();
56
-//        data.set
57
-//        data.set
58
-//        data.set
59
-//        data.set
60
-        list.add(data);
61
-        return success(list);
53
+    public AjaxResult totalView() {
54
+        return success(postCheckedProblemService.totalView());
62 55
     }
63 56
 
64 57
 

+ 2 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/mapper/PostCheckedProblemMapper.java

@@ -62,4 +62,6 @@ public interface PostCheckedProblemMapper extends BaseMapper<PostCheckedProblem>
62 62
     public int deletePostCheckedProblemByIds(Long[] ids);
63 63
 
64 64
     BigDecimal getPostTotalByDeptId(Long deptId);
65
+
66
+    Integer selectCheckedPostCount(int status);
65 67
 }

+ 2 - 1
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/service/IPostCheckedProblemService.java

@@ -8,6 +8,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
8 8
 import com.ruoyi.common.enums.BusinessType;
9 9
 import com.ruoyi.postCheck.domain.PostCheckedProblem;
10 10
 import com.baomidou.mybatisplus.extension.service.IService;
11
+import com.ruoyi.postCheck.domain.homePage.PostTotalView;
11 12
 import io.swagger.annotations.ApiImplicitParam;
12 13
 import io.swagger.annotations.ApiImplicitParams;
13 14
 import io.swagger.annotations.ApiOperation;
@@ -152,5 +153,5 @@ public interface IPostCheckedProblemService extends IService<PostCheckedProblem>
152 153
     int setReviewDepartmentReviewerTime(Long id, Integer status, String reviewConclusion, String reason);
153 154
 
154 155
 
155
-
156
+    PostTotalView totalView();
156 157
 }

+ 28 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/service/impl/PostCheckedProblemServiceImpl.java

@@ -13,11 +13,14 @@ import com.ruoyi.common.exception.base.BaseException;
13 13
 import com.ruoyi.common.utils.DateUtils;
14 14
 import com.ruoyi.postCheck.domain.PostAssessmentRating;
15 15
 import com.ruoyi.postCheck.domain.PostAssessmentRules;
16
+import com.ruoyi.postCheck.domain.PostList;
16 17
 import com.ruoyi.postCheck.domain.PostPlan;
17 18
 import com.ruoyi.postCheck.domain.PostPlanInfo;
19
+import com.ruoyi.postCheck.domain.homePage.PostTotalView;
18 20
 import com.ruoyi.postCheck.domain.join.PostPlanJoinProblem;
19 21
 import com.ruoyi.postCheck.mapper.PostAssessmentRatingMapper;
20 22
 import com.ruoyi.postCheck.mapper.PostAssessmentRulesMapper;
23
+import com.ruoyi.postCheck.mapper.PostListMapper;
21 24
 import com.ruoyi.postCheck.mapper.PostPlanInfoMapper;
22 25
 import com.ruoyi.postCheck.mapper.PostPlanMapper;
23 26
 import com.ruoyi.postCheck.service.IPostPlanJoinProblemService;
@@ -61,6 +64,8 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
61 64
     private PostAssessmentRulesMapper postAssessmentRulesMapper;
62 65
     @Autowired
63 66
     private IPostPlanJoinProblemService postPlanJoinProblemService;
67
+    @Autowired
68
+    private PostListMapper postListMapper;
64 69
     /**
65 70
      * 查询岗检问题表
66 71
      *
@@ -474,5 +479,28 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
474 479
         data.setReviewDepartmentReviewerTime(new Date());
475 480
         return postCheckedProblemMapper.updatePostCheckedProblem(data);
476 481
     }
482
+
483
+    /**
484
+     * 1、责任制清单:post_list表
485
+     * 2、检查出的问题:post_checked_problem表
486
+     * 3、岗检数量-已查:post_plan t1 inner join post_plan_info t2 两张表连接,t2.status(岗检状态:1-未检;2-已检;)
487
+     * 4、岗检数量-未查:post_plan t1 inner join post_plan_info t2 两张表连接,t2.status(岗检状态:1-未检;2-已检;)
488
+     */
489
+    @Override
490
+    public PostTotalView totalView() {
491
+        PostTotalView postTotalView = new PostTotalView();
492
+        // 1
493
+        List<PostList> postLists = postListMapper.selectList(Wrappers.lambdaQuery());
494
+        postTotalView.setListCount(postLists.size());
495
+        // 2
496
+        List<PostCheckedProblem> postCheckedProblems = postCheckedProblemMapper.selectList(Wrappers.lambdaQuery());
497
+        postTotalView.setProblemCount(postCheckedProblems.size());
498
+        // 3
499
+        Integer checkedPostCount = postCheckedProblemMapper.selectCheckedPostCount(1);
500
+        postTotalView.setCheckedPostCount(checkedPostCount);
501
+        Integer uncheckedPostCount = postCheckedProblemMapper.selectCheckedPostCount(2);
502
+        postTotalView.setUncheckedPostCount(uncheckedPostCount);
503
+        return postTotalView;
504
+    }
477 505
 }
478 506
 

+ 6 - 0
ruoyi-postcheck/src/main/resources/mapper/postCheck/PostCheckedProblemMapper.xml

@@ -299,4 +299,10 @@
299 299
                                         LEFT JOIN "public"."sys_role_dept" srd ON sur."role_id"  = srd."role_id"
300 300
         WHERE srd."dept_id" = #{deptId} GROUP BY a."post_id"
301 301
     </select>
302
+
303
+    <select id="selectCheckedPostCount" resultType="java.lang.Integer">
304
+        SELECT COUNT(0)
305
+        FROM "public"."post_plan" a INNER JOIN "public"."post_plan_info" ppi ON a."id"  = ppi."post_plan_id" WHERE ppi."status" = #{status}
306
+
307
+    </select>
302 308
 </mapper>