weiximei 6 years ago
parent
commit
6fa663c065

+ 6
- 0
whole-estate/src/main/java/com/example/wholeestate/common/Constant.java View File

21
      * 用户 session
21
      * 用户 session
22
      */
22
      */
23
     public static final String USER_SESSION = "user_session";
23
     public static final String USER_SESSION = "user_session";
24
+
25
+    /**
26
+     * 楼盘图片类型 banner
27
+     */
28
+    public static final String BUILDING_IMG_TYPE_BANNER = "banner";
29
+
24
 }
30
 }

+ 9
- 3
whole-estate/src/main/java/com/example/wholeestate/controller/ActivityController.java View File

175
     @ApiOperation(value = "根据活动id查询活动报名列表", notes = "根据活动id查询活动报名列表")
175
     @ApiOperation(value = "根据活动id查询活动报名列表", notes = "根据活动id查询活动报名列表")
176
     @ApiImplicitParams({
176
     @ApiImplicitParams({
177
             @ApiImplicitParam(paramType = "query", dataTypeClass = Integer.class, name = "pageNum", value = "pageNum第几页"),
177
             @ApiImplicitParam(paramType = "query", dataTypeClass = Integer.class, name = "pageNum", value = "pageNum第几页"),
178
-            @ApiImplicitParam(paramType = "query", dataTypeClass = Integer.class, name = "pageSize", value = "pageSize一页多少行")
178
+            @ApiImplicitParam(paramType = "query", dataTypeClass = Integer.class, name = "pageSize", value = "pageSize一页多少行"),
179
+            @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "customerName", value = "客户端用户名"),
180
+            @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "customerPhone", value = "客户端用户手机"),
179
     })
181
     })
180
-    public ResponseBean activityEnrollList(@PathVariable("activityId") String activityId, @RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize) {
182
+    public ResponseBean activityEnrollList(@PathVariable("activityId") String activityId,
183
+                                           @RequestParam(defaultValue = "1") Integer pageNum,
184
+                                           @RequestParam(defaultValue = "10") Integer pageSize,
185
+                                           @RequestParam(required = false) String customerName,
186
+                                           @RequestParam(required = false) String customerPhone) {
181
         ResponseBean responseBean = new ResponseBean();
187
         ResponseBean responseBean = new ResponseBean();
182
-        responseBean = iActivityEnrollService.getActivitySignUpList(activityId, pageNum, pageSize);
188
+        responseBean = iActivityEnrollService.getActivitySignUpList(activityId, pageNum, pageSize, customerName, customerPhone);
183
         return responseBean;
189
         return responseBean;
184
     }
190
     }
185
 
191
 

+ 11
- 0
whole-estate/src/main/java/com/example/wholeestate/controller/BuildingController.java View File

245
 ////        return responseBean;
245
 ////        return responseBean;
246
 ////    }
246
 ////    }
247
 
247
 
248
+
249
+    @ApiOperation(value = "微信小程序楼盘列表", notes = "微信小程序楼盘列表")
250
+    @ApiImplicitParams({
251
+
252
+    })
253
+    @RequestMapping(value = "/wx/building/list", method = RequestMethod.GET)
254
+    public ResponseBean getWxBuildingList(){
255
+        ResponseBean  responseBean = iBuildingService.getWxBuildingList();
256
+        return responseBean;
257
+    }
258
+
248
 }
259
 }

+ 1
- 1
whole-estate/src/main/java/com/example/wholeestate/controller/CommentController.java View File

93
     public ResponseBean commentList(@RequestParam(defaultValue = "1") Integer pageNum,
93
     public ResponseBean commentList(@RequestParam(defaultValue = "1") Integer pageNum,
94
                                     @RequestParam(defaultValue = "10") Integer pageSize,
94
                                     @RequestParam(defaultValue = "10") Integer pageSize,
95
                                     @RequestParam String commentType,
95
                                     @RequestParam String commentType,
96
-                                    @RequestParam String mainId) {
96
+                                    @RequestParam(required = false) String mainId) {
97
         ResponseBean responseBean = new ResponseBean();
97
         ResponseBean responseBean = new ResponseBean();
98
         responseBean = iCommentService.getCommentList(commentType, mainId, pageNum, pageSize);
98
         responseBean = iCommentService.getCommentList(commentType, mainId, pageNum, pageSize);
99
         return responseBean;
99
         return responseBean;

+ 1
- 3
whole-estate/src/main/java/com/example/wholeestate/controller/CustomerController.java View File

32
     @ApiOperation(value = "会员列表", notes = "会员列表")
32
     @ApiOperation(value = "会员列表", notes = "会员列表")
33
     @ApiImplicitParams({
33
     @ApiImplicitParams({
34
             @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "pageNum:分页第几页" +
34
             @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "pageNum:分页第几页" +
35
-                    "pageSize:每页长度,phone:手机号,name:姓名"
36
-
37
-            )
35
+                    "pageSize:每页长度,phone:手机号,name:姓名")
38
 
36
 
39
     })
37
     })
40
 //    @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "token")
38
 //    @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "token")

+ 3
- 6
whole-estate/src/main/java/com/example/wholeestate/dao/ActivityEnrollMapper.java View File

8
 import org.apache.ibatis.annotations.Param;
8
 import org.apache.ibatis.annotations.Param;
9
 import org.apache.ibatis.annotations.Select;
9
 import org.apache.ibatis.annotations.Select;
10
 
10
 
11
+import java.util.Map;
12
+
11
 /**
13
 /**
12
  * <p>
14
  * <p>
13
  * 活动报名表 Mapper 接口
15
  * 活动报名表 Mapper 接口
24
      * @param activityId
26
      * @param activityId
25
      * @return
27
      * @return
26
      */
28
      */
27
-    @Select("SELECT tacus.phone as phone,tacus.`name` as name,tacus.customer_name as customerName,tab.building_name AS buildingName FROM ta_activity tac " +
28
-            "RIGHT JOIN ta_activity_enroll tace ON tac.activity_id = tace.activity_id " +
29
-            "LEFT JOIN ta_customer tacus ON tace.customer_id = tacus.customer_id " +
30
-            "LEFT JOIN ta_building tab ON tac.building_id = tab.building_id " +
31
-            "WHERE tac.activity_id = #{activityId} and tac.status > -1")
32
-    IPage<Activity> selectPageActivityEnroll(Page page, @Param("activityId") String activityId);
29
+    IPage<Map<String, Object>> selectPageActivityEnroll(Page page, @Param("activityId") String activityId, @Param("customerName") String customerName, @Param("customerPhone") String customerPhone);
33
 
30
 
34
     /**
31
     /**
35
      * 根据 openid 查询 我参加的活动
32
      * 根据 openid 查询 我参加的活动

+ 1
- 0
whole-estate/src/main/java/com/example/wholeestate/model/Activity.java View File

127
      */
127
      */
128
     @TableField(exist = false)
128
     @TableField(exist = false)
129
     private Integer signUpNumber;
129
     private Integer signUpNumber;
130
+
130
 }
131
 }

+ 1
- 1
whole-estate/src/main/java/com/example/wholeestate/service/IActivityEnrollService.java View File

21
      * @param pageNum
21
      * @param pageNum
22
      * @return
22
      * @return
23
      */
23
      */
24
-    ResponseBean getActivitySignUpList(String activityId, Integer pageNum, Integer pageSize);
24
+    ResponseBean getActivitySignUpList(String activityId, Integer pageNum, Integer pageSize, String customerName, String customerPhone);
25
 
25
 
26
     /**
26
     /**
27
      * 根据 openid 查询. 我的活动记录
27
      * 根据 openid 查询. 我的活动记录

+ 8
- 0
whole-estate/src/main/java/com/example/wholeestate/service/IBuildingService.java View File

89
      * @return
89
      * @return
90
      */
90
      */
91
     ResponseBean appointmentUpdate(String id,String writeoffRemark);
91
     ResponseBean appointmentUpdate(String id,String writeoffRemark);
92
+
93
+    /**
94
+     * 微信小程序 楼盘列表
95
+     * @return
96
+     */
97
+    ResponseBean getWxBuildingList();
98
+
99
+    ResponseBean getWxBuildingById(String buildingId);
92
 }
100
 }

+ 8
- 4
whole-estate/src/main/java/com/example/wholeestate/service/impl/ActivityEnrollServiceImpl.java View File

17
 import org.springframework.beans.factory.annotation.Autowired;
17
 import org.springframework.beans.factory.annotation.Autowired;
18
 import org.springframework.stereotype.Service;
18
 import org.springframework.stereotype.Service;
19
 
19
 
20
+import java.util.Map;
21
+
20
 /**
22
 /**
21
  * <p>
23
  * <p>
22
  * 活动报名表 服务实现类
24
  * 活动报名表 服务实现类
40
     private IdGen idGen = IdGen.get();
42
     private IdGen idGen = IdGen.get();
41
 
43
 
42
     @Override
44
     @Override
43
-    public ResponseBean getActivitySignUpList(String activityId, Integer pageNum, Integer pageSize) {
45
+    public ResponseBean getActivitySignUpList(String activityId, Integer pageNum, Integer pageSize, String customerName, String customerPhone) {
44
         ResponseBean responseBean = new ResponseBean();
46
         ResponseBean responseBean = new ResponseBean();
45
 
47
 
46
-        Activity activity = activityMapper.selectById(activityId);
48
+        QueryWrapper<Activity> activityQueryWrapper = new QueryWrapper<>();
49
+        activityQueryWrapper.eq("activity_id", activityId);
50
+        Activity activity = activityMapper.selectOne(activityQueryWrapper);
47
         if (null == activity) {
51
         if (null == activity) {
48
             responseBean.addError("活动不存在!");
52
             responseBean.addError("活动不存在!");
49
             return responseBean;
53
             return responseBean;
50
         }
54
         }
51
 
55
 
52
-        Page<Activity> page = new Page<>();
56
+        Page<Map<String, Object>> page = new Page<>();
53
         page.setCurrent(pageNum == null ? 1 : pageNum);
57
         page.setCurrent(pageNum == null ? 1 : pageNum);
54
         page.setSize(pageSize == null ? 10 : pageSize);
58
         page.setSize(pageSize == null ? 10 : pageSize);
55
-        IPage<Activity> activityEnrollIPage = activityEnrollMapper.selectPageActivityEnroll(page, activityId);
59
+        IPage<Map<String, Object>> activityEnrollIPage = activityEnrollMapper.selectPageActivityEnroll(page, activityId, customerName, customerPhone);
56
 
60
 
57
         responseBean.addSuccess(activityEnrollIPage);
61
         responseBean.addSuccess(activityEnrollIPage);
58
         return responseBean;
62
         return responseBean;

+ 35
- 0
whole-estate/src/main/java/com/example/wholeestate/service/impl/BuildingServiceImpl.java View File

6
 import com.baomidou.mybatisplus.core.metadata.IPage;
6
 import com.baomidou.mybatisplus.core.metadata.IPage;
7
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
8
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
8
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
9
+import com.example.wholeestate.common.Constant;
9
 import com.example.wholeestate.common.resp.ResponseBean;
10
 import com.example.wholeestate.common.resp.ResponseBean;
10
 import com.example.wholeestate.common.uuid.IdGen;
11
 import com.example.wholeestate.common.uuid.IdGen;
11
 import com.example.wholeestate.dao.*;
12
 import com.example.wholeestate.dao.*;
368
     }
369
     }
369
 
370
 
370
 
371
 
372
+    @Override
373
+    public ResponseBean getWxBuildingList() {
374
+        ResponseBean responseBean = new ResponseBean();
375
+
376
+        QueryWrapper<Building> buildingQueryWrapper = new QueryWrapper<>();
377
+        List<Building> buildingList = buildingMapper.selectList(buildingQueryWrapper);
378
+        responseBean.addSuccess(buildingList);
379
+
380
+        return responseBean;
381
+    }
382
+
383
+    @Override
384
+    public ResponseBean getWxBuildingById(String buildingId) {
385
+        ResponseBean responseBean = new ResponseBean();
386
+
387
+        // 楼盘信息
388
+        QueryWrapper<Building> buildingQueryWrapper = new QueryWrapper<>();
389
+        buildingQueryWrapper.eq("building_id", buildingId);
390
+        Building building = buildingMapper.selectOne(buildingQueryWrapper);
391
+        if (null == building) {
392
+            responseBean.addError("楼盘不存在!");
393
+            return responseBean;
394
+        }
395
+
396
+        // 楼盘Banner
397
+        QueryWrapper<BuildingImg> buildingImgQueryWrapper = new QueryWrapper<>();
398
+        buildingImgQueryWrapper.eq("building_id", building.getBuildingId());
399
+        buildingImgQueryWrapper.eq("img_type", Constant.BUILDING_IMG_TYPE_BANNER);
400
+        buildingImgMapper.selectList(buildingImgQueryWrapper);
401
+
402
+        // 楼盘户型图
403
+
404
+        return responseBean;
405
+    }
371
 }
406
 }

+ 1
- 1
whole-estate/src/main/java/com/example/wholeestate/service/impl/CommentServiceImpl.java View File

78
 
78
 
79
         QueryWrapper<Comment> commentQueryWrapper = new QueryWrapper<>();
79
         QueryWrapper<Comment> commentQueryWrapper = new QueryWrapper<>();
80
         commentQueryWrapper.eq("comment_type", commentType);
80
         commentQueryWrapper.eq("comment_type", commentType);
81
-        commentQueryWrapper.eq("main_id", mainId);
81
+        commentQueryWrapper.eq(StringUtils.isNotBlank(mainId),"main_id", mainId);
82
         IPage<Comment> commentIPage = commentMapper.selectPage(page, commentQueryWrapper);
82
         IPage<Comment> commentIPage = commentMapper.selectPage(page, commentQueryWrapper);
83
 
83
 
84
         responseBean.addSuccess(commentIPage);
84
         responseBean.addSuccess(commentIPage);

+ 24
- 0
whole-estate/src/main/resources/mapper/ActivityEnrollMapper.xml View File

1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.example.wholeestate.dao.ActivityEnrollMapper">
4
+
5
+    <select id="selectPageActivityEnroll" resultType="map">
6
+        SELECT
7
+          tacus.phone as phone,tacus.`name` as name,tacus.customer_name as customerName,tab.building_name AS buildingName,
8
+          tacus.id_num as idNum, tacus.avatar as avatar, tace.enroll_date as enrollDate
9
+        FROM ta_activity tac
10
+        RIGHT JOIN ta_activity_enroll tace ON tac.activity_id = tace.activity_id
11
+        LEFT JOIN ta_customer tacus ON tace.customer_id = tacus.customer_id
12
+        LEFT JOIN ta_building tab ON tac.building_id = tab.building_id
13
+        <where>
14
+            tac.activity_id = #{activityId} and tac.status > -1
15
+            <if test="customerName != null and customerName !=''">
16
+                and tacus.customer_name like CONCAT('%', #{customerName} , '%')
17
+            </if>
18
+            <if test="customerPhone != null and customerPhone !=''">
19
+                and tacus.phone like CONCAT('%', #{customerPhone} , '%')
20
+            </if>
21
+        </where>
22
+    </select>
23
+
24
+</mapper>