yujian
2020-05-19 b7a90c576ac6b482c68ad6d0c2777831f9127b4a
Merge remote-tracking branch 'origin/div' into div
12个文件已修改
1个文件已添加
944 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/HelpController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserInfoController.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserVipController.java 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java 299 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/SwiperPicture.java 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SwiperPictureMapper.xml 351 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/GiveVIPApplyInfoServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/manger/goods/ConvertLinkManager.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/FilePathEnum.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/ImageUtil.java 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/user/vip/GiveVIPApplyInfoRecordVOFactory.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/order/OrderMessageListener.java 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/HelpController.java
@@ -128,7 +128,7 @@
        BigDecimal fanLiRate = orderHongBaoMoneyComputeService.getFanliRate(levelList.get(0), new Date());
        
        moneyBigDecial=MoneyBigDecimalUtil.div(moneyBigDecial.multiply(new BigDecimal(100)), fanLiRate);
        moneyBigDecial=MoneyBigDecimalUtil.divUp(moneyBigDecial.multiply(new BigDecimal(100)), fanLiRate);
        List<UserTeamLevel> bossList = new ArrayList<>();
        if (levelList.size() > 1)
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserInfoController.java
@@ -274,10 +274,9 @@
    @Resource
    private GiveVIPApplyInfoService giveVIPApplyInfoService;
    @Resource
    private PreviewInfoService previewInfoService;
    private static final String EXTRACT_MIN_MONEY = ConfigKeyEnum.extractMoneyMin.getKey();
    private static final String EXTRACT_MAX_MONEY = ConfigKeyEnum.extractMoneyMAX.getKey();
@@ -2236,18 +2235,18 @@
                        if (vo != null) {
                            if (!StringUtil.isNullOrEmpty(vo.getBalance()))
                                userInfo.setMyHongBao(new BigDecimal(vo.getBalance()));
                            if (!StringUtil.isNullOrEmpty(vo.getLevel()))
                                 for (UserInviteLevelEnum levelEnum: UserInviteLevelEnum.values()) {
                                     if (levelEnum.name().equals(vo.getLevel())) {
                                         level = levelEnum;
                                         break;
                                     }
                                 }
                                for (UserInviteLevelEnum levelEnum : UserInviteLevelEnum.values()) {
                                    if (levelEnum.name().equals(vo.getLevel())) {
                                        level = levelEnum;
                                        break;
                                    }
                                }
                        }
                    }
                }
                if (level == null) {
                    if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
                        level = userInviteService.getUserInviteLevelNew(uid);
@@ -2268,7 +2267,9 @@
                UserLevelEnum level = userLevelManager.getUserLevel(uid);
                JSONObject vipAction = null;
                if (level == UserLevelEnum.superVIP || level == UserLevelEnum.tearcher) {
                String managerLink = userVipConfigService.getValueByKey("vip_manager_link");
                if ((level == UserLevelEnum.superVIP || level == UserLevelEnum.tearcher)
                        && !StringUtil.isNullOrEmpty(managerLink)) {
                    vipAction = new JSONObject();
                    vipAction.put("name", "超会管理");
                    vipAction.put("jumpDetail",
@@ -2278,7 +2279,6 @@
                    JSONObject params = new JSONObject();
                    params.put("url", userVipConfigService.getValueByKey("vip_manager_link"));
                    vipAction.put("params", params);
                } else {
                    // 查询是否可以提交会员申请,是的话返回资料填写页面
                    List<GiveVIPApplyInfo> list = giveVIPApplyInfoService.listByStateAndTargetUid(uid,
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserVipController.java
@@ -82,6 +82,31 @@
        }
    }
    @RequestMapping(value = "getApplyInfo")
    public void getApplyInfo(AcceptData acceptData, String id, Long uid, String callback, PrintWriter out) {
        if (StringUtil.isNullOrEmpty(id)) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请上传id"));
            return;
        }
        GiveVIPApplyInfo info = giveVIPApplyInfoService.selectByPrimaryKey(id);
        if (info == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("申请信息不存在"));
            return;
        }
        // 查询开通人是否为他的下级
        ThreeSaleDetail detail = threeSaleDetailService.getByBossUidAndWorkerUid(info.getSourceUid(),
                info.getTargetUid());
        if (detail == null && info.getTargetUid().longValue() != uid) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该用户不是您的粉丝"));
            return;
        }
        JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(JsonUtil.getSimpleGson().toJson(info)));
    }
    // 提交申请信息
    @RequestMapping(value = "uploadApplyInfo")
    public void uploadApplyInfo(AcceptData acceptData, GiveVIPApplyInfo info, String callback,
@@ -132,8 +157,9 @@
            if (imgList.size() > 0)
                info.setImgList(imgList);
            info.setState(GiveVIPApplyInfo.STATE_NOT_VERIFY);
            giveVIPApplyInfoService.updateGiveVIPApplyInfo(info);
        }
        giveVIPApplyInfoService.updateGiveVIPApplyInfo(info);
        JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("资料提交成功"));
    }
@@ -171,9 +197,9 @@
        Gson gson = gb.create();
        if (Constant.IS_TEST) {
            count = 100;
        }
        // if (Constant.IS_TEST) {
        // count = 100;
        // }
        JSONObject data = new JSONObject();
        data.put("list", gson.toJson(recordList));
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java
@@ -1,14 +1,18 @@
package com.yeshi.fanli.controller.client.v2;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import javax.annotation.Resource;
@@ -17,8 +21,11 @@
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.yeshi.utils.HttpUtil;
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.QRCodeUtil;
import org.yeshi.utils.entity.FileUploadResult;
import org.yeshi.utils.tencentcloud.COSManager;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -67,13 +74,17 @@
import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.service.manger.goods.ConvertLinkManager;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.FilePathEnum;
import com.yeshi.fanli.util.ImageUtil;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.util.VersionUtil;
import com.yeshi.fanli.util.cache.JDGoodsCacheUtil;
import com.yeshi.fanli.util.jd.JDApiUtil;
import com.yeshi.fanli.util.jd.JDUtil;
import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil;
import com.yeshi.fanli.util.pinduoduo.PinDuoDuoUtil;
import com.yeshi.fanli.util.taobao.DaTaoKeUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.vo.dynamic.ArticleVO;
@@ -144,11 +155,9 @@
    @Resource
    private DailyCountMomentsService dailyCountMomentsService;
    @Resource
    private CommonShareInfoService commonShareInfoService;
    @Resource(name = "taskExecutor")
    private TaskExecutor executor;
@@ -267,7 +276,7 @@
            list.add(map.get(TYPE_FAQUAN));
            list.add(map.get(TYPE_HUODONG));
            // list.add(map.get(TYPE_XUEYUAN));
             list.add(map.get(TYPE_SUCAI));
            list.add(map.get(TYPE_SUCAI));
        } else if (VersionUtil.greaterThan_2_0_6(acceptData.getPlatform(), acceptData.getVersion())) {
            // 2.0.6返回热销+活动+推荐+学院+邀请
            list.add(map.get(TYPE_REXIAO));
@@ -371,8 +380,8 @@
            listKey.add("special_channel_pdd");
        }
        List<SpecialVO> list = specialService.listByPlaceKeyHasLabel((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE,
                listKey, platformCode, Integer.parseInt(acceptData.getVersion()));
        List<SpecialVO> list = specialService.listByPlaceKeyHasLabel((page - 1) * Constant.PAGE_SIZE,
                Constant.PAGE_SIZE, listKey, platformCode, Integer.parseInt(acceptData.getVersion()));
        long time = System.currentTimeMillis();
@@ -382,7 +391,7 @@
            if (special.getState() == 1L) {
                continue;
            }
            // 是否活动已过期
            if (special.getStartTime() != null && special.getEndTime() != null) {
                if (time < special.getStartTime().getTime() || time > special.getEndTime().getTime()) {
@@ -392,9 +401,7 @@
                    special.setCountDownTime((special.getEndTime().getTime() - time) / 1000);
                }
            }
            // 设置标签
            List<SpecialLabel> listLabels = special.getListLabels();
            if (listLabels != null && !listLabels.isEmpty()) {
@@ -404,7 +411,7 @@
                }
                special.setLabels(labels);
            }
        }
        long count = specialService.countByPlaceKeyList(listKey, platformCode,
@@ -644,9 +651,12 @@
                        continue;
                    }
                    // 跳转过渡页
                    //String jumpLink = configService.get(ConfigKeyEnum.activityDetailLink.getKey()) + "?type=%s&id=%s";
                    //jumpLink = String.format(jumpLink, "circle", evaluateNew.getId());
                    //evaluateNew.setJumpLink(jumpLink);
                    // String jumpLink =
                    // configService.get(ConfigKeyEnum.activityDetailLink.getKey())
                    // + "?type=%s&id=%s";
                    // jumpLink = String.format(jumpLink, "circle",
                    // evaluateNew.getId());
                    // evaluateNew.setJumpLink(jumpLink);
                    // 图片数量
                    if (evaluateNew.getImgList() != null && evaluateNew.getImgList().size() > 0) {
@@ -1009,8 +1019,6 @@
        return null;
    }
    /**
     * 评论复制-H5
     * 
@@ -1108,10 +1116,7 @@
            }
        });
    }
    /**
     * 评论复制-专题
     * 
@@ -1127,7 +1132,7 @@
        }
        CommonShareInfo shareInfo = commonShareInfoService.getByPidAndType(id, CommonShareInfoEnum.special.name());
        if (shareInfo == null ||  StringUtil.isNullOrEmpty(shareInfo.getComment())) {
        if (shareInfo == null || StringUtil.isNullOrEmpty(shareInfo.getComment())) {
            out.print(JsonUtil.loadFalseResult("该内容已不存在"));
            return;
        }
@@ -1155,7 +1160,7 @@
        }
        String text = shareInfo.getComment();
        String newText = text;
        String newText = text;
        if (shareInfo.getNeedSpin() != null && shareInfo.getNeedSpin()) {
            try {
                newText = convertLinkManager.convertLinkFromText(text, uid, true);
@@ -1175,13 +1180,10 @@
        data.put("text", newText);
        out.print(JsonUtil.loadTrueResult(data));
    }
    @RequestMapping(value = "getActivityDetail")
    public void getActivityDetail(String callback, AcceptData acceptData, Long uid, String type, String id, PrintWriter out) {
    public void getActivityDetail(String callback, AcceptData acceptData, Long uid, String type, String id,
            PrintWriter out) {
        if (uid == null || StringUtil.isNullOrEmpty(id) || StringUtil.isNullOrEmpty(type)) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("参数不能为空"));
            return;
@@ -1190,6 +1192,9 @@
        String title = "";
        String comment = "";
        String params = "";
        String desc = "";
        Date startTime = null;
        Date endTime = null;
        JumpDetailV2 jumpDetail = null;
        List<String> imgs = new ArrayList<>();
        if ("circle".equalsIgnoreCase(type)) { // 发圈活动
@@ -1204,7 +1209,7 @@
            if (comments != null && comments.size() > 0) {
                comment = comments.get(0).getContent();
            }
            String jumpLink = null;
            if (!StringUtil.isNullOrEmpty(evaluate.getJumpLink())) {
                jumpLink = evaluate.getJumpLink();
@@ -1213,25 +1218,26 @@
            List<ImgInfo> imgList = evaluate.getImgList();
            if (imgList != null && imgList.size() > 0) {
                for (ImgInfo imgInfo : imgList) {
                    if (!StringUtil.isNullOrEmpty(imgInfo.getUrl())
                    if (!StringUtil.isNullOrEmpty(imgInfo.getUrl())
                            && (imgInfo.getType() == ImgEnum.img || imgInfo.getType() == ImgEnum.activity)) {
                        imgs.add(imgInfo.getUrl());
                    }
                    if (imgInfo.getType() == ImgEnum.img || imgInfo.getType() == ImgEnum.activity) {
                        if (StringUtil.isNullOrEmpty(jumpLink) && !StringUtil.isNullOrEmpty(imgInfo.getActivityUrl())) {
                            jumpLink  = imgInfo.getActivityUrl();
                            jumpLink = imgInfo.getActivityUrl();
                        }
                    }
                }
            }
            int platformCode = Constant.getPlatformCode(acceptData.getPlatform());
            jumpDetail = jumpDetailV2Service.getByTypeCache("web", platformCode, Integer.parseInt(acceptData.getVersion()));
            jumpDetail = jumpDetailV2Service.getByTypeCache("web", platformCode,
                    Integer.parseInt(acceptData.getVersion()));
            JSONObject inner = new JSONObject();
            inner.put("url", jumpLink);
            params = inner.toString();
        } else {
        } else {
            long pid = Long.parseLong(id);
            if (CommonShareInfoEnum.special.name().equalsIgnoreCase(type)) {
                Special special = specialService.selectByPrimaryKey(pid);
@@ -1239,12 +1245,15 @@
                    JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该活动已下架"));
                    return;
                }
                params = special.getParams();
                jumpDetail = special.getJumpDetail();
                if (!StringUtil.isNullOrEmpty(special.getPicture())) {
                    imgs.add(special.getPicture());
                }
                desc = special.getRemark();
                startTime = special.getStartTime();
                endTime = special.getEndTime();
            } else if (CommonShareInfoEnum.banner.name().equalsIgnoreCase(type)) {
                SwiperPicture swiper = swiperPictureService.selectByPrimaryKey(pid);
                if (swiper == null) {
@@ -1256,13 +1265,16 @@
                if (!StringUtil.isNullOrEmpty(swiper.getSrc())) {
                    imgs.add(swiper.getSrc());
                }
                desc = swiper.getRemark();
                startTime = swiper.getStartTime();
                endTime = swiper.getEndTime();
            }
            CommonShareInfo shareInfo = commonShareInfoService.getByPidAndType(pid, type);
            if (shareInfo != null && !StringUtil.isNullOrEmpty(shareInfo.getComment())) {
                comment = shareInfo.getComment();
            }
        }
        if (!StringUtil.isNullOrEmpty(comment)) { // 替换淘宝官方活动
            List<String> activityIdList = convertLinkManager.getTaoBaoOfficialActivityId(comment);
            for (String st : activityIdList)
@@ -1271,15 +1283,22 @@
        JSONObject data = new JSONObject();
        data.put("title", title);
        data.put("desc", desc);
        data.put("comment", comment);
        data.put("params", params);
        data.put("jumpDetail", jumpDetail);
        data.put("imgs", imgs);
        if (startTime != null) {
            data.put("startTime", TimeUtil.getGernalTime(startTime.getTime(), "yyyy.MM.dd"));
        }
        if (endTime != null) {
            data.put("endTime", TimeUtil.getGernalTime(endTime.getTime(), "yyyy.MM.dd"));
        }
        JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
    }
    /**
     * 评论复制-专题
     * 
@@ -1288,18 +1307,18 @@
     * @param out
     */
    @RequestMapping(value = "copyShareComment")
    public void copyShareComment(String callback, AcceptData acceptData, Long uid, String id,
            String type, PrintWriter out) {
    public void copyShareComment(String callback, AcceptData acceptData, Long uid, String id, String type,
            PrintWriter out) {
        if (uid == null || StringUtil.isNullOrEmpty(id) || StringUtil.isNullOrEmpty(type)) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("参数不能为空"));
            return;
        }
        if ("circle".equalsIgnoreCase(type)) { // 发圈活动
            copyActivityComment(callback, acceptData, uid, id, out);
            return;
        }
        long pid = Long.parseLong(id);
        CommonShareInfo shareInfo = commonShareInfoService.getByPidAndType(pid, type);
        if (shareInfo == null || StringUtil.isNullOrEmpty(shareInfo.getComment())) {
@@ -1314,7 +1333,8 @@
        }
        if (user != null && user.getState() != UserInfo.STATE_NORMAL) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC));
            JsonUtil.printMode(out, callback,
                    JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC));
            return;
        }
@@ -1330,18 +1350,18 @@
        }
        String text = shareInfo.getComment();
        String newText = text;
        String newText = text;
        if (shareInfo.getNeedSpin() != null && shareInfo.getNeedSpin()) {
            try {
                newText = convertLinkManager.convertLinkFromText(text, uid, true);
            } catch (ConvertLinkExceptionException e) {
                if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) {
                    JsonUtil.printMode(out, callback,JsonUtil.loadFalseResult("评论生成失败"));
                    JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("评论生成失败"));
                    return;
                }
            } catch (Exception e) {
                LogHelper.errorDetailInfo(e);
                JsonUtil.printMode(out, callback,JsonUtil.loadFalseResult("评论生成失败"));
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("评论生成失败"));
                return;
            }
        }
@@ -1350,34 +1370,102 @@
        data.put("text", newText);
        JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
    }
    /**
     * 评论复制
     * 活动分享绘图
     * @Title: createActivityShareImg
     * @Description:
     * @param title
     * @param desc
     * @param imgUrl
     * @param erCodeContent
     * @return
     * String 返回类型
     * @throws
     */
    private String createActivityShareImg(String type, String id, String erCodeContent) {
        String title = "";
        String desc = "";
        String img = "";
        if ("circle".equalsIgnoreCase(type)) {
        } else if ("banner".equalsIgnoreCase(type)) {
            SwiperPicture picture = swiperPictureService.selectByPrimaryKey(Long.parseLong(id));
            title = picture.getTitle();
            desc = picture.getDesc();
            img = picture.getSrc();
        } else if ("special".equalsIgnoreCase(type)) {
            Special special = specialService.selectByPrimaryKey(Long.parseLong(id));
            title = special.getName();
            desc = special.getRemark();
            img = special.getPicture();
        }
        try {
            InputStream erCodeInputStream = null;
            erCodeInputStream = QRCodeUtil.getInstance(250).encode(erCodeContent);
            int[] size = new int[2];
            try {
                size = ImageUtil.getImgWidthAndHeight(img);
            } catch (MalformedURLException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            }
            InputStream resultInputStream = ImageUtil.drawActivityShareImg(HttpUtil.getAsInputStream(img),
                    (float) size[0] / size[1], title, desc, erCodeInputStream);
            if (resultInputStream != null) {
                String filePath = FilePathEnum.activityShare.getPath() + UUID.randomUUID().toString().replace("-", "")
                        + ".png";
                FileUploadResult result = COSManager.getInstance().uploadFile(resultInputStream, filePath);
                if (result != null)
                    return result.getUrl();
            }
        } catch (Exception e1) {
            e1.printStackTrace();
        }
        return null;
    }
    /**
     * 评论复制-专题
     * 
     * @param acceptData
     * @param id
     * @param out
     */
    private void copyActivityComment(String callback, AcceptData acceptData, Long uid, String id, PrintWriter out) {
        if (StringUtil.isNullOrEmpty(id)) {
            JsonUtil.printMode(out, callback,JsonUtil.loadFalseResult("id不能为空"));
    @RequestMapping(value = "getActivityShareImg")
    public void getActivityShareImg(String callback, AcceptData acceptData, Long uid, String id, String type,
            PrintWriter out) {
        if (uid == null || StringUtil.isNullOrEmpty(id) || StringUtil.isNullOrEmpty(type)) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("参数不能为空"));
            return;
        }
        GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(id);
        if (goodsEvaluate == null) {
            JsonUtil.printMode(out, callback,JsonUtil.loadFalseResult("该内容已不存在"));
        if ("circle".equalsIgnoreCase(type)) { // 发圈活动
            // copyActivityComment(callback, acceptData, uid, id, out);
            // TODO 分享发圈的图
            return;
        }
        long pid = Long.parseLong(id);
        CommonShareInfo shareInfo = commonShareInfoService.getByPidAndType(pid, type);
        if (shareInfo == null || StringUtil.isNullOrEmpty(shareInfo.getComment())) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该内容已不存在"));
            return;
        }
        UserInfo user = userInfoService.getUserByIdWithMybatis(uid);
        if (user == null) {
            JsonUtil.printMode(out, callback,JsonUtil.loadFalseResult("用户未登录"));
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录"));
            return;
        }
        if (user != null && user.getState() != UserInfo.STATE_NORMAL) {
            JsonUtil.printMode(out, callback,JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC));
            JsonUtil.printMode(out, callback,
                    JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC));
            return;
        }
@@ -1388,7 +1476,98 @@
            relationId = taoBaoInfo.getRelationId();
        if (StringUtil.isNullOrEmpty(relationId)) {
            JsonUtil.printMode(out, callback,JsonUtil.loadFalseResult(2, "淘宝未授权,请前往\"我的\"绑定淘宝账号"));
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(2, "淘宝未授权,请前往\"我的\"绑定淘宝账号"));
            return;
        }
        String text = shareInfo.getComment();
        String newText = text;
        String imgUrl = null;
        if (shareInfo.getNeedSpin() != null && shareInfo.getNeedSpin()) {
            try {
                String erCodeContent = "";
                newText = convertLinkManager.convertLinkFromText(text, uid, true);
                // 获取口令
                List<String> tokenList = TaoBaoUtil.getTokenListFromTextWithKuoHao(newText);
                if (tokenList != null && tokenList.size() > 0) {
                    // 构造分享链接
                    erCodeContent = ShareControllerV2.getTaoBaoActiivtyERCodeContentNew(
                            configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()), tokenList.get(0));
                } else {
                    // 获取链接
                    List<String> urlList = JDUtil.getJDShortLinksFromText(newText);
                    if (urlList != null && urlList.size() > 0) {
                        erCodeContent = urlList.get(0);
                    } else {
                        urlList = PinDuoDuoUtil.getPDDShortLinksFromText(newText);
                        if (urlList != null && urlList.size() > 0) {
                            erCodeContent = urlList.get(0);
                        }
                    }
                }
                imgUrl = createActivityShareImg(type, id, erCodeContent);
            } catch (ConvertLinkExceptionException e) {
                if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) {
                    JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("评论生成失败"));
                    return;
                }
            } catch (Exception e) {
                LogHelper.errorDetailInfo(e);
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("评论生成失败"));
                return;
            }
        }
        if (StringUtil.isNullOrEmpty(imgUrl)) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("分享图生成失败"));
        } else {
            JSONObject data = new JSONObject();
            data.put("text", newText);
            data.put("img", imgUrl);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        }
    }
    /**
     * 评论复制
     *
     * @param acceptData
     * @param id
     * @param out
     */
    private void copyActivityComment(String callback, AcceptData acceptData, Long uid, String id, PrintWriter out) {
        if (StringUtil.isNullOrEmpty(id)) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("id不能为空"));
            return;
        }
        GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(id);
        if (goodsEvaluate == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该内容已不存在"));
            return;
        }
        UserInfo user = userInfoService.getUserByIdWithMybatis(uid);
        if (user == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录"));
            return;
        }
        if (user != null && user.getState() != UserInfo.STATE_NORMAL) {
            JsonUtil.printMode(out, callback,
                    JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC));
            return;
        }
        UserExtraTaoBaoInfo taoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid);
        String relationId = null;
        if (taoBaoInfo != null && taoBaoInfo.getRelationId() != null && taoBaoInfo.getRelationValid() != null
                && taoBaoInfo.getRelationValid() == true)
            relationId = taoBaoInfo.getRelationId();
        if (StringUtil.isNullOrEmpty(relationId)) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(2, "淘宝未授权,请前往\"我的\"绑定淘宝账号"));
            return;
        }
@@ -1407,18 +1586,18 @@
                newText = convertLinkManager.convertLinkFromText(text, uid, true);
            } catch (ConvertLinkExceptionException e) {
                if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) {
                    JsonUtil.printMode(out, callback,JsonUtil.loadFalseResult("评论生成失败"));
                    JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("评论生成失败"));
                    return;
                }
            } catch (Exception e) {
                LogHelper.errorDetailInfo(e);
                JsonUtil.printMode(out, callback,JsonUtil.loadFalseResult("评论生成失败"));
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("评论生成失败"));
                return;
            }
        }
        JSONObject data = new JSONObject();
        data.put("text", newText);
        JsonUtil.printMode(out, callback,JsonUtil.loadTrueResult(data));
        JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        executor.execute(new Runnable() {
            @Override
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java
@@ -106,7 +106,7 @@
    @Resource
    private HongBaoManageService hongBaoManageService;
    @Resource
    private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService;
@@ -259,6 +259,13 @@
            commentText = commentText.replace("[券后价]", TaoBaoUtil.getAfterUseCouplePrice(goods) + "");
        }
        commentText = commentText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n");
        return commentText;
    }
    // 淘宝分享活动
    public static String getTaoBaoActiivtyERCodeContentNew(String template, String token) {
        String commentText = template.replace("[淘口令]", token);
        commentText = commentText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n");
        return commentText;
    }
@@ -654,8 +661,9 @@
            shareInfo.setRecommendText(deleteBlankLine(recommendText));
            // 设置评论文本选项
            shareInfo.setCommentTextChoiceList(getCommentChoiceList(shareInfo.getCommentText(), null, inviteCode,
                    TaoBaoUtil.getGoodsHongBaoMoney(taoBaoLink.getGoods(), hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP))));
            shareInfo.setCommentTextChoiceList(
                    getCommentChoiceList(shareInfo.getCommentText(), null, inviteCode, TaoBaoUtil.getGoodsHongBaoMoney(
                            taoBaoLink.getGoods(), hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP))));
            out.print(JsonUtil.loadTrueResult(
                    JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
@@ -734,8 +742,8 @@
        shareInfo.setCommentTexts(new ArrayList<>());
        if (needGoods)
            shareInfo.setGoodsInfo(GoodsDetailVOFactory.convertJDGoods(jdGoods,
                    orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion())));
            shareInfo.setGoodsInfo(GoodsDetailVOFactory.convertJDGoods(jdGoods, orderHongBaoMoneyComputeService
                    .getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion())));
        boolean hasCoupon = false;
        if (couponInfo != null) {
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/SwiperPicture.java
@@ -17,7 +17,7 @@
 */
@Table("yeshi_ec_swiper_banner_picture")
public class SwiperPicture implements Serializable {
    private static final long serialVersionUID = 1L;
    @Expose
@@ -37,16 +37,16 @@
    @Expose
    @Column(name = "pic_jumpid")
    private JumpDetailV2 jumpDetail;
    // 跳转参数
    @Expose
    @Column(name = "pic_params")
    private String params;
    // 跳转是否需要登陆
    @Column(name = "pic_jump_need_login")
    private boolean jumpNeedLogin;
    // 排序
    @Column(name = "pic_order")
    private Integer order;
@@ -61,12 +61,12 @@
    // 自动控制
    @Column(name = "pic_auto_control")
    private Integer autoControl;
    // 起始时间
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "pic_start_time")
    private Date startTime;
    // 结束时间
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "pic_end_time")
@@ -78,13 +78,34 @@
    @Column(name = "pic_updatetime")
    private Date updatetime;
    // 起始时间
    private String startTime_str;
    // 结束时间
    private String endTime_str;
    // 标题
    @Column(name = "pic_title")
    private String title;
    // 简介
    @Column(name = "pic_desc")
    private String desc;
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    public String getDesc() {
        return desc;
    }
    public void setDesc(String desc) {
        this.desc = desc;
    }
    public Long getId() {
        return this.id;
    }
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SwiperPictureMapper.xml
@@ -1,160 +1,191 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeshi.fanli.dao.mybatis.homemodule.SwiperPictureMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.homemodule.SwiperPicture">
    <id column="pic_id" property="id" jdbcType="BIGINT"/>
    <result column="pic_banner_id" property="bannerId" jdbcType="BIGINT"/>
    <result column="pic_src" property="src" jdbcType="VARCHAR"/>
    <result column="pic_params" property="params" jdbcType="VARCHAR"/>
    <result column="pic_jump_need_login" property="jumpNeedLogin" jdbcType="VARCHAR"/>
    <result column="pic_order" property="order" jdbcType="INTEGER"/>
    <result column="pic_remark" property="remark" jdbcType="VARCHAR"/>
    <result column="pic_state" property="state" jdbcType="INTEGER"/>
    <result column="pic_auto_control" property="autoControl" jdbcType="INTEGER"/>
    <result column="pic_start_time" property="startTime" jdbcType="TIMESTAMP"/>
    <result column="pic_end_time" property="endTime" jdbcType="TIMESTAMP"/>
    <result column="pic_createtime" property="createtime" jdbcType="TIMESTAMP"/>
    <result column="pic_updatetime" property="updatetime" jdbcType="TIMESTAMP"/>
    <association property="jumpDetail" column="pic_jumpid" resultMap="com.yeshi.fanli.dao.mybatis.common.JumpDetailV2Mapper.BaseResultMap"/>
  </resultMap>
  <sql id="Base_Column_List">pic_id,pic_banner_id,pic_src,pic_jumpid,pic_params,pic_jump_need_login,pic_order,pic_remark,pic_state,pic_auto_control,pic_start_time,pic_end_time,pic_createtime,pic_updatetime</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_swiper_banner_picture where pic_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_swiper_banner_picture where pic_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.SwiperPicture" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_swiper_banner_picture (pic_id,pic_banner_id,pic_src,pic_jumpid,pic_params,pic_jump_need_login,pic_order,pic_remark,pic_state,pic_auto_control,pic_start_time,pic_end_time,pic_createtime,pic_updatetime) values (#{id,jdbcType=BIGINT},#{bannerId,jdbcType=BIGINT},#{src,jdbcType=VARCHAR},#{jumpDetail.id,jdbcType=BIGINT},#{params,jdbcType=VARCHAR},#{jumpNeedLogin,jdbcType=VARCHAR},#{order,jdbcType=INTEGER},#{remark,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{autoControl,jdbcType=INTEGER},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.SwiperPicture" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_swiper_banner_picture
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">pic_id,</if>
      <if test="bannerId != null">pic_banner_id,</if>
      <if test="src != null">pic_src,</if>
      <if test="jumpDetail != null">pic_jumpid,</if>
      <if test="params != null">pic_params,</if>
      <if test="jumpNeedLogin != null">pic_jump_need_login,</if>
      <if test="order != null">pic_order,</if>
      <if test="remark != null">pic_remark,</if>
      <if test="state != null">pic_state,</if>
      <if test="autoControl != null">pic_auto_control,</if>
      <if test="startTime != null">pic_start_time,</if>
      <if test="endTime != null">pic_end_time,</if>
      <if test="createtime != null">pic_createtime,</if>
      <if test="updatetime != null">pic_updatetime,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="bannerId != null">#{bannerId,jdbcType=BIGINT},</if>
      <if test="src != null">#{src,jdbcType=VARCHAR},</if>
      <if test="jumpDetail != null">#{jumpDetail.id,jdbcType=BIGINT},</if>
      <if test="params != null">#{params,jdbcType=VARCHAR},</if>
      <if test="jumpNeedLogin != null">#{jumpNeedLogin,jdbcType=VARCHAR},</if>
      <if test="order != null">#{order,jdbcType=INTEGER},</if>
      <if test="remark != null">#{remark,jdbcType=VARCHAR},</if>
      <if test="state != null">#{state,jdbcType=INTEGER},</if>
      <if test="autoControl != null">#{autoControl,jdbcType=INTEGER},</if>
      <if test="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if>
      <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if>
      <if test="createtime != null">#{createtime,jdbcType=TIMESTAMP},</if>
      <if test="updatetime != null">#{updatetime,jdbcType=TIMESTAMP},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.SwiperPicture">update yeshi_ec_swiper_banner_picture set pic_banner_id = #{bannerId,jdbcType=BIGINT},pic_src = #{src,jdbcType=VARCHAR},pic_jumpid = #{jumpDetail.id,jdbcType=BIGINT},pic_params = #{params,jdbcType=VARCHAR},pic_jump_need_login = #{jumpNeedLogin,jdbcType=VARCHAR},pic_order = #{order,jdbcType=INTEGER},pic_remark = #{remark,jdbcType=VARCHAR},pic_state = #{state,jdbcType=INTEGER},pic_auto_control = #{autoControl,jdbcType=INTEGER},pic_start_time = #{startTime,jdbcType=TIMESTAMP},pic_end_time = #{endTime,jdbcType=TIMESTAMP},pic_createtime = #{createtime,jdbcType=TIMESTAMP},pic_updatetime = #{updatetime,jdbcType=TIMESTAMP} where pic_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.SwiperPicture">update yeshi_ec_swiper_banner_picture
    <set>
      <if test="bannerId != null">pic_banner_id=#{bannerId,jdbcType=BIGINT},</if>
      <if test="src != null">pic_src=#{src,jdbcType=VARCHAR},</if>
      <if test="jumpDetail != null">pic_jumpid=#{jumpDetail.id,jdbcType=BIGINT},</if>
      <if test="params != null">pic_params=#{params,jdbcType=VARCHAR},</if>
      <if test="jumpNeedLogin != null">pic_jump_need_login=#{jumpNeedLogin,jdbcType=VARCHAR},</if>
      <if test="order != null">pic_order=#{order,jdbcType=INTEGER},</if>
      <if test="remark != null">pic_remark=#{remark,jdbcType=VARCHAR},</if>
      <if test="state != null">pic_state=#{state,jdbcType=INTEGER},</if>
      <if test="autoControl != null">pic_auto_control=#{autoControl,jdbcType=INTEGER},</if>
      <if test="startTime != null">pic_start_time=#{startTime,jdbcType=TIMESTAMP},</if>
      <if test="endTime != null">pic_end_time=#{endTime,jdbcType=TIMESTAMP},</if>
      <if test="createtime != null">pic_createtime=#{createtime,jdbcType=TIMESTAMP},</if>
      <if test="updatetime != null">pic_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if>
    </set> where pic_id = #{id,jdbcType=BIGINT}
  </update>
   <select id="queryByBannerID" resultMap="BaseResultMap">
       SELECT *  FROM yeshi_ec_swiper_banner_picture p
       LEFT JOIN `yeshi_ec_action_jumpdetail_v2` j ON j.`jp_id` = p.`pic_jumpid`
       WHERE pic_banner_id = #{bannerId}
          ORDER BY pic_order
       LIMIT ${start},${count}
   </select>
   <select id="countQueryByBannerID" resultType="java.lang.Long">
        SELECT IFNULL(count(pic_id),0)  FROM yeshi_ec_swiper_banner_picture
        WHERE pic_banner_id = #{bannerId}
    </select>
      <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List">
        delete from yeshi_ec_swiper_banner_picture WHERE pic_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
    </delete>
    <delete id="deleteBatchByBannerID" parameterType="java.util.List">
        delete from yeshi_ec_swiper_banner_picture WHERE pic_banner_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
    </delete>
     <select id="queryByListPrimaryKey" parameterType="java.util.List" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />  FROM yeshi_ec_swiper_banner_picture
        WHERE pic_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
   </select>
    <select id="queryByListBannerID" parameterType="java.util.List" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />  FROM yeshi_ec_swiper_banner_picture
        WHERE pic_banner_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
   </select>
    <select id="getOrderByBannerID" resultMap="BaseResultMap">
        SELECT  <include refid="Base_Column_List" /> FROM yeshi_ec_swiper_banner_picture
        WHERE  pic_banner_id = #{bannerId}
        <if test="type == -1">
            <![CDATA[and pic_order < #{order}]]>
            order by pic_order desc
        </if>
        <if test="type == 1">
            <![CDATA[and pic_order > #{order} ]]>
            order by pic_order
        </if>
   </select>
    <select id="getMaxOrderByBannerID" resultType="java.lang.Integer">
        SELECT IFNULL(MAX(pic_order),0) FROM yeshi_ec_swiper_banner_picture
        WHERE pic_banner_id = #{bannerId}
   </select>
    <select id="getByBannerCard" resultMap="BaseResultMap">
        SELECT * FROM `yeshi_ec_swiper_banner` w
        LEFT JOIN  `yeshi_ec_swiper_banner_picture` p ON p.`pic_banner_id` = w.`sp_id`
        LEFT JOIN `yeshi_ec_action_jumpdetail_v2` j ON j.`jp_id` = p.`pic_jumpid`
        WHERE w.`sp_card` = #{card} AND w.`sp_state` = 0 AND p.`pic_state`= 0
            <![CDATA[AND IF(p.`pic_auto_control` = 1, p.`pic_start_time` <= NOW() AND p.`pic_end_time` >= NOW(),TRUE)]]>
        ORDER BY p.`pic_order`
   </select>
    <select id="getByBannerId" resultMap="BaseResultMap">
        SELECT * FROM `yeshi_ec_swiper_banner` w
        LEFT JOIN  `yeshi_ec_swiper_banner_picture` p ON p.`pic_banner_id` = w.`sp_id`
        LEFT JOIN `yeshi_ec_action_jumpdetail_v2` j ON j.`jp_id` = p.`pic_jumpid`
        WHERE w.`sp_id` = #{bannerId} AND w.`sp_state` = 0 AND p.`pic_state`= 0
            <![CDATA[AND IF(p.`pic_auto_control` = 1, p.`pic_start_time` <= NOW() AND p.`pic_end_time` >= NOW(),TRUE)]]>
        ORDER BY p.`pic_order`
   </select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeshi.fanli.dao.mybatis.homemodule.SwiperPictureMapper">
    <resultMap id="BaseResultMap"
        type="com.yeshi.fanli.entity.bus.homemodule.SwiperPicture">
        <id column="pic_id" property="id" jdbcType="BIGINT" />
        <result column="pic_banner_id" property="bannerId" jdbcType="BIGINT" />
        <result column="pic_src" property="src" jdbcType="VARCHAR" />
        <result column="pic_params" property="params" jdbcType="VARCHAR" />
        <result column="pic_jump_need_login" property="jumpNeedLogin"
            jdbcType="VARCHAR" />
        <result column="pic_order" property="order" jdbcType="INTEGER" />
        <result column="pic_remark" property="remark" jdbcType="VARCHAR" />
        <result column="pic_state" property="state" jdbcType="INTEGER" />
        <result column="pic_auto_control" property="autoControl"
            jdbcType="INTEGER" />
        <result column="pic_start_time" property="startTime" jdbcType="TIMESTAMP" />
        <result column="pic_end_time" property="endTime" jdbcType="TIMESTAMP" />
        <result column="pic_createtime" property="createtime" jdbcType="TIMESTAMP" />
        <result column="pic_updatetime" property="updatetime" jdbcType="TIMESTAMP" />
        <result column="pic_title" property="title" jdbcType="VARCHAR" />
        <result column="pic_desc" property="desc" jdbcType="VARCHAR" />
        <association property="jumpDetail" column="pic_jumpid"
            resultMap="com.yeshi.fanli.dao.mybatis.common.JumpDetailV2Mapper.BaseResultMap" />
    </resultMap>
    <sql id="Base_Column_List">pic_id,pic_banner_id,pic_src,pic_jumpid,pic_params,pic_jump_need_login,pic_order,pic_remark,pic_state,pic_auto_control,pic_start_time,pic_end_time,pic_createtime,pic_updatetime,pic_title,pic_desc
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_swiper_banner_picture where pic_id =
        #{id,jdbcType=BIGINT}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_swiper_banner_picture where pic_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.SwiperPicture"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_swiper_banner_picture
        (pic_id,pic_banner_id,pic_src,pic_jumpid,pic_params,pic_jump_need_login,pic_order,pic_remark,pic_state,pic_auto_control,pic_start_time,pic_end_time,pic_createtime,pic_updatetime,pic_title,pic_desc)
        values
        (#{id,jdbcType=BIGINT},#{bannerId,jdbcType=BIGINT},#{src,jdbcType=VARCHAR},#{jumpDetail.id,jdbcType=BIGINT},#{params,jdbcType=VARCHAR},#{jumpNeedLogin,jdbcType=VARCHAR},#{order,jdbcType=INTEGER},#{remark,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{autoControl,jdbcType=INTEGER},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP},#{title,jdbcType=VARCHAR},#{desc,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.SwiperPicture"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_swiper_banner_picture
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">pic_id,</if>
            <if test="bannerId != null">pic_banner_id,</if>
            <if test="src != null">pic_src,</if>
            <if test="jumpDetail != null">pic_jumpid,</if>
            <if test="params != null">pic_params,</if>
            <if test="jumpNeedLogin != null">pic_jump_need_login,</if>
            <if test="order != null">pic_order,</if>
            <if test="remark != null">pic_remark,</if>
            <if test="state != null">pic_state,</if>
            <if test="autoControl != null">pic_auto_control,</if>
            <if test="startTime != null">pic_start_time,</if>
            <if test="endTime != null">pic_end_time,</if>
            <if test="createtime != null">pic_createtime,</if>
            <if test="updatetime != null">pic_updatetime,</if>
            <if test="title != null">pic_title,</if>
            <if test="desc != null">pic_desc,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="bannerId != null">#{bannerId,jdbcType=BIGINT},</if>
            <if test="src != null">#{src,jdbcType=VARCHAR},</if>
            <if test="jumpDetail != null">#{jumpDetail.id,jdbcType=BIGINT},</if>
            <if test="params != null">#{params,jdbcType=VARCHAR},</if>
            <if test="jumpNeedLogin != null">#{jumpNeedLogin,jdbcType=VARCHAR},</if>
            <if test="order != null">#{order,jdbcType=INTEGER},</if>
            <if test="remark != null">#{remark,jdbcType=VARCHAR},</if>
            <if test="state != null">#{state,jdbcType=INTEGER},</if>
            <if test="autoControl != null">#{autoControl,jdbcType=INTEGER},</if>
            <if test="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if>
            <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if>
            <if test="createtime != null">#{createtime,jdbcType=TIMESTAMP},</if>
            <if test="updatetime != null">#{updatetime,jdbcType=TIMESTAMP},</if>
            <if test="title != null">#{title,jdbcType=VARCHAR},</if>
            <if test="desc != null">#{desc,jdbcType=VARCHAR},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.SwiperPicture">update
        yeshi_ec_swiper_banner_picture set pic_banner_id =
        #{bannerId,jdbcType=BIGINT},pic_src =
        #{src,jdbcType=VARCHAR},pic_jumpid =
        #{jumpDetail.id,jdbcType=BIGINT},pic_params =
        #{params,jdbcType=VARCHAR},pic_jump_need_login =
        #{jumpNeedLogin,jdbcType=VARCHAR},pic_order =
        #{order,jdbcType=INTEGER},pic_remark =
        #{remark,jdbcType=VARCHAR},pic_state =
        #{state,jdbcType=INTEGER},pic_auto_control =
        #{autoControl,jdbcType=INTEGER},pic_start_time =
        #{startTime,jdbcType=TIMESTAMP},pic_end_time =
        #{endTime,jdbcType=TIMESTAMP},pic_createtime =
        #{createtime,jdbcType=TIMESTAMP},pic_updatetime =
        #{updatetime,jdbcType=TIMESTAMP} ,pic_title =#{title,jdbcType=VARCHAR}
        ,pic_desc =#{desc,jdbcType=VARCHAR} where pic_id =
        #{id,jdbcType=BIGINT}</update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.SwiperPicture">
        update yeshi_ec_swiper_banner_picture
        <set>
            <if test="bannerId != null">pic_banner_id=#{bannerId,jdbcType=BIGINT},</if>
            <if test="src != null">pic_src=#{src,jdbcType=VARCHAR},</if>
            <if test="jumpDetail != null">pic_jumpid=#{jumpDetail.id,jdbcType=BIGINT},</if>
            <if test="params != null">pic_params=#{params,jdbcType=VARCHAR},</if>
            <if test="jumpNeedLogin != null">pic_jump_need_login=#{jumpNeedLogin,jdbcType=VARCHAR},
            </if>
            <if test="order != null">pic_order=#{order,jdbcType=INTEGER},</if>
            <if test="remark != null">pic_remark=#{remark,jdbcType=VARCHAR},</if>
            <if test="state != null">pic_state=#{state,jdbcType=INTEGER},</if>
            <if test="autoControl != null">pic_auto_control=#{autoControl,jdbcType=INTEGER},</if>
            <if test="startTime != null">pic_start_time=#{startTime,jdbcType=TIMESTAMP},</if>
            <if test="endTime != null">pic_end_time=#{endTime,jdbcType=TIMESTAMP},</if>
            <if test="createtime != null">pic_createtime=#{createtime,jdbcType=TIMESTAMP},</if>
            <if test="updatetime != null">pic_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if>
            <if test="title !=null">pic_title =#{title,jdbcType=VARCHAR},</if>
            <if test="desc !=null">pic_desc =#{desc,jdbcType=VARCHAR},</if>
        </set>
        where pic_id = #{id,jdbcType=BIGINT}
    </update>
    <select id="queryByBannerID" resultMap="BaseResultMap">SELECT * FROM
        yeshi_ec_swiper_banner_picture p LEFT JOIN
        `yeshi_ec_action_jumpdetail_v2` j ON j.`jp_id` = p.`pic_jumpid` WHERE
        pic_banner_id = #{bannerId} ORDER BY pic_order LIMIT ${start},${count}
    </select>
    <select id="countQueryByBannerID" resultType="java.lang.Long">SELECT
        IFNULL(count(pic_id),0) FROM yeshi_ec_swiper_banner_picture WHERE
        pic_banner_id = #{bannerId}</select>
    <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List">
        delete from yeshi_ec_swiper_banner_picture WHERE pic_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
    </delete>
    <delete id="deleteBatchByBannerID" parameterType="java.util.List">
        delete from yeshi_ec_swiper_banner_picture WHERE pic_banner_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
    </delete>
    <select id="queryByListPrimaryKey" parameterType="java.util.List"
        resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List" />
        FROM yeshi_ec_swiper_banner_picture WHERE pic_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
    </select>
    <select id="queryByListBannerID" parameterType="java.util.List"
        resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List" />
        FROM yeshi_ec_swiper_banner_picture WHERE pic_banner_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
    </select>
    <select id="getOrderByBannerID" resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List" />
        FROM yeshi_ec_swiper_banner_picture WHERE pic_banner_id = #{bannerId}
        <if test="type == -1"> <![CDATA[and pic_order < #{order}]]>
            order by pic_order desc
        </if>
        <if test="type == 1"> <![CDATA[and pic_order > #{order} ]]>
            order by pic_order
        </if>
    </select>
    <select id="getMaxOrderByBannerID" resultType="java.lang.Integer">SELECT
        IFNULL(MAX(pic_order),0) FROM yeshi_ec_swiper_banner_picture WHERE
        pic_banner_id = #{bannerId}</select>
    <select id="getByBannerCard" resultMap="BaseResultMap">SELECT
        * FROM `yeshi_ec_swiper_banner` w LEFT JOIN
        `yeshi_ec_swiper_banner_picture` p ON p.`pic_banner_id` = w.`sp_id`
        LEFT JOIN `yeshi_ec_action_jumpdetail_v2` j ON j.`jp_id` =
        p.`pic_jumpid` WHERE w.`sp_card` = #{card} AND w.`sp_state` = 0 AND
        p.`pic_state`= 0<![CDATA[AND IF(p.`pic_auto_control` = 1, p.`pic_start_time` <= NOW() AND p.`pic_end_time` >= NOW(),TRUE)]]>
        ORDER BY p.`pic_order`
    </select>
    <select id="getByBannerId" resultMap="BaseResultMap">SELECT
        * FROM `yeshi_ec_swiper_banner` w LEFT JOIN
        `yeshi_ec_swiper_banner_picture` p ON p.`pic_banner_id` = w.`sp_id`
        LEFT JOIN `yeshi_ec_action_jumpdetail_v2` j ON j.`jp_id` =
        p.`pic_jumpid` WHERE w.`sp_id` = #{bannerId} AND w.`sp_state` = 0 AND
        p.`pic_state`= 0<![CDATA[AND IF(p.`pic_auto_control` = 1, p.`pic_start_time` <= NOW() AND p.`pic_end_time` >= NOW(),TRUE)]]>
        ORDER BY p.`pic_order`
    </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/GiveVIPApplyInfoServiceImpl.java
@@ -190,7 +190,7 @@
    @Override
    public List<GiveVIPApplyInfo> listBySourceUid(Long uid, int page, int pageSize) {
        return giveVIPApplyInfoDao.listBySourceUid(uid, null, (page - 1) * pageSize, 1);
        return giveVIPApplyInfoDao.listBySourceUid(uid, null, (page - 1) * pageSize, pageSize);
    }
    @Override
fanli/src/main/java/com/yeshi/fanli/service/manger/goods/ConvertLinkManager.java
@@ -254,6 +254,10 @@
                    TaoKeOfficialActivityConvertResultDTO dto = TaoKeApiUtil.officialActivityConvert(adzoneId,
                            activityid, relationId);
                    String link = dto.getShort_click_url();
                    if (StringUtil.isNullOrEmpty(link)) {
                        link = dto.getClick_url();
                    }
                    String token = TaoKeApiUtil.getTKToken("http://", "淘宝官方活动", link);
                    newText = newText.replace(st, TaoBaoUtil.filterTaoToken(token));
                }
fanli/src/main/java/com/yeshi/fanli/util/FilePathEnum.java
@@ -13,6 +13,7 @@
    shareXCX("/user/img/sharegoods_xcx/", "分享小程序图片"),
    vipApply("/usr/img/vip/apply/","会员申请用户上传图片"),
    elmeShare("/usr/img/elme/share/","饿了么分享图生成"),
    activityShare("/usr/img/activity/share/","活动分享图生成"),
    // 编辑相关
    apk("/editor/apk/", "上传Apk安装包"), // -- /img/admin/
    section("/editor/upload_imgs/", "后台上传图片路径"), // -- /img/admin/
fanli/src/main/java/com/yeshi/fanli/util/ImageUtil.java
@@ -2484,4 +2484,95 @@
        return null;
    }
    public static InputStream drawActivityShareImg(InputStream banner, float bannerRate, String title, String desc,
            InputStream erCode) {
        // 计算高度
        int width = 750;
        int height = 116;
        int bannerWidth = 640;
        int bannerHeight = (int) (bannerWidth / bannerRate);
        height += bannerHeight;
        height += 524;
        try {
            final BufferedImage targetImg = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
            HashMap<Key, Object> mapH = new HashMap<Key, Object>();
            mapH.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);// 抗锯齿 (抗锯齿总开关)  
            mapH.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_GASP);// 文字抗锯齿 
            final Graphics2D g2d = (Graphics2D) targetImg.getGraphics();
            g2d.setRenderingHints(mapH);
            g2d.setColor(Color.decode("#FF6940"));
            g2d.fillRect(0, 0, width, height);
            // 画logo
            g2d.drawImage(zoomInImage(
                    ImageIO.read(ImageUtil.class.getClassLoader().getResource("image/activityShare/icon_logo.png")), 59,
                    59), 346, 17, null);
            // 画banner背景
            g2d.setColor(Color.decode("#FFFFFF"));
            g2d.fillRect(30, 94, 692, bannerHeight + 22);
            // 画banner
            g2d.drawImage(roundImage( zoomInImage(ImageIO.read(banner), bannerWidth, bannerHeight),20), 55, 116, null);
            // 画二维码背景
            g2d.drawImage(
                    ImageIO.read(
                            ImageUtil.class.getClassLoader().getResource("image/activityShare/qrcode_content_bg.png")),
                    27, bannerHeight + 116, null);
            // 画二维码
            g2d.drawImage(zoomInImage(ImageIO.read(erCode), 230, 230), 260, 116 + bannerHeight + 171, null);
            // 画文字
            g2d.setColor(Color.decode("#F03143"));
            String fontBoldPath = "/usr/share/fonts/yahei_bold.ttf";
            String os = System.getProperty("os.name");
            if (os.toLowerCase().startsWith("win")) {
                fontBoldPath = "C:/Users/Administrator/Desktop/fonts/yahei_bold.ttf";
            }
            String fontPath = "/usr/share/fonts/yahei.ttf";
            if (os.toLowerCase().startsWith("win")) {
                fontPath = "C:/Users/Administrator/Desktop/fonts/yahei.ttf";
            }
            Font boldFont = Font.createFont(Font.PLAIN, new File(fontBoldPath)).deriveFont(48.0f);
            g2d.setFont(boldFont);
            FontMetrics fm = g2d.getFontMetrics(boldFont);
            int textLength = fm.stringWidth(title);
            g2d.drawString(title, (width - textLength) / 2, 116 + bannerHeight + 50 + 45);
            textLength = fm.stringWidth(desc);
            g2d.drawString(desc, (width - textLength) / 2, 116 + bannerHeight + 50 + 50 + 45);
            Font font = Font.createFont(Font.PLAIN, new File(fontPath)).deriveFont(24.0f);
            g2d.setFont(font);
            g2d.setColor(Color.decode("#666666"));
            fm = g2d.getFontMetrics(font);
            textLength = fm.stringWidth("长按识别二维码 查看详情");
            g2d.drawString("长按识别二维码 查看详情", (width - textLength) / 2, 116 + bannerHeight + 428+10);
            g2d.dispose();
            ByteArrayOutputStream aos = new ByteArrayOutputStream();
            ImageIO.write(targetImg, "JPEG", aos);
            return new ByteArrayInputStream(aos.toByteArray());
        } catch (Exception e) {
            e.printStackTrace();
            try {
                LogHelper.errorDetailInfo(e);
            } catch (Exception e1) {
                e1.printStackTrace();
            }
        }
        return null;
    }
}
fanli/src/main/java/com/yeshi/fanli/util/factory/user/vip/GiveVIPApplyInfoRecordVOFactory.java
@@ -9,10 +9,9 @@
        GiveVIPApplyInfoRecordVO vo = new GiveVIPApplyInfoRecordVO();
        vo.setCreateTime(info.getCreateTime());
        vo.setLevel(info.getLevel());
        if (info.getState() == GiveVIPApplyInfo.STATE_NO_INFO)
            vo.setLink(uploadInfoLink.replace("[ID]", info.getId()));
        else
            vo.setLink(vipLink);
        vo.setLink(uploadInfoLink.replace("[ID]", info.getId()));
        if (info.getState() == GiveVIPApplyInfo.STATE_REJECT)
            vo.setRejectReson(info.getRejectReson());
        vo.setState(info.getState());
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/order/OrderMessageListener.java
New file
@@ -0,0 +1,74 @@
package com.yeshi.fanli.util.rocketmq.consumer.order;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import com.aliyun.openservices.ons.api.Action;
import com.aliyun.openservices.ons.api.ConsumeContext;
import com.aliyun.openservices.ons.api.Message;
import com.aliyun.openservices.ons.api.MessageListener;
import com.aliyun.openservices.ons.api.Producer;
import com.yeshi.fanli.dto.mq.order.OrderTopicTagEnum;
import com.yeshi.fanli.dto.mq.order.body.OrderMoneyRecievedMQMsg;
import com.yeshi.fanli.entity.bus.user.HongBaoV2;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.hongbao.HongBaoV2SettleTempService;
import com.yeshi.fanli.service.inter.order.HongBaoOrderService;
import com.yeshi.fanli.service.inter.order.HongBaoV2Service;
import com.yeshi.fanli.util.rocketmq.MQTopicName;
/**
 * 订单到账消费
 *
 * @author Administrator
 *
 */
@Component
public class OrderMessageListener implements MessageListener {
    @Resource
    private HongBaoV2SettleTempService hongBaoV2SettleTempService;
    @Resource
    private HongBaoV2Service hongBaoV2Service;
    @Resource
    private HongBaoOrderService hongBaoOrderService;
    @Resource
    private Producer producer;
    private int getHongBaoType(int type) {
        switch (type) {
        case HongBaoV2.TYPE_YIJI:
        case HongBaoV2.TYPE_ERJI:
        case HongBaoV2.TYPE_SHARE_YIJI:
        case HongBaoV2.TYPE_SHARE_ERJI:
            return OrderMoneyRecievedMQMsg.TYPE_INVITE;
        case HongBaoV2.TYPE_SHARE_GOODS:
            return OrderMoneyRecievedMQMsg.TYPE_SHARE;
        case HongBaoV2.TYPE_ZIGOU:
            return OrderMoneyRecievedMQMsg.TYPE_ZIGOU;
        }
        return 0;
    }
    @Override
    public Action consume(Message message, ConsumeContext context) {
        LogHelper.mqInfo("consumer:OrderMessageListener", message.getMsgID(), message.getTopic(), message.getTag(),
                new String(message.getBody()));
        if (MQTopicName.TOPIC_ORDER.name().equalsIgnoreCase(message.getTopic())) {
            if (OrderTopicTagEnum.taoBaoOrderWeiQuan.name().equalsIgnoreCase(message.getTag())) {
                String key = message.getKey();
                // 订单维权
                //TODO 维权增加
                return Action.CommitMessage;
            }
        }
        return Action.CommitMessage;
    }
}