yujian
2020-04-23 d844a30a240603daab46e8b2b32b01cd90f1272e
会员升级调整
6个文件已删除
36个文件已修改
2500 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/HomeNavbarAdminController.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/SpecialCardAdminController.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/InviteGetMoneyController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserInfoController.java 67 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java 138 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java 102 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/InviteController.java 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/HongBaoV2CountMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/ThreeSaleMapper.java 170 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserInviteSeparateMapper.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/user/UserInviteLevelEnum.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/HomeNavbar.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/ThreeSale.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserInviteSeparate.java 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/UpdateThreeSaleJob.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/ThreeSaleMapper.xml 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/hongbao/HongBaoV2CountMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserInviteSeparateMapper.xml 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/count/HongBaoV2CountServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/HomeNavbarServiceImpl.java 109 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialCardServiceImpl.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/integral/CodePublishRecordServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/ThreeSaleSerivceImpl.java 146 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/UserInviteMsgNotificationServiceImpl.java 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/UserInviteSeparateServiceImpl.java 198 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/UserInviteServiceImpl.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/msg/UserAccountMsgNotificationServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPInfoServiceImpl.java 118 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPPreInfoServiceImpl.java 431 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/count/HongBaoV2CountService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/HomeNavbarService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SpecialCardService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInviteSeparateService.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/invite/ThreeSaleSerivce.java 109 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/invite/UserInviteMsgNotificationService.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/msg/UserAccountMsgNotificationService.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/vip/UserVIPPreInfoService.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgAccountDetailFactory.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgInviteDetailFactory.java 156 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/user/UserVIPMessageListener.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/HomeNavbarAdminController.java
@@ -93,7 +93,6 @@
     */
    @RequestMapping(value = "query")
    public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer sex, PrintWriter out) {
        if (pageIndex == null || pageIndex < 1) {
            pageIndex = 1;
        }
@@ -104,14 +103,12 @@
        try {
            List<HomeNavbar> list = homeNavbarService.listQuery((pageIndex - 1) * pageSize, pageSize, key, sex);
            if (list == null || list.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
                return;
            }
            
            long count = homeNavbarService.countlistQuery(key, sex);
            int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
            PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
@@ -124,12 +121,10 @@
            data.put("result_list", gson.toJson(list));
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
            e.printStackTrace();
        }
    }
@@ -141,7 +136,6 @@
     */
    @RequestMapping(value = "delete")
    public void delete(String callback, String idArray, PrintWriter out) {
        try {
            if (StringUtil.isNullOrEmpty(idArray)) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择操作的数据"));
@@ -157,12 +151,29 @@
            }
            
            int count = homeNavbarService.deleteBatchByPrimaryKey(list);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("成功删除["+ count +"]条数据"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
            e.printStackTrace();
        }
    }
    /**
     * 修改状态
     * @param callback
     * @param id
     * @param out
     */
    @RequestMapping(value = "switchState")
    public void switchState(String callback, Long id, PrintWriter out) {
        try {
            homeNavbarService.switchState(id);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
        } catch (HomeNavbarException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
            e.printStackTrace();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/SpecialCardAdminController.java
@@ -21,7 +21,7 @@
import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl.AdActivityType;
import com.yeshi.fanli.entity.bus.homemodule.Special;
import com.yeshi.fanli.entity.bus.homemodule.SpecialCard;
import com.yeshi.fanli.exception.homemodule.FloatADException;
import com.yeshi.fanli.exception.homemodule.SpecialCardException;
import com.yeshi.fanli.exception.homemodule.SpecialException;
import com.yeshi.fanli.service.inter.config.AppVersionService;
import com.yeshi.fanli.service.inter.homemodule.AdActivityVersionControlService;
@@ -67,9 +67,8 @@
            } else {
                specialCardService.saveObject(null, specialCard);
            }
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
        } catch (FloatADException e) {
        } catch (SpecialCardException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("保存失败"));
@@ -118,9 +117,7 @@
            JSONObject data = new JSONObject();
            data.put("pe", pe);
            data.put("result_list", gson.toJson(list));
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
            e.printStackTrace();
@@ -137,7 +134,6 @@
     */
    @RequestMapping(value = "delete")
    public void delete(String callback, String idArray, PrintWriter out) {
        try {
            if (StringUtil.isNullOrEmpty(idArray)) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择操作的数据"));
@@ -152,16 +148,12 @@
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("未检测到删除的数据"));
                return;
            }
            int count = specialCardService.deleteBatchByPrimaryKey(list);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("成功删除[" + count + "]条数据"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
            e.printStackTrace();
        }
    }
    /**
@@ -219,14 +211,11 @@
            }
            int count = specialService.deleteBatchByPrimaryKey(list);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("成功删除[" + count + "]条数据"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
            e.printStackTrace();
        }
    }
    /**
@@ -387,6 +376,25 @@
     * @param id
     * @param out
     */
    @RequestMapping(value = "switchStateCard")
    public void switchStateCard(String callback, Long id, PrintWriter out) {
        try {
            specialCardService.switchState(id);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
        } catch (SpecialCardException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
            e.printStackTrace();
        }
    }
    /**
     * 修改状态
     * @param callback
     * @param id
     * @param out
     */
    @RequestMapping(value = "switchState")
    public void switchState(String callback, Long id, PrintWriter out) {
        try {
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/InviteGetMoneyController.java
@@ -104,8 +104,8 @@
            data.put("moneyLastMonth", "---");
        } else {
            // 我的队员
            long myFirstTeamCount = threeSaleSerivce.getFirstUsersCount(Long.parseLong(uid));
            long mySecondTeamCount = threeSaleSerivce.getSecondUsersCount(Long.parseLong(uid));
            long myFirstTeamCount = threeSaleSerivce.countFirstTeam(Long.parseLong(uid));
            long mySecondTeamCount = threeSaleSerivce.countSecondTeam(Long.parseLong(uid));
            long myTeamCount = myFirstTeamCount + mySecondTeamCount;
            data.put("myTeam", myTeamCount);
            // 1.5.0后已经不使用此字段
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserInfoController.java
@@ -1679,19 +1679,17 @@
            JSONObject resultData = new JSONObject();
            if (type == 1) {
                resultData = threeSaleSerivce.getMyFirstTeam((page - 1) * pageSize, pageSize, uid, null);
                resultData = threeSaleSerivce.getMyFirstTeam((page - 1) * pageSize, pageSize, uid);
            } else if (type == 2) {
                resultData = threeSaleSerivce.getMySecondTeam((page - 1) * pageSize, pageSize, uid, null);
                resultData = threeSaleSerivce.getMySecondTeam((page - 1) * pageSize, pageSize, uid);
            }
            // 安卓系统返回所有数据
            String platform = acceptData.getPlatform();
            if ("android".equalsIgnoreCase(platform)) {
                long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1);
                long firstTeamTotal = threeSaleSerivce.countFirstTeam(uid, null);
                long firstTeam = threeSaleSerivce.countFirstTeam(uid);
                long secondTeam = threeSaleSerivce.countSecondTeam(uid, 1);
                long secondTeamTotal = threeSaleSerivce.countSecondTeam(uid, null);
                long secondTeam = threeSaleSerivce.countSecondTeam(uid);
                JSONObject bossData = null;
                ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);
@@ -1726,9 +1724,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);
            }
            out.print(JsonUtil.loadTrueResult(resultData));
@@ -1754,17 +1752,17 @@
            JSONObject resultData = new JSONObject();
            if (type == 1) {
                resultData = threeSaleSerivce.getMyFirstTeam((page - 1) * pageSize, pageSize, uid, 1);
                resultData = threeSaleSerivce.getMyFirstTeam((page - 1) * pageSize, pageSize, uid);
            } else if (type == 2) {
                resultData = threeSaleSerivce.getMySecondTeam((page - 1) * pageSize, pageSize, uid, 1);
                resultData = threeSaleSerivce.getMySecondTeam((page - 1) * pageSize, pageSize, uid);
            }
            // 安卓系统返回所有数据
            String platform = acceptData.getPlatform();
            if ("android".equalsIgnoreCase(platform)) {
                long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1);
                long firstTeam = threeSaleSerivce.countFirstTeam(uid);
                long secondTeam = threeSaleSerivce.countSecondTeam(uid, 1);
                long secondTeam = threeSaleSerivce.countSecondTeam(uid);
                JSONObject bossData = null;
                ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);
@@ -1819,11 +1817,9 @@
    @RequestMapping(value = "countMyTeam", method = RequestMethod.POST)
    public void countMyTeam(AcceptData acceptData, long uid, PrintWriter out) {
        try {
            long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1);
            long firstTeamTotal = threeSaleSerivce.countFirstTeam(uid, null);
            long firstTeam = threeSaleSerivce.countFirstTeam(uid);
            long secondTeam = threeSaleSerivce.countSecondTeam(uid, 1);
            long secondTeamTotal = threeSaleSerivce.countSecondTeam(uid, null);
            long secondTeam = threeSaleSerivce.countSecondTeam(uid);
            JSONObject bossData = new JSONObject();
            ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);
            if (threeSale != null) {
@@ -1847,9 +1843,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;
@@ -1913,41 +1909,6 @@
        out.print(JsonUtil.loadTrueResult("保存成功"));
    }
    /**
     * 删除队员关系
     *
     * @param acceptData
     * @param uid
     * @param inviteId
     *            邀请id
     * @param out
     */
    @RequestMapping(value = "removethreesale", method = RequestMethod.POST)
    public void removethreesale(AcceptData acceptData, long uid, long inviteId, PrintWriter out) {
        try {
            List<ThreeSale> listThreeSale = threeSaleSerivce.listbyIdAndBossId(inviteId, uid, 1);
            if (listThreeSale == null || listThreeSale.size() == 0) {
                out.print(JsonUtil.loadFalseResult("操作数据无效"));
                return;
            }
            UserInfo worker = listThreeSale.get(0).getWorker();
            if (worker == null) {
                out.print(JsonUtil.loadFalseResult("操作数据无效"));
                return;
            }
            // 删除关系
            threeSaleSerivce.deleteByPrimaryKey(inviteId);
            // 删除备注
            threeSaleExtraInfoSerivce.deleteByBossIdAndWorkerId(uid, worker.getId());
            out.print(JsonUtil.loadTrueResult("删除成功"));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult("删除失败"));
            e.printStackTrace();
        }
    }
    /**
     * 设置界面开关状态
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java
@@ -13,7 +13,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.vip.UserVIPLevel;
@@ -25,7 +24,6 @@
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.bus.user.UserInviteValidNum;
import com.yeshi.fanli.entity.bus.user.UserInviteValidRecord;
import com.yeshi.fanli.entity.bus.user.WeiXinUser;
@@ -44,7 +42,6 @@
import com.yeshi.fanli.service.inter.user.SpreadUserImgService;
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.invite.UserInviteService;
@@ -55,7 +52,6 @@
import com.yeshi.fanli.util.RedisKeyEnum;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.util.VersionUtil;
import com.yeshi.fanli.util.annotation.RequestSerializableByKey;
import com.yeshi.fanli.util.user.UserLevelUtil;
@@ -94,9 +90,6 @@
    @Resource
    private UserVIPInfoService userVIPInfoService;
    @Resource
    private UserInviteSeparateService userInviteSeparateService;
    @Resource
    private SpreadImgService spreadImgService;
@@ -227,11 +220,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 = false;
@@ -299,32 +292,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();
@@ -392,13 +359,13 @@
        long count = 0;
        List<ThreeSale> listTeam = null;
        if (type == 1) {
            listTeam = threeSaleSerivce.listFirstTeamByUndeleted((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid);
            count = threeSaleSerivce.countFirstTeamByUndeleted(uid);
            listTeam = threeSaleSerivce.listFirstTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid);
            count = threeSaleSerivce.countFirstTeam(uid);
        } else if (type == 2) {
            listTeam = threeSaleSerivce.listSecondTeamByUndeleted((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid);
            count = threeSaleSerivce.countSecondTeamByUndeleted(uid);
            listTeam = threeSaleSerivce.listSecondTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid);
            count = threeSaleSerivce.countSecondTeam(uid);
        }
        JSONObject result = new JSONObject();
        result.put("count", count);
        result.put("list", organizeTeamNew(count, listTeam, uid, type, true));
@@ -447,22 +414,13 @@
        if (type == 1) {
            validType = UserInviteValidRecord.TYPE_ONE;
        }
        List<Long> listVid = userInviteValidRecordService.getValidWorkerIdsByUid(uid, listWid, validType);
    
        for (ThreeSale threeSale : list) {
            UserInfo worker = threeSale.getWorker();
            Long workerId = worker.getId();
            // 邀请状态
            Boolean state = threeSale.getState();
            if (type == 2) {
                if (state &&  threeSale.getStateSuper()) {
                    state = true;
                } else {
                    state = false;
                }
            }
            // 邀请成功时间
            Long succeedTime = threeSale.getSucceedTime(); 
            if (succeedTime == null) {
@@ -471,7 +429,7 @@
            
            // 有效粉丝
            boolean validFans = false; 
            if (state && listVid != null && listVid.size() > 0 && listVid.contains(workerId)) {
            if (listVid != null && listVid.size() > 0 && listVid.contains(workerId)) {
                validFans = true;
            }
            
@@ -509,54 +467,11 @@
            object.put("portrait", worker.getPortrait());
            object.put("inviteId", threeSale.getId());
            object.put("inviteTime", format.format(new Date(succeedTime)) + " 加入");
            object.put("state", state? 1 : 2);
            object.put("state", 1);
            object.put("recentMsg", array);
            object.put("level", level.name());
            object.put("validFans", validFans);
            
            // 判断是否存在脱离关系队员
            if (vipLevel != null && state) {
                Long bossId = threeSale.getBoss().getId();
                UserInviteSeparate separate = userInviteSeparateService.selectByWorkerIdAndBossId(workerId, bossId);
                if (separate != null && separate.getEndTime() != null) {
                    try {
                        JSONObject contentJson1 = new JSONObject();
                        contentJson1.put("color", "#888888");
                        contentJson1.put("content", "将于");
                        String dateDiff = DateUtil.dateDiff4(new Date(), separate.getEndTime());
                        JSONObject contentJson2 = new JSONObject();
                        contentJson2.put("color", "#F14242");
                        contentJson2.put("content", dateDiff);
                        JSONObject contentJson3 = new JSONObject();
                        contentJson3.put("color", "#888888");
                        contentJson3.put("content", "后脱离邀请关系");
                        JSONArray vipBreak = new JSONArray();
                        vipBreak.add(contentJson1);
                        vipBreak.add(contentJson2);
                        vipBreak.add(contentJson3);
                        object.put("vipBreakTime",vipBreak);
                        List<String> tips = new ArrayList<String>();
                        tips.add("于"+ TimeUtil.formatDateDot(vipLevel.getSuccessTime()) + "升级为" + level.getName());
                        if (type == 1) {
                            tips.add("你需要在"+ dateDiff +"内升级为会员,否则按照邀请规则TA将与你脱离邀请关系。");
                            tips.add("赶快加油升级为会员吧!");
                        } else {
                            tips.add("你需要辅助TA的邀请人"+ threeSale.getBoss().getNickName()+ "在"+dateDiff+"内升级为会员,否则这位间接粉丝" +worker.getNickName()+"将与你脱离邀请关系。");
                            tips.add("赶快帮助TA升级为会员吧!");
                        }
                        object.put("vipBreakTip",tips);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }
            if (wxtip && type == 1 && threeSale.getState() != null && threeSale.getState()) {
                // 一级队员 查询昵称备注
                String memoName = null;
@@ -583,7 +498,6 @@
                    }
                }
            }
            resultArray.add(object);
        }
        return resultArray;
@@ -605,8 +519,8 @@
            return;
        }
        
        List<ThreeSale> listTeam = threeSaleSerivce.listFirstTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, tid, 1);
        long count = threeSaleSerivce.countFirstTeam(tid, 1);
        List<ThreeSale> listTeam = threeSaleSerivce.listFirstTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, tid);
        long count = threeSaleSerivce.countFirstTeam(tid);
        JSONObject result = new JSONObject();
        result.put("count", count);
@@ -627,13 +541,14 @@
        JSONObject bossData = getBossInfo(uid, threeSaleSerivce.getMyBoss(uid));
        JSONObject resultData = new JSONObject();
        long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1);
        long firstTeam = threeSaleSerivce.countFirstTeam(uid);
        long countSecond = threeSaleSerivce.countSecondTeam(uid);
        resultData.put("boss", bossData);
        resultData.put("helpLink", configService.get(ConfigKeyEnum.teamHelpUrl.getKey()));
        resultData.put("firstTeam", firstTeam);
        resultData.put("firstTeamTotal", threeSaleSerivce.countFirstTeam(uid, null));
        resultData.put("secondTeam", threeSaleSerivce.countSecondTeam(uid, 1));
        resultData.put("secondTeamTotal", threeSaleSerivce.countSecondTeam(uid, null));
        resultData.put("firstTeamTotal", firstTeam);
        resultData.put("secondTeam", countSecond);
        resultData.put("secondTeamTotal", countSecond);
        resultData.put("helpLink", configService.get(ConfigKeyEnum.teamHelpUrl.getKey()));
        boolean hasTeam = true;
        if (firstTeam <= 0) {
@@ -906,19 +821,6 @@
        data.put("num", doneFirst);
        data.put("limit", Constant.INVITE_CODRE_TAILOR_LIMIT);
        JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
    }
    @RequestMapping(value = "remvoeBreak")
    public void remvoeBreak(String callback, AcceptData acceptData,Long inviteId, Long uid, Long tid, PrintWriter out) {
        if (uid == null || inviteId == null || tid == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("传输参数不完整"));
            return;
        }
        threeSaleSerivce.remvoeBreak(inviteId, uid, tid);
        JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
    }
    
}
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java
@@ -25,7 +25,6 @@
import com.google.gson.JsonSerializer;
import com.yeshi.fanli.dto.user.UserInviteLevelEnum;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.HongBaoV2;
import com.yeshi.fanli.entity.bus.user.SMSHistory;
import com.yeshi.fanli.entity.bus.user.ThreeSale;
import com.yeshi.fanli.entity.bus.user.UserInfo;
@@ -584,35 +583,13 @@
        UserInviteLevelEnum level = userInviteService.getUserInviteLevelNew(uid);
        
        // 达人
        long limitZiGou = 0;
        long limitShare = 0;
        long limitOrder = 0;
        long limitFirst = 0;
        long limitSecond = 0;
        if (level == UserInviteLevelEnum.actived ||  level == UserInviteLevelEnum.noActive) {
            String zigou = userVipConfigService.getValueByKey("vip_pre_3_zigou_order_count");
            if (!StringUtil.isNullOrEmpty(zigou)) {
                limitZiGou = Long.parseLong(zigou);
            }
            String share = userVipConfigService.getValueByKey("vip_pre_3_share_order_count");
            if (!StringUtil.isNullOrEmpty(share)) {
                limitShare = Long.parseLong(share);
            }
            String first = userVipConfigService.getValueByKey("vip_pre_3_first_level_team_count");
            if (!StringUtil.isNullOrEmpty(first)) {
                limitFirst = Long.parseLong(first);
            }
            String second = userVipConfigService.getValueByKey("vip_pre_3_second_level_team_count");
            if (!StringUtil.isNullOrEmpty(second)) {
                limitSecond = Long.parseLong(second);
            }
        } else if (level == UserInviteLevelEnum.normalVIP) {
            String zigou = userVipConfigService.getValueByKey("vip_pre_7_zigou_order_count");
            if (!StringUtil.isNullOrEmpty(zigou)) {
                limitZiGou = Long.parseLong(zigou);
            }
            String share = userVipConfigService.getValueByKey("vip_pre_7_share_order_count");
            if (!StringUtil.isNullOrEmpty(share)) {
                limitShare = Long.parseLong(share);
            String orderCount = userVipConfigService.getValueByKey("vip_pre_7_order_count");
            if (!StringUtil.isNullOrEmpty(orderCount)) {
                limitOrder = Long.parseLong(orderCount);
            }
            String first = userVipConfigService.getValueByKey("vip_pre_7_first_level_team_count");
            if (!StringUtil.isNullOrEmpty(first)) {
@@ -623,13 +600,9 @@
                limitSecond = Long.parseLong(second);
            }
        } else if (level == UserInviteLevelEnum.highVIP || level == UserInviteLevelEnum.vipApply) {
            String zigou = userVipConfigService.getValueByKey("vip_pre_10_zigou_order_count");
            if (!StringUtil.isNullOrEmpty(zigou)) {
                limitZiGou = Long.parseLong(zigou);
            }
            String share = userVipConfigService.getValueByKey("vip_pre_10_share_order_count");
            if (!StringUtil.isNullOrEmpty(share)) {
                limitShare = Long.parseLong(share);
            String orderCount = userVipConfigService.getValueByKey("vip_pre_10_order_count");
            if (!StringUtil.isNullOrEmpty(orderCount)) {
                limitOrder = Long.parseLong(orderCount);
            }
            String first = userVipConfigService.getValueByKey("vip_pre_10_first_level_team_count");
            if (!StringUtil.isNullOrEmpty(first)) {
@@ -647,16 +620,7 @@
        }
        
        // 自购订单
        long doneZiGou = hongBaoV2CountService.counOrderByUidAndOrderType(uid, Constant.VIP_ORDER_PAY,
                HongBaoV2.TYPE_ZIGOU);
        // 分享订单
        long doneShare = hongBaoV2CountService.counOrderByUidAndOrderType(uid, Constant.VIP_ORDER_PAY,
                HongBaoV2.TYPE_SHARE_GOODS);
        Date now = new Date();
        Date start = new Date(0);
        long doneOrder = hongBaoV2CountService.countMyDirectOrderByCashArrival(uid, Constant.VIP_ORDER_PAY);
        // 有效粉丝
        int doneFirst = 0;
        int doneSecond = 0;
@@ -666,6 +630,8 @@
            doneSecond = userInviteValidNum.getNumSecond() == null ? 0 : userInviteValidNum.getNumSecond();
        }
        
        Date now = new Date();
        Date start = new Date(0);
        // 省钱: ---返利订单、奖励券提成
        List<UserMoneyDetailTypeEnum> typeFanli = new ArrayList<>();
        typeFanli.add(UserMoneyDetailTypeEnum.fanli);
@@ -687,33 +653,24 @@
        }
        
        String shareRate = "可享佣金的<label style=\"color:#E5005C;\">%s</label>";
        String fansRate = "最高佣金的<label style=\"color:#E5005C;\">%s</label>";
        String fansIndirect = "最高佣金的<label style=\"color:#E5005C;\">%s</label>";
        String teamBonus = "团队分红池<label style=\"color:#E5005C;\">%s</label>";
        String teamRate = "最高佣金的<label style=\"color:#E5005C;\">%s</label>";
        // 达人版
        JSONObject jsonrRed1 = new JSONObject();
        jsonrRed1.put("shareRate", String.format(shareRate, "152%"));
        jsonrRed1.put("fansRate", String.format(fansRate, "22.5%"));
        jsonrRed1.put("fansIndirect", String.format(fansIndirect, "5%"));
        jsonrRed1.put("teamBonus", "高级会员以上专属");
        jsonrRed1.put("enjoyRate", String.format(shareRate, "145%"));
        jsonrRed1.put("teamRate", String.format(teamRate, "25%"));
        jsonrRed1.put("teamIncome", "高级会员以上专属");
        
        // 高级会员
        JSONObject jsonrRed2 = new JSONObject();
        jsonrRed2.put("shareRate", String.format(shareRate, "162.5%"));
        jsonrRed2.put("fansRate", String.format(fansRate, "27.5%"));
        jsonrRed2.put("fansIndirect", String.format(fansIndirect, "7.5%"));
        jsonrRed2.put("teamBonus", "高级会员以上专属");
        jsonrRed2.put("enjoyRate", String.format(shareRate, "195%"));
        jsonrRed2.put("teamRate", String.format(teamRate, "50%"));
        jsonrRed2.put("teamIncome", "享高级团队收益");
        // 超级会员
        JSONObject jsonrRed3 = new JSONObject();
        jsonrRed3.put("shareRate", String.format(shareRate, "170%"));
        jsonrRed3.put("fansRate", String.format(fansRate, "32.5%"));
        jsonrRed3.put("fansIndirect", String.format(fansIndirect, "10%"));
        jsonrRed3.put("teamBonus", String.format(teamBonus, "40%"));
        JSONObject jsonrRed4 = new JSONObject();
        jsonrRed4.put("shareRate", String.format(shareRate, "225%"));
        jsonrRed4.put("fansRate", String.format(fansRate, "37.5%"));
        jsonrRed4.put("fansIndirect", String.format(fansIndirect, "12.5%"));
        jsonrRed4.put("teamBonus", String.format(teamBonus, "80%"));
        jsonrRed3.put("enjoyRate", String.format(shareRate, "210%"));
        jsonrRed3.put("teamRate", String.format(teamRate, "110%"));
        jsonrRed3.put("teamIncome", "享超级团队收益");
        
        
        JSONObject json = new JSONObject();
@@ -729,22 +686,19 @@
        json.put("newerGongLue", configService.get(ConfigKeyEnum.newerGonglue.getKey()));
        
        // 已完成
        json.put("doneZiGou", doneZiGou);
        json.put("doneShare", doneShare);
        json.put("doneOrder", doneOrder);
        json.put("doneFirst", doneFirst);
        json.put("doneSecond", doneSecond);
        
        // 标准
        json.put("limitZiGou", limitZiGou);
        json.put("limitShare", limitShare);
        json.put("limitOrder", limitOrder);
        json.put("limitFirst", limitFirst);
        json.put("limitSecond", limitSecond);
        
        // 已完成
        json.put("master", jsonrRed1);
        json.put("vip1", jsonrRed2);
        json.put("vip2", jsonrRed3);
        json.put("vip3", jsonrRed4);
        json.put("daRen", jsonrRed1);
        json.put("highVIP", jsonrRed2);
        json.put("superVIP", jsonrRed3);
        
        // 人工客服链接
        json.put("csdLink", configService.get(ConfigKeyEnum.customerServiceLink.getKey()));
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();
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/HongBaoV2CountMapper.java
@@ -150,11 +150,10 @@
    /**
     *  注:1笔且付款总金额不小于 payment 元(退款为失效
     * @param uid
     * @param list 类型
     * @param payment
     * @return
     */
    Long counOrderByUidAndOrderType(@Param("uid") Long uid, @Param("payment") BigDecimal payment,
            @Param("type") int type);
    Long countMyDirectOrderByCashArrival(@Param("uid") Long uid, @Param("payment") BigDecimal payment);
    
    
    
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/ThreeSaleMapper.java
@@ -15,38 +15,52 @@
    int insertSelective(ThreeSale record);
    ThreeSale selectByPrimaryKey(Long id);
    UserInfo selectBoss(Long uid);
    List<ThreeSale> selectByUid(Long uid);
    int updateByPrimaryKey(ThreeSale record);
    int updateByPrimaryKeySelective(ThreeSale record);
    int updateByPrimaryKey(ThreeSale record);
    int effectThreeSale(Long workerUid);
    ThreeSale selectByPrimaryKey(Long id);
    UserInfo selectBoss(Long uid);
    
    /**
     * 删除失效
     * @param bossId
     * 根据被邀请者ID查询
     *
     * @param workerId
     * @return
     */
    int deleteExpireRecord(@Param("bossId")Long bossId, @Param("workerId")Long workerId);
    ThreeSale getByWorkerId(Long workerId);
    
    /**
     * 失效
     * @param bossId
     *
     * @param uid
     * @return
     */
    ThreeSale getMyBoss(@Param("uid") Long uid);
    /**
     * 根据下级查询成功的邀请关系
     * @param workerId
     * @return
     */
    List<ThreeSale> getExpireRecord(@Param("bossId")Long bossId, @Param("workerId")Long workerId);
    ThreeSale selectSuccessByWorkerId(Long workerId);
    /**
     * 根据邀请者ID查询关系
     *
     * @param workerId
     * @return
     */
    List<ThreeSale> listByWorkerId(Long workerId);
    
    /**
     * 一级查询
     * 一级查询-后台查询
     * 
     * @param start
     * @param count
@@ -63,7 +77,7 @@
            @Param("endTime") String endTime, @Param("validState") Integer validState);
    /**
     * 二级查询
     * 二级查询 -后台查询
     * 
     * @param start
     * @param count
@@ -80,7 +94,7 @@
            @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("validState") Integer validState);
    /**
     * 上级查询
     * 上级查询 -后台查询
     * 
     * @param start
     * @param count
@@ -92,97 +106,40 @@
    long countSuperiorQuery(@Param("state") Integer state, @Param("uid") Long uid);
    /**
     * 查询一级队员
     *
     * @param paramLong
     * @param paramInt
     * @param paramLong1
     * @param start
     * @param count
     * @param uid
     * @return
     */
    List<ThreeSale> listFirstTeam(@Param("start") long start, @Param("count") int count,
            @Param("uid") Long uid, @Param("state") Integer state);
    List<ThreeSale> listFirstTeam(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid);
    /**
     * 查询二级队员
     * @param start
     * @param count
     * @param uid
     * @return
     */
    List<ThreeSale> listSecondTeam(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid);
    /**
     * 统计一级队员
     *
     * @param uid
     * @param state
     * @return
     */
    long countFirstTeam(@Param("uid") Long uid, @Param("state") Integer state);
    /**
     * 查询一级队员-未删除版
     *
     * @param paramLong
     * @param paramInt
     * @param paramLong1
     * @return
     */
    List<ThreeSale> listFirstTeamByUndeleted(@Param("start") long start, @Param("count") int count,  @Param("uid") Long uid);
    /**
     * 统计一级队员 -未删除版
     *
     * @param uid
     * @param state
     * @return
     */
    long countFirstTeamByUndeleted(@Param("uid") Long uid);
    /**
     * 查询二级队员
     *
     * @param start
     * @param count
     * @param uid
     * @return
     */
    List<ThreeSale> listSecondTeamByUndeleted(@Param("start") long start, @Param("count") int count,
            @Param("uid") Long uid);
    long countFirstTeam(@Param("uid") Long uid);
    /**
     * 统计二级队员
     *
     * @param uid
     * @param state
     * @return
     */
    long countSecondTeamByUndeleted(@Param("uid") Long uid);
    long countSecondTeam(@Param("uid") Long uid);
    /**
     * 查询二级队员
     *
     * @param start
     * @param count
     * @param uid
     * @return
     */
    List<ThreeSale> listSecondTeam(@Param("start") long start, @Param("count") int count,
            @Param("uid") Long uid,@Param("state") Integer state);
    /**
     * 统计二级队员
     *
     * @param uid
     * @param state
     * @return
     */
    long countSecondTeam(@Param("uid") Long uid, @Param("state") Integer state);
    /**
     *
     * @param uid
     * @return
     */
    ThreeSale getMyBoss(@Param("uid") Long uid);
    /**
     * 根据id、uid查询
@@ -193,14 +150,6 @@
     */
    List<ThreeSale> listbyIdAndBossId(@Param("id") Long id, @Param("uid") Long uid, @Param("expire") Integer expire);
    /**
     * 根据邀请者ID查询关系
     *
     * @param workerId
     * @return
     */
    List<ThreeSale> listByWorkerId(Long workerId);
    
    /**
     * 获取成功邀请关系数量
@@ -228,23 +177,6 @@
     */
    ThreeSale getNearRelationByBossIdAndWorkerId(@Param("bossId") Long bossId, @Param("workerId") Long workerId);
    
    /**
     * 根据下级查询成功的邀请关系
     * @param workerId
     * @return
     */
    ThreeSale selectSuccessByWorkerId(Long workerId);
    /**
     * 根据邀请者ID查询未失效关系
     *
     * @param workerId
     * @return
     */
    ThreeSale getByWorkerId(Long workerId);
    
    
    /**
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserInviteSeparateMapper.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/dto/user/UserInviteLevelEnum.java
@@ -3,7 +3,6 @@
public enum UserInviteLevelEnum {
    noActive(0,"未激活", ""),
    actived(0, "已经激活", ""),
    normalVIP(3,"普通会员", ""),
    highVIP(7,"高级会员", ""), 
    vipApply(7,"超级会员申请中", ""),
    vip(10, "超级会员", ""), 
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/HomeNavbar.java
@@ -111,8 +111,6 @@
    @Column(name = "br_params")
    private String params;
    
    // 是否定时
    private boolean timeTask;
    // 起始时间
    private String startTime_str;
    // 结束时间
@@ -235,14 +233,6 @@
    public void setState(Integer state) {
        this.state = state;
    }
    public boolean isTimeTask() {
        return timeTask;
    }
    public void setTimeTask(boolean timeTask) {
        this.timeTask = timeTask;
    }
    public String getStartTime_str() {
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/ThreeSale.java
@@ -70,9 +70,7 @@
    // 上上级关系状态
    @Transient
    private Boolean stateSuper;
    // 有效关系
    @Transient
    private Integer validState;
    public Long getId() {
        return id;
@@ -154,12 +152,5 @@
        this.stateSuper = stateSuper;
    }
    public Integer getValidState() {
        return validState;
    }
    public void setValidState(Integer validState) {
        this.validState = validState;
    }
    
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserInviteSeparate.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/job/UpdateThreeSaleJob.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/mapping/ThreeSaleMapper.xml
@@ -30,8 +30,6 @@
        <result column="createTime" property="createTime" jdbcType="BIGINT" />
        <result column="updateTime" property="updateTime" jdbcType="BIGINT" />
        <result column="expire" property="expire" jdbcType="INTEGER" />
        <result column="stateSuper" property="stateSuper" jdbcType="BOOLEAN" />
        <association property="boss" column="boss_id"
            select="com.yeshi.fanli.dao.mybatis.UserInfoMapper.selectByPrimaryKey" />
@@ -51,14 +49,6 @@
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_threeSale where id = #{id,jdbcType=BIGINT}
    </select>
    <select id="selectByUid" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_threeSale where boss_id = #{0} or worker_id=#{0}
    </select>
@@ -84,7 +74,7 @@
    <!-- 根据邀请者ID查询关系 -->
    <select id="getByWorkerId" resultMap="BaseResultMap" parameterType="java.lang.Long">
        select <include refid="Base_Column_List" /> from yeshi_ec_threeSale 
        where worker_id = #{0} AND state = 1
        where worker_id = #{0}
    </select>
    
    <select id="selectLatestByWorkerIdAndState" resultMap="BaseResultMap">
@@ -155,27 +145,12 @@
        where id = #{id,jdbcType=BIGINT}
    </update>
    <update id="effectThreeSale" parameterType="java.lang.Long">
        update yeshi_ec_threeSale t set t.state=1,
        t.succeedTime = <![CDATA[UNIX_TIMESTAMP(CURRENT_TIMESTAMP()) * 1000]]>,
        t.updateTime = <![CDATA[UNIX_TIMESTAMP(CURRENT_TIMESTAMP()) * 1000]]>
        where t.state=0 and t.worker_id=#{0} AND (t.expire = 0 OR t.expire IS
        NULL)
    </update>
    
    <update id="inviteSeparate">
        update yeshi_ec_threeSale t set t.state = 0,t.expire = 2,
            t.updateTime = <![CDATA[UNIX_TIMESTAMP(CURRENT_TIMESTAMP()) * 1000]]>
        where t.worker_id=#{workerId} AND t.boss_id = #{bossId}
    </update>
    <delete id="deleteExpireRecord" parameterType="java.lang.Long">
        DELETE FROM
        yeshi_ec_threesale
        WHERE expire = 1 AND boss_id = #{bossId} AND
        worker_id = #{workerId}
    </delete>
    <select id="listFirstTeamQuery" resultMap="BaseResultMap">
@@ -322,39 +297,24 @@
    <select id="listFirstTeam" resultMap="AllResultMap">
        SELECT * FROM `yeshi_ec_threesale` ts
        LEFT JOIN `yeshi_ec_threesale_extra_info` ff
        ON
        ts.`boss_id` = ff.`tf_boss_id` AND ts.`worker_id`=ff.`tf_worker_id`
        LEFT JOIN `yeshi_ec_threesale_extra_info` ff ON (ts.`boss_id` = ff.`tf_boss_id` AND ts.`worker_id`=ff.`tf_worker_id`)
        WHERE ts.`boss_id` = #{uid}
            <if test="state != null">
                AND ts.`state` = #{state}
            </if>
        ORDER BY ts.state DESC, ts.expire, ts.createTime DESC
        ORDER BY ts.createTime DESC
        LIMIT ${start},${count}
    </select>
    <select id="countFirstTeam" resultType="java.lang.Long">
        SELECT IFNULL(count(id),0) FROM `yeshi_ec_threesale`
        WHERE `boss_id` = #{uid}
        <if test="state != null">
            AND `state` = #{state}
        </if>
    </select>
    <select id="listSecondTeam" resultMap="AllResultMap">
        SELECT yet.* FROM (
            SELECT DISTINCT(ts.`id`) AS id FROM `yeshi_ec_threesale` ts
            LEFT JOIN yeshi_ec_threesale tf ON ts.`boss_id`=tf.`worker_id`
            WHERE tf.`boss_id` = #{uid} AND tf.`state` = 1)A
            LEFT JOIN yeshi_ec_threesale tf ON ts.`boss_id`= tf.`worker_id`
            WHERE tf.`boss_id` = #{uid})A
        LEFT JOIN yeshi_ec_threesale yet ON yet.id = A.id
        WHERE 1=1
            <if test="state != null">
                AND yet.`state` = #{state}
            </if>
        ORDER BY
        yet.state DESC,
        yet.expire, yet.createTime DESC
        ORDER BY yet.createTime DESC
        LIMIT ${start},${count}
    </select>
@@ -362,49 +322,10 @@
        SELECT COUNT(A.id) FROM (
            SELECT DISTINCT(ts.`id`) AS id FROM `yeshi_ec_threesale` ts
            LEFT JOIN yeshi_ec_threesale tf ON ts.`boss_id`=tf.`worker_id`
            WHERE tf.`boss_id` = #{uid} AND tf.`state` = 1
            <if test="state != null">
                AND ts.`state` = #{state}
            </if>
            WHERE tf.`boss_id` = #{uid}
        )A
    </select>
    
    <select id="listFirstTeamByUndeleted" resultMap="AllResultMap">
        SELECT * FROM `yeshi_ec_threesale` ts
        LEFT JOIN `yeshi_ec_threesale_extra_info` ff ON (ts.`boss_id` = ff.`tf_boss_id` AND ts.`worker_id`=ff.`tf_worker_id`)
        WHERE ts.`boss_id` = #{uid} AND (ts.`expire` = 0 OR ts.`expire` = 2 OR ts.`expire` = 4)
        ORDER BY ts.state DESC, ts.createTime DESC
        LIMIT ${start},${count}
    </select>
    <select id="countFirstTeamByUndeleted" resultType="java.lang.Long">
        SELECT IFNULL(count(ts.id),0) FROM `yeshi_ec_threesale` ts
        WHERE ts.`boss_id` = #{uid} AND (ts.`expire` = 0 OR ts.`expire` = 2 OR ts.`expire` = 4)
    </select>
    <select id="listSecondTeamByUndeleted" resultMap="AllResultMap">
        SELECT yet.*,stateSuper FROM (
            SELECT DISTINCT(ts.`id`) AS id, tf.state AS stateSuper FROM `yeshi_ec_threesale` ts
            LEFT JOIN yeshi_ec_threesale tf ON ts.`boss_id`=tf.`worker_id`
            WHERE tf.`boss_id` = #{uid} AND (tf.`expire` = 0 OR tf.`expire` = 2))A
        LEFT JOIN yeshi_ec_threesale yet ON yet.id = A.id
        WHERE yet.`expire` = 0 OR yet.`expire` = 2 OR yet.`expire` = 3
        ORDER BY yet.state DESC, yet.createTime DESC
        LIMIT ${start},${count}
    </select>
    <select id="countSecondTeamByUndeleted" resultType="java.lang.Long">
        SELECT COUNT(DISTINCT yet.id) FROM (SELECT DISTINCT(ts.`id`) AS id FROM `yeshi_ec_threesale` ts
               LEFT JOIN yeshi_ec_threesale tf ON ts.`boss_id`=tf.`worker_id`
           WHERE tf.`boss_id` = #{uid} AND (tf.`expire` = 0 OR tf.`expire` = 2))A
        LEFT JOIN yeshi_ec_threesale yet ON yet.id = A.id
        WHERE yet.`expire` = 0 OR yet.`expire` = 2 OR yet.`expire` = 3
    </select>
    <select id="getMyBoss" resultMap="AllResultMap">
        select
        <include refid="Base_Column_List" />
@@ -445,12 +366,6 @@
        LIMIT 1
    </select>
    <select id="getExpireRecord" resultMap="BaseResultMap">
        SELECT * FROM
        `yeshi_ec_threesale`
        WHERE expire = 1 AND boss_id = #{bossId} AND
        worker_id = #{workerId}
    </select>
    <select id="selectSuccessByWorkerId" resultMap="BaseResultMap" parameterType="java.lang.Long">
        SELECT * FROM `yeshi_ec_threesale`
fanli/src/main/java/com/yeshi/fanli/mapping/hongbao/HongBaoV2CountMapper.xml
@@ -303,11 +303,12 @@
    </select>
    
    
    <select id="counOrderByUidAndOrderType" resultType="Long">
    <select id="countMyDirectOrderByCashArrival" resultType="Long">
        SELECT COUNT(0)  FROM (SELECT co.`co_order_no` FROM yeshi_ec_hongbao_v2 v2
        LEFT JOIN yeshi_ec_hongbao_order h ON v2.`hb_id` = h.`ho_hongbao_id`
        LEFT JOIN yeshi_ec_common_order co ON h.`ho_order_id` = co.`co_id`
        WHERE v2.`hb_uid` = #{uid} AND v2.`hb_state` = 3 AND co.`co_payment` >=  #{payment} AND v2.`hb_type` = #{type}
        WHERE v2.`hb_state` = 3 AND (v2.`hb_type` = 1 OR v2.`hb_type` = 20)
            AND v2.`hb_uid` = #{uid} AND   co.`co_payment` >=  #{payment}
        GROUP BY co.`co_order_no`,co.`co_source_type`)A
    </select>
    
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserInviteSeparateMapper.xml
File was deleted
fanli/src/main/java/com/yeshi/fanli/service/impl/count/HongBaoV2CountServiceImpl.java
@@ -10,7 +10,6 @@
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.HongBaoV2CountMapper;
import com.yeshi.fanli.dto.ChartTDO;
import com.yeshi.fanli.entity.bus.user.HongBaoV2;
import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
import com.yeshi.fanli.vo.order.HongBaoV2VO;
@@ -158,8 +157,8 @@
    
    
    @Override
    public long counOrderByUidAndOrderType(Long uid, BigDecimal payment,int type) {
        Long count = hongBaoV2CountMapper.counOrderByUidAndOrderType(uid, payment, type);
    public long countMyDirectOrderByCashArrival(Long uid, BigDecimal payment) {
        Long count = hongBaoV2CountMapper.countMyDirectOrderByCashArrival(uid, payment);
        if (count == null) {
            count = 0L;
        }
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/HomeNavbarServiceImpl.java
@@ -20,6 +20,7 @@
import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar.NavbarTypeEnum;
import com.yeshi.fanli.entity.bus.homemodule.SwiperBanner;
import com.yeshi.fanli.exception.homemodule.HomeNavbarException;
import com.yeshi.fanli.exception.homemodule.SpecialException;
import com.yeshi.fanli.service.inter.goods.GoodsClassService;
import com.yeshi.fanli.service.inter.homemodule.HomeNavbarService;
import com.yeshi.fanli.service.inter.homemodule.SwiperBannerService;
@@ -69,12 +70,6 @@
            throw new HomeNavbarException(1, "导航名称不能为空");
        }
        
        String startTime_str = record.getStartTime_str();
        if (record.isTimeTask() && (startTime_str == null || startTime_str.length() == 0)) {
            throw new HomeNavbarException(1, "控制时间不能为空");
        }
        Integer sex = null;
        NavbarTypeEnum type = record.getType();
        if (NavbarTypeEnum.category.equals(type)) {
@@ -108,7 +103,7 @@
        }
        
        // 时间转换
        conversionTime(record);
        handleTime(record);
        
        // 图片上传
        String picture = null;
@@ -201,37 +196,33 @@
        }
    }
    
    /**
     * web段时间转换
     *
     * @param record
     */
    public void conversionTime(HomeNavbar record) throws HomeNavbarException, Exception {
        // 是否时间控制
        if(!record.isTimeTask()) {
            record.setStartTime(null);
            record.setEndTime(null);
        } else {
            String startTime_str = record.getStartTime_str();
            String endTime_str = record.getEndTime_str();
            if ((startTime_str == null|| startTime_str.trim().length() == 0)
                    && (endTime_str == null || endTime_str.trim().length() == 0)) {
                throw new HomeNavbarException(1, "请输入控制时间");
            } else {
                SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
                if (startTime_str != null && startTime_str.trim().length() > 0) {
                    startTime_str = startTime_str.replaceAll("T", " ");
                    record.setStartTime(format.parse(startTime_str));
                }
                if (endTime_str != null && endTime_str.trim().length() > 0) {
                    endTime_str = endTime_str.replaceAll("T", " ");
                    record.setEndTime(format.parse(endTime_str));
                }
            }
    private void handleTime(HomeNavbar record) throws SpecialException, Exception {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        String startTime_str = record.getStartTime_str();
        if (!StringUtil.isNullOrEmpty(startTime_str)) {
            startTime_str = startTime_str.replaceAll("T", " ");
            record.setStartTime(format.parse(startTime_str));
        }
        String endTime_str = record.getEndTime_str();
        if (!StringUtil.isNullOrEmpty(endTime_str)) {
            endTime_str = endTime_str.replaceAll("T", " ");
            record.setEndTime(format.parse(endTime_str));
        }
        if (record.getEndTime() != null && record.getStartTime() != null
                && record.getStartTime().getTime() > record.getEndTime().getTime()) {
            throw new SpecialException(1, "起始时间不能小于结束时间");
        }
    }
    
    @Override
    public void updateOrder(Long id, Integer moveType, Integer sex) throws HomeNavbarException, Exception{
@@ -299,30 +290,21 @@
            return null;
        }
        
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
        for (HomeNavbar homeNavbar: listObj) {
            Date startTime = homeNavbar.getStartTime();
            Date endTime = homeNavbar.getEndTime();
            if (startTime == null && endTime == null) {
                homeNavbar.setTimeTask(false);
            if (startTime == null) {
                homeNavbar.setStartTime_str("");
            } else {
                homeNavbar.setStartTime_str(sdf.format(startTime));
            }
            Date endTime = homeNavbar.getEndTime();
            if (endTime == null) {
                homeNavbar.setEndTime_str("");
            } else {
                homeNavbar.setTimeTask(true);
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
                if (startTime == null) {
                    homeNavbar.setStartTime_str("");
                } else {
                    homeNavbar.setStartTime_str(sdf.format(startTime));
                }
                if (endTime == null) {
                    homeNavbar.setEndTime_str("");
                } else {
                    homeNavbar.setEndTime_str(sdf.format(endTime));
                }
                homeNavbar.setEndTime_str(sdf.format(endTime));
            }
            
            Long classId = homeNavbar.getClassId();
@@ -377,4 +359,29 @@
        return homeNavbarMapper.getEffectiveByClassId(classId);
    }
    @Override
    public void switchState(Long id) throws HomeNavbarException {
        if (id == null) {
            throw new HomeNavbarException(1, "请传递正确参数");
        }
        HomeNavbar resultObj = homeNavbarMapper.selectByPrimaryKey(id);
        if (resultObj == null) {
            throw new HomeNavbarException(1, "此内容已不存在");
        }
        Integer state = resultObj.getState();
        if (state == null || state == 0) {
            state = 1;
        } else {
            state = 0;
        }
        HomeNavbar updateObj = new HomeNavbar();
        updateObj.setId(id);
        updateObj.setState(state);
        homeNavbarMapper.updateByPrimaryKeySelective(updateObj);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialCardServiceImpl.java
@@ -185,6 +185,14 @@
            long totalSpecial= specialService.countlistQueryByCard(specialCard.getId(), null, null);
            specialCard.setTotalSpecial(totalSpecial);
            
            // 将状态变化
            if (specialCard.getState() != null && specialCard.getState() == 0) {
                specialCard.setState(1);
            } else {
                specialCard.setState(0);
            }
            Date startTime = specialCard.getStartTime();
            Date endTime = specialCard.getEndTime();
            if (startTime == null && endTime == null) {
@@ -227,6 +235,29 @@
    }
    
    
    @Override
    public void switchState(Long id) throws SpecialCardException {
        if (id == null) {
            throw new SpecialCardException(1, "请传递正确参数");
        }
        SpecialCard resultObj = specialCardMapper.selectByPrimaryKey(id);
        if (resultObj == null) {
            throw new SpecialCardException(1, "此内容已不存在");
        }
        Integer state = resultObj.getState();
        if (state == null || state == 0) {
            state = 1;
        } else {
            state = 0;
        }
        SpecialCard updateObj = new SpecialCard();
        updateObj.setId(id);
        updateObj.setState(state);
        specialCardMapper.updateByPrimaryKeySelective(updateObj);
    }
    
}
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java
@@ -383,10 +383,14 @@
        // 跳转链接
        for (Special special : list) {
            if (special.getState() != null && special.getState().longValue() == 0) {
                special.setState(1L);
            } else {
                special.setState(0L);
            }
            Date startTime = special.getStartTime();
            Date endTime = special.getEndTime();
            if (startTime == null && endTime == null) {
                special.setStartTime_str("");
                special.setEndTime_str("");
@@ -729,6 +733,7 @@
        Special updateObj = new Special();
        updateObj.setId(id);
        updateObj.setState(state);
        updateObj.setJumpLogin(resultObj.isJumpLogin());
        specialMapper.updateByPrimaryKeySelective(updateObj);
    }
    
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
@@ -1570,7 +1570,7 @@
        if (couponType == CouponTypeEnum.freeCoupon.name()) {
            stateActivated = 0; //
        } else if (couponType == CouponTypeEnum.welfareFreeCoupon.name()
                && threeSaleSerivce.countSuccessFirstTeam(uid) <= 0) {
                && threeSaleSerivce.countFirstTeam(uid) <= 0) {
            stateActivated = 0; // 无下级队员 --待激活
        }
fanli/src/main/java/com/yeshi/fanli/service/impl/user/integral/CodePublishRecordServiceImpl.java
@@ -83,8 +83,8 @@
            UserInfo user = userInfoService.selectByPKey(codePublishRecord.getUid());
            long firstTeam = threeSaleSerivce.countFirstTeam(codePublishRecord.getUid(), 1);
            long secondTeam = threeSaleSerivce.countSecondTeam(codePublishRecord.getUid(), 1);
            long firstTeam = threeSaleSerivce.countFirstTeam(codePublishRecord.getUid());
            long secondTeam = threeSaleSerivce.countSecondTeam(codePublishRecord.getUid());
            codePublishRecord.setTeam(firstTeam + secondTeam);
            if (user != null && user.getType() == 1) {// 假用户
                long s = Integer
fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/ThreeSaleSerivceImpl.java
@@ -105,16 +105,6 @@
            threeSale.setWorker(inviteeUser);
            threeSaleMapper.insertSelective(threeSale);
            List<ThreeSale> listExpire = threeSaleMapper.getExpireRecord(inviter.getId(), inviteeUser.getId());
            if (listExpire != null && listExpire.size() > 0) {
                // 删除失效
                for (ThreeSale saleExpire : listExpire) {
                    msgInviteDetailService.deleteByThreeSale(saleExpire);
                }
                // 删除已失效关系
                threeSaleMapper.deleteExpireRecord(inviter.getId(), inviteeUser.getId());
            }
        } else {// 是已经存在的用户
            if (worker.getId().longValue() == inviter.getId())
                throw new ThreeSaleException(4, "不能绑定自己");
@@ -144,20 +134,6 @@
                        threeSale.setUpdateTime(java.lang.System.currentTimeMillis());
                        threeSale.setWorker(worker);
                        threeSaleMapper.insertSelective(threeSale);
                        // 删除已失效关系
                        threeSaleMapper.deleteExpireRecord(inviter.getId(), worker.getId());
                        List<ThreeSale> listExpire = threeSaleMapper.getExpireRecord(inviter.getId(), worker.getId());
                        if (listExpire != null && listExpire.size() > 0) {
                            // 删除历史通知
                            for (ThreeSale saleExpire : listExpire) {
                                msgInviteDetailService.deleteByThreeSale(saleExpire);
                            }
                            // 删除已失效关系
                            threeSaleMapper.deleteExpireRecord(inviter.getId(), worker.getId());
                        }
                    } else {
                        // 还存在有效的邀请,则不做处理
                    }
@@ -232,22 +208,6 @@
        }
    }
    @Override
    public long getFirstUsersCount(Long uid) {
        return threeSaleMapper.countFirstTeam(uid, null);
    }
    @Override
    public long getSecondUsersCount(Long uid) {
        return threeSaleMapper.countSecondTeam(uid, null);
    }
    @Override
    public int deleteByPrimaryKey(Long id) {
        return threeSaleMapper.deleteByPrimaryKey(id);
    }
    @Override
    public List<ThreeSale> listFirstTeamQuery(long start, int count, Long uid, Integer state, String startTime,
@@ -282,16 +242,6 @@
    }
    @Override
    public long countFirstTeam(Long uid, Integer state) {
        return threeSaleMapper.countFirstTeam(uid, state);
    }
    @Override
    public long countSecondTeam(Long uid, Integer state) {
        return threeSaleMapper.countSecondTeam(uid, state);
    }
    @Override
    public ThreeSale getMyBoss(Long uid) {
        return threeSaleMapper.getMyBoss(uid);
    }
@@ -307,27 +257,22 @@
    }
    @Override
    public JSONObject getMyFirstTeam(long start, int count, Long uid, Integer state) {
        List<ThreeSale> list = threeSaleMapper.listFirstTeam(start, count, uid, state);
    public JSONObject getMyFirstTeam(long start, int count, Long uid) {
        List<ThreeSale> list = threeSaleMapper.listFirstTeam(start, count, uid);
        if (list == null) {
            list = new ArrayList<ThreeSale>();
        }
        long countTotal = threeSaleMapper.countFirstTeam(uid, state);
        long countTotal = threeSaleMapper.countFirstTeam(uid);
        return organizeTeam(countTotal, list);
    }
    @Override
    public JSONObject getMySecondTeam(long start, int count, Long uid, Integer state) {
        List<ThreeSale> list = threeSaleMapper.listSecondTeam(start, count, uid, state);
    public JSONObject getMySecondTeam(long start, int count, Long uid) {
        List<ThreeSale> list = threeSaleMapper.listSecondTeam(start, count, uid);
        if (list == null) {
            list = new ArrayList<ThreeSale>();
        }
        long countTotal = threeSaleMapper.countSecondTeam(uid, state);
        long countTotal = threeSaleMapper.countSecondTeam(uid);
        return organizeTeam(countTotal, list);
    }
@@ -529,11 +474,7 @@
        return threeSaleMapper.getByWorkerId(workerId);
    }
    @Override
    public long countSuccessFirstTeam(Long uid) {
        return threeSaleMapper.countFirstTeam(uid, 1);
    }
    @Override
    public ThreeSale selectByWorkerId(Long workerId) {
        return threeSaleMapper.selectSuccessByWorkerId(workerId);
@@ -550,34 +491,25 @@
    }
    @Override
    public List<ThreeSale> listFirstTeam(long start, int count, Long uid, Integer state) {
        return threeSaleMapper.listFirstTeam(start, count, uid, state);
    public List<ThreeSale> listFirstTeam(long start, int count, Long uid) {
        return threeSaleMapper.listFirstTeam(start, count, uid);
    }
    @Override
    public List<ThreeSale> listFirstTeamByUndeleted(long start, int count, Long uid) {
        return threeSaleMapper.listFirstTeamByUndeleted(start, count, uid);
    public List<ThreeSale> listSecondTeam(long start, int count, Long uid) {
        return threeSaleMapper.listSecondTeam(start, count, uid);
    }
    @Override
    public long countFirstTeam(Long uid) {
        return threeSaleMapper.countFirstTeam(uid);
    }
    @Override
    public long countFirstTeamByUndeleted(Long uid) {
        return threeSaleMapper.countFirstTeamByUndeleted(uid);
    public long countSecondTeam(Long uid) {
        return threeSaleMapper.countSecondTeam(uid);
    }
    @Override
    public List<ThreeSale> listSecondTeamByUndeleted(long start, int count, Long uid) {
        return threeSaleMapper.listSecondTeamByUndeleted(start, count, uid);
    }
    @Override
    public long countSecondTeamByUndeleted(Long uid) {
        return threeSaleMapper.countSecondTeamByUndeleted(uid);
    }
    @Override
    public List<ThreeSale> listSecondTeam(long start, int count, Long uid, Integer state) {
        return threeSaleMapper.listSecondTeam(start, count, uid, state);
    }
    @Override
    public ThreeSale selectLatestByWorkerIdAndState(Long workerId, int state) {
@@ -622,46 +554,6 @@
    public List<ThreeSale> getMyBossDeepList(Long uid) {
        //TODO 需要更加简便的方式处理
        return getMyBossDeepList(uid, 100);
    }
    @Override
    public void remvoeBreak(Long id, Long uid, Long tid) {
        ThreeSale threeSale = threeSaleMapper.selectByPrimaryKey(id);
        if (threeSale == null) {
            return;
        }
        Long workerId = threeSale.getWorker().getId();
        if (tid.longValue() != workerId.longValue()) {
            return;
        }
        Integer expire = threeSale.getExpire();
        if (expire == ThreeSale.EXPIRE_NORMAL) {
            return;
        }
        int upExpire = expire;
        Long bossId = threeSale.getBoss().getId();
        if (bossId.longValue() == uid.longValue()) { // 直接粉丝
            if (expire == ThreeSale.EXPIRE_BREAK_VIP_DEL4) {
                upExpire = ThreeSale.EXPIRE_BREAK_VIP_DEL34;
            } else {
                upExpire = ThreeSale.EXPIRE_BREAK_VIP_DEL3;
            }
        } else { // 间接粉丝
            if (expire == ThreeSale.EXPIRE_BREAK_VIP_DEL3) {
                upExpire = ThreeSale.EXPIRE_BREAK_VIP_DEL34;
            } else {
                upExpire = ThreeSale.EXPIRE_BREAK_VIP_DEL4;
            }
        }
        ThreeSale update = new ThreeSale();
        update.setId(id);
        update.setExpire(upExpire);
        update.setUpdateTime(java.lang.System.currentTimeMillis());
        threeSaleMapper.updateByPrimaryKeySelective(update);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/UserInviteMsgNotificationServiceImpl.java
@@ -47,33 +47,9 @@
    
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void fansUpgrade(Long uid, String relation, String rankName, String nickName, String item, Date time) {
        saveMsgDetail(MsgInviteDetailFactory.fansUpgrade(uid, relation, rankName, nickName, item, time));
    public void fansUpgrade(Long uid, String rankName, String nickName, String item, Date time) {
        saveMsgDetail(MsgInviteDetailFactory.fansUpgrade(uid, rankName, nickName, item, time));
    }
    
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void fansPreDivorced(Long uid, String rankName, String nickName, Date time) {
        saveMsgDetail(MsgInviteDetailFactory.fansPreDivorced(uid, rankName, nickName, time));
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void fansPredivorcedIndirect(Long uid, String rankName, String nickName, String fansName, Date time) {
        saveMsgDetail(MsgInviteDetailFactory.fansPredivorcedIndirect(uid, rankName, nickName, fansName, time));
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void fansDivorced(Long uid, String nickName, Date time) {
        saveMsgDetail(MsgInviteDetailFactory.fansDivorced(uid, nickName, time));
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void fansDivorcedIndirect(Long uid, String nickName, String fansName, Date time) {
        saveMsgDetail(MsgInviteDetailFactory.fansDivorcedIndirect(uid, nickName, fansName, time));
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/UserInviteSeparateServiceImpl.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/UserInviteServiceImpl.java
@@ -7,7 +7,6 @@
import com.yeshi.fanli.dao.mybatis.user.vip.UserVIPLevelMapper;
import com.yeshi.fanli.dto.user.UserInviteLevelEnum;
import com.yeshi.fanli.dto.vip.UserVIPLevel;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.bus.user.vip.UserVIPInfo;
import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
@@ -62,11 +61,7 @@
        if (info == null) {
            UserVIPPreInfo userVIPPreInfo = userVIPPreInfoService.getLatestProcessInfo(uid);
            if (userVIPPreInfo != null) {
                if (userVIPPreInfo.getProcess() == UserVIPPreInfo.PROCESS_1) {
                    return UserInviteLevelEnum.normalVIP;
                } else if (userVIPPreInfo.getProcess() == UserVIPPreInfo.PROCESS_2) {
                    return UserInviteLevelEnum.highVIP;
                }
                return UserInviteLevelEnum.highVIP;
            }
        } else if (info.getState() == UserVIPInfo.STATE_VERIFING) {
            return UserInviteLevelEnum.vipApply;
fanli/src/main/java/com/yeshi/fanli/service/impl/user/msg/UserAccountMsgNotificationServiceImpl.java
@@ -47,9 +47,8 @@
    }
    
    @Override
    public void vipPreUpgrade(Long uid, String originalName, String upName, int days, long targetNum1, Long targetNum2,Integer type) {
        saveDetail( MsgAccountDetailFactory.vipPreUpgrade(uid, originalName, upName, days, targetNum1,
                targetNum2, type, null));
    public void vipPreUpgrade(Long uid, String originalName, String upName, int days, long targetNum1, Long targetNum2) {
        saveDetail( MsgAccountDetailFactory.vipPreUpgrade(uid, originalName, upName, days, targetNum1,targetNum2));
    }
    
    @Override
fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPInfoServiceImpl.java
@@ -16,26 +16,18 @@
import com.yeshi.fanli.dao.mybatis.user.vip.UserVIPInfoMapper;
import com.yeshi.fanli.dto.mq.user.UserTopicTagEnum;
import com.yeshi.fanli.dto.mq.user.body.UserLevelChangedMQMsg;
import com.yeshi.fanli.entity.bus.user.HongBaoV2;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.bus.user.ThreeSale;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInviteValidNum;
import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelUpgradedNotify;
import com.yeshi.fanli.entity.bus.user.vip.UserVIPInfo;
import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo;
import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
import com.yeshi.fanli.exception.user.vip.UserVIPInfoException;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
import com.yeshi.fanli.service.inter.msg.UserOtherMsgNotificationService;
import com.yeshi.fanli.service.inter.shop.BanLiShopOrderService;
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.UserSystemCouponService;
import com.yeshi.fanli.service.inter.user.integral.IntegralDetailService;
import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
import com.yeshi.fanli.service.inter.user.invite.UserInviteMsgNotificationService;
import com.yeshi.fanli.service.inter.user.invite.UserInviteValidNumService;
import com.yeshi.fanli.service.inter.user.msg.UserAccountMsgNotificationService;
import com.yeshi.fanli.service.inter.user.vip.UserLevelUpgradedNotifyService;
@@ -58,36 +50,16 @@
    private UserInfoService userInfoService;
    @Resource
    private UserInfoExtraService userInfoExtraService;
    @Resource
    private UserVipConfigService userVipConfigService;
    @Lazy
    @Resource
    private HongBaoV2CountService hongBaoV2CountService;
    @Resource
    private IntegralDetailService integralDetailService;
    @Resource
    private BanLiShopOrderService banLiShopOrderService;
    @Resource
    private UserOtherMsgNotificationService userOtherMsgNotificationService;
    @Resource
    private ThreeSaleSerivce threeSaleSerivce;
    @Resource
    private UserInviteSeparateService userInviteSeparateService;
    @Resource
    private ConfigService configService;
    @Lazy
    @Resource
    private UserSystemCouponService userSystemCouponService;
    @Resource
    private UserVIPPreInfoService userVIPPreInfoService;
@@ -101,6 +73,8 @@
    @Resource
    private UserLevelUpgradedNotifyService userLevelUpgradedNotifyService;
    
    @Resource
    private UserInviteMsgNotificationService userInviteMsgNotificationService;
    
    @Resource(name = "producer")
    private Producer producer;
@@ -224,12 +198,7 @@
        if (!verifyVip(uid))
            throw new UserVIPInfoException(1, "系统验证:不满足升级条件");
        // 额外信息
        UserInfoExtra userInfoExtra = userInfoExtraService.getByUidForUpdate(uid);
        if (userInfoExtra == null)
            throw new UserVIPInfoException(1, "用户信息不存在");
        Date upgradeTime = new Date();
        // 通过超级会员
        UserVIPInfo info = new UserVIPInfo();
@@ -249,24 +218,17 @@
        userLevelUpgradedNotifyService.addUserLevelUpgradedNotify(notify);
        
        try {
            // 赠送免单券
            String giveCoupon = userVipConfigService.getValueByKey("vip_pre_10_gift_givefree_coupon");
            if (!StringUtil.isNullOrEmpty(giveCoupon)) {
                int num = Integer.parseInt(giveCoupon);
                userSystemCouponService.freeCouponWin(uid, CouponTypeEnum.freeCouponGive,
                        UserSystemCoupon.SOURCE_SYSTEM_PUSH, num, true);
            }
        } catch (Exception e) {
            throw new UserVIPInfoException(1, "券赠送失败");
        }
        try {
            // 升级消息
            UserVIPPreInfo pre1 = userVIPPreInfoService.getVipByProcess(uid, UserVIPPreInfo.PROCESS_2);
            userAccountMsgNotificationService.vipUpgradeSuccess(uid, TimeUtil.getDayDifferenceCount(pre1.getCreateTime(), new Date()));
            
            // 升级提醒上级
            userVIPPreInfoService.remindBoss(uid, "超级会员", getPassItem(uid), upgradeTime, false);
            // 直接粉丝升级提醒
            ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);
            if (threeSale != null) {
                Long bossId = threeSale.getBoss().getId();
                UserInfo userInfo = userInfoService.selectByPKey(uid);
                userInviteMsgNotificationService.fansUpgrade(bossId,  "超级会员", userInfo.getNickName(), getPassItem(uid), upgradeTime);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
@@ -286,13 +248,8 @@
     * @return
     */
    private String getPassItem(Long uid) {
        // 自购订单
        long doneZiGou = hongBaoV2CountService.counOrderByUidAndOrderType(uid, Constant.VIP_ORDER_PAY,
                HongBaoV2.TYPE_ZIGOU);
        // 分享订单
        long doneShare = hongBaoV2CountService.counOrderByUidAndOrderType(uid, Constant.VIP_ORDER_PAY,
                HongBaoV2.TYPE_SHARE_GOODS);
        // 自购 + 分享订单
        long doneOrder = hongBaoV2CountService.countMyDirectOrderByCashArrival(uid, Constant.VIP_ORDER_PAY);
        // 有效粉丝
        int doneFirst = 0;
        int doneSecond = 0;
@@ -302,16 +259,10 @@
            doneSecond = userInviteValidNum.getNumSecond() == null ? 0 : userInviteValidNum.getNumSecond();
        }
        long limitZiGou = 0;
        String zigou = userVipConfigService.getValueByKey("vip_pre_10_zigou_order_count");
        long limitOrder = 0;
        String zigou = userVipConfigService.getValueByKey("vip_pre_10_order_count");
        if (!StringUtil.isNullOrEmpty(zigou)) {
            limitZiGou = Long.parseLong(zigou);
        }
        long limitShare = 0;
        String share = userVipConfigService.getValueByKey("vip_pre_10_share_order_count");
        if (!StringUtil.isNullOrEmpty(share)) {
            limitShare = Long.parseLong(share);
            limitOrder = Long.parseLong(zigou);
        }
        
        long limitFirst = 0;
@@ -327,12 +278,10 @@
        }
        
        String item = "";
        if (doneZiGou >= limitZiGou) {
            item = "返利订单";
        } else if (doneShare >= limitShare) {
            item = "分享订单";
        if (doneOrder >= limitOrder) {
            item = "返利+分享订单";
        } else if (doneFirst >= limitFirst && doneSecond >= limitSecond) {
            item = "邀请粉丝";
            item = "直接+间接粉丝";
        }
        return item;
    }
@@ -344,13 +293,8 @@
     * @return
     */
    private boolean verifyVip(Long uid) {
        // 自购订单
        long doneZiGou = hongBaoV2CountService.counOrderByUidAndOrderType(uid, Constant.VIP_ORDER_PAY,
                HongBaoV2.TYPE_ZIGOU);
        // 分享订单
        long doneShare = hongBaoV2CountService.counOrderByUidAndOrderType(uid, Constant.VIP_ORDER_PAY,
                HongBaoV2.TYPE_SHARE_GOODS);
        // 自购 + 分享订单
        long doneOrder = hongBaoV2CountService.countMyDirectOrderByCashArrival(uid, Constant.VIP_ORDER_PAY);
        // 有效粉丝
        int doneFirst = 0;
        int doneSecond = 0;
@@ -359,17 +303,10 @@
            doneFirst = userInviteValidNum.getNumFirst() == null ? 0 : userInviteValidNum.getNumFirst();
            doneSecond = userInviteValidNum.getNumSecond() == null ? 0 : userInviteValidNum.getNumSecond();
        }
        long limitZiGou = 0;
        String zigou = userVipConfigService.getValueByKey("vip_pre_10_zigou_order_count");
        long limitOrder = 0;
        String zigou = userVipConfigService.getValueByKey("vip_pre_10_order_count");
        if (!StringUtil.isNullOrEmpty(zigou)) {
            limitZiGou = Long.parseLong(zigou);
        }
        long limitShare = 0;
        String share = userVipConfigService.getValueByKey("vip_pre_10_share_order_count");
        if (!StringUtil.isNullOrEmpty(share)) {
            limitShare = Long.parseLong(share);
            limitOrder = Long.parseLong(zigou);
        }
        
        long limitFirst = 0;
@@ -384,7 +321,7 @@
            limitSecond = Long.parseLong(second);
        }
        
        if (doneZiGou >= limitZiGou || doneShare >= limitShare || (doneFirst >= limitFirst && doneSecond >= limitSecond)) {
        if (doneOrder >= limitOrder  || (doneFirst >= limitFirst && doneSecond >= limitSecond)) {
            return true;
        }
        return false;
@@ -406,7 +343,6 @@
        info.setState(UserVIPInfo.STATE_INVALID);
        info.setUpdateTime(new Date());
        userVIPInfoMapper.updateByPrimaryKeySelective(info);
        // 消息
        userAccountMsgNotificationService.vipUpgradeFail(uid, reason);
    }
fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPPreInfoServiceImpl.java
@@ -1,6 +1,5 @@
package com.yeshi.fanli.service.impl.user.vip;
import java.math.BigDecimal;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
@@ -8,40 +7,29 @@
import javax.annotation.Resource;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.task.TaskExecutor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.yeshi.utils.DateUtil;
import com.aliyun.openservices.ons.api.Message;
import com.aliyun.openservices.ons.api.Producer;
import com.yeshi.fanli.dao.mybatis.user.vip.UserVIPPreInfoMapper;
import com.yeshi.fanli.dto.mq.user.UserTopicTagEnum;
import com.yeshi.fanli.dto.mq.user.body.UserLevelChangedMQMsg;
import com.yeshi.fanli.entity.bus.user.HongBaoV2;
import com.yeshi.fanli.entity.bus.user.ThreeSale;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.bus.user.UserInfoRegister;
import com.yeshi.fanli.entity.bus.user.UserInviteValidNum;
import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelUpgradedNotify;
import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo;
import com.yeshi.fanli.entity.integral.IntegralDetail;
import com.yeshi.fanli.entity.system.ConfigKeyEnum;
import com.yeshi.fanli.exception.user.vip.UserVIPPreInfoException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
import com.yeshi.fanli.service.inter.msg.UserOtherMsgNotificationService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.service.inter.user.UserInfoRegisterService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.service.inter.user.UserInviteSeparateService;
import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
import com.yeshi.fanli.service.inter.user.integral.IntegralDetailService;
import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
import com.yeshi.fanli.service.inter.user.invite.UserInviteMsgNotificationService;
import com.yeshi.fanli.service.inter.user.invite.UserInviteValidNumService;
@@ -70,50 +58,37 @@
    @Resource
    private UserVipConfigService userVipConfigService;
    @Resource
    private UserInviteValidNumService userInviteValidNumService;
    @Resource
    private UserInfoExtraService userInfoExtraService;
    @Resource
    private IntegralDetailService integralDetailService;
    @Resource
    private ConfigService configService;
    @Lazy
    @Resource
    private UserSystemCouponService userSystemCouponService;
    @Resource
    private UserInviteSeparateService userInviteSeparateService;
    @Resource
    private UserInfoService userInfoService;
    @Resource
    private UserOtherMsgNotificationService userOtherMsgNotificationService;
    @Resource
    private UserAccountMsgNotificationService userAccountMsgNotificationService;
    @Resource
    private UserInfoRegisterService userInfoRegisterService;
    @Resource
    private UserInviteMsgNotificationService userInviteMsgNotificationService;
    @Resource
    private UserLevelUpgradedNotifyService userLevelUpgradedNotifyService;
    @Resource(name = "taskExecutor")
    private TaskExecutor executor;
    @Resource(name = "producer")
    private Producer producer;
    @Override
    public void addUserVIPPreInfo(UserVIPPreInfo info) throws UserVIPPreInfoException {
@@ -135,7 +110,6 @@
            return null;
        Comparator<UserVIPPreInfo> cm = new Comparator<UserVIPPreInfo>() {
            @Override
            public int compare(UserVIPPreInfo o1, UserVIPPreInfo o2) {
                return o2.getProcess() - o1.getProcess();
@@ -145,12 +119,11 @@
        Collections.sort(infoList, cm);
        return infoList.get(0);
    }
    @Override
    public UserVIPPreInfo getVipByProcess(Long uid, int process){
    public UserVIPPreInfo getVipByProcess(Long uid, int process) {
        return userVIPPreInfoMapper.selectByUidAndProcess(uid, process);
    }
    @Override
    public UserVIPPreInfo getProcessInfo(Long uid, Date time) {
@@ -158,7 +131,6 @@
        if (infoList == null || infoList.size() == 0)
            return null;
        Comparator<UserVIPPreInfo> cm = new Comparator<UserVIPPreInfo>() {
            @Override
            public int compare(UserVIPPreInfo o1, UserVIPPreInfo o2) {
                return o2.getProcess() - o1.getProcess();
@@ -173,104 +145,40 @@
        return null;
    }
    @Override
    @RequestSerializableByKeyService(key = "#uid")
    @Transactional(rollbackFor = Exception.class)
    public void upgradeVipByFanLiOrder(Long uid) {
    public void upgradeVipByMyOrder(Long uid) {
        UserVIPPreInfo latest = getLatestProcessInfo(uid);
        if (latest != null && latest.getProcess() == UserVIPPreInfo.PROCESS_2) {
            return;
        }
        if (latest == null) {
            String inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
            if (StringUtil.isNullOrEmpty(inviteCode)) {
                return; //未激活邀请码
                return; // 未激活邀请码
            }
        }
        // 自购订单到账
        long doneZiGou = hongBaoV2CountService.counOrderByUidAndOrderType(uid, Constant.VIP_ORDER_PAY, HongBaoV2.TYPE_ZIGOU);
        }
        // 自购+ 分享订单到账
        long doneZiGou = hongBaoV2CountService.countMyDirectOrderByCashArrival(uid, Constant.VIP_ORDER_PAY);
        // 高级会员限制条件
        long limitZiGou7 = 0;
        String zigou7 = userVipConfigService.getValueByKey("vip_pre_7_zigou_order_count");
        String zigou7 = userVipConfigService.getValueByKey("vip_pre_7_order_count");
        if (!StringUtil.isNullOrEmpty(zigou7)) {
            limitZiGou7 = Long.parseLong(zigou7);
        }
        // 验证是否满足升级高级会员
        if (doneZiGou >= limitZiGou7) {
            twoProcess(uid, limitZiGou7, null, Constant.TYPE_REBATE);
            return;
        }
        // 已经成为普通会员
        if (latest != null && latest.getProcess() == UserVIPPreInfo.PROCESS_1) {
            return;
        }
        // 普通会员条件
        long limitZiGou3 = 0;
        String zigou3 = userVipConfigService.getValueByKey("vip_pre_3_zigou_order_count");
        if (!StringUtil.isNullOrEmpty(zigou3)) {
            limitZiGou3 = Long.parseLong(zigou3);
        }
        if (doneZiGou >= limitZiGou3) {
            oneProcess(uid, limitZiGou3, null, Constant.TYPE_REBATE);
        }
    }
    @Override
    @RequestSerializableByKeyService(key = "#uid")
    @Transactional(rollbackFor = Exception.class)
    public void upgradeVipByShareOrder(Long uid) {
        UserVIPPreInfo latest = getLatestProcessInfo(uid);
        if (latest != null && latest.getProcess() == UserVIPPreInfo.PROCESS_2) {
            return;
        }
        if (latest == null) {
            String inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
            if (StringUtil.isNullOrEmpty(inviteCode)) {
                return; //未激活邀请码
            try {
                twoProcess(uid, limitZiGou7, null);
            } catch (UserVIPPreInfoException e) {
            }
        }
        // 分享订单已到账
        long doneShare = hongBaoV2CountService.counOrderByUidAndOrderType(uid, Constant.VIP_ORDER_PAY,
                HongBaoV2.TYPE_SHARE_GOODS);
        // 高级会员限制条件
        long limitShare7 = 0;
        String share7 = userVipConfigService.getValueByKey("vip_pre_7_share_order_count");
        if (!StringUtil.isNullOrEmpty(share7)) {
            limitShare7 = Long.parseLong(share7);
        }
        // 验证是否满足升级高级会员
        if (doneShare >= limitShare7) {
            twoProcess(uid, limitShare7, null, Constant.TYPE_SHAER);
            return;
        }
        // 已经成为普通会员
        if (latest != null && latest.getProcess() == UserVIPPreInfo.PROCESS_1) {
            return;
        }
        // 普通会员条件
        long limitShare3 = 0;
        String share3 = userVipConfigService.getValueByKey("vip_pre_3_share_order_count");
        if (!StringUtil.isNullOrEmpty(share3)) {
            limitShare3 = Long.parseLong(share3);
        }
        if (doneShare >= limitShare3) {
            oneProcess(uid, limitShare3, null, Constant.TYPE_SHAER);
        }
    }
    @Override
    @RequestSerializableByKeyService(key = "#tid")
    @Transactional(rollbackFor = Exception.class)
@@ -280,7 +188,7 @@
            return;
        }
        Long bossId = boss.getId();
        // 验证上上级 -间接粉丝是否满足
        executor.execute(new Runnable() {
            @Override
@@ -288,12 +196,12 @@
                upgradeVipByTeamNum(bossId);
            }
        });
        UserVIPPreInfo latest = getLatestProcessInfo(bossId);
        if (latest != null && latest.getProcess() == UserVIPPreInfo.PROCESS_2) {
            return;
        }
        // 有效粉丝
        int doneFirst = 0;
        int doneSecond = 0;
@@ -302,7 +210,7 @@
            doneFirst = userInviteValidNum.getNumFirst() == null ? 0 : userInviteValidNum.getNumFirst();
            doneSecond = userInviteValidNum.getNumSecond() == null ? 0 : userInviteValidNum.getNumSecond();
        }
        long limitFirst7 = 0;
        String first7 = userVipConfigService.getValueByKey("vip_pre_7_first_level_team_count");
        if (!StringUtil.isNullOrEmpty(first7)) {
@@ -313,106 +221,17 @@
        if (!StringUtil.isNullOrEmpty(second7)) {
            limitSecond7 = Long.parseLong(second7);
        }
        // 验证是否满足升级高级会员
        if (doneFirst >= limitFirst7 && doneSecond >= limitSecond7) {
            twoProcess(bossId, limitFirst7, limitSecond7, null);
            return;
        }
        // 已经成为普通会员
        if (latest != null && latest.getProcess() == UserVIPPreInfo.PROCESS_1) {
            return;
        }
        // 普通会员 条件
        long limitFirst3 = 0;
        String first = userVipConfigService.getValueByKey("vip_pre_3_first_level_team_count");
        if (!StringUtil.isNullOrEmpty(first)) {
            limitFirst3 = Long.parseLong(first);
        }
        long limitSecond3 = 0;
        String second = userVipConfigService.getValueByKey("vip_pre_3_second_level_team_count");
        if (!StringUtil.isNullOrEmpty(second)) {
            limitSecond3 = Long.parseLong(second);
        }
        if (doneFirst >= limitFirst3 && doneSecond >= limitSecond3) {
            oneProcess(bossId, limitFirst3, limitSecond3, null);
            try {
                twoProcess(bossId, limitFirst7, limitSecond7);
            } catch (UserVIPPreInfoException e) {
            }
        }
    }
    /**
     * 一阶段
     *
     * @param uid
     * @param countZiGou
     * @param countShare
     * @param firstTeam
     * @param secondTeam
     */
    @Transactional(rollbackFor = Exception.class)
    private void oneProcess(Long uid, long limit1, Long limit2, Integer type) {
        try {
            String item = null;
            if (type == null) {
                item = "邀请粉丝";
            } else if (type == Constant.TYPE_REBATE) {
                item = "返利订单";
            } else {
                item = "分享订单";
            }
            Date upgradeTime = new Date();
            UserVIPPreInfo info = new UserVIPPreInfo();
            info.setUid(uid);
            info.setProcess(UserVIPPreInfo.PROCESS_1);
            info.setCreateTime(upgradeTime);
            info.setUpdateTime(upgradeTime);
            addUserVIPPreInfo(info);
            // 升级消息
            Date registerTime = new Date(1577836800000L);
            UserInfoRegister userInfoRegister = userInfoRegisterService.selectByPrimaryKey(uid);
            if (userInfoRegister != null && userInfoRegister.getCreateTime() != null) {
                registerTime = userInfoRegister.getCreateTime();
            }
            int daysBetween = TimeUtil.getDayDifferenceCount(registerTime, new Date());
            userAccountMsgNotificationService.vipPreUpgrade(uid, "快省达人", "普通会员", daysBetween, limit1, limit2, type);
            // 升级弹框提示
            UserLevelUpgradedNotify notify = new UserLevelUpgradedNotify();
            notify.setUid(uid);
            notify.setFromLevel(UserLevelEnum.daRen);
//            notify.setToLevel(UserLevelEnum.normalVIP);
            notify.setValid(true);
            notify.setCreateTime(new Date());
            userLevelUpgradedNotifyService.addUserLevelUpgradedNotify(notify);
            // 金币奖励
            goldcoinReward(uid);
            // 是否存在下级脱离期限 -更新不脱离
            userInviteSeparateService.updateInvalidByBossId(uid);
            // 提醒上级
            remindBoss(uid, "普通会员", item, upgradeTime, true);
//            if (!Constant.IS_TEST) {
//                UserLevelChangedMQMsg msg = new UserLevelChangedMQMsg(uid, UserLevelEnum.daRen,UserLevelEnum.normalVIP, new Date());
//                Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.userLevelChanged, msg);
//                producer.send(message);
//            }
        } catch (Exception e) {
           e.printStackTrace();
        }
    }
    /**
     * 二阶段
     * 
@@ -423,149 +242,61 @@
     * @param secondTeam
     */
    @Transactional(rollbackFor = Exception.class)
    private void twoProcess(Long uid, long limit1, Long limit2, Integer type) {
    private void twoProcess(Long uid, long limit1, Long limit2) throws UserVIPPreInfoException{
        String item = null;
        if (limit2 == null) {
            item = "返利+分享订单";
        } else {
            item = "直接+间接粉丝";
        }
        Date upgradeTime = new Date();
        UserVIPPreInfo info = new UserVIPPreInfo();
        info.setUid(uid);
        info.setProcess(UserVIPPreInfo.PROCESS_2);
        info.setCreateTime(upgradeTime);
        info.setUpdateTime(upgradeTime);
        addUserVIPPreInfo(info);
        // 升级弹框提示
        UserLevelUpgradedNotify notify = new UserLevelUpgradedNotify();
        notify.setUid(uid);
        notify.setFromLevel(UserLevelEnum.daRen);
        notify.setToLevel(UserLevelEnum.highVIP);
        notify.setValid(true);
        notify.setCreateTime(new Date());
        userLevelUpgradedNotifyService.addUserLevelUpgradedNotify(notify);
        try {
            String item = null;
            if (type == null) {
                item = "邀请粉丝";
            } else if (type == Constant.TYPE_REBATE) {
                item = "返利订单";
            } else {
                item = "分享订单";
            }
            Date upgradeTime = new Date();
            UserVIPPreInfo info = new UserVIPPreInfo();
            info.setUid(uid);
            info.setProcess(UserVIPPreInfo.PROCESS_2);
            info.setCreateTime(upgradeTime);
            info.setUpdateTime(upgradeTime);
            addUserVIPPreInfo(info);
            // 升级弹框提示
            UserLevelUpgradedNotify notify = new UserLevelUpgradedNotify();
            notify.setUid(uid);
//            notify.setFromLevel(UserLevelEnum.normalVIP);
            notify.setToLevel(UserLevelEnum.highVIP);
            notify.setValid(true);
            notify.setCreateTime(new Date());
            userLevelUpgradedNotifyService.addUserLevelUpgradedNotify(notify);
            // 升级福利-赠送奖励券
            String rewardCoupon = userVipConfigService.getValueByKey("vip_pre_7_gift_reward_coupon");
            if (!StringUtil.isNullOrEmpty(rewardCoupon)) {
                int num = Integer.parseInt(rewardCoupon);
                BigDecimal percent = new BigDecimal(configService.get(ConfigKeyEnum.exchangeRebatePercent.getKey()));
                userSystemCouponService.rewardCouponWin(uid, UserSystemCoupon.SOURCE_SYSTEM_PUSH, num, true, percent);
            }
            // 升级消息
//            UserLevelEnum fromLevel = UserLevelEnum.normalVIP;
            int daysBetween = 0;
            boolean divorced = false;
            String beforeName = "快省达人";
            UserVIPPreInfo pre1 = userVIPPreInfoMapper.selectByUidAndProcess(uid, UserVIPPreInfo.PROCESS_1);
            if (pre1 != null) {
                beforeName = "普通会员";
                daysBetween = DateUtil.daysBetween(pre1.getCreateTime(), upgradeTime);
            } else {
                Date registerTime = new Date(1577836800000L);
                UserInfoRegister userInfoRegister = userInfoRegisterService.selectByPrimaryKey(uid);
                if (userInfoRegister != null && userInfoRegister.getCreateTime() != null) {
                    registerTime = userInfoRegister.getCreateTime();
                }
                daysBetween = TimeUtil.getDayDifferenceCount(registerTime, upgradeTime);
                // 金币奖励 (直接升级高级会员补齐一级奖励)
                goldcoinReward(uid);
                // 需要发送脱离信息
                divorced = true;
//                fromLevel = UserLevelEnum.daRen;
            Date registerTime = new Date(1577836800000L);
            UserInfoRegister userInfoRegister = userInfoRegisterService.selectByPrimaryKey(uid);
            if (userInfoRegister != null && userInfoRegister.getCreateTime() != null) {
                registerTime = userInfoRegister.getCreateTime();
            }
            userAccountMsgNotificationService.vipPreUpgrade(uid, beforeName, "高级会员", daysBetween, limit1, limit2, type);
            int daysBetween = TimeUtil.getDayDifferenceCount(registerTime, upgradeTime);
            userAccountMsgNotificationService.vipPreUpgrade(uid, "快省达人", "高级会员", daysBetween, limit1, limit2);
            // 提醒上级
            remindBoss(uid, "高级会员", item, upgradeTime, divorced);
//            if (!Constant.IS_TEST) {
//                UserLevelChangedMQMsg msg = new UserLevelChangedMQMsg(uid, fromLevel,UserLevelEnum.highVIP, new Date());
//                Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.userLevelChanged, msg);
//                producer.send(message);
//            }
            // 直接粉丝升级提醒
            ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);
            if (threeSale != null) {
                Long bossId = threeSale.getBoss().getId();
                UserInfo userInfo = userInfoService.selectByPKey(uid);
                userInviteMsgNotificationService.fansUpgrade(bossId, "高级会员", userInfo.getNickName(), item, upgradeTime);
            }
        } catch (Exception e) {
            e.printStackTrace();
            LogHelper.error(e);
        }
    }
    /**
     * 升级奖励金币
     * @param uid
     */
    private void goldcoinReward(Long uid) {
        String goldcoin = userVipConfigService.getValueByKey("vip_pre_3_gift_goldcoin");
        if (!StringUtil.isNullOrEmpty(goldcoin)) {
            int goldcoinNum = Integer.parseInt(goldcoin);
            // 添加金币明细
            IntegralDetail detail = new IntegralDetail();
            detail.setTitle("升级VIP福利");
            detail.setUid(uid);
            detail.setMoney(Integer.parseInt(goldcoin));
            detail.setCreateTime(new Date());
            detail.setUniqueKey("VIP-3-" + uid);
            integralDetailService.insertSelective(detail);
            // 添加金币
            userInfoExtraService.addGoldCoinByUid(uid, Integer.parseInt(goldcoin));
            // 消息
            UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
            userOtherMsgNotificationService.goldCoinSystemGiveMsg(uid, goldcoinNum, userInfoExtra.getGoldCoin());
        if (!Constant.IS_TEST) {
            UserLevelChangedMQMsg msg = new UserLevelChangedMQMsg(uid, UserLevelEnum.daRen, UserLevelEnum.highVIP,
                    new Date());
            Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.userLevelChanged, msg);
            producer.send(message);
        }
    }
    @Override
    public void remindBoss(Long uid, String rankName, String item, Date time, boolean divorced) {
        // 是否存在上级
        ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);
        if (threeSale == null)
            return;
        Long bossId = threeSale.getBoss().getId();
        UserInfo userInfo = userInfoService.selectByPKey(uid);
        // 粉丝升级提醒
        userInviteMsgNotificationService.fansUpgrade(bossId, "直接粉丝", rankName, userInfo.getNickName(), item, time);
        // 是否存在上上级
        ThreeSale threeSaleSuper = threeSaleSerivce.getMyBoss(bossId);
        if (threeSaleSuper != null) { // 粉丝升级提醒
            Long bossIdSuper = threeSaleSuper.getBoss().getId();
            userInviteMsgNotificationService.fansUpgrade(bossIdSuper, "间接粉丝", rankName, userInfo.getNickName(), item, time);
        }
        // 是否升级脱离
        if (!divorced) {
            return;
        }
        UserVIPPreInfo latestInfo = getLatestProcessInfo(bossId);
        if (latestInfo == null) {
            // 添加脱离关系倒计时
            userInviteSeparateService.addPreSeparateRecord(uid, bossId);
            // 直接粉丝脱离-开始脱离提醒
            userInviteMsgNotificationService.fansPreDivorced(bossId, rankName, userInfo.getNickName(), time);
            //间接粉丝脱离-开始脱离提醒
            if (threeSaleSuper != null) {
                UserInfo boss = userInfoService.selectByPKey(bossId);
                Long bossIdSuper = threeSaleSuper.getBoss().getId();
                userInviteMsgNotificationService.fansPredivorcedIndirect(bossIdSuper, rankName, userInfo.getNickName(),
                        boss.getNickName(), time);
            }
        }
    }
    @Override
    public UserVIPPreInfo selectByUidAndProcess(Long uid, int process) {
        return userVIPPreInfoMapper.selectByUidAndProcess(uid, process);
fanli/src/main/java/com/yeshi/fanli/service/inter/count/HongBaoV2CountService.java
@@ -204,7 +204,7 @@
     * @param type 订单类型
     * @return
     */
    public long counOrderByUidAndOrderType(Long uid, BigDecimal payment, int type);
    public long countMyDirectOrderByCashArrival(Long uid, BigDecimal payment);
    /**
     * 统计已结算
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/HomeNavbarService.java
@@ -82,5 +82,12 @@
     * @return
     */
    public List<HomeNavbar> listQueryFixedNavbar();
    /**
     * 改变状态
     * @param id
     * @throws HomeNavbarException
     */
    public void switchState(Long id) throws HomeNavbarException;
    
}
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SpecialCardService.java
@@ -43,4 +43,12 @@
     */
    public String getbottomPicture(String placeKey);
    /**
     * 状态切换
     * @param id
     * @throws SpecialCardException
     */
    public void switchState(Long id) throws SpecialCardException;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInviteSeparateService.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/service/inter/user/invite/ThreeSaleSerivce.java
@@ -28,23 +28,6 @@
     */
    void effective(UserInfo worker);
    // 获取一级用户数量
    long getFirstUsersCount(Long uid);
    // 获取二级用户数量
    long getSecondUsersCount(Long uid);
    /**
     * 删除邀请关系id
     *
     * @param id
     * @return
     */
    public int deleteByPrimaryKey(Long id);
    /**
     * 一级查询
@@ -89,25 +72,6 @@
    public long countSuperiorQuery(Integer state, Long uid);
    /**
     * 统计所有一级队员
     *
     * @param uid
     * @param state
     *            状态,值 为空时则统计所有
     * @return
     */
    public long countFirstTeam(Long uid, Integer state);
    /**
     * 统计二级队员
     *
     * @param uid
     * @param state
     *            状态,值 为空时则统计所有
     * @return
     */
    public long countSecondTeam(Long uid, Integer state);
    /**
     * 前端查询一级队员
@@ -117,7 +81,7 @@
     * @param uid
     * @return
     */
    public JSONObject getMyFirstTeam(long start, int count, Long uid, Integer state);
    public JSONObject getMyFirstTeam(long start, int count, Long uid);
    /**
     * 前端查询二级队员
@@ -127,7 +91,7 @@
     * @param uid
     * @return
     */
    public JSONObject getMySecondTeam(long start, int count, Long uid, Integer state);
    public JSONObject getMySecondTeam(long start, int count, Long uid);
    /**
     * 获取上级
@@ -166,14 +130,6 @@
     */
    public int getSuccessRelationshipNum(Long uid);
    /**
     * 统计邀请成功队员数量
     *
     * @param uid
     * @return
     */
    public long countSuccessFirstTeam(Long uid);
    /**
     * 根据邀请者查询关系
@@ -225,7 +181,7 @@
     * @param state
     * @return
     */
    public List<ThreeSale> listFirstTeam(long start, int count, Long uid, Integer state);
    public List<ThreeSale> listFirstTeam(long start, int count, Long uid);
    /**
     * 二级队员
@@ -235,8 +191,24 @@
     * @param state
     * @return
     */
    public List<ThreeSale> listSecondTeam(long start, int count, Long uid, Integer state);
    public List<ThreeSale> listSecondTeam(long start, int count, Long uid);
    /**
     * 统计直接粉丝数量
     *
     * @param uid
     * @return
     */
    public long countFirstTeam(Long uid);
    /**
     * 统计间接粉丝数量
     * @param uid
     * @return
     */
    public long countSecondTeam(Long uid);
    /**
     * 查询邀请关系 时间筛选
     * @param workerId 下级id
@@ -298,46 +270,5 @@
     * @throws
     */
    public List<ThreeSale> getMyBossDeepList(Long uid);
    /**
     * 查询未删除版-粉丝一级
     * @param start
     * @param count
     * @param uid
     * @return
     */
    public List<ThreeSale> listFirstTeamByUndeleted(long start, int count, Long uid);
    /**
     * 统计粉丝一级
     * @param uid
     * @return
     */
    public long countFirstTeamByUndeleted(Long uid);
    /**
     * 查询未删除版-粉丝二级
     * @param start
     * @param count
     * @param uid
     * @return
     */
    public List<ThreeSale> listSecondTeamByUndeleted(long start, int count, Long uid);
    /**
     * 统计粉丝二级
     * @param uid
     * @return
     */
    public long countSecondTeamByUndeleted(Long uid);
    /**
     * 删除脱离队员
     * @param id
     * @param uid
     * @param tid
     */
    public void remvoeBreak(Long id, Long uid, Long tid);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/invite/UserInviteMsgNotificationService.java
@@ -32,54 +32,14 @@
    /**
     * 粉丝升级提醒
     * 直接粉丝升级提醒
     * @param uid
     * @param relation 直接粉丝 、 间接粉丝
     * @param rankName 等级名称
     * @param nickName 昵称
     * @param item   满足条件项名称
     * @param time   升级时间
     */
    public void fansUpgrade(Long uid, String relation, String rankName, String nickName, String item, Date time);
    public void fansUpgrade(Long uid, String rankName, String nickName, String item, Date time);
    /**
     * 直接粉丝脱离-开始脱离提醒
     * @param uid
     * @param rankName
     * @param nickName
     * @param item
     * @param time
     */
    public void fansPreDivorced(Long uid, String rankName, String nickName, Date time);
    /**
     * 间接粉丝脱离-开始脱离提醒
     * @param uid
     * @param rankName
     * @param nickName
     * @param fansName 直接粉丝昵称
     * @param item
     * @param time
     */
    public void fansPredivorcedIndirect(Long uid, String rankName, String nickName, String fansName, Date time);
    /**
     * 直接粉丝脱离-已经脱离提醒
     * @param uid
     * @param nickName
     * @param time
     */
    public void fansDivorced(Long uid, String nickName, Date time);
    /**
     * 间接粉丝脱离-已经脱离提醒
     * @param uid
     * @param nickName
     * @param fansName 直接粉丝昵称
     * @param time
     */
    public void fansDivorcedIndirect(Long uid, String nickName, String fansName, Date time);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/msg/UserAccountMsgNotificationService.java
@@ -49,10 +49,8 @@
     * @param days
     * @param targetNum1
     * @param targetNum2
     * @param type
     */
    public void vipPreUpgrade(Long uid, String originalName, String upName, int days, long targetNum1, Long targetNum2,
            Integer type);
    public void vipPreUpgrade(Long uid, String originalName, String upName, int days, long targetNum1, Long targetNum2);
    /**
     * 超级会员升级成功
fanli/src/main/java/com/yeshi/fanli/service/inter/user/vip/UserVIPPreInfoService.java
@@ -63,27 +63,13 @@
    public UserVIPPreInfo getVipByProcess(Long uid, int process);
    
    /**
     * 升级提醒上级
     * @param uid
     * @param rankName
     * @param item
     * @param time
     * @param divorced
     */
    public void remindBoss(Long uid, String rankName, String item, Date time, boolean divorced);
    /**
     * 自购订单到账 满足升级验证
     * 自购+ 分享订单到账 满足升级验证
     * @param uid
     */
    public void upgradeVipByFanLiOrder(Long uid);
    public void upgradeVipByMyOrder(Long uid);
    /**
     * 分享订单到账 -满足升级验证
     * @param uid
     */
    public void upgradeVipByShareOrder(Long uid);
    /**
     * 粉丝完成收货-验证直接-间接粉丝
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgAccountDetailFactory.java
@@ -8,7 +8,6 @@
import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail;
import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail.MsgTypeAccountTypeEnum;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
import com.yeshi.fanli.vo.msg.CommonMsgItemVO;
@@ -201,25 +200,21 @@
     * @return
     */
    public static MsgAccountDetail vipPreUpgrade(Long uid, String originalName, String upName, int days, long targetNum1, 
             Long targetNum2, Integer type, String beizu) {
             Long targetNum2) {
        if (uid == null || originalName == null || upName == null)
            return null;
        
        List<CommonMsgItemVO> listMsg = new ArrayList<>();
        List<ClientTextStyleVO> contentList = new ArrayList<>();
        contentList.add(new ClientTextStyleVO("恭喜你!有效", ClientTextStyleVO.COLOR_CONTENT));
        if (type == null) {
        if (targetNum2 == null) {
            contentList.add(new ClientTextStyleVO("直接粉丝已达", ClientTextStyleVO.COLOR_CONTENT));
            contentList.add(new ClientTextStyleVO(targetNum1+"", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
            contentList.add(new ClientTextStyleVO("人,有效间接粉丝已达", ClientTextStyleVO.COLOR_CONTENT));
            contentList.add(new ClientTextStyleVO(targetNum2+"", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
            contentList.add(new ClientTextStyleVO("人", ClientTextStyleVO.COLOR_CONTENT));
        } else if (type == Constant.TYPE_REBATE) {
            contentList.add(new ClientTextStyleVO("返利订单已达", ClientTextStyleVO.COLOR_CONTENT));
            contentList.add(new ClientTextStyleVO(targetNum1+"", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
            contentList.add(new ClientTextStyleVO("笔", ClientTextStyleVO.COLOR_CONTENT));
        } else if (type == Constant.TYPE_SHAER) {
            contentList.add(new ClientTextStyleVO("分享订单已达", ClientTextStyleVO.COLOR_CONTENT));
        } else {
            contentList.add(new ClientTextStyleVO("返利+分享订单已达", ClientTextStyleVO.COLOR_CONTENT));
            contentList.add(new ClientTextStyleVO(targetNum1+"", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
            contentList.add(new ClientTextStyleVO("笔", ClientTextStyleVO.COLOR_CONTENT));
        }
@@ -239,10 +234,9 @@
                new ClientTextStyleVO("从收到本消息起,你将获得该账户等级对应的全部权益", ClientTextStyleVO.COLOR_CONTENT)));
        
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO(StringUtil.isNullOrEmpty(beizu)?"无":beizu, ClientTextStyleVO.COLOR_CONTENT)));
                new ClientTextStyleVO("无", ClientTextStyleVO.COLOR_CONTENT)));
        
        MsgAccountDetail detail = new MsgAccountDetail();
        detail.setBeiZhu(beizu);
        detail.setTitle("等级成长");
        detail.setType(MsgTypeAccountTypeEnum.vipPgrade);
        detail.setUser(new UserInfo(uid));
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgInviteDetailFactory.java
@@ -95,12 +95,12 @@
     * @param time
     * @return
     */
    public static MsgInviteDetail fansUpgrade(Long uid, String relation, String rankName, String nickName, String item,   Date time) {
    public static MsgInviteDetail fansUpgrade(Long uid, String rankName, String nickName, String item, Date time) {
        if (nickName == null || uid == null || item == null || time == null)
            return null;
        List<CommonMsgItemVO> listMsg = new ArrayList<>();
        List<ClientTextStyleVO> contentList = new ArrayList<>();
        contentList.add(new ClientTextStyleVO("恭喜你!你的" + relation + ":", ClientTextStyleVO.COLOR_CONTENT));
        contentList.add(new ClientTextStyleVO("恭喜你!你的直接粉丝:", ClientTextStyleVO.COLOR_CONTENT));
        contentList.add(new ClientTextStyleVO(nickName ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
        contentList.add(new ClientTextStyleVO("已升级为", ClientTextStyleVO.COLOR_CONTENT));
        contentList.add(new ClientTextStyleVO(rankName, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
@@ -118,158 +118,6 @@
        MsgInviteDetail detail = new MsgInviteDetail();
        detail.setCreateTime(new Date());
        detail.setMsgType(MsgTypeInviteTypeEnum.fansUpgrade);
        detail.setRead(false);
        detail.setUser(new UserInfo(uid));
        detail.setExtraInfo(new Gson().toJson(listMsg));
        return detail;
    }
    /**
     * 直接粉丝脱离-开始脱离提醒
     * @param uid
     * @param rankName
     * @param nickName
     * @param item
     * @param time
     * @return
     */
    public static MsgInviteDetail fansPreDivorced(Long uid, String rankName, String nickName, Date time) {
        if (nickName == null || uid == null || time == null)
            return null;
        List<CommonMsgItemVO> listMsg = new ArrayList<>();
        List<ClientTextStyleVO> contentList = new ArrayList<>();
        contentList.add(new ClientTextStyleVO("很抱歉!你的直接粉丝:", ClientTextStyleVO.COLOR_CONTENT));
        contentList.add(new ClientTextStyleVO(nickName ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
        contentList.add(new ClientTextStyleVO("已升级为", ClientTextStyleVO.COLOR_CONTENT));
        contentList.add(new ClientTextStyleVO(rankName, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离粉丝", ClientTextStyleVO.COLOR_TITLE),contentList));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("升级时间", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO(TimeUtil.formatDate(time), ClientTextStyleVO.COLOR_CONTENT)));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离原因", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO("你还不是会员,即日起你需要在60天内升级为任意会员", ClientTextStyleVO.COLOR_CONTENT)));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO("可在【\"我的-我的粉丝\"】中查看脱离剩余时间", ClientTextStyleVO.COLOR_CONTENT)));
        MsgInviteDetail detail = new MsgInviteDetail();
        detail.setCreateTime(new Date());
        detail.setMsgType(MsgTypeInviteTypeEnum.fansDivorced);
        detail.setRead(false);
        detail.setUser(new UserInfo(uid));
        detail.setExtraInfo(new Gson().toJson(listMsg));
        return detail;
    }
    /**
     * 间接粉丝脱离-开始脱离提醒
     * @param uid
     * @param rankName
     * @param nickName
     * @param fansName
     * @param item
     * @param time
     * @return
     */
    public static MsgInviteDetail fansPredivorcedIndirect(Long uid, String rankName, String nickName, String fansName, Date time) {
        if (nickName == null || uid == null || time == null)
            return null;
        List<CommonMsgItemVO> listMsg = new ArrayList<>();
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离粉丝", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO(String.format("很抱歉!你的间接粉丝:%s已升级为%s", nickName, rankName), ClientTextStyleVO.COLOR_CONTENT)));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("升级时间", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO(TimeUtil.formatDate(time), ClientTextStyleVO.COLOR_CONTENT)));
        List<ClientTextStyleVO> contentList = new ArrayList<>();
        contentList.add(new ClientTextStyleVO("你的直接粉丝", ClientTextStyleVO.COLOR_CONTENT));
        contentList.add(new ClientTextStyleVO(fansName,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
        contentList.add(new ClientTextStyleVO("还不是会员,即日起你需要在60天内助力他成长为任意会员", ClientTextStyleVO.COLOR_CONTENT));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离原因", ClientTextStyleVO.COLOR_TITLE),contentList));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO("可在【\"我的-我的粉丝\"】中查看脱离剩余时间", ClientTextStyleVO.COLOR_CONTENT)));
        MsgInviteDetail detail = new MsgInviteDetail();
        detail.setCreateTime(new Date());
        detail.setMsgType(MsgTypeInviteTypeEnum.fansDivorced);
        detail.setRead(false);
        detail.setUser(new UserInfo(uid));
        detail.setExtraInfo(new Gson().toJson(listMsg));
        return detail;
    }
    /**
     * 直接粉丝脱离-已经脱离提醒
     * @param uid
     * @param rankName
     * @param nickName
     * @param item
     * @param time
     * @return
     */
    public static MsgInviteDetail fansDivorced(Long uid, String nickName, Date time) {
        if (nickName == null || uid == null || time == null)
            return null;
        List<CommonMsgItemVO> listMsg = new ArrayList<>();
        List<ClientTextStyleVO> contentList = new ArrayList<>();
        contentList.add(new ClientTextStyleVO("很抱歉!你的直接粉丝:", ClientTextStyleVO.COLOR_CONTENT));
        contentList.add(new ClientTextStyleVO(nickName ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
        contentList.add(new ClientTextStyleVO("已经脱离了你", ClientTextStyleVO.COLOR_CONTENT));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离粉丝", ClientTextStyleVO.COLOR_TITLE),contentList));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离时间", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO(TimeUtil.formatDate(time), ClientTextStyleVO.COLOR_CONTENT)));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离原因", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO("你未能在60天内升级为任意会员", ClientTextStyleVO.COLOR_CONTENT)));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO("如有疑问请联系人工客服", ClientTextStyleVO.COLOR_CONTENT)));
        MsgInviteDetail detail = new MsgInviteDetail();
        detail.setCreateTime(new Date());
        detail.setMsgType(MsgTypeInviteTypeEnum.fansDivorced);
        detail.setRead(false);
        detail.setUser(new UserInfo(uid));
        detail.setExtraInfo(new Gson().toJson(listMsg));
        return detail;
    }
    /**
     * 直接粉丝脱离-已经脱离提醒
     * @param uid
     * @param rankName
     * @param nickName
     * @param item
     * @param time
     * @return
     */
    public static MsgInviteDetail fansDivorcedIndirect(Long uid, String nickName, String fansName, Date time) {
        if (nickName == null || uid == null || time == null)
            return null;
        List<CommonMsgItemVO> listMsg = new ArrayList<>();
        List<ClientTextStyleVO> contentList = new ArrayList<>();
        contentList.add(new ClientTextStyleVO("很抱歉!你的间接粉丝:", ClientTextStyleVO.COLOR_CONTENT));
        contentList.add(new ClientTextStyleVO(nickName ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
        contentList.add(new ClientTextStyleVO("已经脱离了你", ClientTextStyleVO.COLOR_CONTENT));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离粉丝", ClientTextStyleVO.COLOR_TITLE),contentList));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离时间", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO(TimeUtil.formatDate(time), ClientTextStyleVO.COLOR_CONTENT)));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离原因", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO(String.format("你的直接粉丝%s未能在60天内升级为任意会员", fansName), ClientTextStyleVO.COLOR_CONTENT)));
        listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
                new ClientTextStyleVO("如有疑问请联系人工客服", ClientTextStyleVO.COLOR_CONTENT)));
        MsgInviteDetail detail = new MsgInviteDetail();
        detail.setCreateTime(new Date());
        detail.setMsgType(MsgTypeInviteTypeEnum.fansDivorced);
        detail.setRead(false);
        detail.setUser(new UserInfo(uid));
        detail.setExtraInfo(new Gson().toJson(listMsg));
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/user/UserVIPMessageListener.java
@@ -94,10 +94,10 @@
                if (dto != null) {
                    if (dto.getType() == OrderMoneyRecievedMQMsg.TYPE_ZIGOU) {// 自购到账
                        // 会员升级-自购订单数量验证
                        userVIPPreInfoService.upgradeVipByFanLiOrder(dto.getUid());
                        userVIPPreInfoService.upgradeVipByMyOrder(dto.getUid());
                    } else if (dto.getType() == OrderMoneyRecievedMQMsg.TYPE_SHARE) {// 分享到账
                        // 会员升级-分享订单数量验证
                        userVIPPreInfoService.upgradeVipByShareOrder(dto.getUid());
                        userVIPPreInfoService.upgradeVipByMyOrder(dto.getUid());
                    }
                }
            } else if (tag.equalsIgnoreCase(OrderTopicTagEnum.orderConfirm.name())) {