浏览代码

帮我找房需求

fuxingfan 4 年前
父节点
当前提交
4edffea162

+ 161
- 0
src/main/java/com/yunzhi/marketing/xlk/controller/SearchHouseController.java 查看文件

@@ -0,0 +1,161 @@
1
+package com.yunzhi.marketing.xlk.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.marketing.base.BaseController;
7
+import com.yunzhi.marketing.base.ResponseBean;
8
+import com.yunzhi.marketing.xlk.entity.SearchHouse;
9
+import com.yunzhi.marketing.xlk.service.ISearchHouseService;
10
+import io.swagger.annotations.Api;
11
+import io.swagger.annotations.ApiOperation;
12
+import org.slf4j.Logger;
13
+import org.slf4j.LoggerFactory;
14
+import org.springframework.beans.factory.annotation.Autowired;
15
+import org.springframework.web.bind.annotation.PathVariable;
16
+import org.springframework.web.bind.annotation.RequestBody;
17
+import org.springframework.web.bind.annotation.RequestHeader;
18
+import org.springframework.web.bind.annotation.RequestMapping;
19
+import org.springframework.web.bind.annotation.RequestMethod;
20
+import org.springframework.web.bind.annotation.RequestParam;
21
+import org.springframework.web.bind.annotation.ResponseBody;
22
+import org.springframework.web.bind.annotation.RestController;
23
+
24
+import javax.servlet.http.HttpServletRequest;
25
+
26
+/**
27
+ * <p>
28
+    * 帮我找房  前端控制器
29
+    * </p>
30
+ *
31
+ * @author jobob
32
+ * @since 2021-05-19
33
+ */
34
+@RestController
35
+@RequestMapping("/api")
36
+@Api(value = "帮我找房", tags = "xlk-帮我找房")
37
+public class SearchHouseController extends BaseController {
38
+
39
+    private final Logger logger = LoggerFactory.getLogger(SearchHouseController.class);
40
+
41
+    @Autowired
42
+    public ISearchHouseService iSearchHouseService;
43
+
44
+
45
+    /**
46
+     * 分页查询列表
47
+     * @param pageNum
48
+     * @param pageSize
49
+     * @return
50
+     */
51
+    @ApiOperation(value = "获取帮我找房列表", notes = "获取帮我找房列表")
52
+    @RequestMapping(value="/searchHouse",method= RequestMethod.GET)
53
+    public ResponseBean searchHouseList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
54
+                                        @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
55
+                                        @RequestHeader("authorization") String token, HttpServletRequest request){
56
+        ResponseBean responseBean = new ResponseBean();
57
+        try {
58
+            //使用分页插件
59
+		    IPage<SearchHouse> pg = new Page<>(pageNum, pageSize);
60
+            LambdaQueryWrapper<SearchHouse> queryWrapper = new LambdaQueryWrapper<>();
61
+            queryWrapper.orderByDesc(SearchHouse::getCreatedTime);
62
+
63
+            IPage<SearchHouse> result = iSearchHouseService.page(pg, queryWrapper);
64
+            responseBean.addSuccess(result);
65
+        }catch (Exception e){
66
+            e.printStackTrace();
67
+            logger.error("searchHouseList -=- {}",e.toString());
68
+            responseBean.addError(e.getMessage());
69
+        }
70
+        return responseBean;
71
+    }
72
+
73
+    /**
74
+     * 保存对象
75
+     * @param searchHouse 实体对象
76
+     * @return
77
+     */
78
+    @ApiOperation(value = "保存帮我找房需求", notes = "保存帮我找房需求")
79
+    @RequestMapping(value="/searchHouse",method= RequestMethod.POST)
80
+    public ResponseBean searchHouseAdd(@RequestBody SearchHouse searchHouse, @RequestHeader("authorization") String token, HttpServletRequest request){
81
+        ResponseBean responseBean = new ResponseBean();
82
+        try {
83
+            if (iSearchHouseService.save(searchHouse)){
84
+                responseBean.addSuccess(searchHouse);
85
+            }else {
86
+                responseBean.addError("fail");
87
+            }
88
+        }catch (Exception e){
89
+            e.printStackTrace();
90
+            logger.error("searchHouseAdd -=- {}",e.toString());
91
+            responseBean.addError(e.getMessage());
92
+        }
93
+        return responseBean;
94
+    }
95
+
96
+    /**
97
+     * 根据id删除对象
98
+     * @param id  实体ID
99
+     */
100
+    @ApiOperation(value = "根据id删除帮我找房需求", notes = "根据id删除帮我找房需求")
101
+    @ResponseBody
102
+    @RequestMapping(value="/searchHouse/{id}", method= RequestMethod.DELETE)
103
+    public ResponseBean searchHouseDelete(@PathVariable Integer id, @RequestHeader("authorization") String token, HttpServletRequest request){
104
+        ResponseBean responseBean = new ResponseBean();
105
+        try {
106
+            if(iSearchHouseService.removeById(id)){
107
+                responseBean.addSuccess("success");
108
+            }else {
109
+                responseBean.addError("fail");
110
+            }
111
+        }catch (Exception e){
112
+            e.printStackTrace();
113
+            logger.error("searchHouseDelete -=- {}",e.toString());
114
+            responseBean.addError(e.getMessage());
115
+        }
116
+        return responseBean;
117
+    }
118
+
119
+    /**
120
+     * 修改对象
121
+     * @param id  实体ID
122
+     * @param searchHouse 实体对象
123
+     * @return
124
+     */
125
+    @ApiOperation(value = "修改帮我找房需求", notes = "修改帮我找房需求")
126
+    @RequestMapping(value="/searchHouse/{id}",method= RequestMethod.PUT)
127
+    public ResponseBean searchHouseUpdate(@PathVariable Integer id,
128
+                                          @RequestBody SearchHouse searchHouse, @RequestHeader("authorization") String token, HttpServletRequest request){
129
+        ResponseBean responseBean = new ResponseBean();
130
+        try {
131
+            if (iSearchHouseService.updateById(searchHouse)){
132
+                responseBean.addSuccess(searchHouse);
133
+            }else {
134
+                responseBean.addError("fail");
135
+            }
136
+        }catch (Exception e){
137
+            e.printStackTrace();
138
+            logger.error("searchHouseUpdate -=- {}",e.toString());
139
+            responseBean.addError(e.getMessage());
140
+        }
141
+        return responseBean;
142
+    }
143
+
144
+    /**
145
+     * 根据id查询对象
146
+     * @param id  实体ID
147
+     */
148
+    @ApiOperation(value = "根据id查询帮我找房需求详情", notes = "根据id查询帮我找房需求详情")
149
+    @RequestMapping(value="/searchHouse/{id}",method= RequestMethod.GET)
150
+    public ResponseBean searchHouseGet(@PathVariable Integer id, @RequestHeader("authorization") String token, HttpServletRequest request){
151
+        ResponseBean responseBean = new ResponseBean();
152
+        try {
153
+            responseBean.addSuccess(iSearchHouseService.getById(id));
154
+        }catch (Exception e){
155
+            e.printStackTrace();
156
+            logger.error("searchHouseDelete -=- {}",e.toString());
157
+            responseBean.addError(e.getMessage());
158
+        }
159
+        return responseBean;
160
+    }
161
+}

+ 113
- 0
src/main/java/com/yunzhi/marketing/xlk/entity/SearchHouse.java 查看文件

@@ -0,0 +1,113 @@
1
+package com.yunzhi.marketing.xlk.entity;
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 jobob
18
+ * @since 2021-05-19
19
+ */
20
+@Data
21
+@EqualsAndHashCode(callSuper = false)
22
+@Accessors(chain = true)
23
+@TableName("xlk_search_house")
24
+public class SearchHouse implements Serializable {
25
+
26
+    private static final long serialVersionUID = 1L;
27
+
28
+    /**
29
+     * 创建人小程序人员
30
+     */
31
+    private String personId;
32
+
33
+    /**
34
+     * 创建时间
35
+     */
36
+    @TableField("CREATED_TIME")
37
+    private LocalDateTime createdTime;
38
+
39
+    /**
40
+     * 更新人
41
+     */
42
+    @TableField("UPDATED_BY")
43
+    private String updatedBy;
44
+
45
+    /**
46
+     * 更新时间
47
+     */
48
+    @TableField("UPDATED_TIME")
49
+    private LocalDateTime updatedTime;
50
+
51
+    /**
52
+     * 公司id
53
+     */
54
+    @TableField("ORG_ID")
55
+    private Integer orgId;
56
+
57
+    /**
58
+     * 意向区域
59
+     */
60
+    private String intentArea;
61
+
62
+    /**
63
+     * 意向楼盘
64
+     */
65
+    private String intentBuilding;
66
+
67
+    /**
68
+     * 最小面积
69
+     */
70
+    private String minArea;
71
+
72
+    /**
73
+     * 最大面积
74
+     */
75
+    private String maxArea;
76
+
77
+    /**
78
+     * 最小户型
79
+     */
80
+    private String minHouseType;
81
+
82
+    /**
83
+     * 最大户型
84
+     */
85
+    private String maxHouseType;
86
+
87
+    /**
88
+     * 最小价格
89
+     */
90
+    private String minPrice;
91
+
92
+    /**
93
+     * 最大价格
94
+     */
95
+    private String maxPrice;
96
+
97
+    /**
98
+     * 备注
99
+     */
100
+    private String remark;
101
+
102
+    /**
103
+     * 0待回访,1已回访,2无效
104
+     */
105
+    private String status;
106
+
107
+    /**
108
+     * 审核结果
109
+     */
110
+    private String auditRemark;
111
+
112
+
113
+}

+ 18
- 0
src/main/java/com/yunzhi/marketing/xlk/mapper/SearchHouseMapper.java 查看文件

@@ -0,0 +1,18 @@
1
+package com.yunzhi.marketing.xlk.mapper;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.yunzhi.marketing.xlk.entity.SearchHouse;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 帮我找房  Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author jobob
13
+ * @since 2021-05-19
14
+ */
15
+@Mapper
16
+public interface SearchHouseMapper extends BaseMapper<SearchHouse> {
17
+
18
+}

+ 16
- 0
src/main/java/com/yunzhi/marketing/xlk/service/ISearchHouseService.java 查看文件

@@ -0,0 +1,16 @@
1
+package com.yunzhi.marketing.xlk.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.yunzhi.marketing.xlk.entity.SearchHouse;
5
+
6
+/**
7
+ * <p>
8
+ * 帮我找房  服务类
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2021-05-19
13
+ */
14
+public interface ISearchHouseService extends IService<SearchHouse> {
15
+
16
+}

+ 20
- 0
src/main/java/com/yunzhi/marketing/xlk/service/impl/SearchHouseServiceImpl.java 查看文件

@@ -0,0 +1,20 @@
1
+package com.yunzhi.marketing.xlk.service.impl;
2
+
3
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4
+import com.yunzhi.marketing.xlk.entity.SearchHouse;
5
+import com.yunzhi.marketing.xlk.mapper.SearchHouseMapper;
6
+import com.yunzhi.marketing.xlk.service.ISearchHouseService;
7
+import org.springframework.stereotype.Service;
8
+
9
+/**
10
+ * <p>
11
+ * 帮我找房  服务实现类
12
+ * </p>
13
+ *
14
+ * @author jobob
15
+ * @since 2021-05-19
16
+ */
17
+@Service
18
+public class SearchHouseServiceImpl extends ServiceImpl<SearchHouseMapper, SearchHouse> implements ISearchHouseService {
19
+
20
+}

+ 157
- 0
src/main/resources/db/marketing.pdman.json 查看文件

@@ -19611,6 +19611,163 @@
19611 19611
             }
19612 19612
           ],
19613 19613
           "chnname": "课程表"
19614
+        },
19615
+        {
19616
+          "title": "xlk_search_house",
19617
+          "fields": [
19618
+            {
19619
+              "name": "id",
19620
+              "type": "Integer",
19621
+              "remark": "",
19622
+              "chnname": "主键",
19623
+              "pk": true,
19624
+              "notNull": true
19625
+            },
19626
+            {
19627
+              "name": "person_id",
19628
+              "type": "IdOrKey",
19629
+              "remark": "",
19630
+              "chnname": "创建人小程序人员"
19631
+            },
19632
+            {
19633
+              "name": "CREATED_TIME",
19634
+              "type": "DateTime",
19635
+              "remark": "",
19636
+              "chnname": "创建时间"
19637
+            },
19638
+            {
19639
+              "name": "UPDATED_BY",
19640
+              "type": "IdOrKey",
19641
+              "remark": "",
19642
+              "chnname": "更新人"
19643
+            },
19644
+            {
19645
+              "name": "UPDATED_TIME",
19646
+              "type": "DateTime",
19647
+              "remark": "",
19648
+              "chnname": "更新时间"
19649
+            },
19650
+            {
19651
+              "name": "ORG_ID",
19652
+              "type": "Integer",
19653
+              "remark": "",
19654
+              "chnname": "公司id"
19655
+            },
19656
+            {
19657
+              "name": "intent_area",
19658
+              "type": "DefaultString",
19659
+              "remark": "",
19660
+              "chnname": "意向区域"
19661
+            },
19662
+            {
19663
+              "name": "intent_building",
19664
+              "type": "DefaultString",
19665
+              "remark": "",
19666
+              "chnname": "意向楼盘"
19667
+            },
19668
+            {
19669
+              "name": "min_area",
19670
+              "type": "DefaultString",
19671
+              "remark": "",
19672
+              "chnname": "最小面积"
19673
+            },
19674
+            {
19675
+              "name": "max_area",
19676
+              "type": "DefaultString",
19677
+              "remark": "",
19678
+              "chnname": "最大面积"
19679
+            },
19680
+            {
19681
+              "name": "min_house_type",
19682
+              "type": "DefaultString",
19683
+              "remark": "",
19684
+              "chnname": "最小户型"
19685
+            },
19686
+            {
19687
+              "name": "max_house_type",
19688
+              "type": "DefaultString",
19689
+              "remark": "",
19690
+              "chnname": "最大户型"
19691
+            },
19692
+            {
19693
+              "name": "min_price",
19694
+              "type": "DefaultString",
19695
+              "remark": "",
19696
+              "chnname": "最小价格"
19697
+            },
19698
+            {
19699
+              "name": "max_price",
19700
+              "type": "DefaultString",
19701
+              "remark": "",
19702
+              "chnname": "最大价格"
19703
+            },
19704
+            {
19705
+              "name": "remark",
19706
+              "type": "ShortString",
19707
+              "remark": "",
19708
+              "chnname": "备注"
19709
+            },
19710
+            {
19711
+              "name": "status",
19712
+              "type": "CHAR_1",
19713
+              "remark": "",
19714
+              "chnname": "0待回访,1已回访,2无效"
19715
+            },
19716
+            {
19717
+              "name": "audit_remark",
19718
+              "type": "ShortString",
19719
+              "remark": "",
19720
+              "chnname": "审核结果"
19721
+            }
19722
+          ],
19723
+          "indexs": [],
19724
+          "headers": [
19725
+            {
19726
+              "fieldName": "chnname",
19727
+              "relationNoShow": false
19728
+            },
19729
+            {
19730
+              "fieldName": "name",
19731
+              "relationNoShow": false
19732
+            },
19733
+            {
19734
+              "fieldName": "type",
19735
+              "relationNoShow": false
19736
+            },
19737
+            {
19738
+              "fieldName": "dataType",
19739
+              "relationNoShow": true
19740
+            },
19741
+            {
19742
+              "fieldName": "remark",
19743
+              "relationNoShow": true
19744
+            },
19745
+            {
19746
+              "fieldName": "pk",
19747
+              "relationNoShow": false
19748
+            },
19749
+            {
19750
+              "fieldName": "notNull",
19751
+              "relationNoShow": true
19752
+            },
19753
+            {
19754
+              "fieldName": "autoIncrement",
19755
+              "relationNoShow": true
19756
+            },
19757
+            {
19758
+              "fieldName": "defaultValue",
19759
+              "relationNoShow": true
19760
+            },
19761
+            {
19762
+              "fieldName": "relationNoShow",
19763
+              "relationNoShow": true
19764
+            },
19765
+            {
19766
+              "fieldName": "uiHint",
19767
+              "relationNoShow": true
19768
+            }
19769
+          ],
19770
+          "chnname": "帮我找房"
19614 19771
         }
19615 19772
       ],
19616 19773
       "graphCanvas": {

+ 5
- 0
src/main/resources/mapper/xlk/SearchHouseMapper.xml 查看文件

@@ -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.yunzhi.marketing.xlk.mapper.SearchHouseMapper">
4
+
5
+</mapper>