张延森 2 年之前
父節點
當前提交
f3ad9bb3c3

+ 2
- 1
src/main/java/com/yunzhi/marketing/base/BaseController.java 查看文件

4
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5
 import com.yunzhi.marketing.center.taUser.entity.TaUser;
5
 import com.yunzhi.marketing.center.taUser.entity.TaUser;
6
 import com.yunzhi.marketing.center.taUser.service.ITaUserService;
6
 import com.yunzhi.marketing.center.taUser.service.ITaUserService;
7
+import com.yunzhi.marketing.common.CommConstant;
7
 import com.yunzhi.marketing.common.JWTUtils;
8
 import com.yunzhi.marketing.common.JWTUtils;
8
 import com.yunzhi.marketing.entity.TaBuilding;
9
 import com.yunzhi.marketing.entity.TaBuilding;
9
 import com.yunzhi.marketing.entity.TaPersonBuilding;
10
 import com.yunzhi.marketing.entity.TaPersonBuilding;
132
         TaUser taUser = taUserService.getById(getUserId(request));
133
         TaUser taUser = taUserService.getById(getUserId(request));
133
         List<Institution> list = iInstitutionService.getAllByUser(taUser);
134
         List<Institution> list = iInstitutionService.getAllByUser(taUser);
134
         List<String> institutions = list.stream().map(Institution::getInstitutionId).collect(Collectors.toList());
135
         List<String> institutions = list.stream().map(Institution::getInstitutionId).collect(Collectors.toList());
135
-        if (institutions.contains("01")) {
136
+        if (institutions.contains(CommConstant.ROOT_INSTITUTION)) {
136
             return null;
137
             return null;
137
         }
138
         }
138
         return institutions;
139
         return institutions;

+ 53
- 18
src/main/java/com/yunzhi/marketing/borker/controller/BkAgreementController.java 查看文件

5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
 import com.yunzhi.marketing.base.BaseController;
6
 import com.yunzhi.marketing.base.BaseController;
7
 import com.yunzhi.marketing.base.ResponseBean;
7
 import com.yunzhi.marketing.base.ResponseBean;
8
+import com.yunzhi.marketing.common.CommConstant;
8
 import io.swagger.annotations.Api;
9
 import io.swagger.annotations.Api;
9
 import io.swagger.annotations.ApiOperation;
10
 import io.swagger.annotations.ApiOperation;
10
 import io.swagger.annotations.ApiParam;
11
 import io.swagger.annotations.ApiParam;
20
 import com.yunzhi.marketing.borker.entity.BkAgreement;
21
 import com.yunzhi.marketing.borker.entity.BkAgreement;
21
 import org.springframework.web.bind.annotation.RestController;
22
 import org.springframework.web.bind.annotation.RestController;
22
 
23
 
24
+import javax.servlet.http.HttpServletRequest;
25
+
23
 /**
26
 /**
24
  * <p>
27
  * <p>
25
     * 佣金规则 前端控制器
28
     * 佣金规则 前端控制器
31
 
34
 
32
 @Api(tags = "佣金规则")
35
 @Api(tags = "佣金规则")
33
 @RestController
36
 @RestController
34
-@RequestMapping("/")
37
+@RequestMapping("/api")
35
 public class BkAgreementController extends BaseController {
38
 public class BkAgreementController extends BaseController {
36
 
39
 
37
     private final Logger logger = LoggerFactory.getLogger(BkAgreementController.class);
40
     private final Logger logger = LoggerFactory.getLogger(BkAgreementController.class);
46
      * @param pageSize
49
      * @param pageSize
47
      * @return
50
      * @return
48
      */
51
      */
49
-    @RequestMapping(value="/bkAgreement",method= RequestMethod.GET)
52
+    @RequestMapping(value="/{client}/bkAgreement",method= RequestMethod.GET)
50
     @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
53
     @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
-    public ResponseBean bkAgreementList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
-									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
54
+    public ResponseBean bkAgreementList(@ApiParam("客户端") @PathVariable String client,
55
+                                        @ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
56
+                                        @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
57
+                                        HttpServletRequest request) throws Exception{
53
 
58
 
54
-		    IPage<BkAgreement> pg = new Page<>(pageNum, pageSize);
55
-            QueryWrapper<BkAgreement> queryWrapper = new QueryWrapper<>();
56
-            queryWrapper.orderByDesc("create_date");
59
+        IPage<BkAgreement> pg = new Page<>(pageNum, pageSize);
60
+        QueryWrapper<BkAgreement> queryWrapper = new QueryWrapper<>();
61
+        queryWrapper.eq("org_id", getOrgId(request));
62
+        queryWrapper.gt("status", CommConstant.STATUS_DELETE);
63
+        queryWrapper.orderByDesc("create_date");
57
 
64
 
58
-            IPage<BkAgreement> result = iBkAgreementService.page(pg, queryWrapper);
59
-            return ResponseBean.success(result);
65
+        IPage<BkAgreement> result = iBkAgreementService.page(pg, queryWrapper);
66
+        return ResponseBean.success(result);
60
     }
67
     }
61
 
68
 
62
     /**
69
     /**
64
      * @param bkAgreement 实体对象
71
      * @param bkAgreement 实体对象
65
      * @return
72
      * @return
66
      */
73
      */
67
-    @RequestMapping(value="/bkAgreement",method= RequestMethod.POST)
74
+    @RequestMapping(value="/admin/bkAgreement",method= RequestMethod.POST)
68
     @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
75
     @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
69
-    public ResponseBean bkAgreementAdd(@ApiParam("保存内容") @RequestBody BkAgreement bkAgreement) throws Exception{
76
+    public ResponseBean bkAgreementAdd(@ApiParam("保存内容") @RequestBody BkAgreement bkAgreement,
77
+                                       HttpServletRequest request) throws Exception {
78
+
79
+        bkAgreement.setOrgId(getOrgId(request).toString());
80
+        bkAgreement.setInstitutionId(CommConstant.ROOT_INSTITUTION);
70
 
81
 
71
         if (iBkAgreementService.save(bkAgreement)){
82
         if (iBkAgreementService.save(bkAgreement)){
72
             return ResponseBean.success(bkAgreement);
83
             return ResponseBean.success(bkAgreement);
79
      * 根据id删除对象
90
      * 根据id删除对象
80
      * @param id  实体ID
91
      * @param id  实体ID
81
      */
92
      */
82
-    @RequestMapping(value="/bkAgreement/{id}", method= RequestMethod.DELETE)
93
+    @RequestMapping(value="/admin/bkAgreement/{id}", method= RequestMethod.DELETE)
83
     @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
94
     @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
84
-    public ResponseBean bkAgreementDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
95
+    public ResponseBean bkAgreementDelete(@ApiParam("对象ID") @PathVariable String id,
96
+                                          HttpServletRequest request) throws Exception{
97
+
98
+        BkAgreement bkAgreement = iBkAgreementService.getById(id);
99
+        if (null == bkAgreement || CommConstant.STATUS_DELETE.equals(bkAgreement)) {
100
+            return ResponseBean.success("success");
101
+        }
102
+
103
+        if (!bkAgreement.getOrgId().equals(getOrgId(request))) {
104
+            return ResponseBean.error("暂无权限", ResponseBean.ERROR_ILLEGAL_PARAMS);
105
+        }
106
+
85
         if(iBkAgreementService.removeById(id)){
107
         if(iBkAgreementService.removeById(id)){
86
             return ResponseBean.success("success");
108
             return ResponseBean.success("success");
87
         }else {
109
         }else {
95
      * @param bkAgreement 实体对象
117
      * @param bkAgreement 实体对象
96
      * @return
118
      * @return
97
      */
119
      */
98
-    @RequestMapping(value="/bkAgreement/{id}",method= RequestMethod.PUT)
120
+    @RequestMapping(value="/admin/bkAgreement/{id}",method= RequestMethod.PUT)
99
     @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
121
     @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
100
-    public ResponseBean bkAgreementUpdate(@ApiParam("对象ID") @PathVariable Integer id,
101
-                                        @ApiParam("更新内容") @RequestBody BkAgreement bkAgreement) throws Exception{
122
+    public ResponseBean bkAgreementUpdate(@ApiParam("对象ID") @PathVariable String id,
123
+                                          @ApiParam("更新内容") @RequestBody BkAgreement bkAgreement,
124
+                                          HttpServletRequest request) throws Exception{
125
+
126
+
127
+        BkAgreement origin = iBkAgreementService.getById(id);
128
+        if (null == bkAgreement || CommConstant.STATUS_DELETE.equals(bkAgreement)) {
129
+            return ResponseBean.success("success");
130
+        }
131
+
132
+        if (!bkAgreement.getOrgId().equals(getOrgId(request))) {
133
+            return ResponseBean.error("暂无权限", ResponseBean.ERROR_ILLEGAL_PARAMS);
134
+        }
135
+
136
+        bkAgreement.setOrgId(origin.getOrgId());
102
 
137
 
103
         if (iBkAgreementService.updateById(bkAgreement)){
138
         if (iBkAgreementService.updateById(bkAgreement)){
104
             return ResponseBean.success(iBkAgreementService.getById(id));
139
             return ResponseBean.success(iBkAgreementService.getById(id));
111
      * 根据id查询对象
146
      * 根据id查询对象
112
      * @param id  实体ID
147
      * @param id  实体ID
113
      */
148
      */
114
-    @RequestMapping(value="/bkAgreement/{id}",method= RequestMethod.GET)
149
+    @RequestMapping(value="/{client}/bkAgreement/{id}",method= RequestMethod.GET)
115
     @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
150
     @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
116
-    public ResponseBean bkAgreementGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
151
+    public ResponseBean bkAgreementGet(@ApiParam("对象ID") @PathVariable String id) throws Exception{
117
         return ResponseBean.success(iBkAgreementService.getById(id));
152
         return ResponseBean.success(iBkAgreementService.getById(id));
118
     }
153
     }
119
 }
154
 }

+ 50
- 17
src/main/java/com/yunzhi/marketing/borker/controller/BkBankCardController.java 查看文件

5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
 import com.yunzhi.marketing.base.BaseController;
6
 import com.yunzhi.marketing.base.BaseController;
7
 import com.yunzhi.marketing.base.ResponseBean;
7
 import com.yunzhi.marketing.base.ResponseBean;
8
+import com.yunzhi.marketing.common.CommConstant;
9
+import com.yunzhi.marketing.entity.TaPerson;
8
 import io.swagger.annotations.Api;
10
 import io.swagger.annotations.Api;
9
 import io.swagger.annotations.ApiOperation;
11
 import io.swagger.annotations.ApiOperation;
10
 import io.swagger.annotations.ApiParam;
12
 import io.swagger.annotations.ApiParam;
20
 import com.yunzhi.marketing.borker.entity.BkBankCard;
22
 import com.yunzhi.marketing.borker.entity.BkBankCard;
21
 import org.springframework.web.bind.annotation.RestController;
23
 import org.springframework.web.bind.annotation.RestController;
22
 
24
 
25
+import javax.servlet.http.HttpServletRequest;
26
+
23
 /**
27
 /**
24
  * <p>
28
  * <p>
25
     * 经纪人银行卡信息 前端控制器
29
     * 经纪人银行卡信息 前端控制器
31
 
35
 
32
 @Api(tags = "经纪人银行卡信息")
36
 @Api(tags = "经纪人银行卡信息")
33
 @RestController
37
 @RestController
34
-@RequestMapping("/")
38
+@RequestMapping("/api")
35
 public class BkBankCardController extends BaseController {
39
 public class BkBankCardController extends BaseController {
36
 
40
 
37
     private final Logger logger = LoggerFactory.getLogger(BkBankCardController.class);
41
     private final Logger logger = LoggerFactory.getLogger(BkBankCardController.class);
46
      * @param pageSize
50
      * @param pageSize
47
      * @return
51
      * @return
48
      */
52
      */
49
-    @RequestMapping(value="/bkBankCard",method= RequestMethod.GET)
53
+    @RequestMapping(value="/wx/bkBankCard",method= RequestMethod.GET)
50
     @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
54
     @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
     public ResponseBean bkBankCardList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
55
     public ResponseBean bkBankCardList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
-									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
56
+                                       @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
57
+                                       HttpServletRequest request) throws Exception {
58
+
59
+        String personId = getPersonId(request);
53
 
60
 
54
-		    IPage<BkBankCard> pg = new Page<>(pageNum, pageSize);
55
-            QueryWrapper<BkBankCard> queryWrapper = new QueryWrapper<>();
56
-            queryWrapper.orderByDesc("create_date");
61
+        IPage<BkBankCard> pg = new Page<>(pageNum, pageSize);
62
+        QueryWrapper<BkBankCard> queryWrapper = new QueryWrapper<>();
63
+        queryWrapper.gt("status", CommConstant.STATUS_DELETE);
64
+        queryWrapper.eq("person_id", personId);
65
+        queryWrapper.orderByDesc("create_date");
57
 
66
 
58
-            IPage<BkBankCard> result = iBkBankCardService.page(pg, queryWrapper);
59
-            return ResponseBean.success(result);
67
+        IPage<BkBankCard> result = iBkBankCardService.page(pg, queryWrapper);
68
+        return ResponseBean.success(result);
60
     }
69
     }
61
 
70
 
62
     /**
71
     /**
64
      * @param bkBankCard 实体对象
73
      * @param bkBankCard 实体对象
65
      * @return
74
      * @return
66
      */
75
      */
67
-    @RequestMapping(value="/bkBankCard",method= RequestMethod.POST)
76
+    @RequestMapping(value="/wx/bkBankCard",method= RequestMethod.POST)
68
     @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
77
     @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
69
-    public ResponseBean bkBankCardAdd(@ApiParam("保存内容") @RequestBody BkBankCard bkBankCard) throws Exception{
78
+    public ResponseBean bkBankCardAdd(@ApiParam("保存内容") @RequestBody BkBankCard bkBankCard,
79
+                                      HttpServletRequest request) throws Exception {
80
+        String personId = getPersonId(request);
81
+        bkBankCard.setPersonId(personId);
70
 
82
 
71
         if (iBkBankCardService.save(bkBankCard)){
83
         if (iBkBankCardService.save(bkBankCard)){
72
             return ResponseBean.success(bkBankCard);
84
             return ResponseBean.success(bkBankCard);
79
      * 根据id删除对象
91
      * 根据id删除对象
80
      * @param id  实体ID
92
      * @param id  实体ID
81
      */
93
      */
82
-    @RequestMapping(value="/bkBankCard/{id}", method= RequestMethod.DELETE)
94
+    @RequestMapping(value="/wx/bkBankCard/{id}", method= RequestMethod.DELETE)
83
     @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
95
     @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
84
-    public ResponseBean bkBankCardDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
96
+    public ResponseBean bkBankCardDelete(@ApiParam("对象ID") @PathVariable Integer id,
97
+                                         HttpServletRequest request) throws Exception {
98
+        String personId = getPersonId(request);
99
+        BkBankCard bkBankCard = iBkBankCardService.getById(id);
100
+        if (null != bkBankCard && !personId.equals(bkBankCard.getPersonId())) {
101
+            return ResponseBean.error("操作异常", ResponseBean.ERROR_ILLEGAL_PARAMS);
102
+        }
103
+
85
         if(iBkBankCardService.removeById(id)){
104
         if(iBkBankCardService.removeById(id)){
86
             return ResponseBean.success("success");
105
             return ResponseBean.success("success");
87
         }else {
106
         }else {
95
      * @param bkBankCard 实体对象
114
      * @param bkBankCard 实体对象
96
      * @return
115
      * @return
97
      */
116
      */
98
-    @RequestMapping(value="/bkBankCard/{id}",method= RequestMethod.PUT)
117
+    @RequestMapping(value="/wx/bkBankCard/{id}",method= RequestMethod.PUT)
99
     @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
118
     @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
100
     public ResponseBean bkBankCardUpdate(@ApiParam("对象ID") @PathVariable Integer id,
119
     public ResponseBean bkBankCardUpdate(@ApiParam("对象ID") @PathVariable Integer id,
101
-                                        @ApiParam("更新内容") @RequestBody BkBankCard bkBankCard) throws Exception{
120
+                                         @ApiParam("更新内容") @RequestBody BkBankCard bkBankCard,
121
+                                         HttpServletRequest request) throws Exception {
122
+        String personId = getPersonId(request);
123
+        BkBankCard origin = iBkBankCardService.getById(id);
124
+        if (null == origin || CommConstant.STATUS_DELETE.equals(origin.getStatus()) || !personId.equals(origin.getPersonId())) {
125
+            return ResponseBean.error("未找到数据", ResponseBean.ERROR_ILLEGAL_PARAMS);
126
+        }
127
+
128
+        bkBankCard.setPersonId(personId);
102
 
129
 
103
         if (iBkBankCardService.updateById(bkBankCard)){
130
         if (iBkBankCardService.updateById(bkBankCard)){
104
             return ResponseBean.success(iBkBankCardService.getById(id));
131
             return ResponseBean.success(iBkBankCardService.getById(id));
111
      * 根据id查询对象
138
      * 根据id查询对象
112
      * @param id  实体ID
139
      * @param id  实体ID
113
      */
140
      */
114
-    @RequestMapping(value="/bkBankCard/{id}",method= RequestMethod.GET)
141
+    @RequestMapping(value="/wx/bkBankCard/{id}",method= RequestMethod.GET)
115
     @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
142
     @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
116
-    public ResponseBean bkBankCardGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
117
-        return ResponseBean.success(iBkBankCardService.getById(id));
143
+    public ResponseBean bkBankCardGet(@ApiParam("对象ID") @PathVariable Integer id,
144
+                                      HttpServletRequest request) throws Exception{
145
+        String personId = getPersonId(request);
146
+        BkBankCard origin = iBkBankCardService.getById(id);
147
+        if (null == origin || CommConstant.STATUS_DELETE.equals(origin.getStatus()) || !personId.equals(origin.getPersonId())) {
148
+            return ResponseBean.error("未找到数据", ResponseBean.ERROR_ILLEGAL_PARAMS);
149
+        }
150
+        return ResponseBean.success(origin);
118
     }
151
     }
119
 }
152
 }

+ 35
- 16
src/main/java/com/yunzhi/marketing/borker/controller/BkFirstScreenController.java 查看文件

5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
 import com.yunzhi.marketing.base.BaseController;
6
 import com.yunzhi.marketing.base.BaseController;
7
 import com.yunzhi.marketing.base.ResponseBean;
7
 import com.yunzhi.marketing.base.ResponseBean;
8
+import com.yunzhi.marketing.common.CommConstant;
9
+import com.yunzhi.marketing.common.StringUtils;
8
 import io.swagger.annotations.Api;
10
 import io.swagger.annotations.Api;
9
 import io.swagger.annotations.ApiOperation;
11
 import io.swagger.annotations.ApiOperation;
10
 import io.swagger.annotations.ApiParam;
12
 import io.swagger.annotations.ApiParam;
20
 import com.yunzhi.marketing.borker.entity.BkFirstScreen;
22
 import com.yunzhi.marketing.borker.entity.BkFirstScreen;
21
 import org.springframework.web.bind.annotation.RestController;
23
 import org.springframework.web.bind.annotation.RestController;
22
 
24
 
25
+import javax.servlet.http.HttpServletRequest;
26
+import java.util.List;
27
+
23
 /**
28
 /**
24
  * <p>
29
  * <p>
25
     * 经纪人首屏广告 前端控制器
30
     * 经纪人首屏广告 前端控制器
31
 
36
 
32
 @Api(tags = "经纪人首屏广告")
37
 @Api(tags = "经纪人首屏广告")
33
 @RestController
38
 @RestController
34
-@RequestMapping("/")
39
+@RequestMapping("/api")
35
 public class BkFirstScreenController extends BaseController {
40
 public class BkFirstScreenController extends BaseController {
36
 
41
 
37
     private final Logger logger = LoggerFactory.getLogger(BkFirstScreenController.class);
42
     private final Logger logger = LoggerFactory.getLogger(BkFirstScreenController.class);
46
      * @param pageSize
51
      * @param pageSize
47
      * @return
52
      * @return
48
      */
53
      */
49
-    @RequestMapping(value="/bkFirstScreen",method= RequestMethod.GET)
54
+    @RequestMapping(value="/{client}/bkFirstScreen",method= RequestMethod.GET)
50
     @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
55
     @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
-    public ResponseBean bkFirstScreenList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
-									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
56
+    public ResponseBean bkFirstScreenList(@ApiParam("客户端") @PathVariable String client,
57
+                                          @ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
58
+                                          @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
59
+                                          HttpServletRequest request) throws Exception{
60
+
61
+        IPage<BkFirstScreen> pg = new Page<>(pageNum, pageSize);
62
+        QueryWrapper<BkFirstScreen> queryWrapper = new QueryWrapper<>();
63
+        queryWrapper.gt("status", CommConstant.STATUS_DELETE);
64
+        queryWrapper.eq("org_id", getOrgId(request));
53
 
65
 
54
-		    IPage<BkFirstScreen> pg = new Page<>(pageNum, pageSize);
55
-            QueryWrapper<BkFirstScreen> queryWrapper = new QueryWrapper<>();
56
-            queryWrapper.orderByDesc("create_date");
66
+        if ("admin".equals(client)) {
67
+            List<String> institutionIds = getInstitutionIds(request);
68
+            queryWrapper.in(null != institutionIds, "institution_id", institutionIds);
69
+        }
57
 
70
 
58
-            IPage<BkFirstScreen> result = iBkFirstScreenService.page(pg, queryWrapper);
59
-            return ResponseBean.success(result);
71
+        queryWrapper.orderByDesc("create_date");
72
+
73
+        IPage<BkFirstScreen> result = iBkFirstScreenService.page(pg, queryWrapper);
74
+        return ResponseBean.success(result);
60
     }
75
     }
61
 
76
 
62
     /**
77
     /**
64
      * @param bkFirstScreen 实体对象
79
      * @param bkFirstScreen 实体对象
65
      * @return
80
      * @return
66
      */
81
      */
67
-    @RequestMapping(value="/bkFirstScreen",method= RequestMethod.POST)
82
+    @RequestMapping(value="/admin/bkFirstScreen",method= RequestMethod.POST)
68
     @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
83
     @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
69
-    public ResponseBean bkFirstScreenAdd(@ApiParam("保存内容") @RequestBody BkFirstScreen bkFirstScreen) throws Exception{
84
+    public ResponseBean bkFirstScreenAdd(@ApiParam("保存内容") @RequestBody BkFirstScreen bkFirstScreen,
85
+                                         HttpServletRequest request) throws Exception{
86
+
87
+        bkFirstScreen.setInstitutionId(CommConstant.ROOT_INSTITUTION);
88
+        bkFirstScreen.setOrgId(getOrgId(request).toString());
70
 
89
 
71
         if (iBkFirstScreenService.save(bkFirstScreen)){
90
         if (iBkFirstScreenService.save(bkFirstScreen)){
72
             return ResponseBean.success(bkFirstScreen);
91
             return ResponseBean.success(bkFirstScreen);
79
      * 根据id删除对象
98
      * 根据id删除对象
80
      * @param id  实体ID
99
      * @param id  实体ID
81
      */
100
      */
82
-    @RequestMapping(value="/bkFirstScreen/{id}", method= RequestMethod.DELETE)
101
+    @RequestMapping(value="/admin/bkFirstScreen/{id}", method= RequestMethod.DELETE)
83
     @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
102
     @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
84
-    public ResponseBean bkFirstScreenDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
103
+    public ResponseBean bkFirstScreenDelete(@ApiParam("对象ID") @PathVariable String id) throws Exception{
85
         if(iBkFirstScreenService.removeById(id)){
104
         if(iBkFirstScreenService.removeById(id)){
86
             return ResponseBean.success("success");
105
             return ResponseBean.success("success");
87
         }else {
106
         }else {
95
      * @param bkFirstScreen 实体对象
114
      * @param bkFirstScreen 实体对象
96
      * @return
115
      * @return
97
      */
116
      */
98
-    @RequestMapping(value="/bkFirstScreen/{id}",method= RequestMethod.PUT)
117
+    @RequestMapping(value="/admin/bkFirstScreen/{id}",method= RequestMethod.PUT)
99
     @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
118
     @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
100
     public ResponseBean bkFirstScreenUpdate(@ApiParam("对象ID") @PathVariable Integer id,
119
     public ResponseBean bkFirstScreenUpdate(@ApiParam("对象ID") @PathVariable Integer id,
101
                                         @ApiParam("更新内容") @RequestBody BkFirstScreen bkFirstScreen) throws Exception{
120
                                         @ApiParam("更新内容") @RequestBody BkFirstScreen bkFirstScreen) throws Exception{
111
      * 根据id查询对象
130
      * 根据id查询对象
112
      * @param id  实体ID
131
      * @param id  实体ID
113
      */
132
      */
114
-    @RequestMapping(value="/bkFirstScreen/{id}",method= RequestMethod.GET)
133
+    @RequestMapping(value="/admin/bkFirstScreen/{id}",method= RequestMethod.GET)
115
     @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
134
     @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
116
-    public ResponseBean bkFirstScreenGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
135
+    public ResponseBean bkFirstScreenGet(@ApiParam("对象ID") @PathVariable String id) throws Exception{
117
         return ResponseBean.success(iBkFirstScreenService.getById(id));
136
         return ResponseBean.success(iBkFirstScreenService.getById(id));
118
     }
137
     }
119
 }
138
 }

+ 76
- 57
src/main/java/com/yunzhi/marketing/borker/controller/BkNoticeController.java 查看文件

5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
 import com.yunzhi.marketing.base.BaseController;
6
 import com.yunzhi.marketing.base.BaseController;
7
 import com.yunzhi.marketing.base.ResponseBean;
7
 import com.yunzhi.marketing.base.ResponseBean;
8
+import com.yunzhi.marketing.common.CommConstant;
8
 import io.swagger.annotations.Api;
9
 import io.swagger.annotations.Api;
9
 import io.swagger.annotations.ApiOperation;
10
 import io.swagger.annotations.ApiOperation;
10
 import io.swagger.annotations.ApiParam;
11
 import io.swagger.annotations.ApiParam;
20
 import com.yunzhi.marketing.borker.entity.BkNotice;
21
 import com.yunzhi.marketing.borker.entity.BkNotice;
21
 import org.springframework.web.bind.annotation.RestController;
22
 import org.springframework.web.bind.annotation.RestController;
22
 
23
 
24
+import javax.servlet.http.HttpServletRequest;
25
+import java.util.List;
26
+
23
 /**
27
 /**
24
  * <p>
28
  * <p>
25
     * 通知公告 前端控制器
29
     * 通知公告 前端控制器
31
 
35
 
32
 @Api(tags = "通知公告")
36
 @Api(tags = "通知公告")
33
 @RestController
37
 @RestController
34
-@RequestMapping("/")
38
+@RequestMapping("/api")
35
 public class BkNoticeController extends BaseController {
39
 public class BkNoticeController extends BaseController {
36
 
40
 
37
     private final Logger logger = LoggerFactory.getLogger(BkNoticeController.class);
41
     private final Logger logger = LoggerFactory.getLogger(BkNoticeController.class);
46
      * @param pageSize
50
      * @param pageSize
47
      * @return
51
      * @return
48
      */
52
      */
49
-    @RequestMapping(value="/bkNotice",method= RequestMethod.GET)
53
+    @RequestMapping(value="/{client}/bkNotice",method= RequestMethod.GET)
50
     @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
54
     @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
-    public ResponseBean bkNoticeList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
-									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
53
-
54
-		    IPage<BkNotice> pg = new Page<>(pageNum, pageSize);
55
-            QueryWrapper<BkNotice> queryWrapper = new QueryWrapper<>();
56
-            queryWrapper.orderByDesc("create_date");
55
+    public ResponseBean bkNoticeList(@ApiParam("客户端") @PathVariable String client,
56
+                                     @ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
57
+                                     @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
58
+                                     HttpServletRequest request) throws Exception{
57
 
59
 
58
-            IPage<BkNotice> result = iBkNoticeService.page(pg, queryWrapper);
59
-            return ResponseBean.success(result);
60
-    }
60
+        IPage<BkNotice> pg = new Page<>(pageNum, pageSize);
61
+        QueryWrapper<BkNotice> queryWrapper = new QueryWrapper<>();
62
+        queryWrapper.gt("status", CommConstant.STATUS_DELETE);
61
 
63
 
62
-    /**
63
-     * 保存对象
64
-     * @param bkNotice 实体对象
65
-     * @return
66
-     */
67
-    @RequestMapping(value="/bkNotice",method= RequestMethod.POST)
68
-    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
69
-    public ResponseBean bkNoticeAdd(@ApiParam("保存内容") @RequestBody BkNotice bkNotice) throws Exception{
70
-
71
-        if (iBkNoticeService.save(bkNotice)){
72
-            return ResponseBean.success(bkNotice);
73
-        }else {
74
-            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
75
-        }
76
-    }
77
-
78
-    /**
79
-     * 根据id删除对象
80
-     * @param id  实体ID
81
-     */
82
-    @RequestMapping(value="/bkNotice/{id}", method= RequestMethod.DELETE)
83
-    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
84
-    public ResponseBean bkNoticeDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
85
-        if(iBkNoticeService.removeById(id)){
86
-            return ResponseBean.success("success");
87
-        }else {
88
-            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
64
+        if ("admin".equals(client)) {
65
+            List<String> institutionIds = getInstitutionIds(request);
66
+            queryWrapper.in(null != institutionIds, "institution_id", institutionIds);
89
         }
67
         }
90
-    }
91
 
68
 
92
-    /**
93
-     * 修改对象
94
-     * @param id  实体ID
95
-     * @param bkNotice 实体对象
96
-     * @return
97
-     */
98
-    @RequestMapping(value="/bkNotice/{id}",method= RequestMethod.PUT)
99
-    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
100
-    public ResponseBean bkNoticeUpdate(@ApiParam("对象ID") @PathVariable Integer id,
101
-                                        @ApiParam("更新内容") @RequestBody BkNotice bkNotice) throws Exception{
69
+        queryWrapper.orderByDesc("create_date");
102
 
70
 
103
-        if (iBkNoticeService.updateById(bkNotice)){
104
-            return ResponseBean.success(iBkNoticeService.getById(id));
105
-        }else {
106
-            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
107
-        }
71
+        IPage<BkNotice> result = iBkNoticeService.page(pg, queryWrapper);
72
+        return ResponseBean.success(result);
108
     }
73
     }
109
 
74
 
75
+//    /**
76
+//     * 保存对象
77
+//     * @param bkNotice 实体对象
78
+//     * @return
79
+//     */
80
+//    @RequestMapping(value="/bkNotice",method= RequestMethod.POST)
81
+//    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
82
+//    public ResponseBean bkNoticeAdd(@ApiParam("保存内容") @RequestBody BkNotice bkNotice) throws Exception{
83
+//
84
+//        if (iBkNoticeService.save(bkNotice)){
85
+//            return ResponseBean.success(bkNotice);
86
+//        }else {
87
+//            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
88
+//        }
89
+//    }
90
+//
91
+//    /**
92
+//     * 根据id删除对象
93
+//     * @param id  实体ID
94
+//     */
95
+//    @RequestMapping(value="/bkNotice/{id}", method= RequestMethod.DELETE)
96
+//    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
97
+//    public ResponseBean bkNoticeDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
98
+//        if(iBkNoticeService.removeById(id)){
99
+//            return ResponseBean.success("success");
100
+//        }else {
101
+//            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
102
+//        }
103
+//    }
104
+//
105
+//    /**
106
+//     * 修改对象
107
+//     * @param id  实体ID
108
+//     * @param bkNotice 实体对象
109
+//     * @return
110
+//     */
111
+//    @RequestMapping(value="/bkNotice/{id}",method= RequestMethod.PUT)
112
+//    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
113
+//    public ResponseBean bkNoticeUpdate(@ApiParam("对象ID") @PathVariable Integer id,
114
+//                                        @ApiParam("更新内容") @RequestBody BkNotice bkNotice) throws Exception{
115
+//
116
+//        if (iBkNoticeService.updateById(bkNotice)){
117
+//            return ResponseBean.success(iBkNoticeService.getById(id));
118
+//        }else {
119
+//            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
120
+//        }
121
+//    }
122
+
110
     /**
123
     /**
111
      * 根据id查询对象
124
      * 根据id查询对象
112
      * @param id  实体ID
125
      * @param id  实体ID
113
      */
126
      */
114
-    @RequestMapping(value="/bkNotice/{id}",method= RequestMethod.GET)
127
+    @RequestMapping(value="/{client}/bkNotice/{id}",method= RequestMethod.GET)
115
     @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
128
     @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
116
-    public ResponseBean bkNoticeGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
117
-        return ResponseBean.success(iBkNoticeService.getById(id));
129
+    public ResponseBean bkNoticeGet(@ApiParam("客户端") @PathVariable String client,
130
+                                    @ApiParam("对象ID") @PathVariable Integer id) throws Exception {
131
+        BkNotice bkNotice = iBkNoticeService.getById(id);
132
+        if (null == bkNotice || CommConstant.STATUS_DELETE.equals(bkNotice.getStatus())) {
133
+            return ResponseBean.error("未找到数据", ResponseBean.ERROR_ILLEGAL_PARAMS);
134
+        }
135
+
136
+        return ResponseBean.success(bkNotice);
118
     }
137
     }
119
 }
138
 }

+ 1
- 1
src/main/java/com/yunzhi/marketing/borker/entity/BkAgreement.java 查看文件

27
     private static final long serialVersionUID = 1L;
27
     private static final long serialVersionUID = 1L;
28
 
28
 
29
     @ApiModelProperty(value = "规则ID")
29
     @ApiModelProperty(value = "规则ID")
30
-    @TableId(value = "rule_id", type = IdType.INPUT)
30
+    @TableId(value = "rule_id", type = IdType.UUID)
31
     private String ruleId;
31
     private String ruleId;
32
 
32
 
33
     @ApiModelProperty(value = "规则内容")
33
     @ApiModelProperty(value = "规则内容")

+ 1
- 1
src/main/java/com/yunzhi/marketing/borker/entity/BkFirstScreen.java 查看文件

27
     private static final long serialVersionUID = 1L;
27
     private static final long serialVersionUID = 1L;
28
 
28
 
29
     @ApiModelProperty(value = "ID")
29
     @ApiModelProperty(value = "ID")
30
-    @TableId(value = "screen_id", type = IdType.INPUT)
30
+    @TableId(value = "screen_id", type = IdType.UUID)
31
     private String screenId;
31
     private String screenId;
32
 
32
 
33
     @ApiModelProperty(value = "显示类型")
33
     @ApiModelProperty(value = "显示类型")

+ 6
- 0
src/main/java/com/yunzhi/marketing/common/CommConstant.java 查看文件

954
      */
954
      */
955
     public static final String CHANNEL_CUSTOMER_AGREE = "2";
955
     public static final String CHANNEL_CUSTOMER_AGREE = "2";
956
     public static final String CHANNEL_CUSTOMER_DISAGREE = "3";
956
     public static final String CHANNEL_CUSTOMER_DISAGREE = "3";
957
+
958
+    /**
959
+     * 根机构ID
960
+     */
961
+    public static final String ROOT_INSTITUTION = "01";
957
 }
962
 }
963
+

+ 1
- 1
src/main/java/com/yunzhi/marketing/service/impl/TaRecommendCustomerServiceImpl.java 查看文件

703
     public String getInstitutionId(String buildingId) {
703
     public String getInstitutionId(String buildingId) {
704
         TaBuilding building = taBuildingMapper.selectById(buildingId);
704
         TaBuilding building = taBuildingMapper.selectById(buildingId);
705
         if (null == building){
705
         if (null == building){
706
-            return "01";
706
+            return CommConstant.ROOT_INSTITUTION;
707
         }
707
         }
708
         return building.getInstitutionId();
708
         return building.getInstitutionId();
709
     }
709
     }