|
@@ -5,10 +5,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
5
|
5
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
6
|
6
|
import com.yunzhi.marketing.base.BaseController;
|
7
|
7
|
import com.yunzhi.marketing.base.ResponseBean;
|
|
8
|
+import com.yunzhi.marketing.common.CommConstant;
|
8
|
9
|
import com.yunzhi.marketing.common.StringUtils;
|
|
10
|
+import com.yunzhi.marketing.entity.SysOrgParams;
|
9
|
11
|
import com.yunzhi.marketing.entity.TaBuilding;
|
10
|
12
|
import com.yunzhi.marketing.entity.TaPerson;
|
11
|
13
|
import com.yunzhi.marketing.entity.TdCity;
|
|
14
|
+import com.yunzhi.marketing.service.ISysOrgParamsService;
|
12
|
15
|
import com.yunzhi.marketing.service.ITaBuildingService;
|
13
|
16
|
import com.yunzhi.marketing.service.ITaPersonService;
|
14
|
17
|
import com.yunzhi.marketing.service.ITdCityService;
|
|
@@ -24,18 +27,13 @@ import org.slf4j.Logger;
|
24
|
27
|
import org.slf4j.LoggerFactory;
|
25
|
28
|
import org.springframework.beans.BeanUtils;
|
26
|
29
|
import org.springframework.beans.factory.annotation.Autowired;
|
27
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
28
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
29
|
|
-import org.springframework.web.bind.annotation.RequestHeader;
|
30
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
31
|
|
-import org.springframework.web.bind.annotation.RequestMethod;
|
32
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
33
|
|
-import org.springframework.web.bind.annotation.ResponseBody;
|
34
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
30
|
+import org.springframework.web.bind.annotation.*;
|
35
|
31
|
|
36
|
32
|
import javax.servlet.http.HttpServletRequest;
|
37
|
33
|
import java.time.LocalDateTime;
|
|
34
|
+import java.util.HashMap;
|
38
|
35
|
import java.util.List;
|
|
36
|
+import java.util.Map;
|
39
|
37
|
|
40
|
38
|
/**
|
41
|
39
|
* <p>
|
|
@@ -64,6 +62,9 @@ public class SearchHouseController extends BaseController {
|
64
|
62
|
@Autowired
|
65
|
63
|
private ITdCityService tdCityService;
|
66
|
64
|
|
|
65
|
+ @Autowired
|
|
66
|
+ private ISysOrgParamsService iSysOrgParamsService;
|
|
67
|
+
|
67
|
68
|
/**
|
68
|
69
|
* 分页查询列表
|
69
|
70
|
* @param pageNum
|
|
@@ -232,4 +233,54 @@ public class SearchHouseController extends BaseController {
|
232
|
233
|
}
|
233
|
234
|
return responseBean;
|
234
|
235
|
}
|
|
236
|
+
|
|
237
|
+ /**
|
|
238
|
+ * 获取帮我找房设置
|
|
239
|
+ * @param request
|
|
240
|
+ * @return
|
|
241
|
+ */
|
|
242
|
+ @GetMapping("/{plat}/searchHouse/setting")
|
|
243
|
+ public ResponseBean getPhone(@PathVariable String plat,
|
|
244
|
+ HttpServletRequest request) {
|
|
245
|
+ Integer orgId = getOrgId(request);
|
|
246
|
+ SysOrgParams paramByCode = iSysOrgParamsService.getParamByCode(CommConstant.SYSPARAM_FEEDBACK_PHONE, orgId);
|
|
247
|
+ if (null == paramByCode) {
|
|
248
|
+ return ResponseBean.error("客服热线未设置", ResponseBean.ERROR_UNAVAILABLE);
|
|
249
|
+ }
|
|
250
|
+
|
|
251
|
+ Map<String, Object> result = new HashMap<>();
|
|
252
|
+ result.put("phone", paramByCode.getParamValue());
|
|
253
|
+
|
|
254
|
+ return ResponseBean.success(result);
|
|
255
|
+ }
|
|
256
|
+
|
|
257
|
+ @PutMapping("/admin/searchHouse/setting/phone/{val}")
|
|
258
|
+ public ResponseBean savePhone(@PathVariable String val, HttpServletRequest request) {
|
|
259
|
+ if (StringUtils.isEmpty(val)) {
|
|
260
|
+ return ResponseBean.error("请设置有效的电话热线", ResponseBean.ERROR_MISSING_PARAMS);
|
|
261
|
+ }
|
|
262
|
+
|
|
263
|
+ Integer orgId = getOrgId(request);
|
|
264
|
+ SysOrgParams paramByCode = iSysOrgParamsService.getParamByCode(CommConstant.SYSPARAM_FEEDBACK_PHONE, orgId);
|
|
265
|
+ if (null == paramByCode) {
|
|
266
|
+ paramByCode = new SysOrgParams();
|
|
267
|
+ paramByCode.setOrgId(orgId);
|
|
268
|
+ paramByCode.setParamName("客服热线");
|
|
269
|
+ paramByCode.setStatus(CommConstant.STATUS_NORMAL);
|
|
270
|
+ paramByCode.setCreateDate(LocalDateTime.now());
|
|
271
|
+ paramByCode.setParamValue(val);
|
|
272
|
+
|
|
273
|
+ if (!iSysOrgParamsService.save(paramByCode)) {
|
|
274
|
+ return ResponseBean.error("设置失败, 请重试!", ResponseBean.ERROR_MISSING_PARAMS);
|
|
275
|
+ }
|
|
276
|
+ } else {
|
|
277
|
+ paramByCode.setParamValue(val);
|
|
278
|
+
|
|
279
|
+ if (!iSysOrgParamsService.updateById(paramByCode)) {
|
|
280
|
+ return ResponseBean.error("设置失败, 请重试!", ResponseBean.ERROR_MISSING_PARAMS);
|
|
281
|
+ }
|
|
282
|
+ }
|
|
283
|
+
|
|
284
|
+ return ResponseBean.success("设置成功");
|
|
285
|
+ }
|
235
|
286
|
}
|