|
@@ -152,15 +152,23 @@ public class TaPointsExchangeController extends BaseController {
|
152
|
152
|
|
153
|
153
|
/**
|
154
|
154
|
* 修改对象
|
155
|
|
- * @param id 实体ID
|
156
|
|
- * @param taPointsExchange 实体对象
|
|
155
|
+ * @param recId 实体ID
|
157
|
156
|
* @return
|
158
|
157
|
*/
|
159
|
|
- @RequestMapping(value="/taPointsExchange/{id}",method= RequestMethod.PUT)
|
160
|
|
- public ResponseBean taPointsExchangeUpdate(@PathVariable Integer id,
|
161
|
|
- @RequestBody TaPointsExchange taPointsExchange){
|
|
158
|
+ @RequestMapping(value="/admin/taPointsExchange/{recId}",method= RequestMethod.PUT)
|
|
159
|
+ public ResponseBean taPointsExchangeUpdate(@PathVariable Integer recId){
|
162
|
160
|
ResponseBean responseBean = new ResponseBean();
|
163
|
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);
|
164
|
172
|
if (iTaPointsExchangeService.updateById(taPointsExchange)){
|
165
|
173
|
responseBean.addSuccess(taPointsExchange);
|
166
|
174
|
}else {
|