From c02e4e8ebd88f2d277935111ca16f2119adbac23 Mon Sep 17 00:00:00 2001
From: 101captain <237651143@qq.com>
Date: 星期日, 24 七月 2022 10:20:57 +0800
Subject: [PATCH] bug修改

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java |  150 ++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 120 insertions(+), 30 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java
index 9a023bc..4d99130 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java
@@ -4,16 +4,14 @@
 
 import java.math.BigDecimal;
 import java.math.RoundingMode;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
+import java.util.*;
 
 import javax.annotation.Resource;
 
+import com.panzhihua.common.model.dtos.property.CommonPage;
+import com.panzhihua.common.model.vos.LoginUserInfoVO;
 import com.panzhihua.common.model.vos.community.ComActActivityTypeVO;
+import com.panzhihua.common.model.vos.community.volunteer.ComMngVolunteerExcelVO;
 import com.panzhihua.common.model.vos.user.SysTemplateConfigVO;
 import com.panzhihua.service_community.dao.ComActActEvaluateDAO;
 import com.panzhihua.service_community.model.dos.*;
@@ -22,14 +20,7 @@
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.ObjectUtils;
 import org.springframework.util.StringUtils;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -282,10 +273,12 @@
                     }
                     comActActivityVO1.setComActActPrizeVOList(comActActPrizeVOList);
                     Integer volunteerMax = comActActivityVO1.getVolunteerMax();
-                    if (volunteerMax.intValue() != 0) {
-                        comActActivityVO1.setType(1);
-                    } else {
-                        comActActivityVO1.setType(2);
+                    if(comActActivityVO1.getType()==null){
+                        if (volunteerMax.intValue() != 0) {
+                            comActActivityVO1.setType(1);
+                        } else {
+                            comActActivityVO1.setType(2);
+                        }
                     }
                     fillActivitySignList(id, comActActivityVO1);
                 });
@@ -298,7 +291,7 @@
 
     /**
      * 社区后台分页查询社区活动
-     * 
+     *
      * @param comActActivityVO
      *            查询参数
      * @return 返回结果
@@ -906,7 +899,7 @@
 
     /**
      * 查询随手拍是否有活动
-     * 
+     *
      * @return 活动详情
      */
     @PostMapping("getEasyPhotoActivity")
@@ -1197,17 +1190,17 @@
 
     /**
      * 查询所有建筑类型
-     * 
+     *
      * @return 类型列表
      */
     @PostMapping("listbuildtype")
-    public R listBuildType() {
-        return comMngStructOtherBuildService.listBuildType();
+    public R listBuildType(@RequestParam("communityId")Long communityId) {
+        return comMngStructOtherBuildService.listBuildType(communityId);
     }
 
     /**
      * 分页查询 其他建筑
-     * 
+     *
      * @param comMngStructOtherBuildVO
      *            分页查询参数
      * @return 查询结果
@@ -1219,19 +1212,28 @@
 
     /**
      * 增加志愿者
-     * 
+     *
      * @param comMngVolunteerMngVO
      *            志愿者信息
      * @return 增加结果
      */
     @PostMapping("addvolunteer")
     R addVolunteer(@RequestBody ComMngVolunteerMngVO comMngVolunteerMngVO) {
+        Long submitUserId = comMngVolunteerMngVO.getSubmitUserId();
+        if (Objects.nonNull(submitUserId)) {
+            //获取小程序用户信息
+            R<LoginUserInfoVO> userInfoR = userService.getUserInfoByUserId(submitUserId.toString());
+            LoginUserInfoVO userInfo = userInfoR.getData();
+            if (Objects.nonNull(userInfo)) {
+                comMngVolunteerMngVO.setIdCard(userInfo.getIdCard());
+            }
+        }
         return comMngVolunteerMngService.addVolunteer(comMngVolunteerMngVO);
     }
 
     /**
      * 获取志愿者详情
-     * 
+     *
      * @param id
      * @return
      */
@@ -1409,8 +1411,8 @@
      */
     @PostMapping("listactivity")
     public R listActivity(@RequestParam("userId") Long userId,
-                          @RequestParam(value = "status", required = false) Integer status) {
-        return comActActivityService.listActivity(userId, status);
+                          @RequestParam(value = "status", required = false) Integer status,@RequestParam(value = "type", required = false) Integer type) {
+        return comActActivityService.listActivity(userId, status,type);
     }
 
     /**
@@ -2242,7 +2244,7 @@
                 try {
                     WxXCXTempSend util = new WxXCXTempSend();
                     R<SysTemplateConfigVO> sysTemplateConfigVO=userService.selectTemplate(eldersAuthFeedbackAddDTO.getAreaCode(),5);
-                    String accessToken = util.getAppAccessToken();
+                    String accessToken = util.getAccessToken();
                     WxUtil.sendSubscribeRZSH(openid, accessToken, "高龄认证",
                         DateUtils.format(eldersAuthDO.getCreateAt(), DateUtils.ymdhms_format),
                         eldersAuthFeedbackAddDTO.getFeedBack(),sysTemplateConfigVO.getData().getTemplateId());
@@ -2317,7 +2319,7 @@
      * @return 社区列表
      */
     @GetMapping("/eventgrid/community/westList")
-    public R getWestCommunityLists(String areaCode) {
+    public R getWestCommunityLists(@RequestParam("areaCode")String areaCode) {
         return comActService.getWestCommunityLists(areaCode);
     }
 
@@ -2543,4 +2545,92 @@
     public R listMyActivityEvaluate(@RequestParam("userId") Long userId, @RequestParam("activityId") Long activityId) {
         return comActActEvaluateService.listMyActivityEvaluate(userId, activityId);
     }
+
+    /**
+     * 志愿者导入
+     *
+     * @param list        志愿者数据列表
+     * @param communityId 社区id
+     * @param userId      用户id
+     * @return 导入结果
+     */
+    @PostMapping("/volunteer/import/admin")
+    public R importVolunteerAdmin(@RequestBody List<ComMngVolunteerExcelVO> list,
+                                  @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId) {
+        return comMngVolunteerMngService.importVolunteerAdmin(list,communityId,userId);
+    }
+
+    /**
+     * [方法描述] 根据社区ID查询所属城市所在区区域代码,
+     *
+     * @param communityId
+     *            社区ID
+     * @return String 区域code
+     * @author manailin
+     * @date 2022/2/17 10:09
+     */
+    @GetMapping("act/getActBelongRegionCode")
+    public String getActBelongRegionCode(@RequestParam("communityId") Long communityId) {
+        return comActActivityService.getActBelongRegionCode(communityId);
+    }
+
+    /**
+     * 党员活动统计
+     * @param communityId
+     * @param year
+     * @return
+     */
+    @GetMapping("activity/partyMemberCount")
+    public R partyMemberCount(@RequestParam("communityId")Long communityId,@RequestParam("year")String year){
+        return comActActivityService.partyMemberCount(communityId,year);
+    }
+
+    /**
+     * 党员活动详情数据
+     * @return
+     */
+    @PostMapping("activity/partyMemberDetail")
+    public R partyMemberDetail(@RequestBody CommonPage commonPage){
+        return comActActivityService.partyMemberDetail(commonPage);
+    }
+
+
+    /**
+     * 导出党员活动详情数据
+     * @return
+     */
+    @PostMapping("activity/exportPartyMemberDetail")
+    public R exportPartyMemberDetail(@RequestBody CommonPage commonPage){
+        return comActActivityService.exportPartyMemberDetail(commonPage);
+    }
+
+    /**
+     * 批量删除活动
+     * @param ids
+     * @return
+     */
+    @PostMapping("batchDel")
+    public R deleteActivities(@RequestBody List<Long> ids) {
+        return R.ok(comActActivityService.removeByIds(ids));
+    }
+
+    /**
+     * 获取人大代表反馈记录
+     * @param id
+     * @return
+     */
+    @GetMapping("dpc/feedback")
+    public R getFeedbackList(@RequestParam("id") Long id) {
+        return comActEasyPhotoService.getFeedbackList(id);
+    }
+
+    /**
+     * 人大代表反馈随手拍
+     * @param comActEasyPhotoVO
+     * @return
+     */
+    @PostMapping("dpc/feedback")
+    public R addEasyPhotoFeedbackForDpc(@RequestBody ComActEasyPhotoVO comActEasyPhotoVO) {
+        return comActEasyPhotoService.addEasyPhotoFeedbackForDpc(comActEasyPhotoVO);
+    }
 }

--
Gitblit v1.7.1