admin
2019-12-21 31d40dd7320db9a6fa7bd88bda546bcb195b2147
xxl-job任务管理接入
12个文件已修改
5个文件已添加
256 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConfigControllerV2.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/BrandInfoJob.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/log/LogHelper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/CommonTemplateContentServiceImpl.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/msg/UserOrderMsgNotificationServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TLJFreeBuyGoodsServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/manger/HongBaoV2AddManager.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/DaTaoKeUtil.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-dev/xxl-job.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-pro-by/xxl-job.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-pro-job/xxl-job.xml 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-pro/xxl-job.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/log4j.properties 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/spring.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/xxl-job-executor.properties 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pom.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConfigControllerV2.java
@@ -21,6 +21,7 @@
import com.yeshi.fanli.entity.common.JumpDetailV2;
import com.yeshi.fanli.entity.config.AppHomeFloatImg;
import com.yeshi.fanli.entity.taobao.ClientTBPid;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.homemodule.FloatADService;
@@ -161,8 +162,8 @@
     * @param acceptData
     * @param out
     */
    @RequestMapping(value = "getHomeConfigNew", method = RequestMethod.POST)
    public void getHomeConfigNew(AcceptData acceptData, Long uid, PrintWriter out) {
    @RequestMapping(value = "getHomeConfigNew")
    public void getHomeConfigNew(AcceptData acceptData, Long uid, String callback, PrintWriter out) {
        if (uid != null && uid == 0L)
            uid = null;
@@ -230,7 +231,10 @@
        String platform = acceptData.getPlatform();
        data.put("hotFuctionLink",
                configService.getByVersion("hot_function_url", platform, Integer.parseInt(acceptData.getVersion())));
        out.print(JsonUtil.loadTrueResult(data));
        if (StringUtil.isNullOrEmpty(callback))
            out.print(JsonUtil.loadTrueResult(data));
        else
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
    }
    /**
@@ -525,4 +529,19 @@
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
    }
    /**
     * 获取饿了么的推广链接
     *
     * @param acceptData
     * @param uid
     * @param out
     */
    @RequestMapping(value = "userProtocolListen")
    public void userProtocolListen(AcceptData acceptData, Long uid, int type, PrintWriter out) {
        LogHelper.userProtocolListen(String.format("%s#%s#%s", acceptData.getDevice(), uid, type));
        out.print(JsonUtil.loadTrueResult(""));
    }
}
fanli/src/main/java/com/yeshi/fanli/job/BrandInfoJob.java
@@ -2,9 +2,10 @@
import javax.annotation.Resource;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.brand.BrandInfoService;
import com.yeshi.fanli.util.Constant;
@@ -24,8 +25,15 @@
    /**
     * 每两个小时进行更新品牌商品信息
     */
    @Scheduled(cron = "0 0 1/2 * * ? ")
    // @Scheduled(cron = "0 0 1/2 * * ? ")
    @XxlJob("brandGoodsUpdateHandler")
    public ReturnT<String> demoJobHandler(String param) throws Exception {
        updateGoods();
        return ReturnT.SUCCESS;
    }
    public void updateGoods() {
        System.out.println("品牌商品更新执行");
        if (!Constant.IS_TASK)
            return;
        long startTime = java.lang.System.currentTimeMillis();
@@ -33,17 +41,17 @@
        long count = brandInfoService.countValidByCid(null);
        if (count == 0)
            return;
        long totalPage = (count / 100) + 1;
        for (long page = 0; page < totalPage; page++) {
            try {
                brandInfoService.addShopAndGoods(page * 100, 100);
            } catch (Exception e) {
               LogHelper.errorDetailInfo(e);
                LogHelper.errorDetailInfo(e);
            }
        }
        long endTime = java.lang.System.currentTimeMillis();
        LogHelper.test("结束执行品牌更新---updateGoods" + endTime + ",总耗时:" +(endTime -startTime) / 1000);
        LogHelper.test("结束执行品牌更新---updateGoods" + endTime + ",总耗时:" + (endTime - startTime) / 1000);
    }
}
fanli/src/main/java/com/yeshi/fanli/log/LogHelper.java
@@ -47,6 +47,13 @@
    private static Logger mqLogger = Logger.getLogger("mqLog");
    
    private static Logger vipInfoLogger = Logger.getLogger("vipInfoLog");
    private static Logger userProtocolListenLog = Logger.getLogger("userProtocolListenLog");
    public static void userProtocolListen(Object obj) {
        userProtocolListenLog.info(obj);
    }
    public static void userInfo(Object obj) {
        userLogger.info(obj);
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/CommonTemplateContentServiceImpl.java
@@ -227,9 +227,8 @@
        } else {
            List<Integer> cidList = new ArrayList<>();
            cidList.add(Integer.parseInt(cid));
            result =
                    DaTaoKeApiUtil.getGoodsList("", cidList, null, new BigDecimal("10"), null, page, pageSize,
                            DaTaoKeApiUtil.SORT_DEFAULT);
            result = DaTaoKeApiUtil.getGoodsList("", cidList, null, new BigDecimal("10"), null, page, pageSize,
                    DaTaoKeApiUtil.SORT_DEFAULT);
            if (result == null || result.getGoodsList() == null || result.getGoodsList().size() == 0) {
                result = new DaTaoKeGoodsResult();
@@ -725,8 +724,9 @@
            e.printStackTrace();
        }
        Map<Long, TaoBaoGoodsBrief> goodsMap = new HashMap<>();
        for (TaoBaoGoodsBrief goods : listTaoKeGoods)
            goodsMap.put(goods.getAuctionId(), goods);
        if (listTaoKeGoods != null)
            for (TaoBaoGoodsBrief goods : listTaoKeGoods)
                goodsMap.put(goods.getAuctionId(), goods);
        for (int i = 0; i < goodsList.size(); i++) {
            if (goodsMap.get(goodsList.get(i).getAuctionId()) == null) {
                goodsList.remove(i--);
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java
@@ -417,7 +417,7 @@
    private HongBaoOrderMapper hongBaoOrderMapper;
    @Override
    @Transactional(rollbackFor=Exception.class)
    @Transactional(rollbackFor = Exception.class)
    public void fanli(HongBaoV2 hb1) throws TaoBaoWeiQuanException {
        // 查询最新的红包数据
        hb1 = hongBaoV2Mapper.selectByPrimaryKeyForUpdate(hb1.getId());
@@ -484,18 +484,26 @@
        String key = mainUser.getId() + "-" + UUID.randomUUID().toString();
        msg.setKey(key);
        try {
            orderTransactionProducer.send(msg, new LocalTransactionExecuter() {
                @Override
                public TransactionStatus execute(Message arg0, Object arg1) {
                    try {
                        orderMoneySettleService.ziGouSettle(hongBaoOrder.getCommonOrder().getOrderNo(),
                                hongBaoOrder.getCommonOrder().getSourceType(), key);
                        return TransactionStatus.CommitTransaction;
                    } catch (Exception e) {
                        return TransactionStatus.RollbackTransaction;
            if (!Constant.IS_TEST)
                orderTransactionProducer.send(msg, new LocalTransactionExecuter() {
                    @Override
                    public TransactionStatus execute(Message arg0, Object arg1) {
                        try {
                            orderMoneySettleService.ziGouSettle(hongBaoOrder.getCommonOrder().getOrderNo(),
                                    hongBaoOrder.getCommonOrder().getSourceType(), key);
                            return TransactionStatus.CommitTransaction;
                        } catch (Exception e) {
                            return TransactionStatus.RollbackTransaction;
                        }
                    }
                }, null);
            else{
                try {
                    orderMoneySettleService.ziGouSettle(hongBaoOrder.getCommonOrder().getOrderNo(),
                            hongBaoOrder.getCommonOrder().getSourceType(), key);
                } catch (Exception e) {
                }
            }, null);
            }
        } catch (Exception e) {
            LogHelper.mqError(e.getMessage(), msg.getTopic(), msg.getTag(), new Gson().toJson(mqMsg));
        }
@@ -1289,12 +1297,13 @@
        } catch (UserAccountException e) {
        }
        if (resultCode == 1) {// 只发送新增消息
            OrderMQMsg mqMsg = new OrderMQMsg(orderId, sourceType, uid, OrderMQMsg.HANDLE_TYPE_ADD,
                    isCommonOrderValid(coList), 0, new Date());
            Message msg = MQMsgBodyFactory.create(MQTopicName.TOPIC_ORDER, OrderTopicTagEnum.orderStatistic, mqMsg);
            producer.send(msg);
        }
        if (!Constant.IS_TEST)
            if (resultCode == 1) {// 只发送新增消息
                OrderMQMsg mqMsg = new OrderMQMsg(orderId, sourceType, uid, OrderMQMsg.HANDLE_TYPE_ADD,
                        isCommonOrderValid(coList), 0, new Date());
                Message msg = MQMsgBodyFactory.create(MQTopicName.TOPIC_ORDER, OrderTopicTagEnum.orderStatistic, mqMsg);
                producer.send(msg);
            }
    }
    /**
fanli/src/main/java/com/yeshi/fanli/service/impl/order/msg/UserOrderMsgNotificationServiceImpl.java
@@ -148,7 +148,7 @@
    public void orderShareFirstLevelStatistic(Long uid, String orderId, int orderType, BigDecimal payMoney,
            BigDecimal money, int goodsCount, int orderState, String sourceUserName) {
        MsgOrderDetail detail = MsgOrderDetailFactory.createInviteOrder(uid, orderId, orderType, goodsCount, orderState,
                payMoney, money, String.format("由一级粉丝【%s】分享", getShortName(sourceUserName)));
                payMoney, money, String.format("由直接粉丝【%s】分享", getShortName(sourceUserName)));
        try {
            msgOrderDetailService.addMsgOrderDetail(detail,
                    (money == null || money.compareTo(new BigDecimal(0)) <= 0) ? false : true);
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TLJFreeBuyGoodsServiceImpl.java
@@ -71,7 +71,7 @@
    }
    
    //@Cacheable(value = "commonContentCache", key = "'tljFreeBuy-listByDay'+#day")
    @Cacheable(value = "commonContentCache", key = "'tljFreeBuy-listByDay'+#day")
    @Override
    public List<TLJFreeBuyGoods> listByDay(String day) {
        List<TLJFreeBuyGoods> list = listByDay(day, 10);
fanli/src/main/java/com/yeshi/fanli/service/manger/HongBaoV2AddManager.java
@@ -213,7 +213,7 @@
        return CommonOrder.STATE_SX;
    }
    @Transactional(rollbackFor=Exception.class)
    @Transactional(rollbackFor = Exception.class)
    private boolean updateHongBao(HongBaoOrder hongBaoOrder, CommonOrder commonOrder, int type,
            Map<Integer, HongBaoOrder> notificationMap) throws HongBaoException, UserAccountException {
        System.out.println(commonOrder.getOrderNo());
@@ -337,7 +337,7 @@
                                        HongBaoV2.TYPE_YIJI, MoneyBigDecimalUtil.mul(hongBao.getMoney(),
                                                firstRate.divide(new BigDecimal(100))));
                                if (firstHongbao != null)
                                    addInviteHongBao(firstHongbao, notificationMap, commonOrder);
                                    addInviteHongBao(firstHongbao, null, notificationMap, commonOrder);
                            }
                            boss = threeSaleSerivce.getBoss(boss.getId());
                            if (boss != null) {
@@ -352,7 +352,7 @@
                                            HongBaoV2.TYPE_ERJI, MoneyBigDecimalUtil.mul(hongBao.getMoney(),
                                                    secondRate.divide(new BigDecimal(100))));
                                    if (secondHongbao != null)
                                        addInviteHongBao(secondHongbao, notificationMap, commonOrder);
                                        addInviteHongBao(secondHongbao, null, notificationMap, commonOrder);
                                }
                            }
                        }
@@ -486,7 +486,7 @@
                HongBaoV2 firstHongbao = createInviteHongBao(boss.getId(), hongBao, commonOrder, HongBaoV2.TYPE_YIJI,
                        MoneyBigDecimalUtil.mul(hongBao.getMoney(), firstRate.divide(new BigDecimal(100))));
                addInviteHongBao(firstHongbao, notificationMap, commonOrder);
                addInviteHongBao(firstHongbao, null, notificationMap, commonOrder);
                // 插入二级子红包
                boss = threeSaleSerivce.getBoss(boss.getId());
@@ -498,7 +498,7 @@
                    HongBaoV2 secondHongbao = createInviteHongBao(boss.getId(), hongBao, commonOrder,
                            HongBaoV2.TYPE_ERJI,
                            MoneyBigDecimalUtil.mul(hongBao.getMoney(), secondRate.divide(new BigDecimal(100))));
                    addInviteHongBao(secondHongbao, notificationMap, commonOrder);
                    addInviteHongBao(secondHongbao, null, notificationMap, commonOrder);
                }
            }
@@ -534,7 +534,7 @@
                            HongBaoV2.TYPE_SHARE_YIJI,
                            MoneyBigDecimalUtil.mul(hongBao.getMoney(), firstLevelRate.divide(new BigDecimal(100))));
                    addInviteHongBao(firstHongbao, notificationMap, commonOrder);
                    addInviteHongBao(firstHongbao, hongBao.getUserInfo().getNickName(), notificationMap, commonOrder);
                    // 二级分享赚
                    boss = threeSaleSerivce.getBoss(boss.getId());
@@ -546,7 +546,7 @@
                        HongBaoV2 secondChild = createInviteHongBao(boss.getId(), hongBao, commonOrder,
                                HongBaoV2.TYPE_SHARE_ERJI, MoneyBigDecimalUtil.mul(hongBao.getMoney(),
                                        secondLevelRate.divide(new BigDecimal(100))));
                        addInviteHongBao(secondChild, notificationMap, commonOrder);
                        addInviteHongBao(secondChild, null, notificationMap, commonOrder);
                    }
                }
            }
@@ -584,8 +584,8 @@
     * @param notificationMap
     * @param commonOrder
     */
    private void addInviteHongBao(HongBaoV2 child, Map<Integer, HongBaoOrder> notificationMap,
            CommonOrder commonOrder) {
    private void addInviteHongBao(HongBaoV2 child, String parentHongBaoUserName,
            Map<Integer, HongBaoOrder> notificationMap, CommonOrder commonOrder) {
        if (child != null) {
            hongBaoV2Mapper.insertSelective(child);
            // 用户通知
@@ -593,6 +593,9 @@
                HongBaoV2 tempHongBao = new HongBaoV2(child.getId());
                tempHongBao.setUserInfo(child.getUserInfo());
                tempHongBao.setMoney(child.getMoney());
                if (child.getType() == HongBaoV2.TYPE_SHARE_YIJI)
                    tempHongBao.setBeizhu(parentHongBaoUserName);
                CommonOrder tempCommonOrder = new CommonOrder(commonOrder.getId());
                tempCommonOrder.setPayment(commonOrder.getPayment());
                notificationMap.put(child.getType(), new HongBaoOrder(tempCommonOrder, tempHongBao));
fanli/src/main/java/com/yeshi/fanli/util/taobao/DaTaoKeUtil.java
@@ -381,6 +381,8 @@
        } catch (IOException e1) {
            e1.printStackTrace();
        }
        if (doc == null)
            return new ArrayList<>();
        Elements els = doc.getElementsByTag("script");
        for (int i = 0; i < els.size(); i++) {
            String content = els.get(i).html();
@@ -388,7 +390,8 @@
                ScriptEngineManager manager = new ScriptEngineManager();
                ScriptEngine engine = manager.getEngineByName("javascript");
                try {
                    String js = "function getData(){return  JSON.stringify(dataDef);} var test1='--';function test2(res){};" + content.replace("$(window).load", "test2").replace("window.location.search.", "test1.");
                    String js = "function getData(){return  JSON.stringify(dataDef);} var test1='--';function test2(res){};"
                            + content.replace("$(window).load", "test2").replace("window.location.search.", "test1.");
                    engine.eval(js);
                    if (engine instanceof Invocable) {
                        Invocable in = (Invocable) engine;
@@ -611,33 +614,33 @@
        List<DingDongTime> list = new ArrayList<>();
        //获取当前时间之前的5个数据
        // 获取当前时间之前的5个数据
        for (int i = 5; i >= 0; i--) {
            int p = pos - i < 0 ? (times.length + pos - i) : pos - i;
            DingDongTime itemData = new DingDongTime(times[p].getKey(), times[p].getValue(),-1);
            DingDongTime itemData = new DingDongTime(times[p].getKey(), times[p].getValue(), -1);
            if (pos - i < 0)
                itemData.setTime(
                        preDay + "" + (itemData.getKey().length() < 2 ? ("0" + itemData.getKey()) : itemData.getKey()));
            else
                itemData.setTime(
                        nowDay + "" + (itemData.getKey().length() < 2 ? ("0" + itemData.getKey()) : itemData.getKey()));
            if(pos==p)
            if (pos == p)
                itemData.setState(0);
            list.add(itemData);
        }
        //向后添加剩下的
        // 向后添加剩下的
        if (pos + 1 < times.length)
            for (int i = pos + 1; i < times.length; i++) {
                DingDongTime itemData = new DingDongTime(times[i].getKey(), times[i].getValue(),1);
                DingDongTime itemData = new DingDongTime(times[i].getKey(), times[i].getValue(), 1);
                itemData.setTime(
                        nowDay + "" + (itemData.getKey().length() < 2 ? ("0" + itemData.getKey()) : itemData.getKey()));
                list.add(itemData);
            }
        if (times.length - (pos + 1) < 2) {
            DingDongTime itemData = new DingDongTime(times[0].getKey(), times[0].getValue(),1);
            DingDongTime itemData = new DingDongTime(times[0].getKey(), times[0].getValue(), 1);
            itemData.setTime(
                    nextDay + "" + (itemData.getKey().length() < 2 ? ("0" + itemData.getKey()) : itemData.getKey()));
            list.add(itemData);
fanli/src/main/resource/env-dev/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/env-pro-by/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/env-pro-job/xxl-job.xml
New file
@@ -0,0 +1,43 @@
<?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">
    <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="fileEncoding" value="utf-8" />
        <property name="locations">
            <list>
                <value>classpath*:xxl-job-executor.properties</value>
            </list>
        </property>
    </bean>
    <!-- ********************************* 基础配置 ********************************* -->
    <!-- 配置01、JobHandler 扫描路径 -->
    <context:component-scan base-package="com.yeshi.fanli.job" />
    <!-- 配置02、执行器 -->
    <bean id="xxlJobSpringExecutor" class="com.xxl.job.core.executor.impl.XxlJobSpringExecutor" >
        <!-- 执行器注册中心地址[选填],为空则关闭自动注册 -->
        <property name="adminAddresses" value="${xxl.job.admin.addresses}" />
        <!-- 执行器AppName[选填],为空则关闭自动注册 -->
        <property name="appName" value="${xxl.job.executor.appname}" />
        <!-- 执行器IP[选填],为空则自动获取 -->
        <property name="ip" value="${xxl.job.executor.ip}" />
        <!-- 执行器端口号[选填],小于等于0则自动获取 -->
        <property name="port" value="${xxl.job.executor.port}" />
        <!-- 访问令牌[选填],非空则进行匹配校验 -->
        <property name="accessToken" value="${xxl.job.accessToken}" />
        <!-- 执行器日志路径[选填],为空则使用默认路径 -->
        <property name="logPath" value="${xxl.job.executor.logpath}" />
        <!-- 日志保存天数[选填],值大于3时生效 -->
        <property name="logRetentionDays" value="${xxl.job.executor.logretentiondays}" />
    </bean>
</beans>
fanli/src/main/resource/env-pro/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/log4j.properties
@@ -234,6 +234,14 @@
log4j.appender.vipInfoLog.layout=org.apache.log4j.PatternLayout
log4j.appender.vipInfoLog.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%c]-[%p] %m%n  
log4j.logger.userProtocolListenLog=info,userProtocolListenLog
log4j.appender.userProtocolListenLog=org.apache.log4j.DailyRollingFileAppender
log4j.appender.userProtocolListenLog.File=logs/user/userProtocolListenLog.log
log4j.appender.userProtocolListenLog.MaxFileSize=20MB
log4j.appender.userProtocolListenLog.MaxBackupIndex=100
log4j.appender.userProtocolListenLog.layout=org.apache.log4j.PatternLayout
log4j.appender.userProtocolListenLog.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%c]-[%p] %m%n
log4j.appender.mongodb=org.apache.log4j.ConsoleAppender
log4j.appender.mongodb.Target=System.out
log4j.appender.mongodb.Threshold=DEBUG
fanli/src/main/resource/spring.xml
@@ -46,11 +46,15 @@
                <value>classpath:druid.properties</value>
                <value>classpath:mongo.properties</value>
                <value>classpath:rocketmq.properties</value>
                <value>classpath:xxl-job-executor.properties</value>
            </array>
        </property>
    </bean>
    <import resource="classpath:rocketmq.xml" />
    <import resource="classpath:xxl-job.xml" />
    <!--异步定义推荐方式 <task:executor id="executor" pool-size="15" /> <task:scheduler 
        id="scheduler" pool-size="30" /> <task:annotation-driven executor="executor" 
fanli/src/main/resource/xxl-job-executor.properties
New file
@@ -0,0 +1,14 @@
### 调度中心部署跟地址 [选填]:如调度中心集群部署存在多个地址则用逗号分隔。执行器将会使用该地址进行"执行器心跳注册"和"任务结果回调";为空则关闭自动注册;
xxl.job.admin.addresses=http://111.231.250.166:8080/xxl-job-admin
### 执行器AppName [选填]:执行器心跳注册分组依据;为空则关闭自动注册
xxl.job.executor.appname=pro-job
### 执行器IP [选填]:默认为空表示自动获取IP,多网卡时可手动设置指定IP,该IP不会绑定Host仅作为通讯实用;地址信息用于 "执行器注册" 和 "调度中心请求并触发任务";
xxl.job.executor.ip=
### 执行器端口号 [选填]:小于等于0则自动获取;默认端口为9999,单机部署多个执行器时,注意要配置不同执行器端口;
xxl.job.executor.port=9999
### 执行器通讯TOKEN [选填]:非空时启用;
xxl.job.accessToken=BLKS-XXL-666666@
### 执行器运行日志文件存储磁盘路径 [选填] :需要对该路径拥有读写权限;为空则使用默认路径;
xxl.job.executor.logpath=
### 执行器日志文件保存天数 [选填] : 过期日志自动清理, 限制值大于等于3时生效; 否则, 如-1, 关闭自动清理功能;
xxl.job.executor.logretentiondays=30
pom.xml
@@ -544,7 +544,7 @@
        <dependency>
            <groupId>com.xuxueli</groupId>
            <artifactId>xxl-job-core</artifactId>
            <version>2.1.0</version>
            <version>2.1.2</version>
        </dependency>
    </dependencies>