From 8961d05a46aa30c73c3b85cd25da884a17c00e67 Mon Sep 17 00:00:00 2001
From: puhanshu <a9236326>
Date: 星期二, 19 十月 2021 17:29:40 +0800
Subject: [PATCH] 活动积分优化相关代码提交

---
 springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/CommunityApi.java |   52 +++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 49 insertions(+), 3 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/CommunityApi.java b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/CommunityApi.java
index 4fc23dd..abca450 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/CommunityApi.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/CommunityApi.java
@@ -4,6 +4,8 @@
 
 import javax.annotation.Resource;
 
+import com.panzhihua.common.model.dtos.community.PageComMngVillageDTO;
+import com.panzhihua.common.service.partybuilding.PartyBuildingService;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
@@ -38,11 +40,18 @@
     private CommunityService communityService;
     @Resource
     private UserService userService;
+    @Resource
+    private PartyBuildingService partyBuildingService;
 
     @ApiOperation(value = "分页查询小区", response = ComMngStructAreaVO.class)
     @PostMapping("pagearea")
     public R pageArea(@RequestBody ComMngStructAreaVO comMngStructAreaVO) {
         return communityService.pageArea(comMngStructAreaVO);
+    }
+    @ApiOperation(value = "新分页查询小区", response = ComMngVillageVO.class)
+    @PostMapping("pagevillage")
+    public R pageVillage(@RequestBody PageComMngVillageDTO pageComMngVillageDTO) {
+        return communityService.pageVillage(pageComMngVillageDTO);
     }
 
     @ApiOperation(value = "分页获取社区动态", response = ComActDynVO.class)
@@ -108,7 +117,7 @@
         if (loginUserInfo != null) {
             userId = loginUserInfo.getUserId();
         }
-        return communityService.detailActivity(id, userId);
+        return communityService.detailActivity(id, userId,null,null);
     }
 
     @ApiOperation(value = "分页查询活动评价记录", response = ComActActEvaluateVO.class)
@@ -120,7 +129,9 @@
     @ApiOperation(value = "社区活动/志愿者活动签到")
     @PostMapping("activity/sign-in")
     public R activitySignIn(@RequestBody ComActActRegistVO comActActRegistVO) {
-        comActActRegistVO.setUserId(this.getUserId());
+        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
+        comActActRegistVO.setUserId(loginUserInfo.getUserId());
+        comActActRegistVO.setIsVolunteer(loginUserInfo.getIsVolunteer());
         return communityService.activitySignIn(comActActRegistVO);
     }
 
@@ -142,7 +153,7 @@
         signactivityVO.setUserId(userId);
         R r = communityService.signActivity(signactivityVO);
         if (R.isOk(r) && signactivityVO.getType().intValue() == 1) {
-            R r2 = communityService.detailActivity(activityId, userId);
+            R r2 = communityService.detailActivity(activityId, userId,null,null);
             ComActActivityVO comActActivityVO =
                 JSONObject.parseObject(JSONObject.toJSONString(r2.getData()), ComActActivityVO.class);
             SysUserNoticeVO sysUserNoticeVO = new SysUserNoticeVO();
@@ -179,6 +190,41 @@
         return communityService.listActivitySigns(activitySignVO);
     }
 
+    @ApiOperation(value = "活动报名签到情况", response = ActivitySignInRecordVO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "社区活动主键", required = true),
+            @ApiImplicitParam(name = "type", value = "活动类型,1.居民/志愿者活动 2.党员活动", required = true)
+    })
+    @GetMapping("activity/sign-in/list")
+    public R listSignInRecord(@RequestParam("id")  Long id, @RequestParam("type") Integer type) {
+        LoginUserInfoVO loginUserInfo = getLoginUserInfo();
+        if (loginUserInfo.getIsCommunityWorker().intValue() != 1) {
+            return R.fail("非社区工作人员");
+        }
+        if (type.intValue() == 1) {
+            return communityService.listSignInRecord(id);
+        } else {
+            return partyBuildingService.listSignInRecord(id);
+        }
+    }
+
+    @ApiOperation(value = "活动签到记录", response = ComActActRegistVO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "社区活动主键", required = true),
+            @ApiImplicitParam(name = "type", value = "活动类型,1.居民/志愿者活动 2.党员活动", required = true),
+            @ApiImplicitParam(name = "userId", value = "用户id", required = true)
+    })
+    @GetMapping("activity/regist/list")
+    public R listRegistRecord(@RequestParam("id")  Long id,
+                              @RequestParam("type") Integer type,
+                              @RequestParam("userId") Long userId) {
+        if (type.intValue() == 1) {
+            return communityService.listRegistRecord(id, userId);
+        } else {
+            return partyBuildingService.listRegistRecord(id, userId);
+        }
+    }
+
     // @ApiOperation(value = "新增社区动态浏览记录")
     // @PostMapping("dynamicuser")
     // public R addDynamicUser(@RequestBody ComActDynVO comActDynVO){

--
Gitblit v1.7.1