| | |
| | | *
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param ids
|
| | | * @param ids // 领取id
|
| | | * @param gids // 未领取id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "receiveGoldCoin", method = RequestMethod.POST)
|
| | | public void receiveGoldCoin(AcceptData acceptData, Long uid, String ids, PrintWriter out) {
|
| | | public void receiveGoldCoin(AcceptData acceptData, Long uid, String ids, String gids, PrintWriter out) {
|
| | | if (uid == null || uid <= 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | |
| | | out.print(JsonUtil.loadFalseResult("领取id不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | Set<Long> gidList = gson.fromJson(gids, new TypeToken<HashSet<Long>>() {}.getType());
|
| | |
|
| | | try {
|
| | | Integer goldCoin = integralTaskRecordService.receiveGoldCoin(uid, idList);
|
| | | |
| | | List<IntegralTaskRecord> list = null;
|
| | | if (gidList != null && gidList.size() > 0) {
|
| | | list = integralTaskRecordService.listNotReceived(5 - gidList.size(), uid);
|
| | | } else {
|
| | | list = integralTaskRecordService.listNotReceived(5, uid);
|
| | | }
|
| | | |
| | | if (list == null) {
|
| | | list = new ArrayList<IntegralTaskRecord>();
|
| | | }
|
| | | GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
|
| | | Gson gson2 = gsonBuilder.create();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("goldCoin", goldCoin);
|
| | | data.put("list", gson2.toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (IntegralTaskRecordException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|