admin
2020-06-11 3a1b3cc04d2926d830f2a623d656d369ebfb5cb2
获取导师微信接口,云发单回调修改
3个文件已修改
125 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/CallBackController.java 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/help/AppPageNotification.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/CallBackController.java
@@ -2,14 +2,13 @@
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.security.SignatureException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -21,8 +20,6 @@
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.yeshi.utils.taobao.TbImgUtil;
import org.yeshi.utils.wx.WXUtil;
@@ -268,9 +265,9 @@
        JSONObject data = JSONObject.fromObject(contentDecode).optJSONObject("data");
        JSONArray array = data.optJSONObject("recommend").optJSONArray("resultList");
        long startTime=System.currentTimeMillis();
        long startTime = System.currentTimeMillis();
        for (int i = array.size() - 1; i >= 0; i--) {
            JSONObject item = array.optJSONObject(i);
            String title = item.optString("itemName");
@@ -337,14 +334,30 @@
            ActivityUser user = ruleList.get((int) (ruleList.size() * Math.random())).getActivityUser();
            try {
                goodsEvaluateService.addGoodsEvaluate(itemId + "", imageList, user, doc, null, new Date(startTime-1000*60*20L*i));
                goodsEvaluateService.addGoodsEvaluate(itemId + "", imageList, user, doc, null,
                        new Date(startTime - 1000 * 60 * 20L * i));
            } catch (GoodsEvaluateException e) {
                e.printStackTrace();
            }catch(Exception e){
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
    @RequestMapping(value = "yhg/groupmsg")
    public void groupMsg(HttpServletRequest request, PrintWriter out) {
        StringBuilder stringBuilder = new StringBuilder();
        try {
            byte[] buffer = new byte[2048];
            int readBytes = 0;
            while ((readBytes = request.getInputStream().read(buffer)) > 0) {
                stringBuilder.append(new String(buffer, 0, readBytes));
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        LogHelper.test("云发单回调内容:"+stringBuilder.toString());
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java
@@ -207,20 +207,19 @@
    @Resource
    private UserInviteService userInviteService;
    @Resource
    private UserInviteValidNumService userInviteValidNumService;
    @Resource
    private CommonOrderService commonOrderService;
    @Resource
    private TearcherService tearcherService;
    @Resource
    private UserVIPPreInfoService userVIPPreInfoService;
    /**
     * 新版登录 V1.5.3
     * 
@@ -475,15 +474,15 @@
        BigDecimal payMoney = new BigDecimal(userVipConfigService.getValueByKey("require_order_pay"));
        vo.setFinishGoldCoin(Long.parseLong(integralDetailService.getCumulativeMoney(uid).setScale(0).toString()));
//        vo.setFinishTeam(hongBaoV2CountService.countValidOrderTeamUserByUid(uid,
//                , payMoney));
        // vo.setFinishTeam(hongBaoV2CountService.countValidOrderTeamUserByUid(uid,
        // , payMoney));
        int finishTeam = 0;
        long vipBegin = TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME);
        List<ThreeSale> listThreeSale = threeSaleSerivce.getValidWorkerIdsByTime(uid, vipBegin);
        if (listThreeSale != null && listThreeSale.size() > 0) {
            for (ThreeSale three: listThreeSale) {
            for (ThreeSale three : listThreeSale) {
                UserInfo worker = three.getWorker();
                if (worker == null || worker.getId() == null) {
                    continue;
@@ -491,7 +490,7 @@
                // 1、邀请关系成功后;2、单(分享 + 自购)实付款大于1元
                long countValid = commonOrderService.countOrderByUidAndSettled(worker.getId(), payMoney);
                if (countValid > 0) {
                    finishTeam ++;
                    finishTeam++;
                }
            }
        }
@@ -554,7 +553,7 @@
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "用户未登录"));
            return;
        }
        try {
            userVIPInfoService.applyVIP(uid);
        } catch (UserVIPInfoException e) {
@@ -573,8 +572,6 @@
        }
    }
    /**
     * 获取vip信息
     * 
@@ -597,12 +594,12 @@
        }
        // 获取等级
        UserInviteLevelEnum level = userInviteService.getUserInviteLevelNew(uid);
        // 达人
        long limitOrder = 0;
        long limitFirst = 0;
        long limitSecond = 0;
        if (level == UserInviteLevelEnum.actived ||  level == UserInviteLevelEnum.noActive) {
        if (level == UserInviteLevelEnum.actived || level == UserInviteLevelEnum.noActive) {
            String orderCount = userVipConfigService.getValueByKey("vip_pre_7_order_count");
            if (!StringUtil.isNullOrEmpty(orderCount)) {
                limitOrder = Long.parseLong(orderCount);
@@ -630,11 +627,11 @@
            }
        } else if (level == UserInviteLevelEnum.vip || level == UserInviteLevelEnum.tearcherApply) {
            // TODO 比例
        } else if (level == UserInviteLevelEnum.tearcher) {
            // TODO
        }
        // 自购订单
        long doneOrder = hongBaoV2CountService.countMyDirectOrderByCashArrival(uid, Constant.VIP_ORDER_PAY);
        // 有效粉丝
@@ -645,7 +642,7 @@
            doneFirst = userInviteValidNum.getNumFirst() == null ? 0 : userInviteValidNum.getNumFirst();
            doneSecond = userInviteValidNum.getNumSecond() == null ? 0 : userInviteValidNum.getNumSecond();
        }
        Date now = new Date();
        Date start = new Date(0);
        // 省钱: ---返利订单、奖励券提成
@@ -653,7 +650,7 @@
        typeFanli.add(UserMoneyDetailTypeEnum.fanli);
        typeFanli.add(UserMoneyDetailTypeEnum.orderReward);
        BigDecimal saveMoney = userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeFanli, start, now).abs();
        // 赚钱: 邀请订单、分享订单、补贴
        List<UserMoneyDetailTypeEnum> typeList = new ArrayList<>();
        typeList.add(UserMoneyDetailTypeEnum.share);
@@ -667,7 +664,7 @@
            saveMoney = MoneyBigDecimalUtil.mul2(saveMoney, rate);
            earnMoney = MoneyBigDecimalUtil.mul2(earnMoney, rate);
        }
        String shareRate = "可享佣金的<label style=\"color:#E5005C;\">%s</label>";
        String teamRate = "最高佣金的<label style=\"color:#E5005C;\">%s</label>";
        // 达人版
@@ -675,20 +672,19 @@
        jsonrRed1.put("enjoyRate", String.format(shareRate, "145%"));
        jsonrRed1.put("teamRate", String.format(teamRate, "25%"));
        jsonrRed1.put("teamIncome", "高级会员以上专属");
        // 高级会员
        JSONObject jsonrRed2 = new JSONObject();
        jsonrRed2.put("enjoyRate", String.format(shareRate, "195%"));
        jsonrRed2.put("teamRate", String.format(teamRate, "50%"));
        jsonrRed2.put("teamIncome", "享高级团队收益");
        // 超级会员
        JSONObject jsonrRed3 = new JSONObject();
        jsonrRed3.put("enjoyRate", String.format(shareRate, "210%"));
        jsonrRed3.put("teamRate", String.format(teamRate, "110%"));
        jsonrRed3.put("teamIncome", "享超级团队收益");
        JSONObject json = new JSONObject();
        json.put("level", level.name());
        json.put("nickName", userInfo.getNickName());
@@ -696,7 +692,7 @@
        json.put("ruleLink", userVipConfigService.getValueByKey("help_link_vip_h5"));
        json.put("saveMoney", saveMoney);
        json.put("earnMoney", earnMoney);
        String tearcherWX = "";
        TearcherInfo tearcherInfo = tearcherService.selectByUid(uid);
        if (tearcherInfo != null && !StringUtil.isNullOrEmpty(tearcherInfo.getWxID())) {
@@ -705,28 +701,29 @@
        json.put("tearcherWX", tearcherWX);
        json.put("tearcherTip", "我是你的导师,为你在省赚过程中解难答疑,对你一对一辅导,倾听你的需求总结并反馈给板栗快省官方运营团队,快来添加我吧。");
        json.put("newerGongLue", configService.get(ConfigKeyEnum.newerGonglue.getKey()));
        // 已完成
        json.put("doneOrder", doneOrder);
        json.put("doneFirst", doneFirst);
        json.put("doneSecond", doneSecond);
        // 标准
        json.put("limitOrder", limitOrder);
        json.put("limitFirst", limitFirst);
        json.put("limitSecond", limitSecond);
        // 已完成
        json.put("daRen", jsonrRed1);
        json.put("highVIP", jsonrRed2);
        json.put("superVIP", jsonrRed3);
        // 人工客服链接
        json.put("csdLink", configService.get(ConfigKeyEnum.customerServiceLink.getKey()));
        UserVIPInfo userVIPInfo = userVIPInfoService.selectByUid(uid);
        String leftTime = "";
        if (userVIPInfo != null && userVIPInfo.getState() == UserVIPInfo.STATE_VERIFING &&  userVIPInfo.getApplyTime() != null) {
        if (userVIPInfo != null && userVIPInfo.getState() == UserVIPInfo.STATE_VERIFING
                && userVIPInfo.getApplyTime() != null) {
            long s = 48 * 60 * 60 - ((System.currentTimeMillis() - userVIPInfo.getApplyTime().getTime()) / 1000);
            if (s > 3600) {
                leftTime = s / 3600 + "小时";
@@ -749,7 +746,6 @@
        }
    }
    /**
     * 获取vip信息
     * 
@@ -769,18 +765,36 @@
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "还未升级成为会员"));
            return;
        }
        UserLevelEnum level = UserLevelUtil.getByLevel(vipInfo.getProcess());
        if (level == null) {
            level = UserLevelEnum.daRen;
        }
        UserLevelEnum showLevel = UserLevelUtil.getShowLevel(level);
        String desc = "你于"+ TimeUtil.formatDateDot(vipInfo.getCreateTime()) +"升级为" +  showLevel.getName();
        String desc = "你于" + TimeUtil.formatDateDot(vipInfo.getCreateTime()) + "升级为" + showLevel.getName();
        JSONObject json = new JSONObject();
        json.put("desc", desc);
        JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(json));
    }
    @RequestMapping(value = "getTearcherWX")
    public void getTearcherWX(String callback, AcceptData acceptData, Long uid, PrintWriter out) {
        if (uid == null || uid <= 0) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "用户未登录"));
            return;
        }
        TearcherInfo tearcher = tearcherService.selectByUid(uid);
        if (tearcher == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("无导师"));
            return;
        } else {
            JSONObject data = new JSONObject();
            data.put("wx", tearcher.getWxID());
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
            return;
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/help/AppPageNotification.java
@@ -59,7 +59,9 @@
        dynamicShareMulti("动态多图分享"),
        fastShare1("快捷分享-淘宝"),
        fastShare2("快捷分享-京东"),
        fastShare3("快捷分享-拼多多");
        fastShare3("快捷分享-拼多多"),
        goodsDetailVIP("唯品会详情"),
        goodsDetailSuning("苏宁详情");
        private final String desc;