wangfei 6 年之前
父節點
當前提交
7f2e0c3c66

+ 3
- 3
whole-estate/src/main/java/com/example/wholeestate/controller/BuildingController.java 查看文件

301
         return responseBean;
301
         return responseBean;
302
     }
302
     }
303
 
303
 
304
-    @RequestMapping(value = "/wx/building/visit", method = RequestMethod.GET)
304
+    @RequestMapping(value = "/wx/building/visit/{id}", method = RequestMethod.POST)
305
     @ApiOperation(value = "楼盘访问", notes = "楼盘访问")
305
     @ApiOperation(value = "楼盘访问", notes = "楼盘访问")
306
     @ApiImplicitParams({
306
     @ApiImplicitParams({
307
             @ApiImplicitParam(paramType = "path", dataTypeClass=String.class, name = "id", value = "楼盘id"),
307
             @ApiImplicitParam(paramType = "path", dataTypeClass=String.class, name = "id", value = "楼盘id"),
317
         ResponseBean responseBean = new ResponseBean();
317
         ResponseBean responseBean = new ResponseBean();
318
         if (visitList.size() > 0) {
318
         if (visitList.size() > 0) {
319
             Visit updataVisit = visitList.get(0);
319
             Visit updataVisit = visitList.get(0);
320
-            updataVisit.setVisitDate(LocalDateTime.now());
320
+            updataVisit.setVisitDate(new Date());
321
             QueryWrapper<Visit> updateQ = new QueryWrapper<>();
321
             QueryWrapper<Visit> updateQ = new QueryWrapper<>();
322
             updateQ.eq("visit_id", updataVisit.getVisitId());
322
             updateQ.eq("visit_id", updataVisit.getVisitId());
323
             visitMapper.update(updataVisit, updateQ);
323
             visitMapper.update(updataVisit, updateQ);
324
         } else {
324
         } else {
325
             visit.setVisitId(idGen.nextId()+"");
325
             visit.setVisitId(idGen.nextId()+"");
326
-            visit.setVisitDate(LocalDateTime.now());
326
+            visit.setVisitDate(new Date());
327
             visitMapper.insert(visit);
327
             visitMapper.insert(visit);
328
         }
328
         }
329
         return responseBean;
329
         return responseBean;

+ 0
- 2
whole-estate/src/main/java/com/example/wholeestate/controller/CustomerController.java 查看文件

81
         ResponseBean  responseBean = iCustomerService.customerSelectId(id);
81
         ResponseBean  responseBean = iCustomerService.customerSelectId(id);
82
         return responseBean;
82
         return responseBean;
83
     }
83
     }
84
-
85
-
86
 }
84
 }

+ 3
- 1
whole-estate/src/main/java/com/example/wholeestate/controller/PropagandaController.java 查看文件

68
     })
68
     })
69
     public ResponseBean getById(@PathVariable String propagandaId) {
69
     public ResponseBean getById(@PathVariable String propagandaId) {
70
         ResponseBean responseBean = new ResponseBean();
70
         ResponseBean responseBean = new ResponseBean();
71
-        Propaganda propaganda = iPropagandaService.getById(propagandaId);
71
+        QueryWrapper<Propaganda> propagandaQueryWrapper = new QueryWrapper<>();
72
+        propagandaQueryWrapper.eq("propaganda_id",propagandaId);
73
+        Propaganda propaganda = iPropagandaService.getOne(propagandaQueryWrapper);
72
         responseBean.addSuccess(propaganda);
74
         responseBean.addSuccess(propaganda);
73
         return responseBean;
75
         return responseBean;
74
     }
76
     }

+ 13
- 0
whole-estate/src/main/java/com/example/wholeestate/dao/ActivityEnrollMapper.java 查看文件

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.List;
11
 import java.util.Map;
12
 import java.util.Map;
12
 
13
 
13
 /**
14
 /**
41
             "WHERE tacus.openid = #{openid} and tac.status > -1 order by tace.enroll_date desc")
42
             "WHERE tacus.openid = #{openid} and tac.status > -1 order by tace.enroll_date desc")
42
     IPage<Activity> selectOpenidActivityEnroll(Page page, @Param("openid") String openid);
43
     IPage<Activity> selectOpenidActivityEnroll(Page page, @Param("openid") String openid);
43
 
44
 
45
+    /**
46
+     * 根据 openid 查询 我参加的活动
47
+     * @param openid
48
+     * @return
49
+     */
50
+    @Select("SELECT tac.*,tacus.phone as phone,tacus.`name` as name,tacus.customer_name as customerName,tab.building_name AS buildingName FROM ta_activity tac " +
51
+            "RIGHT JOIN ta_activity_enroll tace ON tac.activity_id = tace.activity_id " +
52
+            "LEFT JOIN ta_customer tacus ON tace.customer_id = tacus.customer_id " +
53
+            "LEFT JOIN ta_building tab ON tac.building_id = tab.building_id " +
54
+            "WHERE tacus.openid = #{openid} and tac.status > -1 order by tace.enroll_date desc")
55
+    List<Activity> selectOpenidActivityEnrollList(@Param("openid") String openid);
56
+
44
 }
57
 }

+ 12
- 0
whole-estate/src/main/java/com/example/wholeestate/dao/AppointmentMapper.java 查看文件

7
 import org.apache.ibatis.annotations.Param;
7
 import org.apache.ibatis.annotations.Param;
8
 import org.apache.ibatis.annotations.Select;
8
 import org.apache.ibatis.annotations.Select;
9
 
9
 
10
+import java.util.List;
11
+
10
 /**
12
 /**
11
  * <p>
13
  * <p>
12
  * 预约记录表 Mapper 接口
14
  * 预约记录表 Mapper 接口
33
             "WHERE tac.openid = #{openid} and taa.status = 1 order by taa.create_date desc")
35
             "WHERE tac.openid = #{openid} and taa.status = 1 order by taa.create_date desc")
34
     IPage<Appointment> getOpenidAppendableList(Page<Appointment> page, @Param("openid") String openid);
36
     IPage<Appointment> getOpenidAppendableList(Page<Appointment> page, @Param("openid") String openid);
35
 
37
 
38
+    @Select("SELECT " +
39
+            "taa.*, " +
40
+            "tab.building_name AS buildingName " +
41
+            "FROM " +
42
+            "ta_appointment taa " +
43
+            "LEFT JOIN ta_building tab ON taa.building_id = tab.building_id " +
44
+            "LEFT JOIN ta_customer tac ON taa.customer_id = tac.customer_id " +
45
+            "WHERE tac.openid = #{openid} and taa.status = 1 order by taa.create_date desc")
46
+    List<Appointment> getOpenidAppendables(@Param("openid") String openid);
47
+
36
     IPage<Appointment> appendableList(Page page, @Param("buildingId") String buildingId, @Param("username")String username,@Param("phone") String phone,@Param("status") String status);
48
     IPage<Appointment> appendableList(Page page, @Param("buildingId") String buildingId, @Param("username")String username,@Param("phone") String phone,@Param("status") String status);
37
 
49
 
38
 }
50
 }

+ 16
- 0
whole-estate/src/main/java/com/example/wholeestate/dao/TaCollectionMapper.java 查看文件

9
 import org.apache.ibatis.annotations.Param;
9
 import org.apache.ibatis.annotations.Param;
10
 import org.apache.ibatis.annotations.Select;
10
 import org.apache.ibatis.annotations.Select;
11
 
11
 
12
+import java.util.List;
13
+
12
 /**
14
 /**
13
  * <p>
15
  * <p>
14
  * 收藏表 Mapper 接口
16
  * 收藏表 Mapper 接口
34
             "WHERE tacu.openid = #{openid} order by tac.create_date desc")
36
             "WHERE tacu.openid = #{openid} order by tac.create_date desc")
35
     IPage<Building> openidCollectionBuilding(Page<Building> page, @Param("openid") String openid);
37
     IPage<Building> openidCollectionBuilding(Page<Building> page, @Param("openid") String openid);
36
 
38
 
39
+    /**
40
+     * 根据 openid 查询 收藏楼盘记录
41
+     * @param openid
42
+     * @return
43
+     */
44
+    @Select("SELECT " +
45
+            "tab.* " +
46
+            "FROM " +
47
+            "ta_collection tac " +
48
+            "LEFT JOIN ta_building tab ON tac.building_id = tab.building_id " +
49
+            "LEFT JOIN ta_customer tacu ON tac.customer_id = tacu.customer_id " +
50
+            "WHERE tacu.openid = #{openid} order by tac.create_date desc")
51
+    List<Building> openidCollectionBuildingList(@Param("openid") String openid);
52
+
37
     /**
53
     /**
38
      * 根据 openid 和 楼盘id 删除收藏列表
54
      * 根据 openid 和 楼盘id 删除收藏列表
39
      * @param openid
55
      * @param openid

+ 10
- 0
whole-estate/src/main/java/com/example/wholeestate/model/Building.java 查看文件

109
      */
109
      */
110
     private  String marketStatus;
110
     private  String marketStatus;
111
 
111
 
112
+    /**
113
+     * 楼盘区域
114
+     */
115
+    private  String buildingArea;
116
+
112
     /**
117
     /**
113
      * 排序
118
      * 排序
114
      */
119
      */
119
      */
124
      */
120
     private  Integer isMain;
125
     private  Integer isMain;
121
 
126
 
127
+
128
+    /**
129
+     * 地址图片
130
+     */
131
+    private  String mapImg;
122
     /**
132
     /**
123
      * 图片
133
      * 图片
124
      */
134
      */

+ 20
- 0
whole-estate/src/main/java/com/example/wholeestate/model/Customer.java 查看文件

5
 import java.time.LocalDateTime;
5
 import java.time.LocalDateTime;
6
 import com.baomidou.mybatisplus.annotation.TableField;
6
 import com.baomidou.mybatisplus.annotation.TableField;
7
 import java.io.Serializable;
7
 import java.io.Serializable;
8
+import java.util.List;
9
+
8
 import lombok.Data;
10
 import lombok.Data;
9
 import lombok.EqualsAndHashCode;
11
 import lombok.EqualsAndHashCode;
10
 import lombok.experimental.Accessors;
12
 import lombok.experimental.Accessors;
54
      */
56
      */
55
     private Integer hasReg;
57
     private Integer hasReg;
56
 
58
 
59
+    /**
60
+     * 报名的活动
61
+     */
62
+    @TableField(exist = false)
63
+    private List<Activity> Activity;
64
+
65
+    /**
66
+     * 预约记录
67
+     */
68
+    @TableField(exist = false)
69
+    private List<Appointment> Appointment;
70
+
71
+    /**
72
+     * 收藏的楼盘
73
+     */
74
+    @TableField(exist = false)
75
+    private List<Building> CollectionBuilding;
76
+
57
 }
77
 }

+ 2
- 1
whole-estate/src/main/java/com/example/wholeestate/model/Visit.java 查看文件

7
 
7
 
8
 import java.io.Serializable;
8
 import java.io.Serializable;
9
 import java.time.LocalDateTime;
9
 import java.time.LocalDateTime;
10
+import java.util.Date;
10
 
11
 
11
 /**
12
 /**
12
  * <p>
13
  * <p>
30
 
31
 
31
     private String customerName;
32
     private String customerName;
32
 
33
 
33
-    private LocalDateTime visitDate;
34
+    private Date visitDate;
34
 
35
 
35
     private String avatar;
36
     private String avatar;
36
 
37
 

+ 12
- 7
whole-estate/src/main/java/com/example/wholeestate/service/impl/BuildingServiceImpl.java 查看文件

448
             BuildingImgQueryWrapper.eq("img_type", "banner");
448
             BuildingImgQueryWrapper.eq("img_type", "banner");
449
             List<BuildingImg> buildingImg = buildingImgMapper.selectList(BuildingImgQueryWrapper);
449
             List<BuildingImg> buildingImg = buildingImgMapper.selectList(BuildingImgQueryWrapper);
450
             build.setBuildingImg(buildingImg);
450
             build.setBuildingImg(buildingImg);
451
-
452
-            QueryWrapper<Visit> BuildingVisitQueryWrapper = new QueryWrapper<>();
453
-            BuildingVisitQueryWrapper.eq("visit_type", "building");
454
-            BuildingVisitQueryWrapper.eq("visit_content", build.getBuildingId());
455
-            BuildingVisitQueryWrapper.orderByDesc("visit_date");
456
-            List<Visit> visits = visitMapper.selectList(BuildingVisitQueryWrapper);
457
-            build.setVisits(visits);
458
         }
451
         }
459
 
452
 
460
         responseBean.addSuccess(buildingList);
453
         responseBean.addSuccess(buildingList);
478
             BuildingImgQueryWrapper.eq("img_type", "banner");
471
             BuildingImgQueryWrapper.eq("img_type", "banner");
479
             List<BuildingImg> buildingImg = buildingImgMapper.selectList(BuildingImgQueryWrapper);
472
             List<BuildingImg> buildingImg = buildingImgMapper.selectList(BuildingImgQueryWrapper);
480
             build.setBuildingImg(buildingImg);
473
             build.setBuildingImg(buildingImg);
474
+
475
+            QueryWrapper<Visit> BuildingVisitQueryWrapper = new QueryWrapper<>();
476
+            BuildingVisitQueryWrapper.eq("visit_type", "building");
477
+            BuildingVisitQueryWrapper.eq("visit_content", build.getBuildingId());
478
+            BuildingVisitQueryWrapper.orderByDesc("visit_date");
479
+            List<Visit> visits = visitMapper.selectList(BuildingVisitQueryWrapper);
480
+            build.setVisits(visits);
481
+
482
+            QueryWrapper<BuildingTag> buildingTagQueryWrapper = new QueryWrapper<>();
483
+            buildingTagQueryWrapper.eq("building_id", build.getBuildingId());
484
+            List<BuildingTag> buildingTags = buildingTagMapper.selectList(buildingTagQueryWrapper);
485
+            build.setBuildingTag(buildingTags);
481
         }
486
         }
482
 
487
 
483
         responseBean.addSuccess(buildingList);
488
         responseBean.addSuccess(buildingList);

+ 39
- 1
whole-estate/src/main/java/com/example/wholeestate/service/impl/CustomerServiceImpl.java 查看文件

9
 import com.example.wholeestate.common.Constant;
9
 import com.example.wholeestate.common.Constant;
10
 import com.example.wholeestate.common.resp.ResponseBean;
10
 import com.example.wholeestate.common.resp.ResponseBean;
11
 import com.example.wholeestate.common.uuid.IdGen;
11
 import com.example.wholeestate.common.uuid.IdGen;
12
+import com.example.wholeestate.dao.ActivityEnrollMapper;
13
+import com.example.wholeestate.dao.AppointmentMapper;
12
 import com.example.wholeestate.dao.CustomerMapper;
14
 import com.example.wholeestate.dao.CustomerMapper;
13
 
15
 
16
+import com.example.wholeestate.dao.TaCollectionMapper;
17
+import com.example.wholeestate.model.Activity;
18
+import com.example.wholeestate.model.Appointment;
14
 import com.example.wholeestate.model.Customer;
19
 import com.example.wholeestate.model.Customer;
20
+import com.example.wholeestate.model.Building;
15
 import com.example.wholeestate.service.ICustomerService;
21
 import com.example.wholeestate.service.ICustomerService;
16
 import com.example.wholeestate.utils.BeanTools;
22
 import com.example.wholeestate.utils.BeanTools;
17
 import com.example.wholeestate.wx.mini.IWxMini;
23
 import com.example.wholeestate.wx.mini.IWxMini;
18
 import org.apache.http.HttpStatus;
24
 import org.apache.http.HttpStatus;
25
+import org.checkerframework.checker.units.qual.A;
19
 import org.springframework.beans.factory.annotation.Autowired;
26
 import org.springframework.beans.factory.annotation.Autowired;
20
 import org.springframework.stereotype.Service;
27
 import org.springframework.stereotype.Service;
21
 
28
 
23
 import java.util.Date;
30
 import java.util.Date;
24
 import java.util.HashMap;
31
 import java.util.HashMap;
25
 import java.util.List;
32
 import java.util.List;
26
-
27
 /**
33
 /**
28
  * <p>
34
  * <p>
29
  *  服务实现类
35
  *  服务实现类
43
 
49
 
44
     private IdGen idGen = IdGen.get();
50
     private IdGen idGen = IdGen.get();
45
 
51
 
52
+    @Autowired
53
+    private ActivityEnrollMapper activityEnrollMapper;
54
+
55
+    @Autowired
56
+    private AppointmentMapper appointmentMapper;
57
+
58
+    @Autowired
59
+    private TaCollectionMapper taCollectionMapper;
60
+
46
     @Override
61
     @Override
47
     public ResponseBean customerList(Integer pageNum, Integer pageSize, String phone, Date beginDate, Date endDate, String name , String cardNo) {
62
     public ResponseBean customerList(Integer pageNum, Integer pageSize, String phone, Date beginDate, Date endDate, String name , String cardNo) {
48
         ResponseBean response= new ResponseBean();
63
         ResponseBean response= new ResponseBean();
112
             return responseBean;
127
             return responseBean;
113
         }
128
         }
114
 
129
 
130
+        // 获取用户报名活动信息
131
+        List<Activity> activitys = activityEnrollMapper.selectOpenidActivityEnrollList(openid);
132
+        customer.setActivity(activitys);
133
+
134
+        // 获取用户预约信息
135
+        List<Appointment> appointments = appointmentMapper.getOpenidAppendables(openid);
136
+        customer.setAppointment(appointments);
137
+
138
+        // 获取用户收藏记录
139
+        List<Building> taCollections = taCollectionMapper.openidCollectionBuildingList(openid);
140
+        customer.setCollectionBuilding(taCollections);
141
+
115
         responseBean.addSuccess(customer);
142
         responseBean.addSuccess(customer);
116
         return responseBean;
143
         return responseBean;
117
     }
144
     }
125
         queryWrapper.eq("openid", openid);
152
         queryWrapper.eq("openid", openid);
126
         Customer customer = customerMapper.selectOne(queryWrapper);
153
         Customer customer = customerMapper.selectOne(queryWrapper);
127
         if (null != customer) {
154
         if (null != customer) {
155
+            // 获取用户报名活动信息
156
+            List<Activity> activitys = activityEnrollMapper.selectOpenidActivityEnrollList(openid);
157
+            customer.setActivity(activitys);
158
+
159
+            // 获取用户预约信息
160
+            List<Appointment> appointments = appointmentMapper.getOpenidAppendables(openid);
161
+            customer.setAppointment(appointments);
162
+
163
+            // 获取用户收藏记录
164
+            List<Building> taCollections = taCollectionMapper.openidCollectionBuildingList(openid);
165
+            customer.setCollectionBuilding(taCollections);
128
             responseBean.addSuccess(customer);
166
             responseBean.addSuccess(customer);
129
             return responseBean;
167
             return responseBean;
130
         }
168
         }

+ 1
- 1
whole-estate/src/main/resources/application.yml 查看文件

6
   datasource:
6
   datasource:
7
     username: whole-estate
7
     username: whole-estate
8
     password: whole-estate
8
     password: whole-estate
9
-    url: jdbc:mysql://rm-uf6z3z6jq11x653d77o.mysql.rds.aliyuncs.com:3306/whole-estate?useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true
9
+    url: jdbc:mysql://rm-uf6z3z6jq11x653d77o.mysql.rds.aliyuncs.com:3306/whole-estate?useUnicode=true&serverTimezone=CTT&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true
10
     driver-class-name: com.mysql.jdbc.Driver
10
     driver-class-name: com.mysql.jdbc.Driver
11
     initial-size: 10 # 初始化连接数
11
     initial-size: 10 # 初始化连接数
12
     max-active: 20 # 最大连接数
12
     max-active: 20 # 最大连接数