|
@@ -1,12 +1,16 @@
|
1
|
1
|
package com.huiju.estateagents.controller;
|
2
|
2
|
|
3
|
3
|
|
|
4
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
4
|
5
|
import com.huiju.estateagents.base.ResponseBean;
|
5
|
6
|
import com.huiju.estateagents.common.CommConstant;
|
6
|
7
|
import com.huiju.estateagents.common.JWTUtils;
|
7
|
8
|
import com.huiju.estateagents.common.StringUtils;
|
8
|
9
|
import com.huiju.estateagents.entity.TaBuilding;
|
|
10
|
+import com.huiju.estateagents.entity.TaOrg;
|
9
|
11
|
import com.huiju.estateagents.entity.TaPerson;
|
|
12
|
+import com.huiju.estateagents.mapper.TaBuildingMapper;
|
|
13
|
+import com.huiju.estateagents.mapper.TaOrgMapper;
|
10
|
14
|
import com.huiju.estateagents.service.ITaBuildingService;
|
11
|
15
|
import com.huiju.estateagents.service.ITaPersonService;
|
12
|
16
|
import com.huiju.estateagents.service.ITaSaveService;
|
|
@@ -51,6 +55,12 @@ public class TaBuildingController extends BaseController {
|
51
|
55
|
@Autowired
|
52
|
56
|
ITaPersonService iTaPersonService;
|
53
|
57
|
|
|
58
|
+ @Autowired
|
|
59
|
+ TaBuildingMapper taBuildingMapper;
|
|
60
|
+
|
|
61
|
+ @Autowired
|
|
62
|
+ TaOrgMapper taOrgMapper;
|
|
63
|
+
|
54
|
64
|
|
55
|
65
|
/**
|
56
|
66
|
* 楼盘详情
|
|
@@ -350,5 +360,22 @@ public class TaBuildingController extends BaseController {
|
350
|
360
|
ResponseBean taBuilding= taBuildingService.buildingAll(getOrgId(request));
|
351
|
361
|
return taBuilding;
|
352
|
362
|
}
|
|
363
|
+
|
|
364
|
+ /**
|
|
365
|
+ * 校验楼盘是否可以添加
|
|
366
|
+ */
|
|
367
|
+ @RequestMapping(value = "/admin/verifyMax", method = RequestMethod.GET)
|
|
368
|
+ public ResponseBean verifyMax(HttpServletRequest request) {
|
|
369
|
+ // 根据orgId查询当前楼盘最大数
|
|
370
|
+ TaOrg taOrg = taOrgMapper.selectById(getOrgId(request));
|
|
371
|
+ QueryWrapper<TaBuilding> taBuildingQuery = new QueryWrapper<>();
|
|
372
|
+ taBuildingQuery.eq("org_id", getOrgId(request));
|
|
373
|
+ taBuildingQuery.gt("status", -1);
|
|
374
|
+ int orgNum = taBuildingMapper.selectCount(taBuildingQuery);
|
|
375
|
+ if (orgNum >= taOrg.getBuildingNum()) {
|
|
376
|
+ return ResponseBean.error("当前系统仅供维护" + taOrg.getBuildingNum() + "个项目,需要维护更多项目,请联系相关管理人员", ResponseBean.ERROR_UNAVAILABLE);
|
|
377
|
+ }
|
|
378
|
+ return ResponseBean.success("成功");
|
|
379
|
+ }
|
353
|
380
|
}
|
354
|
381
|
|