|
@@ -1,231 +1,234 @@
|
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.entity.TaPointsExchange;
|
10
|
|
-import com.huiju.estateagents.service.ITaPointsExchangeService;
|
11
|
|
-import org.slf4j.Logger;
|
12
|
|
-import org.slf4j.LoggerFactory;
|
13
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
14
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
15
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
16
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
17
|
|
-import org.springframework.web.bind.annotation.RequestMethod;
|
18
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
19
|
|
-import org.springframework.web.bind.annotation.ResponseBody;
|
20
|
|
-import org.springframework.web.bind.annotation.RestController;
|
21
|
|
-
|
22
|
|
-/**
|
23
|
|
- * <p>
|
24
|
|
- * 积分兑换记录 前端控制器
|
25
|
|
- * </p>
|
26
|
|
- *
|
27
|
|
- * @author jobob
|
28
|
|
- * @since 2019-07-25
|
29
|
|
- */
|
30
|
|
-@RestController
|
31
|
|
-@RequestMapping("/api")
|
32
|
|
-public class TaPointsExchangeController extends BaseController {
|
33
|
|
-
|
34
|
|
- private final Logger logger = LoggerFactory.getLogger(TaPointsExchangeController.class);
|
35
|
|
-
|
36
|
|
- @Autowired
|
37
|
|
- public ITaPointsExchangeService iTaPointsExchangeService;
|
38
|
|
-
|
39
|
|
-
|
40
|
|
- /**
|
41
|
|
- * 分页查询列表
|
42
|
|
- * @param pageNum
|
43
|
|
- * @param pageSize
|
44
|
|
- * @return
|
45
|
|
- */
|
46
|
|
- @RequestMapping(value="/admin/taPointsExchange",method= RequestMethod.GET)
|
47
|
|
- public ResponseBean taPointsExchangeList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
|
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){
|
59
|
|
- ResponseBean responseBean = new ResponseBean();
|
60
|
|
- try {
|
61
|
|
- //使用分页插件
|
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);
|
73
|
|
-
|
74
|
|
- responseBean = iTaPointsExchangeService.selectList(pageNum,pageSize,taPointsExchange);
|
75
|
|
-
|
76
|
|
- }catch (Exception e){
|
77
|
|
- e.printStackTrace();
|
78
|
|
- logger.error("taPointsExchangeList -=- {}",e.toString());
|
79
|
|
- responseBean.addError(e.getMessage());
|
80
|
|
- }
|
81
|
|
- return responseBean;
|
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
|
|
- }
|
108
|
|
-
|
109
|
|
- /**
|
110
|
|
- * 保存对象
|
111
|
|
- * @param taPointsExchange 实体对象
|
112
|
|
- * @return
|
113
|
|
- */
|
114
|
|
- @RequestMapping(value="/taPointsExchange",method= RequestMethod.POST)
|
115
|
|
- public ResponseBean taPointsExchangeAdd(@RequestBody TaPointsExchange taPointsExchange){
|
116
|
|
- ResponseBean responseBean = new ResponseBean();
|
117
|
|
- try {
|
118
|
|
- if (iTaPointsExchangeService.save(taPointsExchange)){
|
119
|
|
- responseBean.addSuccess(taPointsExchange);
|
120
|
|
- }else {
|
121
|
|
- responseBean.addError("fail");
|
122
|
|
- }
|
123
|
|
- }catch (Exception e){
|
124
|
|
- e.printStackTrace();
|
125
|
|
- logger.error("taPointsExchangeAdd -=- {}",e.toString());
|
126
|
|
- responseBean.addError(e.getMessage());
|
127
|
|
- }
|
128
|
|
- return responseBean;
|
129
|
|
- }
|
130
|
|
-
|
131
|
|
- /**
|
132
|
|
- * 根据id删除对象
|
133
|
|
- * @param id 实体ID
|
134
|
|
- */
|
135
|
|
- @ResponseBody
|
136
|
|
- @RequestMapping(value="/taPointsExchange/{id}", method= RequestMethod.DELETE)
|
137
|
|
- public ResponseBean taPointsExchangeDelete(@PathVariable Integer id){
|
138
|
|
- ResponseBean responseBean = new ResponseBean();
|
139
|
|
- try {
|
140
|
|
- if(iTaPointsExchangeService.removeById(id)){
|
141
|
|
- responseBean.addSuccess("success");
|
142
|
|
- }else {
|
143
|
|
- responseBean.addError("fail");
|
144
|
|
- }
|
145
|
|
- }catch (Exception e){
|
146
|
|
- e.printStackTrace();
|
147
|
|
- logger.error("taPointsExchangeDelete -=- {}",e.toString());
|
148
|
|
- responseBean.addError(e.getMessage());
|
149
|
|
- }
|
150
|
|
- return responseBean;
|
151
|
|
- }
|
152
|
|
-
|
153
|
|
- /**
|
154
|
|
- * 修改对象
|
155
|
|
- * @param recId 实体ID
|
156
|
|
- * @return
|
157
|
|
- */
|
158
|
|
- @RequestMapping(value="/admin/taPointsExchange/{recId}",method= RequestMethod.PUT)
|
159
|
|
- public ResponseBean taPointsExchangeUpdate(@PathVariable Integer recId){
|
160
|
|
- ResponseBean responseBean = new ResponseBean();
|
161
|
|
- try {
|
162
|
|
- TaPointsExchange taPointsExchange = iTaPointsExchangeService.getById(recId);
|
163
|
|
- if (null == taPointsExchange){
|
164
|
|
- responseBean.addError("找不到需要核销的商品");
|
165
|
|
- return responseBean;
|
166
|
|
- }
|
167
|
|
- if (taPointsExchange.getStatus().equals(CommConstant.STATUS_NORMAL)){
|
168
|
|
- responseBean.addError("此商品已经被领取");
|
169
|
|
- return responseBean;
|
170
|
|
- }
|
171
|
|
- taPointsExchange.setStatus(CommConstant.STATUS_NORMAL);
|
172
|
|
- if (iTaPointsExchangeService.updateById(taPointsExchange)){
|
173
|
|
- responseBean.addSuccess(taPointsExchange);
|
174
|
|
- }else {
|
175
|
|
- responseBean.addError("fail");
|
176
|
|
- }
|
177
|
|
- }catch (Exception e){
|
178
|
|
- e.printStackTrace();
|
179
|
|
- logger.error("taPointsExchangeUpdate -=- {}",e.toString());
|
180
|
|
- responseBean.addError(e.getMessage());
|
181
|
|
- }
|
182
|
|
- return responseBean;
|
183
|
|
- }
|
184
|
|
-
|
185
|
|
- /**
|
186
|
|
- * 根据id查询对象
|
187
|
|
- * @param id 实体ID
|
188
|
|
- */
|
189
|
|
- @RequestMapping(value="/taPointsExchange/{id}",method= RequestMethod.GET)
|
190
|
|
- public ResponseBean taPointsExchangeGet(@PathVariable Integer id){
|
191
|
|
- ResponseBean responseBean = new ResponseBean();
|
192
|
|
- try {
|
193
|
|
- responseBean.addSuccess(iTaPointsExchangeService.getById(id));
|
194
|
|
- }catch (Exception e){
|
195
|
|
- e.printStackTrace();
|
196
|
|
- logger.error("taPointsExchangeDelete -=- {}",e.toString());
|
197
|
|
- responseBean.addError(e.getMessage());
|
198
|
|
- }
|
199
|
|
- return responseBean;
|
200
|
|
- }
|
201
|
|
-
|
202
|
|
- /**
|
203
|
|
- * 分页查询列表
|
204
|
|
- * @param pageNum
|
205
|
|
- * @param pageSize
|
206
|
|
- * @return
|
207
|
|
- */
|
208
|
|
- @RequestMapping(value="/wx/taPointsExchange",method= RequestMethod.GET)
|
209
|
|
- public ResponseBean wxPointsExchangeList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
|
210
|
|
- @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
|
211
|
|
- @RequestParam(value = "buildingId", required = false) String buildingId,
|
212
|
|
- @RequestParam(value = "personId", required = false) String personId){
|
213
|
|
- ResponseBean responseBean = new ResponseBean();
|
214
|
|
- try {
|
215
|
|
- //使用分页插件
|
216
|
|
- IPage<TaPointsExchange> pg = new Page<>(pageNum, pageSize);
|
217
|
|
- QueryWrapper<TaPointsExchange> queryWrapper = new QueryWrapper<>();
|
218
|
|
- queryWrapper.eq(null != personId, "person_id", personId);
|
219
|
|
- queryWrapper.eq(null != buildingId, "building_id",buildingId);
|
220
|
|
- queryWrapper.orderByDesc("create_date");
|
221
|
|
-
|
222
|
|
- IPage<TaPointsExchange> result = iTaPointsExchangeService.page(pg, queryWrapper);
|
223
|
|
- responseBean.addSuccess(result);
|
224
|
|
- }catch (Exception e){
|
225
|
|
- e.printStackTrace();
|
226
|
|
- logger.error("taPointsExchangeList -=- {}",e.toString());
|
227
|
|
- responseBean.addError(e.getMessage());
|
228
|
|
- }
|
229
|
|
- return responseBean;
|
230
|
|
- }
|
231
|
|
-}
|
|
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.entity.TaPointsExchange;
|
|
10
|
+import com.huiju.estateagents.service.ITaPointsExchangeService;
|
|
11
|
+import org.slf4j.Logger;
|
|
12
|
+import org.slf4j.LoggerFactory;
|
|
13
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
14
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
15
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
16
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
17
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
18
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
19
|
+import org.springframework.web.bind.annotation.ResponseBody;
|
|
20
|
+import org.springframework.web.bind.annotation.RestController;
|
|
21
|
+
|
|
22
|
+import java.time.LocalDateTime;
|
|
23
|
+
|
|
24
|
+/**
|
|
25
|
+ * <p>
|
|
26
|
+ * 积分兑换记录 前端控制器
|
|
27
|
+ * </p>
|
|
28
|
+ *
|
|
29
|
+ * @author jobob
|
|
30
|
+ * @since 2019-07-25
|
|
31
|
+ */
|
|
32
|
+@RestController
|
|
33
|
+@RequestMapping("/api")
|
|
34
|
+public class TaPointsExchangeController extends BaseController {
|
|
35
|
+
|
|
36
|
+ private final Logger logger = LoggerFactory.getLogger(TaPointsExchangeController.class);
|
|
37
|
+
|
|
38
|
+ @Autowired
|
|
39
|
+ public ITaPointsExchangeService iTaPointsExchangeService;
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+ /**
|
|
43
|
+ * 分页查询列表
|
|
44
|
+ * @param pageNum
|
|
45
|
+ * @param pageSize
|
|
46
|
+ * @return
|
|
47
|
+ */
|
|
48
|
+ @RequestMapping(value="/admin/taPointsExchange",method= RequestMethod.GET)
|
|
49
|
+ public ResponseBean taPointsExchangeList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
|
|
50
|
+ @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
|
|
51
|
+ @RequestParam(value ="personName",required = false) String personName,
|
|
52
|
+ @RequestParam(value ="phone",required = false) String phone,
|
|
53
|
+ @RequestParam(value ="personType",required = false) String personType,
|
|
54
|
+ @RequestParam(value ="targetName",required = false) String targetName,
|
|
55
|
+ @RequestParam(value ="startCreateDate",required = false) String startCreateDate,
|
|
56
|
+ @RequestParam(value ="endCreateDate",required = false) String endCreateDate,
|
|
57
|
+ @RequestParam(value ="startVerifyDate",required = false) String startVerifyDate,
|
|
58
|
+ @RequestParam(value ="endVerifyDate",required = false) String endVerifyDate,
|
|
59
|
+ @RequestParam(value ="status",required = false) Integer status,
|
|
60
|
+ @RequestParam(value ="tel",required = false) String tel){
|
|
61
|
+ ResponseBean responseBean = new ResponseBean();
|
|
62
|
+ try {
|
|
63
|
+ //使用分页插件
|
|
64
|
+ TaPointsExchange taPointsExchange = new TaPointsExchange();
|
|
65
|
+ taPointsExchange.setPersonName(personName);
|
|
66
|
+ taPointsExchange.setPhone(phone);
|
|
67
|
+ taPointsExchange.setPersonType(personType);
|
|
68
|
+ taPointsExchange.setTargetName(targetName);
|
|
69
|
+ taPointsExchange.setStartCreateDate(startCreateDate);
|
|
70
|
+ taPointsExchange.setEndCreateDate(endCreateDate);
|
|
71
|
+ taPointsExchange.setStartVerifyDate(startVerifyDate);
|
|
72
|
+ taPointsExchange.setEndVerifyDate(endVerifyDate);
|
|
73
|
+ taPointsExchange.setStatus(status);
|
|
74
|
+ taPointsExchange.setTel(tel);
|
|
75
|
+
|
|
76
|
+ responseBean = iTaPointsExchangeService.selectList(pageNum,pageSize,taPointsExchange);
|
|
77
|
+
|
|
78
|
+ }catch (Exception e){
|
|
79
|
+ e.printStackTrace();
|
|
80
|
+ logger.error("taPointsExchangeList -=- {}",e.toString());
|
|
81
|
+ responseBean.addError(e.getMessage());
|
|
82
|
+ }
|
|
83
|
+ return responseBean;
|
|
84
|
+ }
|
|
85
|
+
|
|
86
|
+ /**
|
|
87
|
+ * 修改对象
|
|
88
|
+ * @param taPointsExchange 实体对象
|
|
89
|
+ * @return
|
|
90
|
+ */
|
|
91
|
+ @RequestMapping(value="/admin/taPointsExchange/change",method= RequestMethod.PUT)
|
|
92
|
+ public ResponseBean taPointsExchangeStatusChange(@RequestBody TaPointsExchange taPointsExchange){
|
|
93
|
+ ResponseBean responseBean = new ResponseBean();
|
|
94
|
+ try {
|
|
95
|
+ if (null != taPointsExchange.getStatus() && !taPointsExchange.getStatus().equals(CommConstant.STATUS_NORMAL)){
|
|
96
|
+ taPointsExchange.setStatus(CommConstant.STATUS_NORMAL);
|
|
97
|
+ }
|
|
98
|
+ if (iTaPointsExchangeService.updateById(taPointsExchange)){
|
|
99
|
+ responseBean.addSuccess(taPointsExchange);
|
|
100
|
+ }else {
|
|
101
|
+ responseBean.addError("fail");
|
|
102
|
+ }
|
|
103
|
+ }catch (Exception e){
|
|
104
|
+ e.printStackTrace();
|
|
105
|
+ logger.error("taPointsExchangeUpdate -=- {}",e.toString());
|
|
106
|
+ responseBean.addError(e.getMessage());
|
|
107
|
+ }
|
|
108
|
+ return responseBean;
|
|
109
|
+ }
|
|
110
|
+
|
|
111
|
+ /**
|
|
112
|
+ * 保存对象
|
|
113
|
+ * @param taPointsExchange 实体对象
|
|
114
|
+ * @return
|
|
115
|
+ */
|
|
116
|
+ @RequestMapping(value="/taPointsExchange",method= RequestMethod.POST)
|
|
117
|
+ public ResponseBean taPointsExchangeAdd(@RequestBody TaPointsExchange taPointsExchange){
|
|
118
|
+ ResponseBean responseBean = new ResponseBean();
|
|
119
|
+ try {
|
|
120
|
+ if (iTaPointsExchangeService.save(taPointsExchange)){
|
|
121
|
+ responseBean.addSuccess(taPointsExchange);
|
|
122
|
+ }else {
|
|
123
|
+ responseBean.addError("fail");
|
|
124
|
+ }
|
|
125
|
+ }catch (Exception e){
|
|
126
|
+ e.printStackTrace();
|
|
127
|
+ logger.error("taPointsExchangeAdd -=- {}",e.toString());
|
|
128
|
+ responseBean.addError(e.getMessage());
|
|
129
|
+ }
|
|
130
|
+ return responseBean;
|
|
131
|
+ }
|
|
132
|
+
|
|
133
|
+ /**
|
|
134
|
+ * 根据id删除对象
|
|
135
|
+ * @param id 实体ID
|
|
136
|
+ */
|
|
137
|
+ @ResponseBody
|
|
138
|
+ @RequestMapping(value="/taPointsExchange/{id}", method= RequestMethod.DELETE)
|
|
139
|
+ public ResponseBean taPointsExchangeDelete(@PathVariable Integer id){
|
|
140
|
+ ResponseBean responseBean = new ResponseBean();
|
|
141
|
+ try {
|
|
142
|
+ if(iTaPointsExchangeService.removeById(id)){
|
|
143
|
+ responseBean.addSuccess("success");
|
|
144
|
+ }else {
|
|
145
|
+ responseBean.addError("fail");
|
|
146
|
+ }
|
|
147
|
+ }catch (Exception e){
|
|
148
|
+ e.printStackTrace();
|
|
149
|
+ logger.error("taPointsExchangeDelete -=- {}",e.toString());
|
|
150
|
+ responseBean.addError(e.getMessage());
|
|
151
|
+ }
|
|
152
|
+ return responseBean;
|
|
153
|
+ }
|
|
154
|
+
|
|
155
|
+ /**
|
|
156
|
+ * 修改对象
|
|
157
|
+ * @param recId 实体ID
|
|
158
|
+ * @return
|
|
159
|
+ */
|
|
160
|
+ @RequestMapping(value="/admin/taPointsExchange/{recId}",method= RequestMethod.PUT)
|
|
161
|
+ public ResponseBean taPointsExchangeUpdate(@PathVariable Integer recId){
|
|
162
|
+ ResponseBean responseBean = new ResponseBean();
|
|
163
|
+ try {
|
|
164
|
+ TaPointsExchange taPointsExchange = iTaPointsExchangeService.getById(recId);
|
|
165
|
+ if (null == taPointsExchange){
|
|
166
|
+ responseBean.addError("找不到需要核销的商品");
|
|
167
|
+ return responseBean;
|
|
168
|
+ }
|
|
169
|
+ if (taPointsExchange.getStatus().equals(CommConstant.STATUS_NORMAL)){
|
|
170
|
+ responseBean.addError("此商品已经被领取");
|
|
171
|
+ return responseBean;
|
|
172
|
+ }
|
|
173
|
+ taPointsExchange.setStatus(CommConstant.STATUS_NORMAL);
|
|
174
|
+ taPointsExchange.setVerifyDate(LocalDateTime.now());
|
|
175
|
+ if (iTaPointsExchangeService.updateById(taPointsExchange)){
|
|
176
|
+ responseBean.addSuccess(taPointsExchange);
|
|
177
|
+ }else {
|
|
178
|
+ responseBean.addError("fail");
|
|
179
|
+ }
|
|
180
|
+ }catch (Exception e){
|
|
181
|
+ e.printStackTrace();
|
|
182
|
+ logger.error("taPointsExchangeUpdate -=- {}",e.toString());
|
|
183
|
+ responseBean.addError(e.getMessage());
|
|
184
|
+ }
|
|
185
|
+ return responseBean;
|
|
186
|
+ }
|
|
187
|
+
|
|
188
|
+ /**
|
|
189
|
+ * 根据id查询对象
|
|
190
|
+ * @param id 实体ID
|
|
191
|
+ */
|
|
192
|
+ @RequestMapping(value="/taPointsExchange/{id}",method= RequestMethod.GET)
|
|
193
|
+ public ResponseBean taPointsExchangeGet(@PathVariable Integer id){
|
|
194
|
+ ResponseBean responseBean = new ResponseBean();
|
|
195
|
+ try {
|
|
196
|
+ responseBean.addSuccess(iTaPointsExchangeService.getById(id));
|
|
197
|
+ }catch (Exception e){
|
|
198
|
+ e.printStackTrace();
|
|
199
|
+ logger.error("taPointsExchangeDelete -=- {}",e.toString());
|
|
200
|
+ responseBean.addError(e.getMessage());
|
|
201
|
+ }
|
|
202
|
+ return responseBean;
|
|
203
|
+ }
|
|
204
|
+
|
|
205
|
+ /**
|
|
206
|
+ * 分页查询列表
|
|
207
|
+ * @param pageNum
|
|
208
|
+ * @param pageSize
|
|
209
|
+ * @return
|
|
210
|
+ */
|
|
211
|
+ @RequestMapping(value="/wx/taPointsExchange",method= RequestMethod.GET)
|
|
212
|
+ public ResponseBean wxPointsExchangeList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
|
|
213
|
+ @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
|
|
214
|
+ @RequestParam(value = "buildingId", required = false) String buildingId,
|
|
215
|
+ @RequestParam(value = "personId", required = false) String personId){
|
|
216
|
+ ResponseBean responseBean = new ResponseBean();
|
|
217
|
+ try {
|
|
218
|
+ //使用分页插件
|
|
219
|
+ IPage<TaPointsExchange> pg = new Page<>(pageNum, pageSize);
|
|
220
|
+ QueryWrapper<TaPointsExchange> queryWrapper = new QueryWrapper<>();
|
|
221
|
+ queryWrapper.eq(null != personId, "person_id", personId);
|
|
222
|
+ queryWrapper.eq(null != buildingId, "building_id",buildingId);
|
|
223
|
+ queryWrapper.orderByDesc("create_date");
|
|
224
|
+
|
|
225
|
+ IPage<TaPointsExchange> result = iTaPointsExchangeService.page(pg, queryWrapper);
|
|
226
|
+ responseBean.addSuccess(result);
|
|
227
|
+ }catch (Exception e){
|
|
228
|
+ e.printStackTrace();
|
|
229
|
+ logger.error("taPointsExchangeList -=- {}",e.toString());
|
|
230
|
+ responseBean.addError(e.getMessage());
|
|
231
|
+ }
|
|
232
|
+ return responseBean;
|
|
233
|
+ }
|
|
234
|
+}
|