dingxin 6 anos atrás
pai
commit
8f63ae667a
20 arquivos alterados com 636 adições e 13 exclusões
  1. 44
    0
      whole-estate/src/main/java/com/example/wholeestate/controller/ActivityController.java
  2. 20
    0
      whole-estate/src/main/java/com/example/wholeestate/controller/ActivityEnrollController.java
  3. 47
    7
      whole-estate/src/main/java/com/example/wholeestate/controller/BuildingController.java
  4. 16
    0
      whole-estate/src/main/java/com/example/wholeestate/dao/ActivityEnrollMapper.java
  5. 16
    0
      whole-estate/src/main/java/com/example/wholeestate/dao/ActivityMapper.java
  6. 10
    2
      whole-estate/src/main/java/com/example/wholeestate/dao/AppointmentMapper.java
  7. 8
    0
      whole-estate/src/main/java/com/example/wholeestate/dao/BuildingMapper.java
  8. 95
    0
      whole-estate/src/main/java/com/example/wholeestate/model/Activity.java
  9. 48
    0
      whole-estate/src/main/java/com/example/wholeestate/model/ActivityEnroll.java
  10. 72
    0
      whole-estate/src/main/java/com/example/wholeestate/model/Appointment.java
  11. 4
    2
      whole-estate/src/main/java/com/example/wholeestate/model/Building.java
  12. 16
    0
      whole-estate/src/main/java/com/example/wholeestate/service/IActivityEnrollService.java
  13. 31
    0
      whole-estate/src/main/java/com/example/wholeestate/service/IActivityService.java
  14. 21
    0
      whole-estate/src/main/java/com/example/wholeestate/service/IBuildingService.java
  15. 20
    0
      whole-estate/src/main/java/com/example/wholeestate/service/impl/ActivityEnrollServiceImpl.java
  16. 59
    0
      whole-estate/src/main/java/com/example/wholeestate/service/impl/ActivityServiceImpl.java
  17. 93
    1
      whole-estate/src/main/java/com/example/wholeestate/service/impl/BuildingServiceImpl.java
  18. 5
    0
      whole-estate/src/main/resources/mapper/ActivityMapper.xml
  19. 8
    0
      whole-estate/src/main/resources/mapper/AppointmentMapper.xml
  20. 3
    1
      whole-estate/src/main/resources/mapper/BuildingMapper.xml

+ 44
- 0
whole-estate/src/main/java/com/example/wholeestate/controller/ActivityController.java Ver arquivo

@@ -0,0 +1,44 @@
1
+package com.example.wholeestate.controller;
2
+
3
+
4
+import com.example.wholeestate.common.base.BaseController;
5
+import com.example.wholeestate.common.resp.ResponseBean;
6
+import com.example.wholeestate.service.IActivityService;
7
+import io.swagger.annotations.Api;
8
+import io.swagger.annotations.ApiImplicitParam;
9
+import io.swagger.annotations.ApiImplicitParams;
10
+import io.swagger.annotations.ApiOperation;
11
+import org.springframework.beans.factory.annotation.Autowired;
12
+import org.springframework.web.bind.annotation.RequestBody;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RequestMethod;
15
+import org.springframework.web.bind.annotation.RestController;
16
+
17
+/**
18
+ * <p>
19
+ * 活动表 前端控制器
20
+ * </p>
21
+ *
22
+ * @author weiximei
23
+ * @since 2019-03-20
24
+ */
25
+@RestController
26
+@RequestMapping("/")
27
+@Api(value = "活动 API", description = "活动 API")
28
+public class ActivityController extends BaseController {
29
+
30
+    @Autowired
31
+    private IActivityService iActivityService;
32
+
33
+    @RequestMapping(value = "/activity/list", method = RequestMethod.POST)
34
+    @ApiOperation(value = "活动列表", notes = "活动列表")
35
+    @ApiImplicitParams({
36
+            @ApiImplicitParam(paramType = "body", dataTypeClass = String.class, name = "parameter", value = "pageNum第几页;pageSize一页多少行")
37
+    })
38
+    public ResponseBean getList(@RequestBody String parameter) {
39
+        ResponseBean responseBean = new ResponseBean();
40
+        responseBean = iActivityService.getList(parameter);
41
+        return responseBean;
42
+    }
43
+
44
+}

+ 20
- 0
whole-estate/src/main/java/com/example/wholeestate/controller/ActivityEnrollController.java Ver arquivo

@@ -0,0 +1,20 @@
1
+package com.example.wholeestate.controller;
2
+
3
+
4
+import com.example.wholeestate.common.base.BaseController;
5
+import org.springframework.web.bind.annotation.RequestMapping;
6
+import org.springframework.web.bind.annotation.RestController;
7
+
8
+/**
9
+ * <p>
10
+ * 活动报名表 前端控制器
11
+ * </p>
12
+ *
13
+ * @author weiximei
14
+ * @since 2019-03-20
15
+ */
16
+@RestController
17
+@RequestMapping("/")
18
+public class ActivityEnrollController extends BaseController {
19
+
20
+}

+ 47
- 7
whole-estate/src/main/java/com/example/wholeestate/controller/BuildingController.java Ver arquivo

@@ -11,10 +11,7 @@ import io.swagger.annotations.ApiImplicitParam;
11 11
 import io.swagger.annotations.ApiImplicitParams;
12 12
 import io.swagger.annotations.ApiOperation;
13 13
 import org.springframework.beans.factory.annotation.Autowired;
14
-import org.springframework.web.bind.annotation.RequestBody;
15
-import org.springframework.web.bind.annotation.RequestMapping;
16
-import org.springframework.web.bind.annotation.RequestMethod;
17
-import org.springframework.web.bind.annotation.RestController;
14
+import org.springframework.web.bind.annotation.*;
18 15
 
19 16
 import javax.servlet.http.HttpSession;
20 17
 
@@ -32,17 +29,60 @@ import javax.servlet.http.HttpSession;
32 29
 public class BuildingController extends BaseController {
33 30
 @Autowired
34 31
     private IBuildingService iBuildingService;
35
-    @ApiOperation(value = "楼盘API", notes = "楼盘API")
32
+
33
+    @RequestMapping(value = "/buildingSelectId/{id}", method = RequestMethod.GET)
34
+    @ApiOperation(value = "楼盘详情", notes = "楼盘详情")
35
+    @ApiImplicitParams({
36
+            @ApiImplicitParam(paramType = "path", dataTypeClass=Integer.class, name = "id", value = "楼盘id"),
37
+    })
38
+//    @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "token")
39
+    public ResponseBean buildingSelectId(@PathVariable(value = "id") Integer id, HttpSession session){
40
+//    SysUser sessionUser= getSessionUser(session);
41
+        ResponseBean  responseBean = iBuildingService.buildingSelectId(id);
42
+        return responseBean;
43
+    }
44
+    @ApiOperation(value = "楼盘列表", notes = "楼盘列表")
36 45
     @ApiImplicitParams({
37 46
             @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "pageNum:分页第几页" +
38 47
                     "pageSize:每页长度")
39 48
 
40 49
     })
41 50
     @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "token")
42
-    @RequestMapping(value = "/buildingList", method = RequestMethod.POST)
51
+    @RequestMapping(value = "/buildinglist", method = RequestMethod.POST)
43 52
     public ResponseBean buildingList(@RequestBody String parameter, HttpSession session){
44
-    SysUser sessionUser= getSessionUser(session);
53
+        SysUser sessionUser= getSessionUser(session);
45 54
         ResponseBean  responseBean = iBuildingService.buildingList(parameter);
46 55
         return responseBean;
47 56
     }
57
+
58
+    @ApiOperation(value = "楼盘修改", notes = "楼盘修改")
59
+    @ApiImplicitParams({
60
+            @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "buildingId:楼盘ID,buildingName:楼盘名称," +
61
+                    "name:楼盘别名,price:价格,openingDate:开盘时间,coordinate:项目坐标,propertyType:物业类型,dynamic:最新动态,tel:电话")
62
+
63
+    })
64
+
65
+//    @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "token")
66
+    @RequestMapping(value = "/building/update", method = RequestMethod.POST)
67
+    public ResponseBean buildingUpdate(@RequestBody String parameter, HttpSession session){
68
+        SysUser sessionUser= getSessionUser(session);
69
+        ResponseBean  responseBean = iBuildingService.buildingUpdate(parameter);
70
+        return responseBean;
71
+    }
72
+
73
+    @ApiOperation(value = "楼盘预约", notes = "楼盘预约")
74
+    @ApiImplicitParams({
75
+            @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "pageNum:分页第几页" +
76
+                    "pageSize:每页长度")
77
+
78
+    })
79
+//    @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "token")
80
+    @RequestMapping(value = "/appointmentlsit", method = RequestMethod.POST)
81
+    public ResponseBean appointmentList(@RequestBody String parameter, HttpSession session){
82
+//        SysUser sessionUser= getSessionUser(session);
83
+        ResponseBean  responseBean = iBuildingService.appointmentList(parameter);
84
+        return responseBean;
85
+    }
86
+
87
+
48 88
 }

+ 16
- 0
whole-estate/src/main/java/com/example/wholeestate/dao/ActivityEnrollMapper.java Ver arquivo

@@ -0,0 +1,16 @@
1
+package com.example.wholeestate.dao;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.example.wholeestate.model.ActivityEnroll;
5
+
6
+/**
7
+ * <p>
8
+ * 活动报名表 Mapper 接口
9
+ * </p>
10
+ *
11
+ * @author weiximei
12
+ * @since 2019-03-20
13
+ */
14
+public interface ActivityEnrollMapper extends BaseMapper<ActivityEnroll> {
15
+
16
+}

+ 16
- 0
whole-estate/src/main/java/com/example/wholeestate/dao/ActivityMapper.java Ver arquivo

@@ -0,0 +1,16 @@
1
+package com.example.wholeestate.dao;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.example.wholeestate.model.Activity;
5
+
6
+/**
7
+ * <p>
8
+ * 活动表 Mapper 接口
9
+ * </p>
10
+ *
11
+ * @author weiximei
12
+ * @since 2019-03-20
13
+ */
14
+public interface ActivityMapper extends BaseMapper<Activity> {
15
+
16
+}

+ 10
- 2
whole-estate/src/main/java/com/example/wholeestate/dao/AppointmentMapper.java Ver arquivo

@@ -1,7 +1,9 @@
1
-package com.community.huiju.ta.mapper;
1
+package com.example.wholeestate.dao;
2 2
 
3
-import com.community.huiju.ta.entity.Appointment;
3
+import com.baomidou.mybatisplus.core.metadata.IPage;
4
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
4 5
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
6
+import com.example.wholeestate.model.Appointment;
5 7
 
6 8
 /**
7 9
  * <p>
@@ -12,5 +14,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
12 14
  * @since 2019-03-20
13 15
  */
14 16
 public interface AppointmentMapper extends BaseMapper<Appointment> {
17
+    /**
18
+     * 预约列表
19
+     * @param page
20
+     * @return
21
+     */
22
+    IPage<Appendable> appendableList(Page<Appendable> page);
15 23
 
16 24
 }

+ 8
- 0
whole-estate/src/main/java/com/example/wholeestate/dao/BuildingMapper.java Ver arquivo

@@ -1,6 +1,8 @@
1 1
 package com.example.wholeestate.dao;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
4 6
 import com.example.wholeestate.model.Building;
5 7
 
6 8
 /**
@@ -12,5 +14,11 @@ import com.example.wholeestate.model.Building;
12 14
  * @since 2019-03-20
13 15
  */
14 16
 public interface BuildingMapper extends BaseMapper<Building> {
17
+    /**
18
+     * 楼盘列表
19
+     * @param page
20
+     * @return
21
+     */
22
+    IPage<Building> buildingList(Page page);
15 23
 
16 24
 }

+ 95
- 0
whole-estate/src/main/java/com/example/wholeestate/model/Activity.java Ver arquivo

@@ -0,0 +1,95 @@
1
+package com.example.wholeestate.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.TableField;
4
+import com.baomidou.mybatisplus.annotation.TableName;
5
+import lombok.Data;
6
+import lombok.EqualsAndHashCode;
7
+import lombok.experimental.Accessors;
8
+
9
+import java.io.Serializable;
10
+import java.time.LocalDateTime;
11
+
12
+/**
13
+ * <p>
14
+ * 活动表
15
+ * </p>
16
+ *
17
+ * @author weiximei
18
+ * @since 2019-03-20
19
+ */
20
+@Data
21
+@EqualsAndHashCode(callSuper = false)
22
+@Accessors(chain = true)
23
+@TableName("ta_activity")
24
+public class Activity implements Serializable {
25
+
26
+    private static final long serialVersionUID = 1L;
27
+
28
+    /**
29
+     * 活动ID
30
+     */
31
+    private String activityId;
32
+
33
+    /**
34
+     * 楼盘ID
35
+     */
36
+    private String buildingId;
37
+
38
+    /**
39
+     * 图片URL
40
+     */
41
+    private String imgUrl;
42
+
43
+    /**
44
+     * 标题
45
+     */
46
+    private String title;
47
+
48
+    /**
49
+     * 描述
50
+     */
51
+    @TableField("`desc`")
52
+    private String desc;
53
+
54
+    /**
55
+     * 发布时间
56
+     */
57
+    private LocalDateTime publicDate;
58
+
59
+    /**
60
+     * 内容
61
+     */
62
+    private String context;
63
+
64
+    /**
65
+     * 0正常,-1删除
66
+     */
67
+    private Integer status;
68
+
69
+    /**
70
+     * 创建时间
71
+     */
72
+    private LocalDateTime createDate;
73
+
74
+    /**
75
+     * 报名开始时间
76
+     */
77
+    private LocalDateTime beginDate;
78
+
79
+    /**
80
+     * 报名截止时间
81
+     */
82
+    private LocalDateTime endDate;
83
+
84
+    /**
85
+     * 活动时间
86
+     */
87
+    private LocalDateTime activityDate;
88
+
89
+    /**
90
+     * 活动的最多人数
91
+     */
92
+    private Integer maxNum;
93
+
94
+
95
+}

+ 48
- 0
whole-estate/src/main/java/com/example/wholeestate/model/ActivityEnroll.java Ver arquivo

@@ -0,0 +1,48 @@
1
+package com.example.wholeestate.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.TableName;
4
+import lombok.Data;
5
+import lombok.EqualsAndHashCode;
6
+import lombok.experimental.Accessors;
7
+
8
+import java.io.Serializable;
9
+import java.time.LocalDateTime;
10
+
11
+/**
12
+ * <p>
13
+ * 活动报名表
14
+ * </p>
15
+ *
16
+ * @author weiximei
17
+ * @since 2019-03-20
18
+ */
19
+@Data
20
+@EqualsAndHashCode(callSuper = false)
21
+@Accessors(chain = true)
22
+@TableName("ta_activity_enroll")
23
+public class ActivityEnroll implements Serializable {
24
+
25
+    private static final long serialVersionUID = 1L;
26
+
27
+    /**
28
+     * 报名ID
29
+     */
30
+    private String enrollId;
31
+
32
+    /**
33
+     * 活动ID
34
+     */
35
+    private String activityId;
36
+
37
+    /**
38
+     * 用户ID
39
+     */
40
+    private String customerId;
41
+
42
+    /**
43
+     * 报名时间
44
+     */
45
+    private LocalDateTime enrollDate;
46
+
47
+
48
+}

+ 72
- 0
whole-estate/src/main/java/com/example/wholeestate/model/Appointment.java Ver arquivo

@@ -0,0 +1,72 @@
1
+package com.example.wholeestate.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.TableName;
4
+import java.time.LocalDateTime;
5
+import java.io.Serializable;
6
+import lombok.Data;
7
+import lombok.EqualsAndHashCode;
8
+import lombok.experimental.Accessors;
9
+
10
+/**
11
+ * <p>
12
+ * 预约记录表
13
+ * </p>
14
+ *
15
+ * @author jobob
16
+ * @since 2019-03-20
17
+ */
18
+@Data
19
+@EqualsAndHashCode(callSuper = false)
20
+@Accessors(chain = true)
21
+@TableName("ta_appointment")
22
+public class Appointment implements Serializable {
23
+
24
+    private static final long serialVersionUID = 1L;
25
+
26
+    /**
27
+     * 预约ID
28
+     */
29
+    private String appointmentId;
30
+
31
+    /**
32
+     * 楼盘ID
33
+     */
34
+    private String buildingId;
35
+
36
+    /**
37
+     * 用户ID
38
+     */
39
+    private String customerId;
40
+
41
+    /**
42
+     * 预约时间
43
+     */
44
+    private String appointmentDate;
45
+
46
+    /**
47
+     * 姓名
48
+     */
49
+    private String customerName;
50
+
51
+    /**
52
+     * 手机号
53
+     */
54
+    private String phone;
55
+
56
+    /**
57
+     * 备注
58
+     */
59
+    private String remark;
60
+
61
+    /**
62
+     * 0正常,-1删除
63
+     */
64
+    private Integer status;
65
+
66
+    /**
67
+     * 创建时间
68
+     */
69
+    private LocalDateTime createDate;
70
+
71
+
72
+}

+ 4
- 2
whole-estate/src/main/java/com/example/wholeestate/model/Building.java Ver arquivo

@@ -3,6 +3,8 @@ package com.example.wholeestate.model;
3 3
 import com.baomidou.mybatisplus.annotation.TableName;
4 4
 import java.time.LocalDateTime;
5 5
 import java.io.Serializable;
6
+import java.util.Date;
7
+
6 8
 import lombok.Data;
7 9
 import lombok.EqualsAndHashCode;
8 10
 import lombok.experimental.Accessors;
@@ -26,7 +28,7 @@ public class Building implements Serializable {
26 28
     /**
27 29
      * 楼盘ID
28 30
      */
29
-    private String buildingId;
31
+    private Integer buildingId;
30 32
 
31 33
     /**
32 34
      * 楼盘名称
@@ -46,7 +48,7 @@ public class Building implements Serializable {
46 48
     /**
47 49
      * 开盘时间
48 50
      */
49
-    private LocalDateTime openingDate;
51
+    private Date openingDate;
50 52
 
51 53
     /**
52 54
      * 项目地址

+ 16
- 0
whole-estate/src/main/java/com/example/wholeestate/service/IActivityEnrollService.java Ver arquivo

@@ -0,0 +1,16 @@
1
+package com.example.wholeestate.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.example.wholeestate.model.ActivityEnroll;
5
+
6
+/**
7
+ * <p>
8
+ * 活动报名表 服务类
9
+ * </p>
10
+ *
11
+ * @author weiximei
12
+ * @since 2019-03-20
13
+ */
14
+public interface IActivityEnrollService extends IService<ActivityEnroll> {
15
+
16
+}

+ 31
- 0
whole-estate/src/main/java/com/example/wholeestate/service/IActivityService.java Ver arquivo

@@ -0,0 +1,31 @@
1
+package com.example.wholeestate.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.example.wholeestate.common.resp.ResponseBean;
5
+import com.example.wholeestate.model.Activity;
6
+
7
+/**
8
+ * <p>
9
+ * 活动表 服务类
10
+ * </p>
11
+ *
12
+ * @author weiximei
13
+ * @since 2019-03-20
14
+ */
15
+public interface IActivityService extends IService<Activity> {
16
+
17
+    /**
18
+     * 查询活动列表
19
+     * @param parameter
20
+     * @return
21
+     */
22
+    ResponseBean getList(String parameter);
23
+
24
+    /**
25
+     * 根据 活动id 查询
26
+     * @param activityId
27
+     * @return
28
+     */
29
+    ResponseBean getById(String activityId);
30
+
31
+}

+ 21
- 0
whole-estate/src/main/java/com/example/wholeestate/service/IBuildingService.java Ver arquivo

@@ -19,4 +19,25 @@ public interface IBuildingService extends IService<Building> {
19 19
      * @return
20 20
      */
21 21
     ResponseBean buildingList(String parameter);
22
+
23
+    /**
24
+     * 楼盘详情
25
+      * @param id
26
+     * @return
27
+     */
28
+    ResponseBean buildingSelectId(Integer id);
29
+
30
+    /**
31
+     * 修改楼盘
32
+     * @param parameter
33
+     * @return
34
+     */
35
+    ResponseBean buildingUpdate(String parameter);
36
+
37
+    /**
38
+     *
39
+     * @param parameter
40
+     * @return
41
+     */
42
+    ResponseBean appointmentList(String parameter);
22 43
 }

+ 20
- 0
whole-estate/src/main/java/com/example/wholeestate/service/impl/ActivityEnrollServiceImpl.java Ver arquivo

@@ -0,0 +1,20 @@
1
+package com.example.wholeestate.service.impl;
2
+
3
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4
+import com.example.wholeestate.dao.ActivityEnrollMapper;
5
+import com.example.wholeestate.model.ActivityEnroll;
6
+import com.example.wholeestate.service.IActivityEnrollService;
7
+import org.springframework.stereotype.Service;
8
+
9
+/**
10
+ * <p>
11
+ * 活动报名表 服务实现类
12
+ * </p>
13
+ *
14
+ * @author weiximei
15
+ * @since 2019-03-20
16
+ */
17
+@Service
18
+public class ActivityEnrollServiceImpl extends ServiceImpl<ActivityEnrollMapper, ActivityEnroll> implements IActivityEnrollService {
19
+
20
+}

+ 59
- 0
whole-estate/src/main/java/com/example/wholeestate/service/impl/ActivityServiceImpl.java Ver arquivo

@@ -0,0 +1,59 @@
1
+package com.example.wholeestate.service.impl;
2
+
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5
+import com.baomidou.mybatisplus.core.metadata.IPage;
6
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
8
+import com.example.wholeestate.common.resp.ResponseBean;
9
+import com.example.wholeestate.dao.ActivityMapper;
10
+import com.example.wholeestate.model.Activity;
11
+import com.example.wholeestate.service.IActivityService;
12
+import org.springframework.beans.factory.annotation.Autowired;
13
+import org.springframework.stereotype.Service;
14
+
15
+/**
16
+ * <p>
17
+ * 活动表 服务实现类
18
+ * </p>
19
+ *
20
+ * @author weiximei
21
+ * @since 2019-03-20
22
+ */
23
+@Service
24
+public class ActivityServiceImpl extends ServiceImpl<ActivityMapper, Activity> implements IActivityService {
25
+
26
+    @Autowired
27
+    private ActivityMapper activityMapper;
28
+
29
+    @Override
30
+    public ResponseBean getList(String parameter) {
31
+        ResponseBean responseBean = new ResponseBean();
32
+
33
+        JSONObject jsonObject = JSONObject.parseObject(parameter);
34
+        Integer pageNum = jsonObject.getInteger("pageNum");
35
+        Integer pageSize = jsonObject.getInteger("pageSize");
36
+
37
+        Page<Activity> page = new Page<>();
38
+        page.setCurrent(pageNum);
39
+        page.setSize(pageSize);
40
+        QueryWrapper<Activity> queryWrapper = new QueryWrapper<>();
41
+        IPage<Activity> activityIPage = activityMapper.selectPage(page, queryWrapper);
42
+        responseBean.addSuccess(activityIPage);
43
+        return responseBean;
44
+    }
45
+
46
+    @Override
47
+    public ResponseBean getById(String activityId) {
48
+        ResponseBean responseBean = new ResponseBean();
49
+
50
+        Activity activity = activityMapper.selectById(activityId);
51
+        if (null == activity) {
52
+            responseBean.addError("活动不存在!");
53
+            return responseBean;
54
+        }
55
+
56
+        responseBean.addSuccess(activityId);
57
+        return responseBean;
58
+    }
59
+}

+ 93
- 1
whole-estate/src/main/java/com/example/wholeestate/service/impl/BuildingServiceImpl.java Ver arquivo

@@ -1,13 +1,24 @@
1 1
 package com.example.wholeestate.service.impl;
2 2
 
3 3
 import com.alibaba.fastjson.JSONObject;
4
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5
+import com.baomidou.mybatisplus.core.metadata.IPage;
6
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
4 7
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5 8
 import com.example.wholeestate.common.resp.ResponseBean;
9
+import com.example.wholeestate.dao.AppointmentMapper;
6 10
 import com.example.wholeestate.dao.BuildingMapper;
7 11
 import com.example.wholeestate.model.Building;
8 12
 import com.example.wholeestate.service.IBuildingService;
13
+import com.fasterxml.jackson.databind.util.ArrayBuilders;
14
+import org.springframework.beans.factory.annotation.Autowired;
9 15
 import org.springframework.stereotype.Service;
10 16
 
17
+import java.time.LocalDateTime;
18
+import java.util.Date;
19
+import java.util.HashMap;
20
+import java.util.List;
21
+
11 22
 /**
12 23
  * <p>
13 24
  * 楼盘表 服务实现类
@@ -18,11 +29,92 @@ import org.springframework.stereotype.Service;
18 29
  */
19 30
 @Service
20 31
 public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> implements IBuildingService {
32
+    @Autowired
33
+    private BuildingMapper buildingMapper;
21 34
 
35
+    @Autowired
36
+    private AppointmentMapper AppointmentMapper;
22 37
     @Override
23 38
     public ResponseBean buildingList(String parameter) {
24 39
         ResponseBean response= new ResponseBean();
25 40
         JSONObject object= JSONObject.parseObject(parameter);
26
-        return null;
41
+
42
+        Integer pageNum = object.getInteger("pageNum");
43
+        Integer pageSize = object.getInteger("pageSize");
44
+
45
+        Page<Building> page = new Page<>();
46
+        page.setSize(pageSize == null ? 10 : pageSize);
47
+        page.setCurrent(pageNum == null ? 1 : pageNum);
48
+         IPage<Building> building= buildingMapper.buildingList(page);
49
+        List<Building> buildingList=building.getRecords();
50
+
51
+        HashMap hashMap= new HashMap<>();
52
+        hashMap.put("list",buildingList);
53
+        hashMap.put("total",building.getTotal());
54
+        hashMap.put("pageNum",building.getCurrent());
55
+        hashMap.put("pageSize",building.getSize());
56
+        response.addSuccess(hashMap);
57
+        return response;
27 58
     }
59
+
60
+    @Override
61
+    public ResponseBean buildingSelectId(Integer id) {
62
+        ResponseBean response= new ResponseBean();
63
+        QueryWrapper<Building> buildingtWrapper = new QueryWrapper<>();
64
+        buildingtWrapper.lambda().eq(Building::getStatus,0);
65
+        Building building= buildingMapper.selectOne(buildingtWrapper);
66
+        response.addSuccess(building);
67
+        return response;
68
+    }
69
+
70
+    @Override
71
+    public ResponseBean buildingUpdate(String parameter) {
72
+        ResponseBean response= new ResponseBean();
73
+
74
+        JSONObject object= JSONObject.parseObject(parameter);
75
+
76
+        Building building = JSONObject.parseObject(parameter,Building.class);
77
+        if (!"".equals(building.getBuildingId())&&null!=building.getBuildingId()){
78
+            response.addError("楼盘名称不能为空");
79
+            return response;
80
+        }
81
+        if (!"".equals(building.getPrice())&&null!=building.getPrice()){
82
+            response.addError("价格不能为空");
83
+            return response;
84
+        }
85
+        if (!"".equals(building.getOpeningDate())&&null!=building.getOpeningDate()){
86
+            response.addError("开盘时间");
87
+            return response;
88
+        }
89
+        building.setOpeningDate(object.getDate("openingDate"));
90
+        building.setCreateDate(LocalDateTime.now());
91
+        buildingMapper.insert(building);
92
+        response.addSuccess("成功");
93
+        return response;
94
+    }
95
+
96
+    @Override
97
+    public ResponseBean appointmentList(String parameter) {
98
+        ResponseBean response= new ResponseBean();
99
+        JSONObject object= JSONObject.parseObject(parameter);
100
+
101
+        Integer pageNum = object.getInteger("pageNum");
102
+        Integer pageSize = object.getInteger("pageSize");
103
+
104
+        Page<Appendable> page = new Page<>();
105
+        page.setSize(pageSize == null ? 10 : pageSize);
106
+        page.setCurrent(pageNum == null ? 1 : pageNum);
107
+        IPage<Appendable> building= AppointmentMapper.appendableList(page);
108
+        List<Appendable> buildingList=building.getRecords();
109
+
110
+        HashMap hashMap= new HashMap<>();
111
+        hashMap.put("list",buildingList);
112
+        hashMap.put("total",building.getTotal());
113
+        hashMap.put("pageNum",building.getCurrent());
114
+        hashMap.put("pageSize",building.getSize());
115
+        response.addSuccess(hashMap);
116
+        return response;
117
+    }
118
+
119
+
28 120
 }

+ 5
- 0
whole-estate/src/main/resources/mapper/ActivityMapper.xml Ver arquivo

@@ -0,0 +1,5 @@
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.ActivityMapper">
4
+
5
+</mapper>

+ 8
- 0
whole-estate/src/main/resources/mapper/AppointmentMapper.xml Ver arquivo

@@ -0,0 +1,8 @@
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.AppointmentMapper">
4
+
5
+    <select id="appendableList" resultType="com.example.wholeestate.model.Appointment">
6
+        SELECT * FROM ta_appointment
7
+    </select>
8
+</mapper>

+ 3
- 1
whole-estate/src/main/resources/mapper/BuildingMapper.xml Ver arquivo

@@ -1,5 +1,7 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.example.wholeestate.dao.BuildingMapper">
4
-
4
+    <select id="buildingList" resultType="com.example.wholeestate.model.Building">
5
+        SELECT * FROM ta_building
6
+    </select>
5 7
 </mapper>