From ac8e9b9d4e5f15369c1c1df49c63378fb1ae6f7b Mon Sep 17 00:00:00 2001 From: yujian <yujian@123.com> Date: 星期五, 23 八月 2019 17:31:18 +0800 Subject: [PATCH] Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div --- fanli/src/main/java/com/yeshi/fanli/controller/client/v2/IntegralControllerV2.java | 48 +++++++++++++++++++++++++++++------------------- 1 files changed, 29 insertions(+), 19 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/IntegralControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/IntegralControllerV2.java index 4b21c10..00cbd7b 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/IntegralControllerV2.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/IntegralControllerV2.java @@ -11,6 +11,7 @@ import java.util.Set; import javax.annotation.Resource; +import javax.servlet.http.HttpSession; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @@ -30,6 +31,7 @@ import com.yeshi.fanli.entity.accept.AcceptData; import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail.TaoLiJinDetailTypeEnum; import com.yeshi.fanli.entity.bus.user.UserInfo; +import com.yeshi.fanli.entity.bus.user.UserInfoExtra; import com.yeshi.fanli.entity.bus.user.UserRank; import com.yeshi.fanli.entity.integral.CodePublishRecord; import com.yeshi.fanli.entity.integral.IntegralExchange; @@ -111,6 +113,7 @@ * @param page * @param out */ +// @RequestSerializableByKey(key="#acceptData.device") @RequestMapping(value = "getTaskList", method = RequestMethod.POST) public void getTaskList(AcceptData acceptData, Long uid, Integer page, PrintWriter out) { if (uid == null || uid <= 0) { @@ -136,7 +139,6 @@ // 鐢ㄦ埛绛惧埌 Integer signState = 0; - int signDays = 1; if (page == 1) { // 绛惧埌 @@ -166,9 +168,6 @@ // 绛惧埌鏃ユ湡淇℃伅 DailySignVO dailySignVO = integralTaskClassService.getDailySignList(uid, userRank.getId()); - if (dailySignVO != null) { - signDays = dailySignVO.getDays(); - } boolean ejectSign = false; if (signState == 1) @@ -407,6 +406,7 @@ out.print(JsonUtil.loadFalseResult(1, e.getMsg())); } } + /** * 鍏戞崲閲戝竵 @@ -421,11 +421,14 @@ try { IntegralExchange exchange = integralExchangeService.exchange(uid, id); + UserInfoExtra extraVO = userInfoExtraService.getUserInfoExtra(uid); + GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation(); Gson gson = gsonBuilder.create(); JSONObject data = new JSONObject(); data.put("result", gson.toJson(exchange)); + data.put("goldCoin", extraVO.getGoldCoin() + "鏋�"); out.print(JsonUtil.loadTrueResult(data)); } catch (IntegralExchangeException e) { out.print(JsonUtil.loadFalseResult(1, e.getMsg())); @@ -467,8 +470,11 @@ @RequestMapping(value = "exchangeInviteCode", method = RequestMethod.POST) public void exchangeInviteCode(AcceptData acceptData, Long uid, Long id, PrintWriter out) { try { - integralExchangeService.exchangeInviteCode(uid, id); - out.print(JsonUtil.loadTrueResult("閭�璇风爜婵�娲绘垚鍔�")); + String inviteCode = integralExchangeService.exchangeInviteCode(uid, id); + JSONObject data = new JSONObject(); + data.put("msg", "鍏戞崲鎴愬姛锛岄噾甯佸凡娑堣�� "); + data.put("inviteCode", inviteCode); + out.print(JsonUtil.loadTrueResult(data)); } catch (IntegralExchangeException e) { out.print(JsonUtil.loadFalseResult(1, e.getMsg())); } @@ -487,20 +493,25 @@ out.print(JsonUtil.loadFalseResult(1, "椤电爜涓嶆纭�")); return; } + + try { + List<CodePublishRecord> list = codePublishRecordService.listValid((page - 1) * Constant.PAGE_SIZE, + Constant.PAGE_SIZE); + if (list == null) { + list = new ArrayList<CodePublishRecord>(); + } - List<CodePublishRecord> list = codePublishRecordService.listValid((page - 1) * Constant.PAGE_SIZE, - Constant.PAGE_SIZE); - if (list == null) { - list = new ArrayList<CodePublishRecord>(); + long count = codePublishRecordService.countValid(); + + JSONObject data = new JSONObject(); + data.put("count", count); + data.put("list", getGson().toJson(list)); + data.put("helpLink", configService.get("publish_list_help_link")); + out.print(JsonUtil.loadTrueResult(data)); + } catch (Exception e) { + out.print(JsonUtil.loadFalseResult(1, "鑾峰彇澶辫触")); + return; } - - long count = codePublishRecordService.countValid(); - - JSONObject data = new JSONObject(); - data.put("count", count); - data.put("list", getGson().toJson(list)); - data.put("helpLink", configService.get("publish_list_help_link")); - out.print(JsonUtil.loadTrueResult(data)); } /** @@ -526,7 +537,6 @@ try { record = integralGetService.addEventStatistic(uid, event, null); } catch (IntegralGetException e) { - e.printStackTrace(); } if (record == null) { out.print(JsonUtil.loadFalseResult("娣诲姞澶辫触")); -- Gitblit v1.8.0