yujian
2020-01-08 b1d0eae0b98ca29089b30ab62e2c34606a6b304a
Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div
19个文件已添加
40个文件已修改
1 文件已重命名
1个文件已删除
1926 ■■■■ 已修改文件
fanli/pom.xml 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/aspect/AdminLoginAspect.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/aspect/WXMPSignValidateAspect.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/goods/ConvertLinkController.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/apph5/AppH5HelpCenterController.java 92 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserAccountController.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserInfoController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/DynamicController.java 208 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/GoodsController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/RecommendController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/UserMsgController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/dynamic/WXMPDynamicInfoDao.java 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/elastic/ESOrderDao.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/goods/jd/NYouHuiGoodsDao.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/order/OrderSearchIndexMapper.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/common/JumpDetailV2.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/dynamic/WXMPDynamicInfo.java 127 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/goods/jd/NYouHuiGoods.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/taobao/dataoke/DaTaoKeDetailV2.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/dynamic/WXMPDynamicInfoException.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/DynamicInfoJob.java 206 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/ElasticSearchJob.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/TaoLiJinJob.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/TestJob.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/common/JumpDetailV2Mapper.xml 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/order/OrderSearchIndexMapper.xml 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/WXMPDynamicInfoServiceImpl.java 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/jd/NYouHuiServiceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/help/HelpCenterServiceImpl.java 109 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/ESOrderServiceImpl.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/dataoke/DaTaoKeGoodsDetailV2ServiceImpl.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/QrCodeServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountServiceImpl.java 165 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/dynamic/WXMPDynamicInfoService.java 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/jd/NYouHuiService.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/order/ESOrderService.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserAccountService.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/manger/goods/ConvertLinkManager.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/Constant.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/FilePathEnum.java 66 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/JumpDetailUtil.java 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/jd/JDApiUtil.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/wx/WXLoginUtil.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/elasticsearch.properties 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/elasticsearch.xml 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-sandbox/constant.properties 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-sandbox/cos.properties 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-sandbox/mongo.properties 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-sandbox/redis.properties 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-sandbox/rocketmq.properties 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-sandbox/rocketmq.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-sandbox/xxl-job.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/spring.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/test/java/org/fanli/TaoKeTest.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/test/java/org/fanli/config/Test_UserOrderWeiQuanRecordService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/test/java/org/fanli/elastic/Test_Query.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pom.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/src/main/java/org/yeshi/utils/JsonUtil.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/pom.xml
@@ -220,6 +220,15 @@
            </properties>
        </profile>
        <profile>
            <!-- 沙箱 -->
            <id>env-sandbox</id>
            <properties>
                <profiles.active>env-sandbox</profiles.active>
            </properties>
        </profile>
    </profiles>
fanli/src/main/java/com/yeshi/fanli/aspect/AdminLoginAspect.java
File was renamed from fanli/src/main/java/com/yeshi/fanli/aspect/LoginAspect.java
@@ -30,12 +30,12 @@
@Component
@Aspect
public class LoginAspect {
public class AdminLoginAspect {
    @Resource
    private AdminUserService adminUserService;
    @Around("execution(public * com.yeshi.fanli.controller.admin.*.*(..))")
    @Around("execution(public * com.yeshi.fanli.controller.admin..*.*(..))")
    public Object verifyLoginState(ProceedingJoinPoint joinPoint) throws IOException {
        Signature signature = joinPoint.getSignature();
fanli/src/main/java/com/yeshi/fanli/aspect/WXMPSignValidateAspect.java
@@ -14,13 +14,11 @@
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.yeshi.utils.JsonUtil;
import com.yeshi.fanli.dto.WXMPAcceptData;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
@@ -34,11 +32,11 @@
 * @author Administrator
 *
 */
@Component
//@Component
@Aspect
@Order(2)
public class WXMPSignValidateAspect {
    public static final String EDP = "execution(* com.yeshi.fanli.controller.wxmp.*.*.*(..))";
    public static final String EDP = "execution(* com.yeshi.fanli.controller.wxmp..*.*(..))";
    public static String KEY = "";
fanli/src/main/java/com/yeshi/fanli/controller/admin/goods/ConvertLinkController.java
New file
@@ -0,0 +1,51 @@
package com.yeshi.fanli.controller.admin.goods;
import java.io.PrintWriter;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.StringUtil;
import com.yeshi.fanli.service.manger.goods.ConvertLinkManager;
@Controller
@RequestMapping("admin/new/api/v1/convertLink")
public class ConvertLinkController {
    @Resource
    private ConvertLinkManager convertLinkManager;
    @RequestMapping(value = "convertLink")
    public void convertLink(String callback, String uid, String content, Boolean share, PrintWriter out) {
        if (StringUtil.isNullOrEmpty(uid)) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请上传用户ID"));
            return;
        }
        if (StringUtil.isNullOrEmpty(content)) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请上传文本内容"));
            return;
        }
        if (share == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择是分享还是自购"));
            return;
        }
        String result = null;
        try {
            result = convertLinkManager.convertLinkFromText(content, Long.parseLong(uid), share);
        } catch (NumberFormatException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户ID转换出错"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMessage()));
            return;
        }
        JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(result));
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/apph5/AppH5HelpCenterController.java
@@ -32,18 +32,16 @@
    @Resource
    private HelpCenterService helpCenterService;
    @Resource
    private HelpClassService helpClassService;
    @Resource
    private AppVersionService appVersionService;
    @Resource
    private AdActivityVersionControlService adActivityVersionControlService;
    /**
     * 查询帮助列表
     * @param callback
@@ -53,41 +51,42 @@
     * @param out
     */
    @RequestMapping(value = "query")
    public void query(String callback,AcceptData acceptData, Long pageId, Integer pageSize, String key,    Long cid,
    public void query(String callback, AcceptData acceptData, Long pageId, Integer pageSize, String key, Long cid,
            PrintWriter out) {
        try {
            if (pageSize == null)
            if (pageSize == null)
                pageSize = Constant.PAGE_SIZE;
            if (cid != null && cid == 0)
                cid = null; // 查询全部
            if (!StringUtil.isNullOrEmpty(key))
            if (!StringUtil.isNullOrEmpty(key))
                key = key.trim();
            if (pageId == null)
                pageId = 0L;
            List<HelpCenter> resultList = new ArrayList<>();
            List<HelpCenter> list = helpCenterService.listValid(pageId, pageSize, key, cid);
            if (list == null || list.size() == 0) {
            List<HelpCenter> list1 = helpCenterService.listValid(pageId, pageSize, key, cid);
            List<HelpCenter> list = new ArrayList<>();
            if (list1 != null && list1.size() > 0)
                list.addAll(list1);
            if (list.size() == 0) {
                pageId = 0L;
            } else {
                // 添加列表
                resultList.addAll(list);
                pageId = resultList.get(resultList.size()-1).getId();
                pageId = list.get(list.size() - 1).getId();
                // 版本过滤
                int version = Integer.parseInt(acceptData.getVersion());
                String platform = acceptData.getPlatform().toLowerCase();
                List<AppVersionInfo> versionList = appVersionService.listByPlatformAndMinVersionCode(platform,version);
                List<AppVersionInfo> versionList = appVersionService.listByPlatformAndMinVersionCode(platform, version);
                if (versionList == null || versionList.size() <= 0) {
                    resultList.clear();
                    list.clear();
                } else {
                    List<Long> sourceIdList = new ArrayList<>();
                    for (HelpCenter record : resultList) {
                    for (HelpCenter record : list) {
                        sourceIdList.add(record.getId());
                    }
                    List<Long> versionIdList = new ArrayList<>();
@@ -96,25 +95,24 @@
                    Set<Long> sets = adActivityVersionControlService.filterSourceIdByVersion(sourceIdList,
                            AdActivityType.helpCenter, versionIdList);
                    for (int i = 0; i < resultList.size(); i++) {
                        if (!sets.contains(resultList.get(i).getId())) {
                            resultList.remove(i--);
                    for (int i = 0; i < list.size(); i++) {
                        if (!sets.contains(list.get(i).getId())) {
                            list.remove(i--);
                        }
                    }
                }
            }
            JSONObject data = new JSONObject();
            data.put("pageId", pageId);
            data.put("result_list", JsonUtil.getApiCommonGson().toJson(resultList));
            data.put("result_list", JsonUtil.getApiCommonGson().toJson(list));
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
            e.printStackTrace();
        }
    }
    /**
     * 获取帮助详情
     * @param callback
@@ -122,7 +120,7 @@
     * @param out
     */
    @RequestMapping(value = "getInfo")
    public void getInfo(String callback, Long id, PrintWriter out){
    public void getInfo(String callback, Long id, PrintWriter out) {
        try {
            if (id == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该内容不存在"));
@@ -133,16 +131,16 @@
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该内容已不存在"));
                return;
            }
            String html = null;
            HelpInfo helpInfo = helpCenterService.getHelpInfoCache(id);
            if (helpInfo != null) {
                html = helpInfo.getHtml();
            }
            JSONObject data = new JSONObject();
            data.put("id",crrent.getId());
            data.put("title",crrent.getTitle());
            data.put("id", crrent.getId());
            data.put("title", crrent.getTitle());
            data.put("html", html);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
@@ -150,8 +148,7 @@
            e.printStackTrace();
        }
    }
    /**
     * 查询启用的分类
     * @param callback
@@ -161,16 +158,16 @@
    public void getClass(String callback, AcceptData acceptData, PrintWriter out) {
        try {
            List<HelpClass> resultList = new ArrayList<>();
            List<HelpClass> list = helpClassService.getClassByState(1);
            if (list != null && list.size() > 0) {
                resultList.addAll(list);
            }
            // 版本过滤
            int version = Integer.parseInt(acceptData.getVersion());
            String platform = acceptData.getPlatform().toLowerCase();
            List<AppVersionInfo> versionList = appVersionService.listByPlatformAndMinVersionCode(platform,version);
            List<AppVersionInfo> versionList = appVersionService.listByPlatformAndMinVersionCode(platform, version);
            if (versionList == null || versionList.size() <= 0) {
                resultList.clear();
            } else {
@@ -183,10 +180,11 @@
                    versionIdList.add(versionInfo.getId());
                Set<Long> sets = adActivityVersionControlService.filterSourceIdByVersion(sourceIdList,
                        AdActivityType.helpClass, versionIdList);
                for (int i = 0; i < resultList.size(); i++) {
                    if (!sets.contains(resultList.get(i).getId())) {
                        resultList.remove(i--);
                for (int i = 0; i < list.size(); i++) {
                    if (!sets.contains(list.get(i).getId())) {
                        list.remove(i--);
                    }
                }
            }
@@ -199,5 +197,5 @@
            e.printStackTrace();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserAccountController.java
@@ -356,39 +356,6 @@
        }
    }
    /**
     * 账号打通
     *
     * @param acceptData
     * @param mainUid
     * @param lessUid
     * @param session
     * @param out
     */
    @RequestMapping(value = "connect")
    public void connect(AcceptData acceptData, long mainUid, long lessUid, HttpSession session, PrintWriter out) {
        BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
                acceptData.getPackages());
        if (system == null) {
            out.print(JsonUtil.loadFalseResult("系统不存在"));
            return;
        }
        if (mainUid == 0 || lessUid == 0) {
            out.print(JsonUtil.loadFalseResult(1, "请上传打通用户ID"));
            return;
        }
        try {
            userAccountService.connectUsers(new UserInfo(mainUid), new UserInfo(lessUid));
            UserInfo user = userInfoService.getUserByIdWithMybatis(mainUid);
            JSONObject data = new JSONObject();
            data.put("user", GsonUtil.toJsonExpose(UserUtil.filterForClientUser(user)));
            out.print(JsonUtil.loadTrueResult(data));
        } catch (UserAccountException e) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
        }
    }
    /**
     * 获取用户ID
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserInfoController.java
@@ -435,7 +435,7 @@
                form.setWxName(xinUser.getNickname());
                String wxHeadImg = COSManager.getInstance()
                        .uploadFile(HttpUtil.getAsInputStream(xinUser.getHeadimgurl()),
                                Constant.WXHEADURL + UUID.randomUUID().toString())
                                FilePathEnum.userPortrait + UUID.randomUUID().toString())
                        .getUrl();
                form.setWxPic(wxHeadImg);
            } else if (formLoginType == Constant.TAOBAO) {
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java
@@ -160,7 +160,7 @@
        // 2.0.6版本增加 学院栏目
        if (VersionUtil.greaterThan_2_0_6(acceptData.getPlatform(), acceptData.getVersion())) {
            list.add(menu6);
            //list.add(menu6);
        }
        list.add(menu4);
fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/DynamicController.java
New file
@@ -0,0 +1,208 @@
package com.yeshi.fanli.controller.wxmp.v1;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.StringUtil;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.yeshi.fanli.dto.WXMPAcceptData;
import com.yeshi.fanli.entity.bus.homemodule.Special;
import com.yeshi.fanli.entity.bus.homemodule.SpecialLabel;
import com.yeshi.fanli.entity.common.JumpDetailV2;
import com.yeshi.fanli.entity.dynamic.GoodsPicture;
import com.yeshi.fanli.entity.dynamic.WXMPDynamicInfo;
import com.yeshi.fanli.exception.dynamic.WXMPDynamicInfoException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.dynamic.WXMPDynamicInfoService;
import com.yeshi.fanli.service.inter.homemodule.SpecialService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.JumpDetailUtil;
import com.yeshi.fanli.util.jd.JDApiUtil;
import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
import net.sf.json.JSONObject;
@Controller("WXMPDynamicController")
@RequestMapping("/wxmp/api/v1/dynamic")
public class DynamicController {
    @Resource
    private WXMPDynamicInfoService wxmpDynamicInfoService;
    @Resource
    private SpecialService specialService;
    /**
     * 首页专题
     *
     * @param acceptData
     * @param uid
     * @param out
     */
    @RequestMapping(value = "getHotList")
    public void getHotList(WXMPAcceptData acceptData, int page, PrintWriter out) {
        List<WXMPDynamicInfo> infoList = wxmpDynamicInfoService.listDynamicInfo(page, Constant.PAGE_SIZE);
        for (WXMPDynamicInfo info : infoList) {
            if (info.getImgs() != null)
                for (GoodsPicture goodsPicture : info.getImgs()) {
                    JSONObject params = new JSONObject();
                    if (goodsPicture.getGoodsVO() != null && goodsPicture.getJumpDetail() != null) {
                        params.put("id", goodsPicture.getGoodsVO().getGoodsId());
                        goodsPicture.setJumpDetail(null);
                        goodsPicture.getGoodsVO().setImgList(null);
                        goodsPicture.getGoodsVO().setShopInfo(null);
                        goodsPicture.getGoodsVO().setCouponInfoList(null);
                    }
                }
        }
        long count = wxmpDynamicInfoService.countDynamicInfo();
        Gson gson = JsonUtil.getConvertDateToShortNameBuilder(JsonUtil
                .getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder().excludeFieldsWithoutExposeAnnotation()))
                .create();
        try {
            JSONObject data = new JSONObject();
            data.put("list", gson.toJson(infoList));
            data.put("count", count);
            out.print(JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult(1, "获取数据失败"));
            try {
                LogHelper.errorDetailInfo(e);
            } catch (Exception e1) {
                e1.printStackTrace();
            }
        }
    }
    @RequestMapping(value = "copyText")
    public void copyText(WXMPAcceptData acceptData, String id, Long uid, PrintWriter out) {
        if (uid == null) {
            out.print(JsonUtil.loadFalseResult("用户未登录"));
            return;
        }
        if (StringUtil.isNullOrEmpty(id)) {
            out.print(JsonUtil.loadFalseResult("商品ID未空"));
            return;
        }
        try {
            String content = wxmpDynamicInfoService.copyContent(id, uid);
            JSONObject data = new JSONObject();
            data.put("content", content);
            out.print(JsonUtil.loadTrueResult(data));
        } catch (WXMPDynamicInfoException e) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMessage()));
        }
    }
    @RequestMapping(value = "getActivityList")
    public void getActivityList(WXMPAcceptData acceptData, int page, PrintWriter out) {
        // 平台区分
        int platformCode = Constant.getPlatformCode(acceptData.getPlatform());
        List<String> listKey = new ArrayList<String>();
        listKey.add("special_channel_jd");
        listKey.add("special_channel_pdd");
        List<Special> list = specialService.listByPlaceKeyHasLabel((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE,
                listKey, platformCode, Integer.parseInt(acceptData.getVersion()));
        long time = System.currentTimeMillis();
        // 删除尚未启用的过期的
        for (int i = 0; i < list.size(); i++) {
            Special special = list.get(i);
            if (special.getJumpDetail() != null) {
                special.setJumpDetail(JumpDetailUtil.getWXMPJumDetail(special.getJumpDetail()));
            }
            if (special.getState() == 1L) {
                list.remove(i--);
            } else {
                if (special.getStartTime() != null && special.getEndTime() != null)
                    special.setTimeTask(true);
                else
                    special.setTimeTask(false);
                if (special.isTimeTask()) {
                    if (time < special.getStartTime().getTime() || time > special.getEndTime().getTime()) {
                        list.remove(i--);
                    } else// 设置倒计时
                    {
                        special.setCountDownTime((special.getEndTime().getTime() - time) / 1000);
                    }
                }
                List<SpecialLabel> listLabels = special.getListLabels();
                if (listLabels != null && !listLabels.isEmpty()) {
                    List<ClientTextStyleVO> labels = new ArrayList<>();
                    for (SpecialLabel specialLabel : listLabels) {
                        labels.add(new ClientTextStyleVO(specialLabel.getName(), specialLabel.getBgColor()));
                    }
                    special.setLabels(labels);
                }
            }
        }
        long count = specialService.countByPlaceKeyList(listKey, platformCode,
                Integer.parseInt(acceptData.getVersion()));
        GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
        Gson gson = gsonBuilder.create();
        JSONObject data = new JSONObject();
        data.put("count", count);
        data.put("list", gson.toJson(list));
        out.print(JsonUtil.loadTrueResult(data));
    }
    @RequestMapping(value = "getActivityDetail")
    public void getActivityDetail(WXMPAcceptData acceptData, Long uid, Long id, PrintWriter out) {
        if (uid == null)
            out.print(JsonUtil.loadFalseResult("用户未登录"));
        if (id == null)
            out.print(JsonUtil.loadFalseResult("活动ID为空"));
        Special special = specialService.selectByPrimaryKey(id);
        if (special == null) {
            out.print(JsonUtil.loadFalseResult("专题不存在"));
            return;
        }
        JumpDetailV2 jumpDetail = special.getJumpDetail();
        jumpDetail.setActivity(null);
        jumpDetail.setController(null);
        String params = special.getParams();
        if (jumpDetail.getType().equalsIgnoreCase("jd")) {// 京东的专题活动
            JSONObject paramsJson = JSONObject.fromObject(params);
            // 京东转链
            String url = paramsJson.optString("url");
            String link = JDApiUtil.convertLinkWithSubUnionId(url, null, JDApiUtil.POSITION_FANLI + "", uid + "");
            if (StringUtil.isNullOrEmpty(link)) {
                out.print(JsonUtil.loadFalseResult("转链失败"));
                return;
            }
            paramsJson.put("url", link);
            params = paramsJson.toString();
        }
        JSONObject data = new JSONObject();
        GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
        Gson gson = gsonBuilder.create();
        data.put("jumpDetail", gson.toJson(jumpDetail));
        data.put("params", params);
        out.print(JsonUtil.loadTrueResult(data));
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/GoodsController.java
@@ -184,7 +184,7 @@
                if (StringUtil.isNullOrEmpty(swiper.getParams())) {
                    params = JSONObject.fromObject(swiper.getParams());
                }
                swiper.setJumpDetail(JumpDetailUtil.getWXMPJumDetail(swiper.getJumpDetail(), params));
                swiper.setJumpDetail(JumpDetailUtil.getWXMPJumDetail(swiper.getJumpDetail()));
                swiper.setParams(null);
            }
            data.put("bannerList", JsonUtil.getApiCommonGson().toJson(picList));
@@ -823,7 +823,7 @@
        String scene = goodsType+"#"+goodsId+"#" + inviteCode;
        FileUploadResult uploadResult = null;
        if (type == 1) {
            String erCodeUrl = "https://wxmp.banliapp.com/goods?info="+ scene;
            String erCodeUrl = "https://wxmp.banliapp.com/goods?i="+ scene;
            uploadResult = qrCodeService.drawGoodsPoster(erCodeUrl, user.getPortrait(), goods);
        } else {
            String acessToken = WXUtil.getAcessToken(Constant.WXMP_APP_INFO.getAppId(), Constant.WXMP_APP_INFO.getAppSecret());
fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/RecommendController.java
@@ -136,7 +136,7 @@
                if (StringUtil.isNullOrEmpty(swiper.getParams())) {
                    params = JSONObject.fromObject(swiper.getParams());
                }
                swiper.setJumpDetail(JumpDetailUtil.getWXMPJumDetail(swiper.getJumpDetail(), params));
                swiper.setJumpDetail(JumpDetailUtil.getWXMPJumDetail(swiper.getJumpDetail()));
                swiper.setParams(null);
            }
@@ -156,7 +156,7 @@
                    params = JSONObject.fromObject(special.getParams());
                }
                
                special.setJumpDetail(JumpDetailUtil.getWXMPJumDetail(jumpDetail, params));
                special.setJumpDetail(JumpDetailUtil.getWXMPJumDetail(jumpDetail));
                special.setParams(null);
            }
@@ -171,7 +171,7 @@
                if (StringUtil.isNullOrEmpty(swiper.getParams())) {
                    params = JSONObject.fromObject(swiper.getParams());
                }
                swiper.setJumpDetail(JumpDetailUtil.getWXMPJumDetail(swiper.getJumpDetail(), params));
                swiper.setJumpDetail(JumpDetailUtil.getWXMPJumDetail(swiper.getJumpDetail()));
                swiper.setParams(null);
            }
fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/UserMsgController.java
@@ -146,7 +146,7 @@
                if (StringUtil.isNullOrEmpty(zhuShouMsg.getParams())) {
                    params = JSONObject.fromObject(zhuShouMsg.getParams());
                }
                JumpDetailV2 wxmpJumDetail = JumpDetailUtil.getWXMPJumDetail(zhuShouMsg.getJumpDetail(), params);
                JumpDetailV2 wxmpJumDetail = JumpDetailUtil.getWXMPJumDetail(zhuShouMsg.getJumpDetail());
                
                commonMsgList.add(new UserCommonMsgVO(zhuShouMsg.getIcon(), zhuShouMsg.getTitle(),
                        zhuShouMsg.getUpdateTime(), UserCommonMsgVO.TYPE_ZHUSHOU, zhuShouMsg.getContent(), read,
@@ -168,7 +168,7 @@
                    if (detail.getType() == MsgTypeOrderTypeEnum.share || detail.getType() == MsgTypeOrderTypeEnum.invite)
                        params.put("orderHideNo", UserUtil.filterOrderId(detail.getOrderId()));
                    
                    JumpDetailV2 wxmpJumDetail = JumpDetailUtil.getWXMPJumDetail(jumpDetailV2Service.getByTypeCache("order_search"), params);
                    JumpDetailV2 wxmpJumDetail = JumpDetailUtil.getWXMPJumDetail(jumpDetailV2Service.getByTypeCache("order_search"));
                    
                    UserMsgVO userMsgVO = UserMsgVOFactory.create(detail, wxmpJumDetail, params);
                    userMsgVO.setType(MSG_TYPE_ORDER);
@@ -248,7 +248,7 @@
                // TODO 跳转地址 
                JSONObject params = new JSONObject();
                params.put("url", "http://apph5.yeshitv.com/special/1.0.9/jingXuanN_9.html?type=9_9");
                JumpDetailV2 wxmpJumDetail = JumpDetailUtil.getWXMPJumDetail(jumpDetailV2Service.getByTypeCache("web"), params);
                JumpDetailV2 wxmpJumDetail = JumpDetailUtil.getWXMPJumDetail(jumpDetailV2Service.getByTypeCache("web"));
                userSystemMsgVO.setJumpDetail(wxmpJumDetail);
                
                root.put("systemMsg", userSystemMsgVO);
fanli/src/main/java/com/yeshi/fanli/dao/dynamic/WXMPDynamicInfoDao.java
New file
@@ -0,0 +1,82 @@
package com.yeshi.fanli.dao.dynamic;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.data.domain.Sort.Order;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.Update;
import org.springframework.stereotype.Repository;
import com.yeshi.fanli.dao.MongodbBaseDao;
import com.yeshi.fanli.entity.dynamic.WXMPDynamicInfo;
@Repository
public class WXMPDynamicInfoDao extends MongodbBaseDao<WXMPDynamicInfo> {
    @Resource
    private MongoTemplate mongoTemplate;
    /**
     *
     * @Title: list
     * @Description: 列表查询
     * @param start
     * @param count
     * @return
     * List<WXMPDynamicInfo> 返回类型
     * @throws
     */
    public List<WXMPDynamicInfo> list(int start, int count) {
        Query query = new Query();
        List<Order> orders = new ArrayList<>();
        orders.add(new Order(Direction.DESC, "createTime"));
        query.with(new Sort(orders));
        query.skip(start);
        query.limit(count);
        return mongoTemplate.find(query, WXMPDynamicInfo.class);
    }
    /**
     *
     * @Title: count
     * @Description: 数量查询
     * @return
     * long 返回类型
     * @throws
     */
    public long count() {
        Query query = new Query();
        return mongoTemplate.count(query, WXMPDynamicInfo.class);
    }
    /**
     *
     * @Title: addShareCount
     * @Description: 添加分享次数
     * @param id
     * void 返回类型
     * @throws
     */
    public void addShareCount(String id) {
        WXMPDynamicInfo info = get(id);
        if (info == null) {
            return;
        }
        Query query = new Query();
        query.addCriteria(Criteria.where("id").is(id));
        Update update = new Update();
        if (info.getShareCount() != null)
            update.set("shareCount", info.getShareCount() + 1);
        else
            update.set("shareCount", 1);
        mongoTemplate.updateFirst(query, update, WXMPDynamicInfo.class);
    }
}
fanli/src/main/java/com/yeshi/fanli/dao/elastic/ESOrderDao.java
@@ -3,10 +3,12 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.SearchHit;
@@ -31,25 +33,31 @@
    public List<ESOrder> query(String key, String uid, List<Integer> listPlatform) {
        List<ESOrder> list = new ArrayList<ESOrder>();
        // 商品名称模糊全词匹配
        BoolQueryBuilder should1 = QueryBuilders.boolQuery().should(QueryBuilders.wildcardQuery("orderNo.keyword", "*" + key + "*"))
        BoolQueryBuilder should1 = QueryBuilders.boolQuery()
                .should(QueryBuilders.wildcardQuery("orderNo.keyword", "*" + key + "*"))
                .should(QueryBuilders.wildcardQuery("goodsName.keyword", "*" + key + "*"));
        // 用户id匹配
        BoolQueryBuilder should2 = QueryBuilders.boolQuery().should(QueryBuilders.termQuery("uid", uid));
                //.should(QueryBuilders.termQuery("uidDirect", uid)).should(QueryBuilders.termQuery("uidDirect", uid));
        // .should(QueryBuilders.termQuery("uidDirect",
        // uid)).should(QueryBuilders.termQuery("uidDirect", uid));
        // 查询创建
        SearchSourceBuilder sourceBuilder = new SearchSourceBuilder();
        if (listPlatform == null || listPlatform.size() == 0) {
            sourceBuilder.query(QueryBuilders.boolQuery().must(should1).must(should2));
        } else {
            BoolQueryBuilder should3 = QueryBuilders.boolQuery();
            for (Integer platform: listPlatform) {
            for (Integer platform : listPlatform) {
                should3.should(QueryBuilders.termQuery("platform", platform));
            }
            sourceBuilder.query(QueryBuilders.boolQuery().must(should1).must(should2).must(should3));
        }
        // 最大查询数为200
        sourceBuilder.size(200);
        // 超时20s
        sourceBuilder.timeout(new TimeValue(20, TimeUnit.SECONDS));
        SearchRequest searchRequest = new SearchRequest();
        searchRequest.indices(getDocument(ESOrder.class));
        searchRequest.source(sourceBuilder);
@@ -67,5 +75,5 @@
        }
        return list;
    }
}
fanli/src/main/java/com/yeshi/fanli/dao/goods/jd/NYouHuiGoodsDao.java
@@ -16,6 +16,15 @@
@Repository
public class NYouHuiGoodsDao extends MongodbBaseDao<NYouHuiGoods> {
    /**
     *
     * @Title: selectByName
     * @Description: 根据名字查询
     * @param name
     * @return
     * NYouHuiGoods 返回类型
     * @throws
     */
    public NYouHuiGoods selectByName(String name) {
        Query query = new Query();
        query.addCriteria(Criteria.where("name").is(name));
@@ -26,4 +35,37 @@
        return mongoTemplate.findOne(query, NYouHuiGoods.class);
    }
    /**
     *
     * @Title: list
     * @Description: 查询列表
     * @param start
     * @param count
     * @return
     * List<NYouHuiGoods> 返回类型
     * @throws
     */
    public List<NYouHuiGoods> list(int start, int count) {
        Query query = new Query();
        List<Order> orders = new ArrayList<>();
        orders.add(new Order(Direction.DESC, "updateTime"));
        query.with(new Sort(orders));
        query.skip(start);
        query.limit(count);
        return mongoTemplate.find(query, NYouHuiGoods.class);
    }
    /**
     *
     * @Title: count
     * @Description: 查询数量
     * @return
     * long 返回类型
     * @throws
     */
    public long count() {
        Query query = new Query();
        return mongoTemplate.count(query, NYouHuiGoods.class);
    }
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/order/OrderSearchIndexMapper.java
New file
@@ -0,0 +1,45 @@
package com.yeshi.fanli.dao.mybatis.order;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.entity.order.ESOrder;
public interface OrderSearchIndexMapper {
    /**
     *
     * @Title: listByHBIds
     * @Description: 根据主hongbaoId检索
     * @param hbIdList
     * @return
     * List<ESOrder> 返回类型
     * @throws
     */
    List<ESOrder> listByHBIds(@Param("hbIdList") List<Long> hbIdList);
    /**
     *
     * @Title: listHBId
     * @Description: 检索需要新增的hongBaoId
     * @param start
     * @param count
     * @return
     * List<Long> 返回类型
     * @throws
     */
    List<Long> listHBId(@Param("start") long start, @Param("count") int count);
    /**
     * 根据hongBaoId删除
     * @Title: deleteByHBIds
     * @Description:
     * @param hbIdList
     * @return
     * int 返回类型
     * @throws
     */
    int deleteByHBIds(@Param("hbIdList") List<Long> hbIdList);
}
fanli/src/main/java/com/yeshi/fanli/entity/common/JumpDetailV2.java
@@ -62,6 +62,7 @@
    @org.yeshi.utils.mybatis.Column(name = "jp_min_ios_version")
    private Integer minIOSAppVersion;// 最小ios版本
    
    @Expose
    @org.yeshi.utils.mybatis.Column(name = "jp_path")
    private String path;//小程序路径
fanli/src/main/java/com/yeshi/fanli/entity/dynamic/WXMPDynamicInfo.java
New file
@@ -0,0 +1,127 @@
package com.yeshi.fanli.entity.dynamic;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
import com.google.gson.annotations.Expose;
import com.yeshi.fanli.entity.bus.activity.ActivityUser;
@Document(collection = "wxmpDynamicInfo")
public class WXMPDynamicInfo implements Serializable {
    public final static int SOURCE_NYH = 11;// 内优惠
    public final static int SOURCE_OWN = 20;// 自有编辑
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    @Id
    @Expose
    @Field("id")
    private String id;
    // 发布用户
    @Expose
    @Field("user")
    private ActivityUser user;
    // 图片内容
    @Expose
    @Field("imgs")
    private List<GoodsPicture> imgs;
    // 文案
    @Expose
    @Field("content")
    private String content;
    // 来源
    @Field("source")
    private Integer source;
    // 分享次数
    @Field("shareCount")
    private Integer shareCount;
    // 分享赚的资金
    @Expose
    @Field("shareMoney")
    private BigDecimal shareMoney;
    // 创建时间
    @Expose
    @Field("createTime")
    private Date createTime;
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public ActivityUser getUser() {
        return user;
    }
    public void setUser(ActivityUser user) {
        this.user = user;
    }
    public List<GoodsPicture> getImgs() {
        return imgs;
    }
    public void setImgs(List<GoodsPicture> imgs) {
        this.imgs = imgs;
    }
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
    public Integer getSource() {
        return source;
    }
    public void setSource(Integer source) {
        this.source = source;
    }
    public Integer getShareCount() {
        return shareCount;
    }
    public void setShareCount(Integer shareCount) {
        this.shareCount = shareCount;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public BigDecimal getShareMoney() {
        return shareMoney;
    }
    public void setShareMoney(BigDecimal shareMoney) {
        this.shareMoney = shareMoney;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/goods/jd/NYouHuiGoods.java
@@ -6,6 +6,9 @@
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
import org.yeshi.utils.StringUtil;
import com.google.gson.Gson;
@Document(collection = "jdGoodsNYouHui")
public class NYouHuiGoods {
@@ -99,4 +102,19 @@
    public void setSourceUrl(String sourceUrl) {
        this.sourceUrl = sourceUrl;
    }
    /**
     *
     * @Title: toId
     * @Description: 转化唯一主键ID
     * @return
     * String 返回类型
     * @throws
     */
    public String toId() {
        String idStr = this.name;
        idStr += "#";
        idStr += new Gson().toJson(this.skuList);
        return StringUtil.Md5(idStr);
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/taobao/dataoke/DaTaoKeDetailV2.java
@@ -5,6 +5,7 @@
import java.util.Date;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
@@ -16,6 +17,7 @@
    private static final long serialVersionUID = 1L;
    @Id
    private Long id;// 商品ID
    @Indexed
    @Field
    private Long goodsId;// 淘宝商品ID
    @Field
fanli/src/main/java/com/yeshi/fanli/exception/dynamic/WXMPDynamicInfoException.java
New file
@@ -0,0 +1,16 @@
package com.yeshi.fanli.exception.dynamic;
import com.yeshi.fanli.exception.BaseException;
public class WXMPDynamicInfoException extends BaseException {
    private static final long serialVersionUID = 1L;
    public WXMPDynamicInfoException(int code, String msg) {
        super(code, msg);
    }
    public WXMPDynamicInfoException() {
        super();
    }
}
fanli/src/main/java/com/yeshi/fanli/job/DynamicInfoJob.java
@@ -1,5 +1,7 @@
package com.yeshi.fanli.job;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -9,33 +11,66 @@
import org.springframework.stereotype.Component;
import org.yeshi.utils.DateUtil;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.entity.bus.activity.RecommendActivity;
import com.yeshi.fanli.entity.bus.activity.RecommendActivityInviteInfo;
import com.yeshi.fanli.entity.dynamic.GoodsPicture;
import com.yeshi.fanli.entity.dynamic.WXMPDynamicInfo;
import com.yeshi.fanli.entity.goods.jd.NYouHuiGoods;
import com.yeshi.fanli.entity.jd.JDGoods;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.activity.ActivityService;
import com.yeshi.fanli.service.inter.activity.ActivityUserService;
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
import com.yeshi.fanli.service.inter.dynamic.DynamicInfoService;
import com.yeshi.fanli.service.inter.dynamic.WXMPDynamicInfoService;
import com.yeshi.fanli.service.inter.goods.jd.NYouHuiService;
import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
import com.yeshi.fanli.service.manger.goods.ConvertLinkManager;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
import com.yeshi.fanli.util.jd.JDApiUtil;
import com.yeshi.fanli.util.jd.JDUtil;
@Component
public class DynamicInfoJob {
    @Resource
    private DynamicInfoService dynamicInfoService;
    @Resource
    private ActivityService activityService;
    @Resource
    private NYouHuiService nyouHuiService;
    @Resource
    private ActivityUserService activityUserService;
    @Resource
    private WXMPDynamicInfoService wxmpDynamicInfoService;
    @Resource
    private ConvertLinkManager convertLinkManager;
    @Resource
    private HongBaoManageService hongBaoManageService;
    @Resource
    private JumpDetailV2Service jumpDetailV2Service;
    /**
     * 每10分钟  晚上00:00~06:00不下发任何一个商品
     */
    @Scheduled(cron = "0 0/10 6-23 * * ?")
    public void insetDynamicInfo() {
        if (!Constant.IS_TASK) {
            return;
        }
        try {
            dynamicInfoService.insertTimeHotSale();
        } catch (Exception e) {
@@ -45,8 +80,7 @@
                e1.printStackTrace();
            }
        }
        try {
            dynamicInfoService.insertTimeRecommend();
        } catch (Exception e) {
@@ -57,18 +91,17 @@
            }
        }
    }
    /**
     * 早上6,7,15,16,21,22,23点更新1次
     */
    @Scheduled(cron = "0 0 6,7,15,16,21,22,23 * * ? ")
    public void insetShopInfo1() {
        if (!Constant.IS_TASK) {
            return;
        }
        try {
            dynamicInfoService.insertShopInfo();
        } catch (Exception e) {
@@ -79,17 +112,17 @@
            }
        }
    }
    /**
     * 早上8:00~10:00每半个小时更新
     */
    @Scheduled(cron = "0 0/30 8,9,10 * * ?")
    public void insetShopInfo2() {
        if (!Constant.IS_TASK) {
            return;
        }
        try {
            dynamicInfoService.insertShopInfo();
        } catch (Exception e) {
@@ -100,18 +133,17 @@
            }
        }
    }
    /**
     * 早上11:00~14:00每半个小时更新
     */
    @Scheduled(cron = "0 0/30 11,12,13,14 * * ?")
    public void insetShopInfo3() {
        if (!Constant.IS_TASK) {
            return;
        }
        try {
            dynamicInfoService.insertShopInfo();
        } catch (Exception e) {
@@ -122,18 +154,17 @@
            }
        }
    }
    /**
     * 下午17:00~20:00每半个小时更新
     */
    @Scheduled(cron = "0 0/30 17,18,19,20 * * ? ")
    public void insetShopInfo4() {
        if (!Constant.IS_TASK) {
            return;
        }
        try {
            dynamicInfoService.insertShopInfo();
        } catch (Exception e) {
@@ -143,19 +174,18 @@
                e1.printStackTrace();
            }
        }
    }
    }
    /**
     * 每天零点删除3天之前数据
     */
    @Scheduled(cron = "0 0 1,10 * * ?")
    public void remove() {
        if (!Constant.IS_TASK) {
            return;
        }
        try {
            LogHelper.test("DynamicInfoJob-remove-开始执行态");
            dynamicInfoService.removeByDate(DateUtil.reduceDay(2, new Date()));
@@ -167,46 +197,45 @@
            }
        }
    }
    /**
     *  后台编辑动态: 每3分钟检索
     */
    @Scheduled(cron = "0 0/3 * * * ?")
    public void activityNeedPublish() {
        if (!Constant.IS_TASK) {
            return;
        }
        try {
            List<RecommendActivity> list = activityService.getNeedPublish();
            if (list == null || list.size() == 0) {
                return;
            }
            for (RecommendActivity activity : list) {
                Integer type = activity.getType();
                if (RecommendActivity.TYPE_SHARE_GOODS == type) {
                    // 商品动态
                    dynamicInfoService.insertActivityRecommend(activity);
                    activity.setState(1);
                    activityService.updateByPrimaryKeySelective(activity);
                } else if (RecommendActivity.TYPE_INVITE == type) {
                    // 邀请素材
                    RecommendActivityInviteInfo inviteInfo = activityService.getRecommendActivityInviteInfoByActivityId(activity.getId());
                    RecommendActivityInviteInfo inviteInfo = activityService
                            .getRecommendActivityInviteInfoByActivityId(activity.getId());
                    activity.setInviteInfo(inviteInfo);
                    dynamicInfoService.insertInviteActivity(activity);
                    activity.setState(1);
                    activityService.updateByPrimaryKeySelective(activity);
                }
            }
        } catch (Exception e) {
            try {
                LogHelper.errorDetailInfo(e);
@@ -215,18 +244,17 @@
            }
        }
    }
    /**
     * 每天6点天更新邀请素材
     */
    @Scheduled(cron = "0 0 6 * * ?")
    public void insertTimeInvite() {
        if (!Constant.IS_TASK) {
            return;
        }
        try {
            dynamicInfoService.insertTimeInvite();
        } catch (Exception e) {
@@ -237,6 +265,92 @@
            }
        }
    }
    /**
     *
     * @Title: demoJobHandler
     * @Description: 更新小程序动态商品
     * @param param
     * @return
     * @throws Exception
     * ReturnT<String> 返回类型
     * @throws
     */
    @XxlJob("dynamic-updateWXMPDynamicInfo")
    public ReturnT<String> updateWXMPDynamicInfoHandler(String param) throws Exception {
        addJDNYHInfo();
        return ReturnT.SUCCESS;
    }
    /**
     * 添加内优惠相关商品
     * @Title: addJDNYHInfo
     * @Description:
     * void 返回类型
     * @throws
     */
    private void addJDNYHInfo() throws Exception {
        List<NYouHuiGoods> list = nyouHuiService.list(1, 1);
        if (list != null && list.size() > 0) {
            NYouHuiGoods goods = list.get(0);
            String id = goods.toId();
            WXMPDynamicInfo info = new WXMPDynamicInfo();
            info.setId(WXMPDynamicInfo.SOURCE_NYH + "#" + id);
            String desc = goods.getDesc();
            info.setSource(WXMPDynamicInfo.SOURCE_NYH);
            info.setUser(activityUserService.getRandomHaoHuo());
            // 做链接转换
            for (String link : goods.getLinkList()) {
                desc = desc.replaceFirst("\\[链接\\]", link);
            }
            desc = convertLinkManager.convertJDLinkFromText(desc, 0L, true);
            info.setContent(desc);
            List<JDGoods> goodsList = JDApiUtil.queryGoodsDetail(goods.getSkuList());
            List<GoodsPicture> imgs = new ArrayList<>();
            BigDecimal totalMoney = new BigDecimal(0);
            List<String> lastPicture = new ArrayList<>();
            for (JDGoods jdGoods : goodsList) {
                GoodsPicture picture = new GoodsPicture();
                BigDecimal money = JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getShareRate());
                totalMoney = totalMoney.add(money);
                picture.setGoodsVO(
                        GoodsDetailVOFactory.convertJDGoods(jdGoods,
                                new ConfigParamsDTO(hongBaoManageService.getFanLiRate(),
                                        hongBaoManageService.getShareRate(), null,
                                        hongBaoManageService.getVIPFanLiRate())));
                picture.setGoodState(0);
                picture.setJumpDetail(jumpDetailV2Service.getByTypeCache("goodsdetail"));
                picture.setParams(null);
                picture.setUrl(jdGoods.getPicUrl());
                imgs.add(picture);
                if (jdGoods.getImageList() != null)
                    if (jdGoods.getImageList().size() > 4)
                        lastPicture.addAll(jdGoods.getImageList().subList(1, 4));
                    else if (jdGoods.getImageList().size() > 1)
                        lastPicture.addAll(jdGoods.getImageList().subList(1, jdGoods.getImageList().size()));
            }
            info.setShareMoney(totalMoney);
            int count = 0;
            while (imgs.size() < 4 && count < 4) {
                count++;
                String picurl = lastPicture.get((int) (lastPicture.size() * Math.random()));
                if (picurl != null) {
                    lastPicture.remove(picurl);
                    GoodsPicture picture = new GoodsPicture();
                    picture.setUrl(picurl);
                    imgs.add(picture);
                }
            }
            info.setImgs(imgs);
            wxmpDynamicInfoService.addWXMPDynamicInfo(info);
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/job/ElasticSearchJob.java
New file
@@ -0,0 +1,41 @@
package com.yeshi.fanli.job;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import org.yeshi.utils.StringUtil;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import com.yeshi.fanli.service.inter.order.ESOrderService;
/**
 * 搜索引擎任务
 * @author Administrator
 *
 */
@Component
public class ElasticSearchJob {
    @Resource
    private ESOrderService esOrderService;
    /**
     * 每两个小时进行更新品牌商品信息
     */
    @XxlJob("orderSearchIndexAddHandler")
    public ReturnT<String> orderSearchIndexAddHandler(String param) throws Exception {
        Integer count = null;
        if (!StringUtil.isNullOrEmpty(param))
            count = Integer.parseInt(param);
        addIndex(count);
        return ReturnT.SUCCESS;
    }
    public void addIndex(Integer count) {
        if (count == null)
            count = 200;
        esOrderService.syncAddOrder(count);
    }
}
fanli/src/main/java/com/yeshi/fanli/job/TaoLiJinJob.java
@@ -166,7 +166,7 @@
            return;
        
        int count = 0;
        int maxCount = 10;
        int maxCount = 15;
        for (int page = 1; page <= 10; page ++) {
            List<TaoBaoGoodsBrief> list = tljFreeBuyGoodsService.listPreGoods("", page);
            if (list == null || list.size() == 0)
fanli/src/main/java/com/yeshi/fanli/job/TestJob.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/mapping/common/JumpDetailV2Mapper.xml
@@ -9,12 +9,13 @@
        <result column="jp_controller" property="controller" jdbcType="VARCHAR" />
        <result column="jp_type" property="type" jdbcType="VARCHAR" />
        <result column="jp_need_login" property="needLogin" jdbcType="BOOLEAN" />
        <result column="jp_path" property="path" jdbcType="VARCHAR" />
        <result column="jp_min_android_version" property="minAndroidAppVersion"
            jdbcType="INTEGER" />
        <result column="jp_min_ios_version" property="minIOSAppVersion"
            jdbcType="INTEGER" />
    </resultMap>
    <sql id="Base_Column_List">jp_id,jp_name,jp_activity,jp_controller,jp_type,jp_need_login,jp_min_android_version,jp_min_ios_version
    <sql id="Base_Column_List">jp_id,jp_name,jp_activity,jp_controller,jp_type,jp_need_login,jp_min_android_version,jp_min_ios_version,jp_path
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
@@ -28,9 +29,9 @@
    <insert id="insert" parameterType="com.yeshi.fanli.entity.common.JumpDetailV2"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_action_jumpdetail_v2
        (jp_id,jp_name,jp_activity,jp_controller,jp_type,jp_need_login,jp_min_android_version,jp_min_ios_version)
        (jp_id,jp_name,jp_activity,jp_controller,jp_type,jp_need_login,jp_min_android_version,jp_min_ios_version,jp_path)
        values
        (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{activity,jdbcType=VARCHAR},#{controller,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{needLogin,jdbcType=BOOLEAN},#{minAndroidAppVersion,jdbcType=INTEGER},#{minIOSAppVersion,jdbcType=INTEGER})
        (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{activity,jdbcType=VARCHAR},#{controller,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{needLogin,jdbcType=BOOLEAN},#{minAndroidAppVersion,jdbcType=INTEGER},#{minIOSAppVersion,jdbcType=INTEGER},#{path,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.common.JumpDetailV2"
        useGeneratedKeys="true" keyProperty="id">
@@ -44,6 +45,7 @@
            <if test="needLogin != null">jp_need_login,</if>
            <if test="minAndroidAppVersion != null">jp_min_android_version,</if>
            <if test="minIOSAppVersion != null">jp_min_ios_version,</if>
            <if test="path != null">jp_path,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -55,6 +57,7 @@
            <if test="needLogin != null">#{jp_need_login,jdbcType=BOOLEAN},</if>
            <if test="minAndroidAppVersion != null">#{minAndroidAppVersion,jdbcType=INTEGER}</if>
            <if test="minIOSAppVersion != null">#{minIOSAppVersion,jdbcType=INTEGER}</if>
            <if test="path != null">#{path,jdbcType=VARCHAR}</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.common.JumpDetailV2">update
@@ -64,7 +67,10 @@
        #{controller,jdbcType=VARCHAR},jp_type =
        #{type,jdbcType=VARCHAR},jp_need_login = #{needLogin,jdbcType=BOOLEAN}
        ,jp_min_android_version =#{minAndroidAppVersion,jdbcType=INTEGER}
        ,jp_min_ios_version =#{minIOSAppVersion,jdbcType=INTEGER} where jp_id
        ,jp_min_ios_version =#{minIOSAppVersion,jdbcType=INTEGER}
        ,jp_path =#{path,jdbcType=VARCHAR}
        where jp_id
        = #{id,jdbcType=BIGINT}</update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.common.JumpDetailV2">
        update yeshi_ec_action_jumpdetail_v2
@@ -77,6 +83,9 @@
            <if test="minAndroidAppVersion !=null">jp_min_android_version
                =#{minAndroidAppVersion,jdbcType=INTEGER},</if>
            <if test="minIOSAppVersion !=null">jp_min_ios_version =#{minIOSAppVersion,jdbcType=INTEGER},
            </if>
            <if test="path !=null">jp_path =#{path,jdbcType=VARCHAR},
            </if>
        </set>
        where jp_id = #{id,jdbcType=BIGINT}
@@ -104,22 +113,24 @@
        1=1
        <if test="key != null and key != &quot;&quot;">AND (jp_name like '%${key}%')</if>
    </select>
    <select id="selectAndroidByTypeAndVersion" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_action_jumpdetail_v2  jv
        WHERE jv.`jp_type`=#{type} AND #{version}>=jv.`jp_min_android_version` ORDER BY  jv.`jp_min_android_version` DESC LIMIT 1
        from yeshi_ec_action_jumpdetail_v2 jv
        WHERE jv.`jp_type`=#{type} AND #{version}>=jv.`jp_min_android_version`
        ORDER BY jv.`jp_min_android_version` DESC LIMIT 1
    </select>
    <select id="selectIOSByTypeAndVersion" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_action_jumpdetail_v2  jv
        WHERE jv.`jp_type`=#{type} AND #{version}>=jv.`jp_min_ios_version` ORDER BY  jv.`jp_min_ios_version` DESC LIMIT 1
        from yeshi_ec_action_jumpdetail_v2 jv
        WHERE jv.`jp_type`=#{type} AND #{version}>=jv.`jp_min_ios_version` ORDER BY
        jv.`jp_min_ios_version` DESC LIMIT 1
    </select>
    <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List">
        delete from yeshi_ec_action_jumpdetail_v2 WHERE jp_id in
        <foreach collection="list" item="item" open="(" close=")"
fanli/src/main/java/com/yeshi/fanli/mapping/order/OrderSearchIndexMapper.xml
New file
@@ -0,0 +1,71 @@
<?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.order.OrderSearchIndexMapper">
    <resultMap id="BASERESULTMAP" type="com.yeshi.fanli.entity.order.ESOrder">
        <result column="uid" property="uid" jdbcType="BIGINT" />
        <result column="uidDirect" property="uidDirect" jdbcType="BIGINT" />
        <result column="uidIndirect" property="uidIndirect" jdbcType="BIGINT" />
        <result column="goodsName" property="goodsName" jdbcType="VARCHAR" />
        <result column="orderNo" property="orderNo" jdbcType="VARCHAR" />
        <result column="tradeId" property="tradeId" jdbcType="VARCHAR" />
        <result column="platform" property="platform" jdbcType="INTEGER" />
    </resultMap>
    <select id="listByHBIds" resultMap="BASERESULTMAP">
        SELECT CONCAT(a.platform,'#',a.tradeId) AS id,a.uid,v.`hb_uid` AS
        uidDirect,vv.`hb_uid` AS
        uidIndirect,a.goodsName,a.orderNo,a.tradeId,a.platform FROM (
        SELECT
        v.`hb_id`,co.`co_uid` AS uid,g.`cog_title` AS
        goodsName,CO.`co_order_no` AS orderNo,co.`co_trade_id` AS
        tradeId,co.`co_source_type` AS platform FROM yeshi_ec_common_order co
        LEFT JOIN yeshi_ec_hongbao_order ho ON ho.`ho_order_id`=co.`co_id`
        LEFT JOIN yeshi_ec_hongbao_v2 v ON v.`hb_id`=ho.`ho_hongbao_id`
        LEFT
        JOIN yeshi_ec_common_order_goods g ON
        g.`cog_id`=co.`co_order_goods_id`
        <foreach collection="hbIdList" item="hbId" open=" WHERE ("
            separator=" or " close=")">
            v.hb_id=#{hbId}
        </foreach>
        ) a
        LEFT JOIN yeshi_ec_hongbao_v2 v ON v.hb_pid=a.hb_id AND
        (v.`hb_type`=6 OR
        v.`hb_type`=21)
        LEFT JOIN yeshi_ec_hongbao_v2 vv ON
        vv.hb_pid=a.hb_id AND (vv.`hb_type`=7
        OR vv.`hb_type`=22)
    </select>
    <select id="listHBId" resultType="java.lang.Long">
        select id from
        yeshi_ec_common_order_change_trigger limit #{start},#{count}
    </select>
    <delete id="deleteByHBIds">
        delete from yeshi_ec_common_order_change_trigger
        <foreach collection="hbIdList" open=" where (" separator=" or "
            item="hbId" close=")">
            id=#{hbId}
        </foreach>
    </delete>
</mapper>
fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/WXMPDynamicInfoServiceImpl.java
New file
@@ -0,0 +1,75 @@
package com.yeshi.fanli.service.impl.dynamic;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.yeshi.utils.StringUtil;
import com.yeshi.fanli.dao.dynamic.WXMPDynamicInfoDao;
import com.yeshi.fanli.entity.dynamic.WXMPDynamicInfo;
import com.yeshi.fanli.exception.dynamic.WXMPDynamicInfoException;
import com.yeshi.fanli.service.inter.dynamic.WXMPDynamicInfoService;
import com.yeshi.fanli.service.manger.goods.ConvertLinkManager;
@Service
public class WXMPDynamicInfoServiceImpl implements WXMPDynamicInfoService {
    @Resource
    private WXMPDynamicInfoDao wxmpDynamicInfoDao;
    @Resource
    private ConvertLinkManager convertLinkManager;
    @Override
    public void addWXMPDynamicInfo(WXMPDynamicInfo info) throws WXMPDynamicInfoException {
        if (StringUtil.isNullOrEmpty(info.getContent()))
            throw new WXMPDynamicInfoException(1, "无文案");
        if (info.getSource() == null)
            throw new WXMPDynamicInfoException(1, "无来源");
        if (info.getUser() == null)
            throw new WXMPDynamicInfoException(1, "无发布用户");
        if (info.getId() == null)
            info.setId(StringUtil.Md5(UUID.randomUUID().toString()));
        if (info.getCreateTime() == null)
            info.setCreateTime(new Date());
        info.setShareCount(0);
        if (wxmpDynamicInfoDao.get(info.getId()) != null)
            throw new WXMPDynamicInfoException(2, "动态已存在");
        wxmpDynamicInfoDao.save(info);
    }
    @Override
    public List<WXMPDynamicInfo> listDynamicInfo(int page, int pageSize) {
        return wxmpDynamicInfoDao.list((page - 1) * pageSize, pageSize);
    }
    @Override
    public Long countDynamicInfo() {
        return wxmpDynamicInfoDao.count();
    }
    @Override
    public String copyContent(String id, Long uid) throws WXMPDynamicInfoException {
        // 转链
        WXMPDynamicInfo info = wxmpDynamicInfoDao.get(id);
        if (info == null)
            throw new WXMPDynamicInfoException(1, "信息不存在");
        // 转链
        String convertContent = null;
        try {
            convertContent = convertLinkManager.convertLinkFromText(info.getContent(), uid, true);
        } catch (Exception e) {
            throw new WXMPDynamicInfoException(2, e.getMessage());
        }
        wxmpDynamicInfoDao.addShareCount(id);
        return convertContent;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/jd/NYouHuiServiceImpl.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.service.impl.goods.jd;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
@@ -24,7 +25,7 @@
        if (goods.getSkuId() == null || StringUtil.isNullOrEmpty(goods.getDesc())
                || StringUtil.isNullOrEmpty(goods.getName()))
            return;
        if(goods.getUpdateTime()==null)
        if (goods.getUpdateTime() == null)
            goods.setUpdateTime(new Date());
        nyouHuiGoodsDao.save(goods);
    }
@@ -34,4 +35,14 @@
        return nyouHuiGoodsDao.selectByName(name);
    }
    @Override
    public List<NYouHuiGoods> list(int page, int pageSize) {
        return nyouHuiGoodsDao.list((page - 1) * pageSize, pageSize);
    }
    @Override
    public long count() {
        return nyouHuiGoodsDao.count();
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/help/HelpCenterServiceImpl.java
@@ -25,6 +25,7 @@
import com.yeshi.fanli.exception.config.HelpCenterException;
import com.yeshi.fanli.service.inter.help.HelpCenterService;
import com.yeshi.fanli.service.inter.homemodule.AdActivityVersionControlService;
import com.yeshi.fanli.util.FilePathEnum;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.db.MongoDBManager;
@@ -33,14 +34,12 @@
    @Resource
    private HelpCenterMapper helpCenterMapper;
    @Resource
    private MongoDBManager mongoDBManager;
    @Resource
    private AdActivityVersionControlService adActivityVersionControlService;
    @Override
    public int updateByPrimaryKey(HelpCenter record) {
@@ -56,30 +55,30 @@
    public HelpCenter selectByPrimaryKey(Long id) {
        return helpCenterMapper.selectByPrimaryKey(id);
    }
    @Override
    public HelpCenter selectByPrimaryKeyCache(Long id) {
        return selectByPrimaryKey(id);
    }
    @Override
    public String save(HelpCenter helpCenter, String content, String html) throws HelpCenterException,Exception {
    public String save(HelpCenter helpCenter, String content, String html) throws HelpCenterException, Exception {
        if (StringUtil.isNullOrEmpty(helpCenter.getTitle()))
            throw new HelpCenterException(1,"标题不能为空");
            throw new HelpCenterException(1, "标题不能为空");
        if (helpCenter.getHelpClass() == null || helpCenter.getHelpClass().getId() <= 0)
            throw new HelpCenterException(1,"分类题不能为空");
            throw new HelpCenterException(1, "分类题不能为空");
        Integer state = helpCenter.getState();
        if (state == null) {
            helpCenter.setState(0);
        }
        Integer weight = helpCenter.getWeight();
        if (weight == null) {
            helpCenter.setWeight(0);
        }
        helpCenter.setUpdatetime(new Date());
        Long id = helpCenter.getId();
        if (id == null) {
@@ -87,18 +86,18 @@
            helpCenterMapper.insert(helpCenter);
        } else {
            HelpCenter result = helpCenterMapper.selectByPrimaryKey(id);
            if (result == null)
                throw new HelpCenterException(1,"此类内容已不存在,请刷新");
            if (result == null)
                throw new HelpCenterException(1, "此类内容已不存在,请刷新");
            helpCenter.setCreatetime(result.getCreatetime());
            helpCenterMapper.updateByPrimaryKey(helpCenter);
        }
        List<Map<String, Object>> positions = getPosition(html);
        if (positions != null && positions.size() > 0) {
            @SuppressWarnings("restriction")
            sun.misc.BASE64Decoder decoder = new sun.misc.BASE64Decoder();
            for (int i = 0; i < positions.size(); i++) {
                Map<String, Object> map = positions.get(i);
                String base64Img = (String) map.get("base64Img");
@@ -111,7 +110,8 @@
                String type = (String) map.get("type");
                // 上传文件相对位置
                String fileUrl = "helpInfo/" + UUID.randomUUID().toString().replace("-", "") + "." +type;
                String fileUrl = FilePathEnum.helpCenterContent + UUID.randomUUID().toString().replace("-", "") + "."
                        + type;
                /* 上传新图片 */
                String uploadFilePath = COSManager.getInstance().uploadFileByte(b, fileUrl).getUrl();
@@ -121,8 +121,7 @@
                }
            }
        }
        String replaceHtml = replaceIframe(html);
        Long backId = helpCenter.getId();
        HelpInfo helpInfo = new HelpInfo(backId, content, replaceHtml);
@@ -157,29 +156,26 @@
                indexStart = tm + compareStrLength;
                indexTypeStart = typetm + compareStrLength;
                //System.out.println(indexStart);
                //System.out.println(indexTypeStart);
                // System.out.println(indexStart);
                // System.out.println(indexTypeStart);
                place.put("start", tm + 7);
                String suffix = content.substring(typetm + 11, tm - 1);
                place.put("type", suffix);
                String newContent = content.substring(tm + 7, content.length());
                char qmark = '"';
                int end = newContent.indexOf(qmark);
                place.put("end", end);
                String base64Img = newContent.substring(0, end);
                place.put("base64Img", base64Img);
                String header = compareStrStart + suffix+ ";" + compareStr +"," +base64Img;
                String header = compareStrStart + suffix + ";" + compareStr + "," + base64Img;
                place.put("header", header);
                listMap.add(place);
            }
        }
@@ -188,50 +184,50 @@
    }
    public String replaceIframe(String html) {
        String result = html;
        // 字符串查找初始从0开始查找
        int indexStart = 0;
        // 需要对比的字符串
        String compareStr = "<iframe";
        int compareStrLength = compareStr.length();
        while (true) {
            int tm = html.indexOf(compareStr, indexStart);
            if (tm <= 0) {
                // 直到没有匹配结果为止
                break;
            } else {
                // 起始位置
                indexStart = tm + compareStrLength;
                // 结束位置
                String newContent = html.substring(tm, html.length());
                int end = newContent.indexOf("</iframe>");
                // 替换指定字段  <iframe src=""></iframe>
                String replaceStr = html.substring(tm,  tm +  end + 9);
                // 替换指定字段 <iframe src=""></iframe>
                String replaceStr = html.substring(tm, tm + end + 9);
                char qmark = '"';
                // src 起始位置
                int srcindex = replaceStr.indexOf("src=", 0);
                String replaceSrc = replaceStr.substring(srcindex + 5, replaceStr.length());
                // src "结束位置
                int endsrc = replaceSrc.indexOf(qmark, 0);
                String src = replaceSrc.substring(0, endsrc +1);
                String src = replaceSrc.substring(0, endsrc + 1);
                String voide = "<video src=\"" + src + " controls=\"controls\"> 您的浏览器不支持video标签,请更新浏览器</video>";
                result = html.replace(replaceStr, voide);
            }
        }
        return result;
    }
@@ -245,13 +241,12 @@
        return helpCenterMapper.countQuery(key, cid, state);
    }
    @Override
    @Cacheable(value = "helpCenterCache",key="'queryIdAndTitle-'+#pageId+'-'+#key+'-'+#cid")
    @Cacheable(value = "helpCenterCache", key = "'queryIdAndTitle-'+#pageId+'-'+#key+'-'+#cid")
    public List<HelpCenter> listValid(long pageId, int pageSize, String key, Long cid) {
        return helpCenterMapper.listValid(pageId, pageSize, key, cid);
    }
    @Override
    public int deleteBatchById(List<String> idList) {
        return helpCenterMapper.deleteBatchById(idList);
@@ -261,18 +256,16 @@
    public HelpInfo getHelpInfo(Long id) {
        return mongoDBManager.getHelpInfo(id);
    }
    @Override
    @Cacheable(value = "helpCenterCache",key="'getHelpInfoCache-'+#id")
    @Cacheable(value = "helpCenterCache", key = "'getHelpInfoCache-'+#id")
    public HelpInfo getHelpInfoCache(Long id) {
        return getHelpInfo(id);
    }
    @Override
    @Transactional(rollbackFor=Exception.class)
    public void deleteInfoBatchById(List<String> idList)  {
    @Transactional(rollbackFor = Exception.class)
    public void deleteInfoBatchById(List<String> idList) {
        if (idList != null) {
            for (String id : idList) {
                mongoDBManager.removeHelpInfo(Long.parseLong(id));
fanli/src/main/java/com/yeshi/fanli/service/impl/order/ESOrderServiceImpl.java
@@ -7,6 +7,7 @@
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.elastic.ESOrderDao;
import com.yeshi.fanli.dao.mybatis.order.OrderSearchIndexMapper;
import com.yeshi.fanli.entity.order.ESOrder;
import com.yeshi.fanli.service.inter.order.ESOrderService;
@@ -14,17 +15,31 @@
public class ESOrderServiceImpl implements ESOrderService {
    @Resource
    private ESOrderDao esOrderDao;
    private OrderSearchIndexMapper orderSearchIndexMapper;
    @Resource
    private ESOrderDao esOrderDao;
    @Override
    public void add(ESOrder record) {
        esOrderDao.save(record, record.getPlatform() + "#" + record.getTradeId());
    }
    @Override
    public List<ESOrder> query(String key, String uid, List<Integer> listPlatform) {
        return esOrderDao.query(key, uid, listPlatform);
    }
    @Override
    public void syncAddOrder(int count) {
        List<Long> hbIdList = orderSearchIndexMapper.listHBId(0, count);
        if (hbIdList == null || hbIdList.size() == 0)
            return;
        List<ESOrder> list = orderSearchIndexMapper.listByHBIds(hbIdList);
        if (list != null)
            for (ESOrder order : list) {
                add(order);
            }
        orderSearchIndexMapper.deleteByHBIds(hbIdList);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/dataoke/DaTaoKeGoodsDetailV2ServiceImpl.java
@@ -159,8 +159,13 @@
        for (TaoBaoGoodsBrief goods : goodsList)
            goodsIdList.add(goods.getAuctionId());
        List<DaTaoKeDetailV2> dtList = listByGoodsIds(goodsIdList);
        List<DaTaoKeDetailV2> dtList = null;
        try {
            dtList = listByGoodsIds(goodsIdList);
        } catch (Exception e) {
        }
        Map<Long, DaTaoKeDetailV2> map = new HashMap<>();
        if (dtList != null)
            for (DaTaoKeDetailV2 goods : dtList)
fanli/src/main/java/com/yeshi/fanli/service/impl/user/QrCodeServiceImpl.java
@@ -192,7 +192,7 @@
        if (new File(targetPath).exists() && new File(targetPath).length() > 0) {
            String fileUrl = null;
            if (uid == null) {
                fileUrl = FilePathEnum.ercode.getPath() + "ercode_" + uuid + "_" + System.currentTimeMillis() + "_" + urlMd5 + ".jpg";
                fileUrl = FilePathEnum.invitePictureDemo.getPath() + "ercode_" + uuid + "_" + System.currentTimeMillis() + "_" + urlMd5 + ".jpg";
            } else {
                fileUrl = FilePathEnum.ercode.getPath() + "ercode_" + uid + "_" + System.currentTimeMillis() + "_" + urlMd5 + ".jpg";
            }
@@ -268,7 +268,7 @@
            // 上传文件相对位置
            String fileUrl = null;
            if (uid == null) {
                fileUrl = FilePathEnum.ercode.getPath() + "ercode_" + uuid + "_" + System.currentTimeMillis() + "_" + urlMd5 + ".jpg";
                fileUrl = FilePathEnum.invitePictureDemo.getPath() + "ercode_" + uuid + "_" + System.currentTimeMillis() + "_" + urlMd5 + ".jpg";
            } else {
                fileUrl = FilePathEnum.ercode.getPath() + "ercode_" + uid + "_" + System.currentTimeMillis() + "_" + urlMd5 + ".jpg";
            }
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountServiceImpl.java
@@ -1,12 +1,6 @@
package com.yeshi.fanli.service.impl.user;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
@@ -27,8 +21,6 @@
import com.yeshi.fanli.dao.mybatis.AccountMessageMapper;
import com.yeshi.fanli.dao.mybatis.UserConnectHistoryMapper;
import com.yeshi.fanli.dao.mybatis.UserInfoMapper;
import com.yeshi.fanli.dto.user.wx.WXMPLoginData;
import com.yeshi.fanli.dto.user.wx.WXMPLoginResult;
import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.BindingAccount;
@@ -36,15 +28,12 @@
import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode.ForbiddenUserIdentifyCodeTypeEnum;
import com.yeshi.fanli.entity.bus.user.LoginResult;
import com.yeshi.fanli.entity.bus.user.SMSHistory;
import com.yeshi.fanli.entity.bus.user.ThreeSale;
import com.yeshi.fanli.entity.bus.user.UserAccountBindingHistory;
import com.yeshi.fanli.entity.bus.user.UserConnectHistory;
import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoModifyRecord.ModifyTypeEnum;
import com.yeshi.fanli.entity.bus.user.WeiXinUser;
import com.yeshi.fanli.exception.user.ForbiddenUserIdentifyCodeException;
import com.yeshi.fanli.exception.user.ThreeSaleException;
import com.yeshi.fanli.exception.user.UserAccountException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.money.extract.BindingAccountService;
@@ -61,12 +50,10 @@
import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.FilePathEnum;
import com.yeshi.fanli.util.FileUtil;
import com.yeshi.fanli.util.RedisKeyEnum;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.ThreadUtil;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.util.factory.msg.MsgAccountDetailFactory;
import com.yeshi.fanli.util.wx.WXLoginUtil;
@@ -472,112 +459,6 @@
        }
    }
    @Override
    public void connectUsers(HttpSession session) throws UserAccountException {
        UserInfo mainUser = (UserInfo) session.getAttribute("WEIXIN_USERINFO");
        UserInfo lessUser = (UserInfo) session.getAttribute("LAST_LOGIN_USER");
        int lessUserLoginType = lessUser.getLoginType();
        if (mainUser == null || lessUser == null || mainUser.getId() == null || lessUser.getId() == null)
            throw new UserAccountException(30001, "缺少打通账号");
        mainUser = userInfoMapper.selectByPrimaryKeyForUpdate(mainUser.getId());
        lessUser = userInfoMapper.selectByPrimaryKeyForUpdate(lessUser.getId());
        session.removeAttribute("WEIXIN_USERINFO");
        session.removeAttribute("LAST_LOGIN_USER");
        if (mainUser == null || lessUser == null)
            throw new UserAccountException(30002, "缺少打通账号");
        // 判断是否有绑定相同类型的账号
        if (lessUserLoginType == 1) {// 次账号以淘宝登录
            if (!StringUtil.isNullOrEmpty(mainUser.getPhone()) && !StringUtil.isNullOrEmpty(lessUser.getPhone())
                    && !lessUser.getPhone().equalsIgnoreCase(mainUser.getPhone()))
                throw new UserAccountException(30003, "请先解除其中一个账号的手机绑定");
        } else if (lessUserLoginType == 3) {// 次账号以手机号登录
            if (!StringUtil.isNullOrEmpty(mainUser.getOpenid()) && !StringUtil.isNullOrEmpty(lessUser.getOpenid())
                    && !lessUser.getOpenid().equalsIgnoreCase(mainUser.getOpenid()))
                throw new UserAccountException(30003, "请先解除其中一个账号的淘宝绑定");
        }
        connectUsers(mainUser, lessUser);
    }
    @Transactional(rollbackFor = Exception.class)
    @Override
    public void connectUsers(UserInfo mainUser, UserInfo lessUser) throws UserAccountException {
        mainUser = userInfoMapper.selectByPrimaryKeyForUpdate(mainUser.getId());
        lessUser = userInfoMapper.selectByPrimaryKeyForUpdate(lessUser.getId());
        if (!StringUtil.isNullOrEmpty(mainUser.getOpenid()) && !StringUtil.isNullOrEmpty(lessUser.getOpenid()))
            throw new UserAccountException(9, "两个账号都绑定了淘宝,请解绑其中一个");
        if (!StringUtil.isNullOrEmpty(mainUser.getPhone()) && !StringUtil.isNullOrEmpty(lessUser.getPhone()))
            throw new UserAccountException(9, "两个账号都绑定了手机号码,请解绑其中一个");
        if (lessUser.getMyHongBao().compareTo(new BigDecimal("10")) >= 0
                && mainUser.getMyHongBao().compareTo(new BigDecimal("10")) > 0)
            throw new UserAccountException(10, String.format("账户ID:%s 的资金超过10元,为保证资金安全请联系客服打通", lessUser.getId() + ""));
        // 判定是否绑定了同一支付宝
        BindingAccount mainUserAccount = bindingAccountService.getBindingAccountByUidAndType(mainUser.getId(),
                BindingAccount.TYPE_ALIPAY);
        BindingAccount lessUserAccount = bindingAccountService.getBindingAccountByUidAndType(lessUser.getId(),
                BindingAccount.TYPE_ALIPAY);
        // 有不同的支付宝账号
        boolean hasDiffrentAlipayAccount = false;
        if (mainUserAccount != null && lessUserAccount != null) {
            if (!mainUserAccount.getAccount().equalsIgnoreCase(lessUserAccount.getAccount()))
                hasDiffrentAlipayAccount = true;
        }
        if (hasDiffrentAlipayAccount)
            throw new UserAccountException(10, "两个账户都绑定了支付宝,请先解绑其中一个");
        // 判定是否有重叠的账号
        UserInfo updateUser = new UserInfo(mainUser.getId());
        if (!StringUtil.isNullOrEmpty(lessUser.getOpenid())) {
            updateUser.setOpenid(lessUser.getOpenid());
            updateUser.setTbName(lessUser.getTbName());
            updateUser.setTbPic(lessUser.getTbPic());
        }
        if (!StringUtil.isNullOrEmpty(lessUser.getPhone())) {
            updateUser.setPhone(lessUser.getPhone());
        }
        // 备份原来的用户信息
        String logUrl = backupUserImportantInfo(lessUser.getId());
        // 添加打通记录
        UserConnectHistory userConnectHistory = new UserConnectHistory();
        userConnectHistory.setCreateTime(new Date());
        userConnectHistory.setLessUser(lessUser);
        userConnectHistory.setMainUser(mainUser);
        userConnectHistory.setLogUrl(logUrl);
        userConnectHistoryMapper.insertSelective(userConnectHistory);
        userInfoMapper.updateByPrimaryKeySelective(updateUser);
        // 删除原来的账号
        UserInfo updateLessUser = new UserInfo(lessUser.getId());
        updateLessUser.setState(UserInfo.STATE_DELETE);
        updateLessUser.setStateDesc("账号被打通删除");
        userInfoMapper.updateByPrimaryKeySelective(updateLessUser);
        // 融合业务
        userInfoMapper.connectUser(mainUser.getId(), lessUser.getId());
        // 查询是否有多余的新人红包
        int subCount = 0;
        int addCount = 0;
        userAccountMsgNotificationService.connectSuccess(mainUser.getId(), lessUser.getId());
        userInfoDeleteRecordService.addDeleteRecord(lessUser.getId(), UserInfo.STATE_DELETE, "删除:账号被打通删除");
    }
    /**
     * 根据系统与unionid寻找用户
@@ -887,46 +768,6 @@
    }
    @Override
    public String backupUserImportantInfo(Long uid) {
        String logPath = String.format(FileUtil.getCacheDir() + "/benfen_%s_" + uid + ".log",
                TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyyMMddHHmmss"));
        // 备份用户信息
        UserInfo user = userInfoMapper.selectAvailableByPrimaryKey(uid);
        // TODO 备份资金明细
        // 备份邀请关系
        List<ThreeSale> threeSaleList = new ArrayList<>();
        FileWriter fw = null;
        try {
            // 设置为:True,表示写入的时候追加数据
            fw = new FileWriter(new File(logPath), true);
            fw.write("#UserInfo" + "\r\n");
            fw.write(JsonUtil.getSimpleGsonWithDate().toJson(user) + "\r\n");
            fw.write("#ThreeSale" + "\r\n");
            fw.write(JsonUtil.getSimpleGsonWithDate().toJson(threeSaleList) + "\r\n");
            fw.close();
            String logUrl = COSManager.getInstance()
                    .uploadFile(new File(logPath), FilePathEnum.beifen.getPath() + new File(logPath).getName()).getUrl();
            return logUrl;
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (new File(logPath).exists())
                new File(logPath).delete();
        }
        return null;
    }
    @Override
    public void clearUserPortrait(Long uid) {
        if (uid == null)
            return;
@@ -1132,7 +973,7 @@
                        InputStream asInputStream = HttpUtil.getAsInputStream(weiXinUser.getHeadimgurl());
                        if (asInputStream != null) {
                            FileUploadResult result = COSManager.getInstance().uploadFile(asInputStream,
                                    String.format(FilePathEnum.userPortrait.getPath() + "%s_%s.jpg", weiXinUser.getUnionid(),
                                    String.format(FilePathEnum.userWXPortrait.getPath() + "%s_%s.jpg", weiXinUser.getUnionid(),
                                            System.currentTimeMillis() + ""));
                            if (result != null && !StringUtil.isNullOrEmpty(result.getUrl()))
                                portrait = result.getUrl();
@@ -1357,7 +1198,7 @@
                LogHelper.test("微信头像下载失败: " + weiXinUser.getUnionid() + " " + headimgurl);
            } else {
                FileUploadResult result = COSManager.getInstance().uploadFile(asInputStream, String
                        .format(FilePathEnum.userPortrait.getPath() + "%s_%s.jpg", weiXinUser.getUnionid(), System.currentTimeMillis() + ""));
                        .format(FilePathEnum.userWXPortrait.getPath() + "%s_%s.jpg", weiXinUser.getUnionid(), System.currentTimeMillis() + ""));
                if (result != null && !StringUtil.isNullOrEmpty(result.getUrl())) {
                    headimgurl = result.getUrl();
                } else {
@@ -1417,7 +1258,7 @@
            InputStream asInputStream = HttpUtil.getAsInputStream(weiXinUser.getHeadimgurl());
            if (asInputStream != null) {
                FileUploadResult result = COSManager.getInstance().uploadFile(asInputStream, String
                        .format(FilePathEnum.userPortrait.getPath() +"%s_%s.jpg", weiXinUser.getUnionid(), System.currentTimeMillis() + ""));
                        .format(FilePathEnum.userWXPortrait.getPath() +"%s_%s.jpg", weiXinUser.getUnionid(), System.currentTimeMillis() + ""));
                if (result != null && !StringUtil.isNullOrEmpty(result.getUrl()))
                    portrait = result.getUrl();
            } else {
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java
@@ -450,7 +450,7 @@
                    LogHelper.test("微信头像下载失败: " + weiXinUser.getUnionid() + " " + headimgurl);
                } else {
                    FileUploadResult result = COSManager.getInstance().uploadFile(asInputStream, String.format(
                            FilePathEnum.userPortrait.getPath() + "%s_%s.jpg", weiXinUser.getUnionid(), System.currentTimeMillis() + ""));
                            FilePathEnum.userWXPortrait.getPath() + "%s_%s.jpg", weiXinUser.getUnionid(), System.currentTimeMillis() + ""));
                    if (result != null && !StringUtil.isNullOrEmpty(result.getUrl())) {
                        headimgurl = result.getUrl();
                    } else {
@@ -569,7 +569,7 @@
                    LogHelper.test("微信头像下载失败: " + weiXinUser.getUnionid() + " " + headimgurl);
                } else {
                    FileUploadResult result = COSManager.getInstance().uploadFile(asInputStream, String.format(
                            FilePathEnum.userPortrait.getPath() + "%s_%s.jpg", weiXinUser.getUnionid(), System.currentTimeMillis() + ""));
                            FilePathEnum.userWXPortrait.getPath() + "%s_%s.jpg", weiXinUser.getUnionid(), System.currentTimeMillis() + ""));
                    if (result != null && !StringUtil.isNullOrEmpty(result.getUrl())) {
                        headimgurl = result.getUrl();
                    } else {
fanli/src/main/java/com/yeshi/fanli/service/inter/dynamic/WXMPDynamicInfoService.java
New file
@@ -0,0 +1,59 @@
package com.yeshi.fanli.service.inter.dynamic;
import java.util.List;
import com.yeshi.fanli.entity.dynamic.WXMPDynamicInfo;
import com.yeshi.fanli.exception.dynamic.WXMPDynamicInfoException;
/**
 * 微信小程序动态商品服务
 * @author Administrator
 *
 */
public interface WXMPDynamicInfoService {
    /**
     *
     * @Title: addWXMPDynamicInfo
     * @Description: 添加微信小程序动态信息
     * @param info
     * @throws WXMPDynamicInfoException
     * void 返回类型
     * @throws
     */
    public void addWXMPDynamicInfo(WXMPDynamicInfo info) throws WXMPDynamicInfoException;
    /**
     *
     * @Title: listDynamicInfo
     * @Description: 动态列表
     * @param page
     * @param pageSize
     * @return
     * List<WXMPDynamicInfo> 返回类型
     * @throws
     */
    public List<WXMPDynamicInfo> listDynamicInfo(int page, int pageSize);
    /**
     *
     * @Title: countDynamicInfo
     * @Description: 动态总数量
     * @return
     * Long 返回类型
     * @throws
     */
    public Long countDynamicInfo();
    /**
     *
     * @Title: copyContent
     * @Description: 复制动态文案
     * @param id
     * @return
     * String 返回类型
     * @throws
     */
    public String copyContent(String id,Long uid) throws WXMPDynamicInfoException;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/jd/NYouHuiService.java
@@ -1,5 +1,7 @@
package com.yeshi.fanli.service.inter.goods.jd;
import java.util.List;
import com.yeshi.fanli.entity.goods.jd.NYouHuiGoods;
public interface NYouHuiService {
@@ -19,4 +21,26 @@
     */
    public NYouHuiGoods selectByName(String name);
    /**
     *
     * @Title: list
     * @Description: 查询列表
     * @param page
     * @param pageSize
     * @return
     * List<NYouHuiGoods> 返回类型
     * @throws
     */
    public List<NYouHuiGoods> list(int page, int pageSize);
    /**
     *
     * @Title: count
     * @Description: 计算所有的数量
     * @return
     * long 返回类型
     * @throws
     */
    public long count();
}
fanli/src/main/java/com/yeshi/fanli/service/inter/order/ESOrderService.java
@@ -19,6 +19,14 @@
     * @return
     */
    List<ESOrder> query(String key, String uid, List<Integer> listPlatform);
    /**
     * @Title: syncAddOrder
     * @Description: 同步新增加的订单
     * @param count
     * void 返回类型
     * @throws
     */
    void syncAddOrder(int count);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserAccountService.java
@@ -45,29 +45,6 @@
    public LoginResult loginNoInstallWX(AcceptData acceptData, String appId, String code, String phone,
            UserInfo tbUserInfo, int loginType) throws UserAccountException;
    /**
     * 打通微信账号与其他类型的一个账号
     *
     * @param session
     * @throws UserAccountException
     */
    public void connectUsers(HttpSession session) throws UserAccountException;
    /**
     * 备份重要的用户信息
     *
     * @param uid
     */
    public String backupUserImportantInfo(Long uid);
    /**
     * 打通两个账号,以主账号为主
     *
     * @param mainUser
     * @param lessUser
     * @throws UserAccountException
     */
    public void connectUsers(UserInfo mainUser, UserInfo lessUser) throws UserAccountException;
    /**
     * 注册用户
fanli/src/main/java/com/yeshi/fanli/service/manger/goods/ConvertLinkManager.java
@@ -49,7 +49,7 @@
     * @throws
     */
    private String convertJDLinkFromText(String text, Long uid, boolean share) throws Exception {
    public String convertJDLinkFromText(String text, Long uid, boolean share) throws Exception {
        StringBuilder builder = new StringBuilder(text);
        String newText = builder.toString();
fanli/src/main/java/com/yeshi/fanli/util/Constant.java
@@ -336,9 +336,9 @@
        else if ("ios".equalsIgnoreCase(platform))
            return 2;
        else if ("wxmp".equalsIgnoreCase(platform))
            return 4;// 未知
            return 4;
        else
            return 0;
            return 0;// 未知
    }
    public static String getAppName(String platform, String version) {
fanli/src/main/java/com/yeshi/fanli/util/FilePathEnum.java
@@ -1,37 +1,41 @@
package com.yeshi.fanli.util;
public enum FilePathEnum {
    userPortrait("/img/user/", "用户头像"), // -- /portrait/wx/ -- /wx/headImg/
    userERcode("/img/user/erCode/", "用户上传微信二维码"),
    userComplaint("/img/UserComplaint/", "用户吐槽图片"),
    userRankings("/userRankings/", "奖金排行榜假用户头像"),
    beifen("/beifen/", ""),
    activityUserPortrait("/img/GoodsSubClass/", "活动用户头像"),
    apk("/apk/admin/", "上传Apk安装包"), // -- /img/admin/
    section("/section/", "后台上传图片路径"), // -- /img/admin/
    shareGoods("/sharegoods/", "分享商品图片"),
    shareXCX("/sharegoods/xcx/", "分享小程序图片"),
    ercode("/ercode/", "分享邀请图二维码图片"),
    invite("/img/invite/", "分享邀请好友图片"),
    helpClass("/img/HelpClass/", "帮助中心分类图片"),
    goodsClassOld("/ClassImg/", "商品一级分类图片-老版"),
    goodsClass("/img/GoodsClass/", "商品一级分类图片"),
    goodsSubClass("/img/GoodsSubClass/", "商品二级以下分类图片"),
    lable("/LableImg/", "标签图片"),
    taoBaoShop("/img/TaoBaoShop/", "淘宝店铺图片"),
    brand("/img/brand/", "品牌图片"),
    article("/img/article/", "学院文章图片"),
    floatAD("/img/FloatAD/", "首页弹框图片"),
    homeNavbar("/img/HomeNavbar/", "导航栏图片"),
    specialCard("/img/SpecialCard/", "专题管理图片"),
    special("/img/special/", "专题图片"),
    swiper("/img/swiperPic/", "轮播图片"),
    banLiShopClass("/img/shopGoodsClass/", "板栗商城分类图片"),
    banLiShopGoods("/img/BanLiShopGoods/", "板栗商城商品图片");
    // 用户相关
    userPortrait("/user/img/portrait/", "用户头像"),
    userWXPortrait("/user/img/portrait_wx/", "用户微信头像"),
    userERcode("/user/img/ercode/", "用户上传微信二维码"),
    userComplaint("/user/img/user_complaint/", "用户吐槽图片"),
    activityUserPortrait("/user/img/dynamic/portrait/", "动态用户头像"),
    ercode("/user/img/invite/", "分享邀请图二维码图片"),
    shareGoods("/user/img/sharegoods/", "分享商品图片"),
    shareXCX("/user/img/sharegoods_xcx/", "分享小程序图片"),
    // 编辑相关
    apk("/editor/apk/", "上传Apk安装包"), // -- /img/admin/
    section("/editor/upload_imgs/", "后台上传图片路径"), // -- /img/admin/
    userRankings("/editor/img/user_rankings/", "奖金排行榜假用户头像"),
    invite("/editor/img/invite/", "分享邀请好友图片素材"),
    invitePictureDemo("/editor/img/invite_demo/", "动态中生成的邀请图demo"),
    helpClass("/editor/img/help_class/", "帮助中心分类图片"),
    helpCenterContent("/editor/img/help_center/", "帮助中心内容图片"),
    goodsClassOld("/editor/img/class_old/", "商品一级分类图片-老版"),
    goodsClass("/editor/img/goods_class/", "商品一级分类图片"),
    goodsSubClass("/editor/img/goods_sub_class/", "商品二级以下分类图片"),
    lable("/editor/img/lable/", "标签图片"),
    taoBaoShop("/editor/img/taobao_shop/", "淘宝店铺图片"),
    brand("/editor/img/brand/", "品牌图片"),
    article("/editor/img/college/article/", "学院文章图片"),
    floatAD("/editor/img/float_ad/", "首页弹框图片"),
    homeNavbar("/editor/img/home_navbar/", "导航栏图片"),
    specialCard("/editor/img/special_card/", "专题管理图片"),
    special("/editor/img/special/", "专题图片"),
    swiper("/editor/img/swiper_pic/", "轮播图片"),
    banLiShopClass("/editor/img/shop/goods_class/", "板栗商城分类图片"),
    banLiShopGoods("/editor/img/shop/goods/", "板栗商城商品图片");
    private final String path;
    private final String desc;
fanli/src/main/java/com/yeshi/fanli/util/JumpDetailUtil.java
@@ -1,12 +1,6 @@
package com.yeshi.fanli.util;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Iterator;
import com.yeshi.fanli.entity.common.JumpDetailV2;
import net.sf.json.JSONObject;
public class JumpDetailUtil {
    /**
@@ -16,25 +10,10 @@
     * @param params
     * @return
     */
    public static JumpDetailV2 getWXMPJumDetail(JumpDetailV2 detail, JSONObject params) {
        String path = detail.getPath();
        if (params != null) {
            path += "?";
            for (Iterator<String> its = params.keys(); its.hasNext();) {
                String key = its.next();
                try {
                    path += (key + "=" + URLEncoder.encode(params.optString(key), "UTF-8") + "&");
                } catch (UnsupportedEncodingException e) {
                    e.printStackTrace();
                }
            }
        }
        if (path.endsWith("&"))
            path = path.substring(0, path.length() - 1);
        JumpDetailV2 v2 = new JumpDetailV2();
        v2.setPath(path);
        v2.setType(detail.getType());
        return v2;
    public static JumpDetailV2 getWXMPJumDetail(JumpDetailV2 detail) {
        detail.setActivity(null);
        detail.setController(null);
        return detail;
    }
}
fanli/src/main/java/com/yeshi/fanli/util/jd/JDApiUtil.java
@@ -190,6 +190,20 @@
        return null;
    }
    public static List<JDGoods> queryGoodsDetail(List<Long> skuIdList) {
        JDFilter filter = new JDFilter();
        filter.setPageIndex(1);
        filter.setPageSize(20);
        filter.setListId(skuIdList);
        JDSearchResult searchResult = queryByKey(filter);
        if (searchResult != null) {
            List<JDGoods> list = searchResult.getGoodsList();
            if (list != null && list.size() > 0)
                return list;
        }
        return null;
    }
    /**
     * 通过商品搜索接口批量获取详情
     * 
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java
@@ -2137,7 +2137,7 @@
     * @throws
     */
    public static List<String> getTokenListFromText(String str) {
        String pattern = "(₳{1}[A-Za-z0-9]+₳{1})|(¥{1}[A-Za-z0-9]+¥{1})|(¥{1}[A-Za-z0-9]+¥{1})";
        String pattern = "(₳{1}[A-Za-z0-9]+₳{1})|(¥{1}[A-Za-z0-9]+¥{1})|(¥{1}[A-Za-z0-9]+¥{1})|(€{1}[A-Za-z0-9]+€{1})";
        Pattern r = Pattern.compile(pattern);
        Matcher m = r.matcher(str);
        List<String> urlList = new ArrayList<>();
fanli/src/main/java/com/yeshi/fanli/util/wx/WXLoginUtil.java
@@ -103,7 +103,7 @@
                }
                
                FileUploadResult result = COSManager.getInstance().uploadFile(asInputStream,
                        String.format(FilePathEnum.userPortrait.getPath() + "%s_%s.jpg", user.getUnionid(), System.currentTimeMillis() + ""));
                        String.format(FilePathEnum.userWXPortrait.getPath() + "%s_%s.jpg", user.getUnionid(), System.currentTimeMillis() + ""));
                if (result != null && !StringUtil.isNullOrEmpty(result.getUrl())) {
                    user.setHeadimgurl(result.getUrl());
                    // COS删除其余头像
fanli/src/main/resource/elasticsearch.properties
New file
@@ -0,0 +1,3 @@
elastic.scheme=http
elastic.port=9200
elastic.host=172.16.16.3
fanli/src/main/resource/elasticsearch.xml
New file
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
    <bean name="inetAddressbean" class="java.net.InetAddress"></bean>
    <bean name="httpHostbean" class="org.apache.http.HttpHost">
         <constructor-arg  ref="inetAddressbean"></constructor-arg>
         <constructor-arg  value="${elastic.host}" ></constructor-arg>
        <constructor-arg  value="${elastic.port}"></constructor-arg>
        <constructor-arg  value="${elastic.scheme}"></constructor-arg>
    </bean>
</beans>
fanli/src/main/resource/env-sandbox/constant.properties
New file
@@ -0,0 +1,3 @@
task =false
outnetwork =true
test=true
fanli/src/main/resource/env-sandbox/cos.properties
New file
@@ -0,0 +1,5 @@
appId =1255749512
secretId =AKIDTlpgJhLjOozvd6QI2XnpfGbgV4NQJk25
secretKey =xhCSUHo55oHUQ6XicFcmfIgspX0EEzWo
bucketName =ec
region=ap-guangzhou
fanli/src/main/resource/env-sandbox/mongo.properties
New file
@@ -0,0 +1,17 @@
mongo.dbname=flq
mongo.port=27017
ƒ
mongo.host=172.16.16.40
mongo.username=admin
mongo.password=123456
mongo.connectionsPerHost=8
mongo.threadsAllowedToBlockForConnectionMultiplier=4
mongo.connectTimeout=1000
mongo.maxWaitTime=1500
mongo.autoConnectRetry=true
mongo.socketKeepAlive=true
mongo.socketTimeout=1500
mongo.slaveOk=true
mongo.writeNumber=1
mongo.riteTimeout=0
mongo.writeFsync=true
fanli/src/main/resource/env-sandbox/redis.properties
New file
@@ -0,0 +1,8 @@
redis.addr=172.16.16.3
redis.port=6379
redis.auth=weikou2014
redis.max_total=1024
redis.max_idle=200
redis.max_wait=10000
redis.timeout=5000
redis.test_on_borrow=true
fanli/src/main/resource/env-sandbox/rocketmq.properties
New file
@@ -0,0 +1,7 @@
rocketmq.AccessKey=LTAI4FwmTxVCuzTaoZtDiV8z
rocketmq.SecretKey=ixWg90QbYFKP6ae5xpAo2P1qwIyll5
#测试  http://MQ_INST_1205444665315884_Bbkj89nI.mq-internet-access.mq-internet.aliyuncs.com:80
#正式 http://MQ_INST_1205444665315884_BbaMbxF4.mq-internet-access.mq-internet.aliyuncs.com:80
rocketmq.NAMESRV_ADDR=http://MQ_INST_1205444665315884_Bbkj89nI.mq-internet-access.mq-internet.aliyuncs.com:80
fanli/src/main/resource/env-sandbox/rocketmq.xml
New file
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
    <import resource="classpath:/rocket/producer.xml" />
    <import resource="classpath:/rocket/transactionProducer.xml" />
</beans>
fanli/src/main/resource/env-sandbox/xxl-job.xml
New file
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans.xsd
           http://www.springframework.org/schema/context
           http://www.springframework.org/schema/context/spring-context.xsd">
    <!-- 不执行任务 -->
</beans>
fanli/src/main/resource/spring.xml
@@ -47,12 +47,16 @@
                <value>classpath:mongo.properties</value>
                <value>classpath:rocketmq.properties</value>
                <value>classpath:xxl-job-executor.properties</value>
                <value>classpath:elasticsearch.properties</value>
            </array>
        </property>
    </bean>
    <import resource="classpath:rocketmq.xml" />
    <import resource="classpath:xxl-job.xml" />
    <import resource="classpath:elasticsearch.xml" />
    
    
fanli/src/test/java/org/fanli/TaoKeTest.java
@@ -32,6 +32,7 @@
import com.yeshi.fanli.service.inter.user.TBPidService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.service.manger.goods.ConvertLinkManager;
import com.yeshi.fanli.util.BeanUtil;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TaoBaoConstant;
@@ -91,14 +92,9 @@
    @Test
    public void test2() {
        // String link = TaoKeApiUtil.officialActivityConvert("87140050199",
        // "1571715733668", "20211660");
        // System.out.println(link);
        String text = HttpUtil.get("https://m.tb.cn/h.eBj7iNJ?sm=c4049c");
        System.out.println(text);
        TaoBaoGoodsBrief goods = TaoKeApiUtil.specialConvertCoupon(571754672318L,
                new TaoKeAppInfo(TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET));
        System.out.println(goods);
    }
@@ -203,8 +199,19 @@
    @Test
    public void test6() {
        TaoBaoGoodsBrief goods = TaoBaoUtil.getSimpleGoodsBrief(607940944794L);
        System.out.println(goods);
        String text = "[玫瑰]各位亲友好,记得领券哦[愉快]" + "【京东1月3日领券精选】\n" + "[红包]抢红包 最高888\n" + "https://u.jd.com/8xeCfl\n"
                + "🚅火车票神券50元\n" + "https://u.jd.com/cMReZz\n" + "🌟居家好物9.9包邮\n" + "https://u.jd.com/AG2z4A\n"
                + "👔男装3件7折\n" + "https://u.jd.com/kgMslr\n" + "👗女装清仓5折起\n" + "https://u.jd.com/kgMslr\n" + "🛍有礼有年货\n"
                + "https://u.jd.com/qdvIiG\n" + "💋SK-II大促\n" + "https://u.jd.com/7XybkD\n" + "💰超级百亿补贴\n"
                + "https://u.jd.com/qVFjDL\n" + "🍼母婴券年货节\n" + "https://u.jd.com/kA0scy\n" + "🛍超市满199-100\n"
                + "https://u.jd.com/eQSwNn\n" + "[發]内购券大全\n" + "https://u.jd.com/zIHmUy\n" + "[福]Plus全品券\n"
                + "https://u.jd.com/d9fcGr\n" + "⚡京东秒杀\n" + "https://u.jd.com/WSIi1z\n" + "【记得与更多好友分享[愉快]】";
        ConvertLinkManager convertLinkManager = BeanUtil.getBean(ConvertLinkManager.class);
        try {
            System.out.println(convertLinkManager.convertLinkFromText(text, 437032L, true));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    @Test
fanli/src/test/java/org/fanli/config/Test_UserOrderWeiQuanRecordService.java
@@ -13,7 +13,7 @@
    public void test3() {
        UserOrderWeiQuanRecordService service = BeanUtil.getBean(UserOrderWeiQuanRecordService.class);
        TaoBaoWeiQuanOrderService taoBaoWeiQuanOrderService = BeanUtil.getBean(TaoBaoWeiQuanOrderService.class);
        String[] sts = new String[] { "579042228537648772","767622209118533749","584142029127826311","770248738403368629","770974179347634248","711783427021923325","756141056240980857","711783427020923325","751754816157378937","583950605974863901"};
        String[] sts = new String[] {"756271874447755338","769373473533206978","752844641559634248","783423777826741052","773694880942796632","770552928635634248","582743790043310703","747354881395634248"};
        for (String orderId : sts)
            service.addTaoBaoWeiQuan(taoBaoWeiQuanOrderService.selectByTradeId(orderId));
    }
fanli/src/test/java/org/fanli/elastic/Test_Query.java
@@ -58,19 +58,19 @@
    
    
    @Test
    public void queryMatch() {
        try {
            ESOrderDao dao = BeanUtil.getBean(ESOrderDao.class);
            List<ESOrder> list = dao.query("8C", "974767");
            for (ESOrder esOrder: list) {
                System.out.println(esOrder.getUid() + " "+ esOrder.getGoodsName());
                System.out.println(esOrder.getUidDirect() + " "+ esOrder.getUidIndirect());
            }
            System.out.println("-------------结束-------------");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
//    @Test
//    public void queryMatch() {
//        try {
//            ESOrderDao dao = BeanUtil.getBean(ESOrderDao.class);
//            List<ESOrder> list = dao.query("8C", "974767");
//            for (ESOrder esOrder: list) {
//                System.out.println(esOrder.getUid() + " "+ esOrder.getGoodsName());
//                System.out.println(esOrder.getUidDirect() + " "+ esOrder.getUidIndirect());
//            }
//            System.out.println("-------------结束-------------");
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//    }
    
}
pom.xml
@@ -556,12 +556,6 @@
        </dependency>
        <dependency>
            <groupId>org.elasticsearch.client</groupId>
            <artifactId>elasticsearch-rest-high-level-client</artifactId>
            <version>7.5.1</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-elasticsearch</artifactId>
            <version>3.2.3.RELEASE</version>
@@ -606,7 +600,5 @@
    <modules>
        <module>utils</module>
        <module>fanli</module>
    </modules>
</project>
utils/src/main/java/org/yeshi/utils/JsonUtil.java
@@ -12,9 +12,6 @@
import java.util.Map;
import java.util.Set;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
@@ -202,7 +199,8 @@
                        desc = (nowDay - oldDay) + "天前";
                    }
                    out.value(desc);
                }
                } else
                    out.value("");
            }
            @Override