ソースを参照

getCustomerById

胡轶钦 5 年 前
コミット
e5154aaec5

+ 47
- 1
src/main/java/com/huiju/estateagents/controller/TaPointsExchangeController.java ファイルの表示

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
5 5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6 6
 import com.huiju.estateagents.base.BaseController;
7 7
 import com.huiju.estateagents.base.ResponseBean;
8
+import com.huiju.estateagents.common.CommConstant;
8 9
 import com.huiju.estateagents.entity.TaPointsExchange;
9 10
 import com.huiju.estateagents.service.ITaPointsExchangeService;
10 11
 import org.slf4j.Logger;
@@ -44,11 +45,31 @@ public class TaPointsExchangeController extends BaseController {
44 45
      */
45 46
     @RequestMapping(value="/admin/taPointsExchange",method= RequestMethod.GET)
46 47
     public ResponseBean taPointsExchangeList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
47
-                                             @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){
48
+                                             @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
49
+                                             @RequestParam(value ="personName",required = false) String personName,
50
+                                             @RequestParam(value ="phone",required = false) String phone,
51
+                                             @RequestParam(value ="personType",required = false) String personType,
52
+                                             @RequestParam(value ="targetName",required = false) String targetName,
53
+                                             @RequestParam(value ="startCreateDate",required = false) String startCreateDate,
54
+                                             @RequestParam(value ="endCreateDate",required = false) String endCreateDate,
55
+                                             @RequestParam(value ="startVerifyDate",required = false) String startVerifyDate,
56
+                                             @RequestParam(value ="endVerifyDate",required = false) String endVerifyDate,
57
+                                             @RequestParam(value ="status",required = false) Integer status,
58
+                                             @RequestParam(value ="tel",required = false) String tel){
48 59
         ResponseBean responseBean = new ResponseBean();
49 60
         try {
50 61
             //使用分页插件
51 62
             TaPointsExchange taPointsExchange = new TaPointsExchange();
63
+            taPointsExchange.setPersonName(personName);
64
+            taPointsExchange.setPhone(phone);
65
+            taPointsExchange.setPersonType(personType);
66
+            taPointsExchange.setTargetName(targetName);
67
+            taPointsExchange.setStartCreateDate(startCreateDate);
68
+            taPointsExchange.setEndCreateDate(endCreateDate);
69
+            taPointsExchange.setStartVerifyDate(startVerifyDate);
70
+            taPointsExchange.setEndVerifyDate(endVerifyDate);
71
+            taPointsExchange.setStatus(status);
72
+            taPointsExchange.setTel(tel);
52 73
             
53 74
             responseBean = iTaPointsExchangeService.selectList(pageNum,pageSize,taPointsExchange);
54 75
 
@@ -59,6 +80,31 @@ public class TaPointsExchangeController extends BaseController {
59 80
         }
60 81
         return responseBean;
61 82
     }
83
+    
84
+    /**
85
+     * 修改对象
86
+     * @param taPointsExchange 实体对象
87
+     * @return
88
+     */
89
+    @RequestMapping(value="/admin/taPointsExchange/change",method= RequestMethod.PUT)
90
+    public ResponseBean taPointsExchangeStatusChange(@RequestBody TaPointsExchange taPointsExchange){
91
+        ResponseBean responseBean = new ResponseBean();
92
+        try {
93
+            if (null != taPointsExchange.getStatus() && !taPointsExchange.getStatus().equals(CommConstant.STATUS_NORMAL)){
94
+                taPointsExchange.setStatus(CommConstant.STATUS_NORMAL);
95
+            }
96
+            if (iTaPointsExchangeService.updateById(taPointsExchange)){
97
+                responseBean.addSuccess(taPointsExchange);
98
+            }else {
99
+                responseBean.addError("fail");
100
+            }
101
+        }catch (Exception e){
102
+            e.printStackTrace();
103
+            logger.error("taPointsExchangeUpdate -=- {}",e.toString());
104
+            responseBean.addError(e.getMessage());
105
+        }
106
+        return responseBean;
107
+    }
62 108
 
63 109
     /**
64 110
      * 保存对象

+ 18
- 16
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();
@@ -177,8 +177,8 @@ public class TaRecommendCustomerController extends BaseController {
177 177
         return responseBean;
178 178
     }
179 179
 
180
-    @RequestMapping(value = "/wx/customer/recommend/get/{id}")
181
-    public ResponseBean getSingleCustomer(String customerId) {
180
+    @RequestMapping(value = "/wx/customer/recommend/get/{id}", method = RequestMethod.GET)
181
+    public ResponseBean getSingleCustomer(@PathVariable(value = "id") String customerId) {
182 182
         ResponseBean responseBean = new ResponseBean();
183 183
         try {
184 184
             responseBean.addSuccess(taRecommendCustomerService.getById(customerId));
@@ -189,8 +189,9 @@ public class TaRecommendCustomerController extends BaseController {
189 189
         return responseBean;
190 190
     }
191 191
 
192
-    @RequestMapping(value = "/customer/recommend/{id}")
193
-    public ResponseBean getCustomerById(String customerId) {
192
+
193
+    @RequestMapping(value = "/admin/customer/recommend/getById/{id}", method = RequestMethod.GET)
194
+    public ResponseBean getRecommendCustomerById(@PathVariable(value = "id") String customerId) {
194 195
         ResponseBean responseBean = new ResponseBean();
195 196
         try {
196 197
             responseBean.addSuccess(taRecommendCustomerService.getCustomerById(customerId));
@@ -201,8 +202,9 @@ public class TaRecommendCustomerController extends BaseController {
201 202
         return responseBean;
202 203
     }
203 204
 
204
-    @RequestMapping(value = "/customer/recommend/get/{id}")
205
-    public ResponseBean getCutomerDetail(String id) {
205
+
206
+    @GetMapping(value = "/admin/customer/recommend/get/{id}")
207
+    public ResponseBean getCutomerDetail(@PathVariable String id) {
206 208
         ResponseBean responseBean = new ResponseBean();
207 209
         try {
208 210
             responseBean.addSuccess(taRecommendCustomerService.getCustomerDetail(id));
@@ -213,7 +215,7 @@ public class TaRecommendCustomerController extends BaseController {
213 215
         return responseBean;
214 216
     }
215 217
 
216
-    @PostMapping("/customer/recommend/drift")
218
+    @GetMapping("/admin/customer/recommend/drift")
217 219
     public ResponseBean getDriftCustomerList (@RequestParam(value ="buildingId",defaultValue = "false") String buildingId,
218 220
                                          @RequestParam(value ="pageNumber",defaultValue = "1") Integer pageNumber,
219 221
                                          @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){

+ 3
- 0
src/main/java/com/huiju/estateagents/entity/TaPointsExchange.java ファイルの表示

@@ -120,4 +120,7 @@ public class TaPointsExchange implements Serializable {
120 120
     
121 121
     @TableField(exist = false)
122 122
     private String endVerifyDate;
123
+    
124
+    @TableField(exist = false)
125
+    private String tel;
123 126
 }

+ 2
- 1
src/main/java/com/huiju/estateagents/mapper/TaPointsExchangeMapper.java ファイルの表示

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5 5
 import com.huiju.estateagents.entity.TaPointsExchange;
6 6
 import org.apache.ibatis.annotations.Mapper;
7
+import org.apache.ibatis.annotations.Param;
7 8
 
8 9
 import java.util.List;
9 10
 
@@ -18,5 +19,5 @@ import java.util.List;
18 19
 @Mapper
19 20
 public interface TaPointsExchangeMapper extends BaseMapper<TaPointsExchange> {
20 21
 	
21
-	List<TaPointsExchange> selectListByParams(Page page, TaPointsExchange taPointsExchange);
22
+	List<TaPointsExchange> selectListByParams(Page page,@Param("taPointsExchange") TaPointsExchange taPointsExchange);
22 23
 }

+ 31
- 0
src/main/resources/mapper/TaPointsExchangeMapper.xml ファイルの表示

@@ -24,5 +24,36 @@
24 24
         FROM
25 25
             ta_points_exchange t
26 26
             LEFT JOIN ta_person p ON t.person_id = p.person_id
27
+        where 1=1
28
+        <if test="taPointsExchange.status != null and taPointsExchange.status != '' or taPointsExchange.status ==0">
29
+            and  t.`status` = #{taPointsExchange.status}
30
+        </if>
31
+        <if test="taPointsExchange.personName != null and taPointsExchange.personName != ''">
32
+            and  t.person_name like concat('%',#{taPointsExchange.personName},'%')
33
+        </if>
34
+        <if test="taPointsExchange.phone != null and taPointsExchange.phone != ''">
35
+            and  t.phone like concat('%',#{taPointsExchange.phone},'%')
36
+        </if>
37
+        <if test="taPointsExchange.tel != null and taPointsExchange.tel != ''">
38
+            and  t.phone = #{taPointsExchange.tel}
39
+        </if>
40
+        <if test="taPointsExchange.personType != null and taPointsExchange.personType != ''">
41
+            and  p.person_type = #{taPointsExchange.personType}
42
+        </if>
43
+        <if test="taPointsExchange.targetName != null and taPointsExchange.targetName != ''">
44
+            and  t.target_name like concat('%',#{taPointsExchange.targetName},'%')
45
+        </if>
46
+        <if test="taPointsExchange.startCreateDate != null and taPointsExchange.startCreateDate != ''">
47
+            and  date_format(t.create_date,'%Y-%m-%d') >= date_format(#{taPointsExchange.startCreateDate},'%Y-%m-%d')
48
+        </if>
49
+        <if test="taPointsExchange.endCreateDate != null and taPointsExchange.endCreateDate != ''">
50
+            and  date_format(t.create_date,'%Y-%m-%d') &lt;= date_format(#{taPointsExchange.endCreateDate},'%Y-%m-%d')
51
+        </if>
52
+        <if test="taPointsExchange.startVerifyDate != null and taPointsExchange.startVerifyDate != ''">
53
+            and  date_format(t.verify_date,'%Y-%m-%d') >= date_format(#{taPointsExchange.startVerifyDate},'%Y-%m-%d')
54
+        </if>
55
+        <if test="taPointsExchange.endVerifyDate != null and taPointsExchange.endVerifyDate != ''">
56
+            and  date_format(t.verify_date,'%Y-%m-%d') &lt;= date_format(#{taPointsExchange.startVerifyDate},'%Y-%m-%d')
57
+        </if>
27 58
     </select>
28 59
 </mapper>