yujian
2020-05-09 7e7db2fa55a9a3af46d4fd8ede0dee147f101d64
fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/InviteController.java
@@ -12,7 +12,6 @@
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.yeshi.utils.DateUtil;
import org.yeshi.utils.JsonUtil;
import com.yeshi.fanli.dto.WXMPAcceptData;
@@ -22,14 +21,12 @@
import com.yeshi.fanli.entity.bus.user.ThreeSaleExtraInfo;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.bus.user.UserInviteSeparate;
import com.yeshi.fanli.entity.system.ConfigKeyEnum;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.msg.UserSystemMsgService;
import com.yeshi.fanli.service.inter.push.PushService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.service.inter.user.UserInviteSeparateService;
import com.yeshi.fanli.service.inter.user.invite.ThreeSaleExtraInfoSerivce;
import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
@@ -54,9 +51,6 @@
   @Resource
   private UserVIPInfoService userVIPInfoService;
   @Resource
   private UserInviteSeparateService userInviteSeparateService;
   @Resource
   private ThreeSaleExtraInfoSerivce threeSaleExtraInfoSerivce;
@@ -108,7 +102,7 @@
      
      JSONObject data = new JSONObject();
      data.put("desc", array);
      data.put("num", threeSaleSerivce.countFirstTeam(uid, 1));
      data.put("num", threeSaleSerivce.countFirstTeam(uid));
      data.put("limit", Constant.INVITE_CODRE_TAILOR_LIMIT);
      
      out.print(JsonUtil.loadTrueResult(data));
@@ -124,11 +118,8 @@
   @RequestMapping(value = "countMyTeam", method = RequestMethod.POST)
   public void countMyTeam(WXMPAcceptData acceptData, long uid, PrintWriter out) {
      try {
         long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1);
         long firstTeamTotal = threeSaleSerivce.countFirstTeam(uid, null);
         long secondTeam = threeSaleSerivce.countSecondTeam(uid, 1);
         long secondTeamTotal = threeSaleSerivce.countSecondTeam(uid, null);
         long firstTeam = threeSaleSerivce.countFirstTeam(uid);
         long secondTeam = threeSaleSerivce.countSecondTeam(uid);
         JSONObject bossData = new JSONObject();
         ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);
         if (threeSale != null) {
@@ -152,9 +143,9 @@
         }
         resultData.put("helpLink", helpLink);
         resultData.put("firstTeam", firstTeam);
         resultData.put("firstTeamTotal", firstTeamTotal);
         resultData.put("firstTeamTotal", firstTeam);
         resultData.put("secondTeam", secondTeam);
         resultData.put("secondTeamTotal", secondTeamTotal);
         resultData.put("secondTeamTotal", secondTeam);
         resultData.put("boss", bossData);
         boolean hasCode = false;
@@ -191,11 +182,11 @@
      long count = 0;
      List<ThreeSale> listTeam = null;
      if (type == 1) {
         listTeam = threeSaleSerivce.listFirstTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid, 1);
         count = threeSaleSerivce.countFirstTeam(uid, 1);
         listTeam = threeSaleSerivce.listFirstTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid);
         count = threeSaleSerivce.countFirstTeam(uid);
      } else if (type == 2) {
         listTeam = threeSaleSerivce.listSecondTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid, 1);
         count = threeSaleSerivce.countSecondTeam(uid, 1);
         listTeam = threeSaleSerivce.listSecondTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid);
         count = threeSaleSerivce.countSecondTeam(uid);
      }
      boolean needVIPInfo = true;
@@ -261,35 +252,6 @@
         // 添加是否为VIP
         if (vipMap != null && vipMap.get(worker.getId()) != null) {
            object.put("vip", vipMap.get(worker.getId()));
            if (vipMap.get(worker.getId())) {
               UserInviteSeparate separate = userInviteSeparateService.selectByWorkerIdAndBossId(worker.getId(),
                     uid);
               if (separate != null && separate.getEndTime() != null) {
                  try {
                     JSONObject contentJson1 = new JSONObject();
                     contentJson1.put("color", "#888888");
                     contentJson1.put("content", "将于");
                     JSONObject contentJson2 = new JSONObject();
                     contentJson2.put("color", "#F14242");
                     contentJson2.put("content", DateUtil.dateDiff4(new Date(), separate.getEndTime()));
                     JSONObject contentJson3 = new JSONObject();
                     contentJson3.put("color", "#888888");
                     contentJson3.put("content", "后脱离邀请关系");
                     JSONArray array = new JSONArray();
                     array.add(contentJson1);
                     array.add(contentJson2);
                     array.add(contentJson3);
                     object.put("vipBreakTime", array);
                  } catch (Exception e) {
                     e.printStackTrace();
                  }
               }
            }
         }
         String fontColor1 = "#888888";
         JSONArray array = new JSONArray();