yujian
2019-08-23 ac8e9b9d4e5f15369c1c1df49c63378fb1ae6f7b
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("添加失败"));