魏熙美 5 年之前
父節點
當前提交
874280fae6

+ 12
- 12
src/main/java/com/huiju/estateagents/controller/TaRecommendCustomerController.java 查看文件

@@ -105,12 +105,12 @@ public class TaRecommendCustomerController extends BaseController {
105 105
         }
106 106
     }
107 107
 
108
-    @PostMapping("/customer/recommend")
109
-    public ResponseBean getCustomerList (@RequestParam(value ="name",defaultValue = "false") String name,
110
-                                         @RequestParam(value ="tel",defaultValue = "false") String tel,
111
-                                         @RequestParam(value ="buildingId",defaultValue = "false") String buildingId,
112
-                                         @RequestParam(value ="consultName",defaultValue = "false") String consultName,
113
-                                         @RequestParam(value ="consultTel",defaultValue = "false") String consultTel,
108
+    @GetMapping("/admin/customer/recommend")
109
+    public ResponseBean getCustomerList (@RequestParam(value ="name",required = false) String name,
110
+                                         @RequestParam(value ="tel",required = false) String tel,
111
+                                         @RequestParam(value ="buildingId",required = false) String buildingId,
112
+                                         @RequestParam(value ="consultName",required = false) String consultName,
113
+                                         @RequestParam(value ="consultTel",required = false) String consultTel,
114 114
                                          @RequestParam(value ="pageNumber",defaultValue = "1") Integer pageNumber,
115 115
                                          @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){
116 116
         try{
@@ -121,8 +121,8 @@ public class TaRecommendCustomerController extends BaseController {
121 121
         }
122 122
     }
123 123
 
124
-    @PostMapping("/customer/recommend/{customerId}")
125
-    public ResponseBean getCustomersIRecommended (@RequestParam int pageNumber, @RequestParam int pageSize,String customerId){
124
+    @GetMapping("/admin/customer/recommend/{customerId}")
125
+    public ResponseBean getCustomersIRecommended (@RequestParam int pageNumber, @RequestParam int pageSize, @PathVariable String customerId){
126 126
         String buildingId="";
127 127
         try{
128 128
             return ResponseBean.success(taRecommendCustomerService.getCustomersIRecommended(pageNumber,pageSize,customerId,buildingId));
@@ -159,7 +159,7 @@ public class TaRecommendCustomerController extends BaseController {
159 159
      * @param taRecommendCustomer 实体对象
160 160
      * @return
161 161
      */
162
-    @RequestMapping(value="/customer/recommend/edit/{id}",method= RequestMethod.PUT)
162
+    @RequestMapping(value="/admin/customer/recommend/edit/{id}",method= RequestMethod.PUT)
163 163
     public ResponseBean taRecommendCustomerUpdate(@PathVariable String id,
164 164
             @RequestBody TaRecommendCustomer taRecommendCustomer){
165 165
         ResponseBean responseBean = new ResponseBean();
@@ -189,8 +189,8 @@ public class TaRecommendCustomerController extends BaseController {
189 189
         return responseBean;
190 190
     }
191 191
 
192
-    @RequestMapping(value = "/customer/recommend/get/{id}")
193
-    public ResponseBean getCutomerDetail(String id) {
192
+    @GetMapping(value = "/admin/customer/recommend/get/{id}")
193
+    public ResponseBean getCutomerDetail(@PathVariable String id) {
194 194
         ResponseBean responseBean = new ResponseBean();
195 195
         try {
196 196
             responseBean.addSuccess(taRecommendCustomerService.getCustomerDetail(id));
@@ -201,7 +201,7 @@ public class TaRecommendCustomerController extends BaseController {
201 201
         return responseBean;
202 202
     }
203 203
 
204
-    @PostMapping("/customer/recommend/drift")
204
+    @GetMapping("/admin/customer/recommend/drift")
205 205
     public ResponseBean getDriftCustomerList (@RequestParam(value ="buildingId",defaultValue = "false") String buildingId,
206 206
                                          @RequestParam(value ="pageNumber",defaultValue = "1") Integer pageNumber,
207 207
                                          @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){

+ 5
- 11
src/main/java/com/huiju/estateagents/service/impl/TaRecommendCustomerServiceImpl.java 查看文件

@@ -248,20 +248,14 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
248 248
     @Override
249 249
     public IPage<TaRecommendCustomer> getCustomerList(int pageNumber, int pageSize,String building,String name,String tel,String consultName,String consultTel){
250 250
         QueryWrapper<TaRecommendCustomer>queryWrapper = new QueryWrapper<>();
251
-        if(building.equals("") && null != building){
252
-            queryWrapper.eq("building_id",building);
253
-        }
254
-        if(name.equals("") && null != name){
255
-            queryWrapper.like("name",name);
256
-        }
257
-        if(tel.equals("") && null != tel){
258
-            queryWrapper.eq("phone",tel);
259
-        }
260
-        if(consultName.equals("") && null != consultName){
251
+        queryWrapper.eq(org.apache.commons.lang3.StringUtils.isNotBlank(building),"building_id",building);
252
+        queryWrapper.like(org.apache.commons.lang3.StringUtils.isNotBlank(name), "name",name);
253
+        queryWrapper.eq(org.apache.commons.lang3.StringUtils.isNotBlank(tel),"phone",tel);
254
+        if(org.apache.commons.lang3.StringUtils.isNotBlank(consultName)){
261 255
             List<String> consultIds = taPersonMapper.getConsultantByName(consultName);
262 256
             queryWrapper.in("realty_consultant",consultIds);
263 257
         }
264
-        if(consultTel.equals("") && null != consultTel){
258
+        if(org.apache.commons.lang3.StringUtils.isNotBlank(consultTel)){
265 259
             String consultId = taPersonMapper.getConsultantByTel(consultTel);
266 260
             queryWrapper.eq("realty_consultant",consultId);
267 261
         }