fuxingfan 3 anos atrás
pai
commit
3b04ec504c

+ 18
- 0
src/main/java/com/yunzhi/marketing/base/BaseController.java Ver arquivo

@@ -1,10 +1,13 @@
1 1
 package com.yunzhi.marketing.base;
2 2
 
3
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
3 4
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4 5
 import com.yunzhi.marketing.center.taUser.entity.TaUser;
5 6
 import com.yunzhi.marketing.center.taUser.service.ITaUserService;
6 7
 import com.yunzhi.marketing.common.JWTUtils;
8
+import com.yunzhi.marketing.entity.TaBuilding;
7 9
 import com.yunzhi.marketing.entity.TaPersonBuilding;
10
+import com.yunzhi.marketing.service.ITaBuildingService;
8 11
 import com.yunzhi.marketing.service.ITaPersonBuildingService;
9 12
 import org.springframework.beans.factory.annotation.Autowired;
10 13
 
@@ -24,6 +27,9 @@ public class BaseController {
24 27
     @Autowired
25 28
     private ITaPersonBuildingService taPersonBuildingService;
26 29
 
30
+    @Autowired
31
+    private ITaBuildingService taBuildingService;
32
+
27 33
     /**
28 34
      * 获取orgId
29 35
      *
@@ -131,9 +137,21 @@ public class BaseController {
131 137
         if (taUser == null) {
132 138
             return null;
133 139
         }
140
+        // 个人授权条件
134 141
         QueryWrapper<TaPersonBuilding> taPersonBuildingQueryWrapper = new QueryWrapper<>();
135 142
         taPersonBuildingQueryWrapper.eq("user_id", taUser.getUserId());
136 143
         List<TaPersonBuilding> taPersonBuildingList = taPersonBuildingService.list(taPersonBuildingQueryWrapper);
144
+        // 新的过滤条件组织机构
145
+        LambdaQueryWrapper<TaBuilding> lambdaQueryWrapper = new LambdaQueryWrapper<>();
146
+        lambdaQueryWrapper.likeRight(TaBuilding::getInstitutionCode,taUser.getInstitutionCode());
147
+        List<TaBuilding> list = taBuildingService.list(lambdaQueryWrapper);
148
+        for (TaBuilding taBuilding: list) {
149
+            TaPersonBuilding taPersonBuilding = new TaPersonBuilding();
150
+            taPersonBuilding.setBuildingId(taBuilding.getBuildingId());
151
+            taPersonBuilding.setUserId(taUser.getUserId());
152
+            taPersonBuildingList.add(taPersonBuilding);
153
+        }
154
+
137 155
         if (null != taUser.getIsAdmin() && taUser.getIsAdmin()) {
138 156
             taPersonBuildingList = new ArrayList<>();
139 157
         }

+ 28
- 0
src/main/java/com/yunzhi/marketing/config/CorsConfig.java Ver arquivo

@@ -0,0 +1,28 @@
1
+package com.yunzhi.marketing.config;
2
+
3
+import org.springframework.context.annotation.Bean;
4
+import org.springframework.context.annotation.Configuration;
5
+import org.springframework.web.cors.CorsConfiguration;
6
+import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
7
+import org.springframework.web.filter.CorsFilter;
8
+
9
+/**
10
+ * 解决跨域问题
11
+ */
12
+@Configuration
13
+public class CorsConfig {
14
+    private CorsConfiguration buildConfig() {
15
+        CorsConfiguration corsConfiguration = new CorsConfiguration();
16
+        corsConfiguration.addAllowedOrigin("*"); // 1 允许任何域名使用
17
+        corsConfiguration.addAllowedHeader("*"); // 2 允许任何头
18
+        corsConfiguration.addAllowedMethod("*"); // 3 允许任何方法(post、get等)
19
+        return corsConfiguration;
20
+    }
21
+
22
+    @Bean
23
+    public CorsFilter corsFilter() {
24
+        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
25
+        source.registerCorsConfiguration("/**", buildConfig()); // 4
26
+        return new CorsFilter(source);
27
+    }
28
+}

+ 1
- 1
src/main/java/com/yunzhi/marketing/xlk/controller/InstitutionController.java Ver arquivo

@@ -66,7 +66,7 @@ public class InstitutionController extends BaseController {
66 66
             }else {
67 67
                 Institution institution = iInstitutionService.getById(institutionCode);
68 68
                 queryWrapper.eq(Institution::getType,institution.getType() + 1);
69
-                queryWrapper.likeLeft(Institution::getInstitutionCode,institution.getInstitutionCode());
69
+                queryWrapper.likeRight(Institution::getInstitutionCode,institution.getInstitutionCode());
70 70
             }
71 71
             queryWrapper.orderByDesc(Institution::getCreateDate);
72 72
 

+ 2
- 133
src/main/java/com/yunzhi/marketing/xlk/dto/SearchHouseDTO.java Ver arquivo

@@ -32,11 +32,6 @@ public class SearchHouseDTO implements Serializable {
32 32
      */
33 33
     private String intentArea;
34 34
 
35
-    /**
36
-     * 意向楼盘
37
-     */
38
-    private String intentBuilding;
39
-
40 35
     /**
41 36
      * 总预算范围最小价格
42 37
      */
@@ -46,12 +41,6 @@ public class SearchHouseDTO implements Serializable {
46 41
      * 总预算范围最大价格
47 42
      */
48 43
     private String maxPrice;
49
-
50
-    /**
51
-     * 首套还是二套
52
-     */
53
-    private String houseNumber;
54
-
55 44
     /**
56 45
      * 0待回访,1已回访,2无效
57 46
      */
@@ -67,134 +56,14 @@ public class SearchHouseDTO implements Serializable {
67 56
      */
68 57
     private Integer type;
69 58
 
70
-    /**
71
-     * 房屋属性
72
-     */
73
-    private String houseAttribute;
74
-
75
-    /**
76
-     * 居室要求
77
-     */
78
-    private String housetRoomType;
79
-
80
-    /**
81
-     * 面积要求
82
-     */
83
-    private String houseArea;
84
-
85
-    /**
86
-     * 价格要求
87
-     */
88
-    private String housePrice;
89
-
90
-    /**
91
-     * 偏好设置
92
-     */
93
-    private String housePreference;
94
-
95
-    /**
96
-     * 购房目的
97
-     */
98
-    private String housePurpose;
99
-
100
-    /**
101
-     * 购房时间
102
-     */
103
-    private String houseTime;
104
-
105 59
     /**
106 60
      * 备注
107 61
      */
108 62
     private String remark;
109 63
 
110 64
     /**
111
-     * 租房预算
112
-     */
113
-    private String rentHouseBudget;
114
-
115
-    /**
116
-     * 租房居室
117
-     */
118
-    private String rentHousetRoomType;
119
-
120
-    /**
121
-     * 租房地址
122
-     */
123
-    private String rentHouseCity;
124
-
125
-    /**
126
-     * 租房要求
127
-     */
128
-    private String rentHouseDemand;
129
-
130
-    /**
131
-     * 海外城市
132
-     */
133
-    private String overseasHouseCity;
134
-
135
-    /**
136
-     * 海外房子预算
137
-     */
138
-    private String overseasHouseBudget;
139
-
140
-    /**
141
-     * 海外房屋类型
142
-     */
143
-    private String overseasHouseType;
144
-
145
-    /**
146
-     * 海外购房目的
147
-     */
148
-    private String overseasHousePurpose;
149
-
150
-    /**
151
-     * 装修预算
152
-     */
153
-    private String fitmentBudget;
154
-
155
-    /**
156
-     * 房屋现状
157
-     */
158
-    private String fitmentHousePresent;
159
-
160
-    /**
161
-     * 家装模式
162
-     */
163
-    private String fitmentMode;
164
-
165
-    /**
166
-     * 看中的家装的方面
167
-     */
168
-    private String fitmentFactor;
169
-
170
-    /**
171
-     * 家装风格
172
-     */
173
-    private String fitmentStyle;
174
-
175
-    /**
176
-     * 家装诉求
177
-     */
178
-    private String fitmentAppeal;
179
-
180
-    /**
181
-     * 家装特殊区域
182
-     */
183
-    private String fitmentSpecialArea;
184
-
185
-    /**
186
-     * 智能家居
187
-     */
188
-    private String fitmentIntelligent;
189
-
190
-    /**
191
-     * 租房偏好
192
-     */
193
-    private String rentHousePreference;
194
-
195
-    /**
196
-     * 装修面积
65
+     * 问卷json字符串
197 66
      */
198
-    private String fitmentArea;
67
+    private String questionnaire;
199 68
 
200 69
 }

+ 0
- 136
src/main/java/com/yunzhi/marketing/xlk/entity/SearchHouse.java Ver arquivo

@@ -67,11 +67,6 @@ public class SearchHouse implements Serializable {
67 67
      */
68 68
     private String intentArea;
69 69
 
70
-    /**
71
-     * 意向楼盘
72
-     */
73
-    private String intentBuilding;
74
-
75 70
     /**
76 71
      * 总预算范围最小价格
77 72
      */
@@ -82,10 +77,6 @@ public class SearchHouse implements Serializable {
82 77
      */
83 78
     private String maxPrice;
84 79
 
85
-    /**
86
-     * 首套还是二套
87
-     */
88
-    private String houseNumber;
89 80
 
90 81
     /**
91 82
      * 0待回访,1已回访,2无效
@@ -102,135 +93,8 @@ public class SearchHouse implements Serializable {
102 93
      */
103 94
     private Integer type;
104 95
 
105
-    /**
106
-     * 房屋属性
107
-     */
108
-    private String houseAttribute;
109
-
110
-    /**
111
-     * 居室要求
112
-     */
113
-    private String housetRoomType;
114
-
115
-    /**
116
-     * 面积要求
117
-     */
118
-    private String houseArea;
119
-
120
-    /**
121
-     * 价格要求
122
-     */
123
-    private String housePrice;
124
-
125
-    /**
126
-     * 偏好设置
127
-     */
128
-    private String housePreference;
129
-
130
-    /**
131
-     * 购房目的
132
-     */
133
-    private String housePurpose;
134
-
135
-    /**
136
-     * 购房时间
137
-     */
138
-    private String houseTime;
139
-
140 96
     /**
141 97
      * 备注
142 98
      */
143 99
     private String remark;
144
-
145
-    /**
146
-     * 租房预算
147
-     */
148
-    private String rentHouseBudget;
149
-
150
-    /**
151
-     * 租房居室
152
-     */
153
-    private String rentHousetRoomType;
154
-
155
-    /**
156
-     * 租房地址
157
-     */
158
-    private String rentHouseCity;
159
-
160
-    /**
161
-     * 租房要求
162
-     */
163
-    private String rentHouseDemand;
164
-
165
-    /**
166
-     * 海外城市
167
-     */
168
-    private String overseasHouseCity;
169
-
170
-    /**
171
-     * 海外房子预算
172
-     */
173
-    private String overseasHouseBudget;
174
-
175
-    /**
176
-     * 海外房屋类型
177
-     */
178
-    private String overseasHouseType;
179
-
180
-    /**
181
-     * 海外购房目的
182
-     */
183
-    private String overseasHousePurpose;
184
-
185
-    /**
186
-     * 装修预算
187
-     */
188
-    private String fitmentBudget;
189
-
190
-    /**
191
-     * 房屋现状
192
-     */
193
-    private String fitmentHousePresent;
194
-
195
-    /**
196
-     * 家装模式
197
-     */
198
-    private String fitmentMode;
199
-
200
-    /**
201
-     * 看中的家装的方面
202
-     */
203
-    private String fitmentFactor;
204
-
205
-    /**
206
-     * 家装风格
207
-     */
208
-    private String fitmentStyle;
209
-
210
-    /**
211
-     * 家装诉求
212
-     */
213
-    private String fitmentAppeal;
214
-
215
-    /**
216
-     * 家装特殊区域
217
-     */
218
-    private String fitmentSpecialArea;
219
-
220
-    /**
221
-     * 智能家居
222
-     */
223
-    private String fitmentIntelligent;
224
-
225
-    /**
226
-     * 租房偏好
227
-     */
228
-    private String rentHousePreference;
229
-
230
-    /**
231
-     * 装修面积
232
-     */
233
-    private String fitmentArea;
234
-
235
-
236 100
 }