|
@@ -1,225 +1,229 @@
|
1
|
|
-package com.huiju.estateagents.controller;
|
2
|
|
-
|
3
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
4
|
|
-import com.baomidou.mybatisplus.core.metadata.IPage;
|
5
|
|
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
6
|
|
-import com.huiju.estateagents.base.BaseController;
|
7
|
|
-import com.huiju.estateagents.base.ResponseBean;
|
8
|
|
-import com.huiju.estateagents.common.CommConstant;
|
9
|
|
-import com.huiju.estateagents.common.JWTUtils;
|
10
|
|
-import com.huiju.estateagents.entity.TaPerson;
|
11
|
|
-import com.huiju.estateagents.entity.TaPointsRecords;
|
12
|
|
-import com.huiju.estateagents.service.ITaPersonService;
|
13
|
|
-import com.huiju.estateagents.service.ITaPointsRecordsService;
|
14
|
|
-import org.apache.ibatis.annotations.Mapper;
|
15
|
|
-import org.slf4j.Logger;
|
16
|
|
-import org.slf4j.LoggerFactory;
|
17
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
18
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
19
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
20
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
21
|
|
-import org.springframework.web.bind.annotation.RequestMethod;
|
22
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
23
|
|
-import org.springframework.web.bind.annotation.ResponseBody;
|
24
|
|
-import org.springframework.web.bind.annotation.RestController;
|
25
|
|
-
|
26
|
|
-import javax.servlet.http.HttpServletRequest;
|
27
|
|
-import java.util.HashMap;
|
28
|
|
-import java.util.List;
|
29
|
|
-import java.util.Map;
|
30
|
|
-
|
31
|
|
-/**
|
32
|
|
- * <p>
|
33
|
|
- * 积分消费流水表 前端控制器
|
34
|
|
- * </p>
|
35
|
|
- *
|
36
|
|
- * @author jobob
|
37
|
|
- * @since 2019-07-25
|
38
|
|
- */
|
39
|
|
-@RestController
|
40
|
|
-@RequestMapping("/api")
|
41
|
|
-public class TaPointsRecordsController extends BaseController {
|
42
|
|
-
|
43
|
|
- private final Logger logger = LoggerFactory.getLogger(TaPointsRecordsController.class);
|
44
|
|
-
|
45
|
|
- @Autowired
|
46
|
|
- public ITaPointsRecordsService iTaPointsRecordsService;
|
47
|
|
-
|
48
|
|
- @Autowired
|
49
|
|
- private ITaPersonService taPersonService;
|
50
|
|
-
|
51
|
|
-
|
52
|
|
- /**
|
53
|
|
- * 分页查询列表
|
54
|
|
- * @param pageNum
|
55
|
|
- * @param pageSize
|
56
|
|
- * @return
|
57
|
|
- */
|
58
|
|
- @RequestMapping(value="/taPointsRecords",method= RequestMethod.GET)
|
59
|
|
- public ResponseBean taPointsRecordsList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
|
60
|
|
- @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){
|
61
|
|
- ResponseBean responseBean = new ResponseBean();
|
62
|
|
- try {
|
63
|
|
- //使用分页插件
|
64
|
|
- IPage<TaPointsRecords> pg = new Page<>(pageNum, pageSize);
|
65
|
|
- QueryWrapper<TaPointsRecords> queryWrapper = new QueryWrapper<>();
|
66
|
|
- queryWrapper.orderByDesc("create_date");
|
67
|
|
-
|
68
|
|
- IPage<TaPointsRecords> result = iTaPointsRecordsService.page(pg, queryWrapper);
|
69
|
|
- responseBean.addSuccess(result);
|
70
|
|
- }catch (Exception e){
|
71
|
|
- e.printStackTrace();
|
72
|
|
- logger.error("taPointsRecordsList -=- {}",e.toString());
|
73
|
|
- responseBean.addError(e.getMessage());
|
74
|
|
- }
|
75
|
|
- return responseBean;
|
76
|
|
- }
|
77
|
|
-
|
78
|
|
- /**
|
79
|
|
- * 保存对象
|
80
|
|
- * @param taPointsRecords 实体对象
|
81
|
|
- * @return
|
82
|
|
- */
|
83
|
|
- @RequestMapping(value="/taPointsRecords",method= RequestMethod.POST)
|
84
|
|
- public ResponseBean taPointsRecordsAdd(@RequestBody TaPointsRecords taPointsRecords){
|
85
|
|
- ResponseBean responseBean = new ResponseBean();
|
86
|
|
- try {
|
87
|
|
- if (iTaPointsRecordsService.save(taPointsRecords)){
|
88
|
|
- responseBean.addSuccess(taPointsRecords);
|
89
|
|
- }else {
|
90
|
|
- responseBean.addError("fail");
|
91
|
|
- }
|
92
|
|
- }catch (Exception e){
|
93
|
|
- e.printStackTrace();
|
94
|
|
- logger.error("taPointsRecordsAdd -=- {}",e.toString());
|
95
|
|
- responseBean.addError(e.getMessage());
|
96
|
|
- }
|
97
|
|
- return responseBean;
|
98
|
|
- }
|
99
|
|
-
|
100
|
|
- /**
|
101
|
|
- * 根据id删除对象
|
102
|
|
- * @param id 实体ID
|
103
|
|
- */
|
104
|
|
- @ResponseBody
|
105
|
|
- @RequestMapping(value="/taPointsRecords/{id}", method= RequestMethod.DELETE)
|
106
|
|
- public ResponseBean taPointsRecordsDelete(@PathVariable Integer id){
|
107
|
|
- ResponseBean responseBean = new ResponseBean();
|
108
|
|
- try {
|
109
|
|
- if(iTaPointsRecordsService.removeById(id)){
|
110
|
|
- responseBean.addSuccess("success");
|
111
|
|
- }else {
|
112
|
|
- responseBean.addError("fail");
|
113
|
|
- }
|
114
|
|
- }catch (Exception e){
|
115
|
|
- e.printStackTrace();
|
116
|
|
- logger.error("taPointsRecordsDelete -=- {}",e.toString());
|
117
|
|
- responseBean.addError(e.getMessage());
|
118
|
|
- }
|
119
|
|
- return responseBean;
|
120
|
|
- }
|
121
|
|
-
|
122
|
|
- /**
|
123
|
|
- * 修改对象
|
124
|
|
- * @param id 实体ID
|
125
|
|
- * @param taPointsRecords 实体对象
|
126
|
|
- * @return
|
127
|
|
- */
|
128
|
|
- @RequestMapping(value="/taPointsRecords/{id}",method= RequestMethod.PUT)
|
129
|
|
- public ResponseBean taPointsRecordsUpdate(@PathVariable Integer id,
|
130
|
|
- @RequestBody TaPointsRecords taPointsRecords){
|
131
|
|
- ResponseBean responseBean = new ResponseBean();
|
132
|
|
- taPointsRecords.setPointsRecordId(id);
|
133
|
|
- try {
|
134
|
|
- if (iTaPointsRecordsService.updateById(taPointsRecords)){
|
135
|
|
- responseBean.addSuccess(taPointsRecords);
|
136
|
|
- }else {
|
137
|
|
- responseBean.addError("fail");
|
138
|
|
- }
|
139
|
|
- }catch (Exception e){
|
140
|
|
- e.printStackTrace();
|
141
|
|
- logger.error("taPointsRecordsUpdate -=- {}",e.toString());
|
142
|
|
- responseBean.addError(e.getMessage());
|
143
|
|
- }
|
144
|
|
- return responseBean;
|
145
|
|
- }
|
146
|
|
-
|
147
|
|
- /**
|
148
|
|
- * 根据id查询对象
|
149
|
|
- * @param id 实体ID
|
150
|
|
- */
|
151
|
|
- @RequestMapping(value="/taPointsRecords/{id}",method= RequestMethod.GET)
|
152
|
|
- public ResponseBean taPointsRecordsGet(@PathVariable Integer id){
|
153
|
|
- ResponseBean responseBean = new ResponseBean();
|
154
|
|
- try {
|
155
|
|
- responseBean.addSuccess(iTaPointsRecordsService.getById(id));
|
156
|
|
- }catch (Exception e){
|
157
|
|
- e.printStackTrace();
|
158
|
|
- logger.error("taPointsRecordsDelete -=- {}",e.toString());
|
159
|
|
- responseBean.addError(e.getMessage());
|
160
|
|
- }
|
161
|
|
- return responseBean;
|
162
|
|
- }
|
163
|
|
-
|
164
|
|
- /**
|
165
|
|
- * 分页查询列表
|
166
|
|
- * @param pageNum
|
167
|
|
- * @param pageSize
|
168
|
|
- * @return
|
169
|
|
- */
|
170
|
|
- @RequestMapping(value="/wx/taPointsRecords",method= RequestMethod.GET)
|
171
|
|
- public ResponseBean wxPointsRecordsList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
|
172
|
|
- @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
|
173
|
|
- HttpServletRequest request){
|
174
|
|
- ResponseBean responseBean = new ResponseBean();
|
175
|
|
- try {
|
176
|
|
- String openid = JWTUtils.getSubject(request);
|
177
|
|
- TaPerson taPerson = taPersonService.getPersonsByOpenId(openid).get(0);
|
178
|
|
- //使用分页插件
|
179
|
|
- IPage<TaPointsRecords> pg = new Page<>(pageNum, pageSize);
|
180
|
|
- QueryWrapper<TaPointsRecords> queryWrapper = new QueryWrapper<>();
|
181
|
|
- queryWrapper.eq("person_id",taPerson.getPersonId());
|
182
|
|
- queryWrapper.orderByDesc("create_date");
|
183
|
|
- IPage<TaPointsRecords> result = iTaPointsRecordsService.page(pg, queryWrapper);
|
184
|
|
- responseBean.addSuccess(result);
|
185
|
|
- }catch (Exception e){
|
186
|
|
- e.printStackTrace();
|
187
|
|
- logger.error("taPointsRecordsList -=- {}",e.toString());
|
188
|
|
- responseBean.addError(e.getMessage());
|
189
|
|
- }
|
190
|
|
- return responseBean;
|
191
|
|
- }
|
192
|
|
-
|
193
|
|
- /**
|
194
|
|
- * 分页查询列表
|
195
|
|
- * @param pageNum
|
196
|
|
- * @param pageSize
|
197
|
|
- * @return
|
198
|
|
- */
|
199
|
|
- @RequestMapping(value="/admin/taPointsRecords/{id}",method= RequestMethod.GET)
|
200
|
|
- public ResponseBean CustomerPointsRecordsList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
|
201
|
|
- @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
|
202
|
|
- @PathVariable(value = "id") String id){
|
203
|
|
- ResponseBean responseBean = new ResponseBean();
|
204
|
|
- try {
|
205
|
|
- IPage<TaPointsRecords> pg = new Page<>(pageNum, pageSize);
|
206
|
|
- QueryWrapper<TaPointsRecords> queryWrapper = new QueryWrapper<>();
|
207
|
|
- queryWrapper.eq("person_id",taPersonService.getPersonIdByCustomerId(id));
|
208
|
|
- queryWrapper.orderByDesc("create_date");
|
209
|
|
- IPage<TaPointsRecords> result = iTaPointsRecordsService.page(pg, queryWrapper);
|
210
|
|
- Integer totalPoints = 0;
|
211
|
|
- for (int i = 0;i<result.getRecords().size();i++){
|
212
|
|
- totalPoints += result.getRecords().get(i).getPointsAmount();
|
213
|
|
- }
|
214
|
|
- Map<String,Object> data = new HashMap<>();
|
215
|
|
- data.put("totalPoints",totalPoints);
|
216
|
|
- data.put("result",result);
|
217
|
|
- responseBean.addSuccess(data);
|
218
|
|
- }catch (Exception e){
|
219
|
|
- e.printStackTrace();
|
220
|
|
- logger.error("taPointsRecordsList -=- {}",e.toString());
|
221
|
|
- responseBean.addError(e.getMessage());
|
222
|
|
- }
|
223
|
|
- return responseBean;
|
224
|
|
- }
|
225
|
|
-}
|
|
1
|
+package com.huiju.estateagents.controller;
|
|
2
|
+
|
|
3
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
4
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
5
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
6
|
+import com.huiju.estateagents.base.BaseController;
|
|
7
|
+import com.huiju.estateagents.base.ResponseBean;
|
|
8
|
+import com.huiju.estateagents.common.CommConstant;
|
|
9
|
+import com.huiju.estateagents.common.JWTUtils;
|
|
10
|
+import com.huiju.estateagents.entity.TaPerson;
|
|
11
|
+import com.huiju.estateagents.entity.TaPointsRecords;
|
|
12
|
+import com.huiju.estateagents.service.ITaPersonService;
|
|
13
|
+import com.huiju.estateagents.service.ITaPointsRecordsService;
|
|
14
|
+import com.huiju.estateagents.service.ITaRecommendCustomerService;
|
|
15
|
+import org.apache.ibatis.annotations.Mapper;
|
|
16
|
+import org.slf4j.Logger;
|
|
17
|
+import org.slf4j.LoggerFactory;
|
|
18
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
19
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
20
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
21
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
22
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
23
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
24
|
+import org.springframework.web.bind.annotation.ResponseBody;
|
|
25
|
+import org.springframework.web.bind.annotation.RestController;
|
|
26
|
+
|
|
27
|
+import javax.servlet.http.HttpServletRequest;
|
|
28
|
+import java.util.HashMap;
|
|
29
|
+import java.util.List;
|
|
30
|
+import java.util.Map;
|
|
31
|
+
|
|
32
|
+/**
|
|
33
|
+ * <p>
|
|
34
|
+ * 积分消费流水表 前端控制器
|
|
35
|
+ * </p>
|
|
36
|
+ *
|
|
37
|
+ * @author jobob
|
|
38
|
+ * @since 2019-07-25
|
|
39
|
+ */
|
|
40
|
+@RestController
|
|
41
|
+@RequestMapping("/api")
|
|
42
|
+public class TaPointsRecordsController extends BaseController {
|
|
43
|
+
|
|
44
|
+ private final Logger logger = LoggerFactory.getLogger(TaPointsRecordsController.class);
|
|
45
|
+
|
|
46
|
+ @Autowired
|
|
47
|
+ public ITaPointsRecordsService iTaPointsRecordsService;
|
|
48
|
+
|
|
49
|
+ @Autowired
|
|
50
|
+ private ITaPersonService taPersonService;
|
|
51
|
+
|
|
52
|
+ @Autowired
|
|
53
|
+ private ITaRecommendCustomerService recommendCustomerService;
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+ /**
|
|
57
|
+ * 分页查询列表
|
|
58
|
+ * @param pageNum
|
|
59
|
+ * @param pageSize
|
|
60
|
+ * @return
|
|
61
|
+ */
|
|
62
|
+ @RequestMapping(value="/taPointsRecords",method= RequestMethod.GET)
|
|
63
|
+ public ResponseBean taPointsRecordsList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
|
|
64
|
+ @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){
|
|
65
|
+ ResponseBean responseBean = new ResponseBean();
|
|
66
|
+ try {
|
|
67
|
+ //使用分页插件
|
|
68
|
+ IPage<TaPointsRecords> pg = new Page<>(pageNum, pageSize);
|
|
69
|
+ QueryWrapper<TaPointsRecords> queryWrapper = new QueryWrapper<>();
|
|
70
|
+ queryWrapper.orderByDesc("create_date");
|
|
71
|
+
|
|
72
|
+ IPage<TaPointsRecords> result = iTaPointsRecordsService.page(pg, queryWrapper);
|
|
73
|
+ responseBean.addSuccess(result);
|
|
74
|
+ }catch (Exception e){
|
|
75
|
+ e.printStackTrace();
|
|
76
|
+ logger.error("taPointsRecordsList -=- {}",e.toString());
|
|
77
|
+ responseBean.addError(e.getMessage());
|
|
78
|
+ }
|
|
79
|
+ return responseBean;
|
|
80
|
+ }
|
|
81
|
+
|
|
82
|
+ /**
|
|
83
|
+ * 保存对象
|
|
84
|
+ * @param taPointsRecords 实体对象
|
|
85
|
+ * @return
|
|
86
|
+ */
|
|
87
|
+ @RequestMapping(value="/taPointsRecords",method= RequestMethod.POST)
|
|
88
|
+ public ResponseBean taPointsRecordsAdd(@RequestBody TaPointsRecords taPointsRecords){
|
|
89
|
+ ResponseBean responseBean = new ResponseBean();
|
|
90
|
+ try {
|
|
91
|
+ if (iTaPointsRecordsService.save(taPointsRecords)){
|
|
92
|
+ responseBean.addSuccess(taPointsRecords);
|
|
93
|
+ }else {
|
|
94
|
+ responseBean.addError("fail");
|
|
95
|
+ }
|
|
96
|
+ }catch (Exception e){
|
|
97
|
+ e.printStackTrace();
|
|
98
|
+ logger.error("taPointsRecordsAdd -=- {}",e.toString());
|
|
99
|
+ responseBean.addError(e.getMessage());
|
|
100
|
+ }
|
|
101
|
+ return responseBean;
|
|
102
|
+ }
|
|
103
|
+
|
|
104
|
+ /**
|
|
105
|
+ * 根据id删除对象
|
|
106
|
+ * @param id 实体ID
|
|
107
|
+ */
|
|
108
|
+ @ResponseBody
|
|
109
|
+ @RequestMapping(value="/taPointsRecords/{id}", method= RequestMethod.DELETE)
|
|
110
|
+ public ResponseBean taPointsRecordsDelete(@PathVariable Integer id){
|
|
111
|
+ ResponseBean responseBean = new ResponseBean();
|
|
112
|
+ try {
|
|
113
|
+ if(iTaPointsRecordsService.removeById(id)){
|
|
114
|
+ responseBean.addSuccess("success");
|
|
115
|
+ }else {
|
|
116
|
+ responseBean.addError("fail");
|
|
117
|
+ }
|
|
118
|
+ }catch (Exception e){
|
|
119
|
+ e.printStackTrace();
|
|
120
|
+ logger.error("taPointsRecordsDelete -=- {}",e.toString());
|
|
121
|
+ responseBean.addError(e.getMessage());
|
|
122
|
+ }
|
|
123
|
+ return responseBean;
|
|
124
|
+ }
|
|
125
|
+
|
|
126
|
+ /**
|
|
127
|
+ * 修改对象
|
|
128
|
+ * @param id 实体ID
|
|
129
|
+ * @param taPointsRecords 实体对象
|
|
130
|
+ * @return
|
|
131
|
+ */
|
|
132
|
+ @RequestMapping(value="/taPointsRecords/{id}",method= RequestMethod.PUT)
|
|
133
|
+ public ResponseBean taPointsRecordsUpdate(@PathVariable Integer id,
|
|
134
|
+ @RequestBody TaPointsRecords taPointsRecords){
|
|
135
|
+ ResponseBean responseBean = new ResponseBean();
|
|
136
|
+ taPointsRecords.setPointsRecordId(id);
|
|
137
|
+ try {
|
|
138
|
+ if (iTaPointsRecordsService.updateById(taPointsRecords)){
|
|
139
|
+ responseBean.addSuccess(taPointsRecords);
|
|
140
|
+ }else {
|
|
141
|
+ responseBean.addError("fail");
|
|
142
|
+ }
|
|
143
|
+ }catch (Exception e){
|
|
144
|
+ e.printStackTrace();
|
|
145
|
+ logger.error("taPointsRecordsUpdate -=- {}",e.toString());
|
|
146
|
+ responseBean.addError(e.getMessage());
|
|
147
|
+ }
|
|
148
|
+ return responseBean;
|
|
149
|
+ }
|
|
150
|
+
|
|
151
|
+ /**
|
|
152
|
+ * 根据id查询对象
|
|
153
|
+ * @param id 实体ID
|
|
154
|
+ */
|
|
155
|
+ @RequestMapping(value="/taPointsRecords/{id}",method= RequestMethod.GET)
|
|
156
|
+ public ResponseBean taPointsRecordsGet(@PathVariable Integer id){
|
|
157
|
+ ResponseBean responseBean = new ResponseBean();
|
|
158
|
+ try {
|
|
159
|
+ responseBean.addSuccess(iTaPointsRecordsService.getById(id));
|
|
160
|
+ }catch (Exception e){
|
|
161
|
+ e.printStackTrace();
|
|
162
|
+ logger.error("taPointsRecordsDelete -=- {}",e.toString());
|
|
163
|
+ responseBean.addError(e.getMessage());
|
|
164
|
+ }
|
|
165
|
+ return responseBean;
|
|
166
|
+ }
|
|
167
|
+
|
|
168
|
+ /**
|
|
169
|
+ * 分页查询列表
|
|
170
|
+ * @param pageNum
|
|
171
|
+ * @param pageSize
|
|
172
|
+ * @return
|
|
173
|
+ */
|
|
174
|
+ @RequestMapping(value="/wx/taPointsRecords",method= RequestMethod.GET)
|
|
175
|
+ public ResponseBean wxPointsRecordsList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
|
|
176
|
+ @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
|
|
177
|
+ HttpServletRequest request){
|
|
178
|
+ ResponseBean responseBean = new ResponseBean();
|
|
179
|
+ try {
|
|
180
|
+ String openid = JWTUtils.getSubject(request);
|
|
181
|
+ TaPerson taPerson = taPersonService.getPersonsByOpenId(openid).get(0);
|
|
182
|
+ //使用分页插件
|
|
183
|
+ IPage<TaPointsRecords> pg = new Page<>(pageNum, pageSize);
|
|
184
|
+ QueryWrapper<TaPointsRecords> queryWrapper = new QueryWrapper<>();
|
|
185
|
+ queryWrapper.eq("person_id",taPerson.getPersonId());
|
|
186
|
+ queryWrapper.orderByDesc("create_date");
|
|
187
|
+ IPage<TaPointsRecords> result = iTaPointsRecordsService.page(pg, queryWrapper);
|
|
188
|
+ responseBean.addSuccess(result);
|
|
189
|
+ }catch (Exception e){
|
|
190
|
+ e.printStackTrace();
|
|
191
|
+ logger.error("taPointsRecordsList -=- {}",e.toString());
|
|
192
|
+ responseBean.addError(e.getMessage());
|
|
193
|
+ }
|
|
194
|
+ return responseBean;
|
|
195
|
+ }
|
|
196
|
+
|
|
197
|
+ /**
|
|
198
|
+ * 分页查询列表
|
|
199
|
+ * @param pageNum
|
|
200
|
+ * @param pageSize
|
|
201
|
+ * @return
|
|
202
|
+ */
|
|
203
|
+ @RequestMapping(value="/admin/taPointsRecords/{id}",method= RequestMethod.GET)
|
|
204
|
+ public ResponseBean CustomerPointsRecordsList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
|
|
205
|
+ @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
|
|
206
|
+ @PathVariable(value = "id") String id){
|
|
207
|
+ ResponseBean responseBean = new ResponseBean();
|
|
208
|
+ try {
|
|
209
|
+ IPage<TaPointsRecords> pg = new Page<>(pageNum, pageSize);
|
|
210
|
+ QueryWrapper<TaPointsRecords> queryWrapper = new QueryWrapper<>();
|
|
211
|
+ queryWrapper.eq("person_id",recommendCustomerService.getById(id).getPersonId());
|
|
212
|
+ queryWrapper.orderByDesc("create_date");
|
|
213
|
+ IPage<TaPointsRecords> result = iTaPointsRecordsService.page(pg, queryWrapper);
|
|
214
|
+ Integer totalPoints = 0;
|
|
215
|
+ for (int i = 0;i<result.getRecords().size();i++){
|
|
216
|
+ totalPoints += result.getRecords().get(i).getPointsAmount();
|
|
217
|
+ }
|
|
218
|
+ Map<String,Object> data = new HashMap<>();
|
|
219
|
+ data.put("totalPoints",totalPoints);
|
|
220
|
+ data.put("result",result);
|
|
221
|
+ responseBean.addSuccess(data);
|
|
222
|
+ }catch (Exception e){
|
|
223
|
+ e.printStackTrace();
|
|
224
|
+ logger.error("taPointsRecordsList -=- {}",e.toString());
|
|
225
|
+ responseBean.addError(e.getMessage());
|
|
226
|
+ }
|
|
227
|
+ return responseBean;
|
|
228
|
+ }
|
|
229
|
+}
|