weiximei 6 år sedan
förälder
incheckning
70bf4537b4

+ 10
- 0
whole-estate/src/main/java/com/example/wholeestate/dao/ActivityMapper.java Visa fil

@@ -3,6 +3,8 @@ package com.example.wholeestate.dao;
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5 5
 import com.example.wholeestate.model.Activity;
6
+import org.apache.ibatis.annotations.Param;
7
+import org.apache.ibatis.annotations.Select;
6 8
 
7 9
 /**
8 10
  * <p>
@@ -14,4 +16,12 @@ import com.example.wholeestate.model.Activity;
14 16
  */
15 17
 public interface ActivityMapper extends BaseMapper<Activity> {
16 18
 
19
+    /**
20
+     * 根据 活动id 查询报名人数
21
+     * @param activityId
22
+     * @return
23
+     */
24
+    @Select("select count(*) from ta_activity where activity_id = #{activityId}")
25
+    Integer signUpNumber(@Param("activityId") String activityId);
26
+
17 27
 }

+ 6
- 0
whole-estate/src/main/java/com/example/wholeestate/model/Activity.java Visa fil

@@ -121,4 +121,10 @@ public class Activity implements Serializable {
121 121
      */
122 122
     @TableField(exist = false)
123 123
     private String buildingName;
124
+
125
+    /**
126
+     * 活动已经报名的人数
127
+     */
128
+    @TableField(exist = false)
129
+    private Integer signUpNumber;
124 130
 }

+ 8
- 1
whole-estate/src/main/java/com/example/wholeestate/service/IBuildingDynamicService.java Visa fil

@@ -28,9 +28,16 @@ public interface IBuildingDynamicService extends IService<BuildingDynamic> {
28 28
     ResponseBean iBuildingDynamicSelectId(Integer id);
29 29
 
30 30
     /**
31
-     * 项目动态管理列表
31
+     * 微信小程序 项目动态管理列表
32 32
      * @return
33 33
      */
34 34
     ResponseBean getWxBuildingDynamiceList(Integer pageNum,Integer pageSize);
35 35
 
36
+    /**
37
+     * 微信小程序 项目详情
38
+     * @param dynamicId
39
+     * @return
40
+     */
41
+    ResponseBean getWxBuildingDynamiceInfo(String dynamicId);
42
+
36 43
 }

+ 7
- 2
whole-estate/src/main/java/com/example/wholeestate/service/impl/ActivityServiceImpl.java Visa fil

@@ -1,6 +1,5 @@
1 1
 package com.example.wholeestate.service.impl;
2 2
 
3
-import com.alibaba.fastjson.JSONObject;
4 3
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5 4
 import com.baomidou.mybatisplus.core.metadata.IPage;
6 5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -14,9 +13,9 @@ import com.example.wholeestate.service.IActivityService;
14 13
 import org.apache.commons.lang.StringUtils;
15 14
 import org.springframework.beans.factory.annotation.Autowired;
16 15
 import org.springframework.stereotype.Service;
17
-import sun.security.krb5.internal.PAData;
18 16
 
19 17
 import java.util.Date;
18
+import java.util.List;
20 19
 
21 20
 /**
22 21
  * <p>
@@ -48,6 +47,12 @@ public class ActivityServiceImpl extends ServiceImpl<ActivityMapper, Activity> i
48 47
         queryWrapper.ge(null != beginDate,"begin_date", beginDate);
49 48
         queryWrapper.le(null != endDate,"end_date", endDate);
50 49
         IPage<Activity> activityIPage = activityMapper.selectPage(page, queryWrapper);
50
+        List<Activity> records = activityIPage.getRecords();
51
+        records.forEach(e -> {
52
+            Integer signUpNumber = activityMapper.signUpNumber(e.getActivityId());
53
+            e.setSignUpNumber(null == signUpNumber ? 0 : signUpNumber);
54
+        });
55
+
51 56
         responseBean.addSuccess(activityIPage);
52 57
         return responseBean;
53 58
     }

+ 10
- 0
whole-estate/src/main/java/com/example/wholeestate/service/impl/BuildingDynamicServiceImpl.java Visa fil

@@ -86,4 +86,14 @@ public class BuildingDynamicServiceImpl extends ServiceImpl<BuildingDynamicMappe
86 86
         responseBean.addSuccess(buildingDynamicIPage);
87 87
         return responseBean;
88 88
     }
89
+
90
+    @Override
91
+    public ResponseBean getWxBuildingDynamiceInfo(String dynamicId) {
92
+        ResponseBean responseBean = new ResponseBean();
93
+
94
+        QueryWrapper<BuildingDynamic> buildingDynamicQueryWrapper = new QueryWrapper<>();
95
+
96
+
97
+        return responseBean;
98
+    }
89 99
 }