yujian
2019-06-24 bd331a582851cffcce54316e677e23760de4f384
冲突文件
72个文件已修改
1875 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/admin/ExtractAdminController.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/OrderAdminController.java 227 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/CommonContentController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/GoodsClassController.java 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/SearchController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserInfoController.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsClassControllerV2.java 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/h5/H5RecommendController.java 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/money/UserMoneyDetailMapper.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/order/HongBaoOrderMapper.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/push/DeviceTokenHWMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/taobao/TaoBaoWeiQuanOrderMapper.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserInfoExtraMapper.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/taobao/SuperTaoBaoGoodsDao.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/money/ExtractOrderStatisticDTO.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/pdd/PDDGoodsDetail.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/pdd/PDDOrderResult.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/activity/ActivityRuleUser.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/help/HelpCenter.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/help/HelpInfo.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/lable/QualityFactory.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgOtherDetail.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/Order.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserCustomSettings.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/dynamic/DynamicInfo.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/goods/CommonGoods.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/push/DeviceTokenHW.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/UpdateDaTaoKeJob.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/UpdateTaoBaoGoodsJob.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/money/UserMoneyDetailMapper.xml 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/order/HongBaoOrderMapper.xml 106 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/pdd/PDDOrderMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/push/DeviceTokenHWMapper.xml 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/taobao/TaoBaoWeiQuanOrderMapper.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserInfoExtraMapper.xml 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/DynamicInfoServiceImpl.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/CommonTemplateContentServiceImpl.java 241 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/ShareGoodsTextTemplateServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/ThreeSaleSerivceImpl.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/lable/TaoKeGoodsServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgOtherDetailServiceImpl.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOrderMsgNotificationServiceImpl.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java 230 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderUserStatisticServiceImpl.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/push/DeviceTokenHWServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoWeiQuanDrawBackServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoWeiQuanOrderServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/ExtractServiceImpl.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserMoneyDetailServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/ShareGoodsTextTemplateService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/msg/UserOtherMsgNotificationService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/order/CommonOrderService.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/order/OrderUserStatisticService.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/push/DeviceTokenHWService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/taobao/TaoBaoWeiQuanOrderService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInfoExtraService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserMoneyDetailService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/RedisManager.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/StringUtil.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/dataoke/DaTaoKeApiUtil.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/CommonGoodsFactory.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/CommonOrderGoodsFactory.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOtherDetailFactory.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/jd/JDUtil.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/pinduoduo/PinDuoDuoApiUtil.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/goods/GoodsSubClassLabelVO.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/order/CommonOrderVO.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/ExtractAdminController.java
@@ -396,19 +396,28 @@
                            }
                        }
                    }
                }
                if (record.getExtraInfo() != null) {
                    StringBuffer desc = new StringBuffer();
                    if (System.currentTimeMillis() > TimeUtil.convertToTimeTemp("2019-06-21", "yyyy-MM-dd")) {
                        desc.append("大笔订单数:" + record.getExtraInfo().getOrderCount50More() + "\n#");
                        desc.append("维权订单数:" + record.getExtraInfo().getWeiQuanOrderCount() + "\n#");
                        desc.append("维权订单佣金:" + record.getExtraInfo().getWeiQuanOrderFanAmount() + "\n#");
                        if (record.getExtraInfo().getOrderCount50More() > 0
                                || record.getExtraInfo().getWeiQuanOrderCount() >1
                                || record.getExtraInfo().getWeiQuanOrderFanAmount().compareTo(new BigDecimal(10)) >= 0)
                            warnLevel = 2;
                    } else {
                    if (record.getExtraInfo().getOrderCount50More() > 0
                            || record.getExtraInfo().getWeiQuanOrderCount() > 0
                            || record.getExtraInfo().getWeiQuanOrderFanAmount().compareTo(new BigDecimal(0)) > 0)
                        warnLevel = 2;
                    StringBuffer desc = new StringBuffer();
                    desc.append("大于50元订单:" + record.getExtraInfo().getOrderCount50More() + "\n#");
                    desc.append("维权订单数:" + record.getExtraInfo().getWeiQuanOrderCount() + "\n#");
                    desc.append("维权订单退回金额:" + record.getExtraInfo().getWeiQuanOrderFanAmount() + "\n#");
                    desc.append("180天安全订单数:" + record.getExtraInfo().getSafeOrderCount());
                    }
                    record.setExtraInfoStr(desc.toString());
                }
                record.setWarnLevel(warnLevel);
fanli/src/main/java/com/yeshi/fanli/controller/admin/OrderAdminController.java
@@ -15,6 +15,12 @@
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.yeshi.fanli.controller.admin.utils.AdminUtils;
import com.yeshi.fanli.entity.bus.user.HongBaoV2;
import com.yeshi.fanli.entity.money.UserMoneyDetail;
import com.yeshi.fanli.entity.money.UserMoneyDetail.UserMoneyDetailTypeEnum;
import com.yeshi.fanli.entity.order.CommonOrder;
import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanDrawBack;
import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder;
import com.yeshi.fanli.exception.order.CommonOrderException;
import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
import com.yeshi.fanli.service.inter.count.TaoBaoOrderCountService;
@@ -22,6 +28,9 @@
import com.yeshi.fanli.service.inter.order.CommonOrderService;
import com.yeshi.fanli.service.inter.order.OrderService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoOrderService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoWeiQuanDrawBackService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoWeiQuanOrderService;
import com.yeshi.fanli.service.inter.user.UserMoneyDetailService;
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
@@ -36,7 +45,6 @@
    @Resource
    private OrderService orderService;
    @Resource
    private HongBaoV2CountService hongBaoV2CountService;
@@ -53,9 +61,18 @@
    @Resource
    private TaoBaoOrderCountService taoBaoOrderCountService;
    @Resource
    private TaoBaoWeiQuanDrawBackService taoBaoWeiQuanDrawBackService;
    @Resource
    private TaoBaoWeiQuanOrderService taoBaoWeiQuanOrderService;
    @Resource
    private UserMoneyDetailService userMoneyDetailService;
    
    /**
     * 统计历史订单-淘宝订单
     *
     * @param callback
     * @param request
     * @param out
@@ -88,9 +105,9 @@
        }
    }
    
    /**
     * 查询所有用户订单列表
     *
     * @param callback
     * @param pageIndex
     * @param pageSize
@@ -104,10 +121,8 @@
     * @param out
     */
    @RequestMapping(value = "getUserOrderList")
    public void getUserOrderList(String callback, Integer pageIndex, Integer pageSize, Integer keyType,
            String key, Integer state, Integer type, Integer orderState, String startTime, String endTime,
            PrintWriter out) {
    public void getUserOrderList(String callback, Integer pageIndex, Integer pageSize, Integer keyType, String key,
            Integer state, Integer type, Integer orderState, String startTime, String endTime, PrintWriter out) {
        if (pageIndex == null || pageIndex < 1) {
            pageIndex = 1;
@@ -132,13 +147,63 @@
            long count = 0;
            // 查询列表
            List<CommonOrderVO> list = commonOrderService.listQuery((pageIndex - 1) * pageSize, pageSize,
                    keyType, key, state, type, orderState, startTime, endTime);
            List<CommonOrderVO> list = commonOrderService.listQuery((pageIndex - 1) * pageSize, pageSize, keyType, key,
                    state, type, orderState, startTime, endTime);
            if (list != null && list.size() > 0) {
                // 统计总数
                count = commonOrderService.countQuery(keyType, key, state, type, orderState, startTime, endTime);
            }
            // 查询是否维权
            for (CommonOrderVO order : list) {
                // 查询是否维权
                TaoBaoWeiQuanOrder weiQuanOrder = taoBaoWeiQuanOrderService.listByorderItemId(order.getTradeId());
                if (weiQuanOrder != null)// 有维权
                {
                    order.setState(CommonOrder.STATE_WQ);
                    TaoBaoWeiQuanDrawBack drawBack = taoBaoWeiQuanDrawBackService
                            .selectByOrderItemId(weiQuanOrder.getOrderItemId());
                    if (drawBack != null) {// 已经退款
                        order.setWeiQuanState(weiQuanOrder.getState());
                        // 计算退款资金
                        UserMoneyDetail detail = null;
                        switch (order.getHongBaoType()) {
                        case HongBaoV2.TYPE_ZIGOU:
                            detail = userMoneyDetailService.selectByTypeAndUidAndIdentifyCode(
                                    UserMoneyDetailTypeEnum.fanliWeiQuan, Long.parseLong(order.getUserId()),
                                    drawBack.getId());
                            if (detail == null)
                                detail = userMoneyDetailService.selectByTypeAndUidAndIdentifyCode(
                                        UserMoneyDetailTypeEnum.weiQuan, Long.parseLong(order.getUserId()),
                                        drawBack.getId());
                            break;
                        case HongBaoV2.TYPE_YIJI:
                        case HongBaoV2.TYPE_ERJI:
                        case HongBaoV2.TYPE_SHARE_YIJI:
                        case HongBaoV2.TYPE_SHARE_ERJI:
                            detail = userMoneyDetailService.selectByTypeAndUidAndIdentifyCode(
                                    UserMoneyDetailTypeEnum.inviteWeiQuan, Long.parseLong(order.getUserId()),
                                    drawBack.getId());
                            break;
                        case HongBaoV2.TYPE_SHARE_GOODS:
                            detail = userMoneyDetailService.selectByTypeAndUidAndIdentifyCode(
                                    UserMoneyDetailTypeEnum.shareWeiQuan, Long.parseLong(order.getUserId()),
                                    drawBack.getId());
                            break;
                        }
                        if (detail != null) {
                            // 退款成功
                            order.setWeiQuanBackMoney(detail.getMoney().abs().toString());
                        } else {// 尚未退款
                            order.setWeiQuanBackMoney("-" + order.getHongBao());
                        }
                    } else {// 尚未退款
                        order.setWeiQuanBackMoney("-" + order.getHongBao());
                    }
                }
            }
            
            int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
@@ -158,10 +223,9 @@
        }
    }
    /**
     * 查询订单列表用户uid
     *
     * @param callback
     * @param pageIndex
     * @param pageSize
@@ -175,8 +239,8 @@
     * @param out
     */
    @RequestMapping(value = "getHistoryOrder")
    public void getHistoryOrder(String callback, Integer pageIndex, Integer pageSize, Long uid, Integer state, Integer type,
            Integer orderState,    String orderNo, String startTime, String endTime, PrintWriter out) {
    public void getHistoryOrder(String callback, Integer pageIndex, Integer pageSize, Long uid, Integer state,
            Integer type, Integer orderState, String orderNo, String startTime, String endTime, PrintWriter out) {
        if (uid == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("uid不能为空"));
@@ -206,13 +270,13 @@
            long count = 0;
            // 查询列表
            List<CommonOrderVO> list = commonOrderService.listQueryByUid((pageIndex - 1) * pageSize, pageSize ,
                    uid, state, type, orderState, orderNo, startTime, endTime, null);
            List<CommonOrderVO> list = commonOrderService.listQueryByUid((pageIndex - 1) * pageSize, pageSize, uid,
                    state, type, orderState, orderNo, startTime, endTime, null);
            if (list != null && list.size() > 0) {
                // 统计总数
                count = commonOrderService.countQueryByUid(uid, state, type, orderState, orderNo, startTime,
                        endTime, null);
                count = commonOrderService.countQueryByUid(uid, state, type, orderState, orderNo, startTime, endTime,
                        null);
            }
            
            int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
@@ -251,8 +315,8 @@
     * @param out
     */
    @RequestMapping(value = "get24HOderChannelCharts")
    public void get24HOderChannelCharts(String callback, String channelArray, Integer dateType,
            String year, String startTime, String endTime, PrintWriter out) {
    public void get24HOderChannelCharts(String callback, String channelArray, Integer dateType, String year,
            String startTime, String endTime, PrintWriter out) {
        String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
        if (validateMsg != null) {
@@ -265,18 +329,17 @@
            endTime = null;
        }
        List<String> channelList = null;
        if (channelArray != null && channelArray.trim().length() > 0) {
            Gson gson = new Gson();
            channelList = gson.fromJson(channelArray, new TypeToken<ArrayList<String>>() {}.getType());
            channelList = gson.fromJson(channelArray, new TypeToken<ArrayList<String>>() {
            }.getType());
        }
        if (channelList == null || channelList.size() == 0) {
            channelList = new ArrayList<String>();
            channelList.add("all");
        }
        
        if (dateType == 1 && year != null) {
            year = null; // 设置为空
@@ -307,8 +370,8 @@
            JSONArray line_list = new JSONArray();
            
            for (String channel : channelList) {
                List<Map<String, Object>> list = hongBaoV2CountService.count24HOderByChannel(channel, dateType, year, startTime, endTime);
                List<Map<String, Object>> list = hongBaoV2CountService.count24HOderByChannel(channel, dateType, year,
                        startTime, endTime);
                
                if ("all".equalsIgnoreCase(channel)) {
                    channel = "总计";
@@ -332,7 +395,6 @@
                line_list.add(innerList);
            }
            JSONObject data = new JSONObject();
            if (objectDate != null) {
                data.put("xAxis_list", gson.toJson(objectDate));
@@ -350,21 +412,24 @@
        }
    }
    /**
     * 统计提现申请总次数
     *
     * @param callback
     * @param channelArray 渠道名 为空是统计所有
     * @param dateType     显示视图:日-1 、月-2、 年-3
     * @param state 状态:  1-未到账 2-已到账  3-已失效
     * @param channelArray
     *            渠道名 为空是统计所有
     * @param dateType
     *            显示视图:日-1 、月-2、 年-3
     * @param state
     *            状态: 1-未到账 2-已到账 3-已失效
     * @param year 
     * @param startTime
     * @param endTime
     * @param out
     */
    @RequestMapping(value = "getHongBaoNum")
    public void getHongBaoNum(String callback,String channelArray, Integer dateType, Integer state,
            String year, String startTime, String endTime, PrintWriter out) {
    public void getHongBaoNum(String callback, String channelArray, Integer dateType, Integer state, String year,
            String startTime, String endTime, PrintWriter out) {
        String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
        if (validateMsg != null) {
@@ -383,18 +448,22 @@
    /**
     * 统计提现申请总金额
     *
     * @param callback
     * @param channelArray 渠道名 为空是统计所有
     * @param dateType     显示视图:日-1 、月-2、 年-3
     * @param state 状态:  1-未到账 2-已到账  3-已失效
     * @param channelArray
     *            渠道名 为空是统计所有
     * @param dateType
     *            显示视图:日-1 、月-2、 年-3
     * @param state
     *            状态: 1-未到账 2-已到账 3-已失效
     * @param year 
     * @param startTime
     * @param endTime
     * @param out
     */
    @RequestMapping(value = "getHongBaoMoney")
    public void getHongBaoMoney(String callback,String channelArray, Integer dateType, Integer state,
            String year, String startTime, String endTime, PrintWriter out) {
    public void getHongBaoMoney(String callback, String channelArray, Integer dateType, Integer state, String year,
            String startTime, String endTime, PrintWriter out) {
        String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
        if (validateMsg != null) {
@@ -412,15 +481,9 @@
        }
    }
    /**
     * 统计红包信息
     *
     * @param channelArray
     * @param dateType
     * @param state
@@ -430,26 +493,25 @@
     * @return
     * @throws Exception
     */
    public JSONObject countHistoryHongBao(String channelArray, Integer dateType, Integer state, String year, String startTime,
            String endTime, int countType) throws Exception {
    public JSONObject countHistoryHongBao(String channelArray, Integer dateType, Integer state, String year,
            String startTime, String endTime, int countType) throws Exception {
        if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) {
            startTime = null;
            endTime = null;
        }
        List<String> channelList = null;
        if (channelArray != null && channelArray.trim().length() > 0) {
            Gson gson = new Gson();
            channelList = gson.fromJson(channelArray, new TypeToken<ArrayList<String>>() {}.getType());
            channelList = gson.fromJson(channelArray, new TypeToken<ArrayList<String>>() {
            }.getType());
        }
        if (channelList == null || channelList.size() == 0) {
            channelList = new ArrayList<String>();
            channelList.add("all");
        }
        
        if (dateType == 1 && year != null) {
            year = null; // 设置为空
@@ -479,11 +541,9 @@
        for (String channel : channelList) {
            List<Map<String, Object>> list = null;
            if (countType == 1 ) {
                list = hongBaoV2CountService.countHongBaoNum(channel, dateType, state, year,
                        startTime, endTime);
                list = hongBaoV2CountService.countHongBaoNum(channel, dateType, state, year, startTime, endTime);
            } else if (countType == 2) {
                list = hongBaoV2CountService.countHongBaoMoney(channel, dateType, state, year,
                        startTime, endTime);
                list = hongBaoV2CountService.countHongBaoMoney(channel, dateType, state, year, startTime, endTime);
            }
            
            if ("all".equalsIgnoreCase(channel)) {
@@ -508,7 +568,6 @@
            line_list.add(innerList);
        }
        JSONObject data = new JSONObject();
        if (objectDate != null) {
            data.put("xAxis_list", gson.toJson(objectDate));
@@ -521,20 +580,22 @@
        return data;
    }
    /**
     * 分类型订单数与比例 
     *
     * @param callback
     * @param dateType 日 -1 月-2 年-3
     * @param type     返利订单-1  分享订单-2  邀请订单-3
     * @param dateType
     *            日 -1 月-2 年-3
     * @param type
     *            返利订单-1 分享订单-2 邀请订单-3
     * @param year
     * @param startTime
     * @param endTime
     * @param out
     */
    @RequestMapping(value = "getTypeNumber")
    public void getTypeNumber(String callback, Integer dateType, String typeArray, String year,
            String startTime, String endTime, PrintWriter out) {
    public void getTypeNumber(String callback, Integer dateType, String typeArray, String year, String startTime,
            String endTime, PrintWriter out) {
        
        String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
        if (validateMsg != null) {
@@ -547,18 +608,17 @@
            endTime = null;
        }
        List<Integer> channelList = null;
        if (typeArray != null && typeArray.trim().length() > 0) {
            Gson gson = new Gson();
            channelList = gson.fromJson(typeArray, new TypeToken<ArrayList<Integer>>() {}.getType());
            channelList = gson.fromJson(typeArray, new TypeToken<ArrayList<Integer>>() {
            }.getType());
        }
        if (channelList == null || channelList.size() == 0) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("订单类型不能为空"));
            return;
        }
        
        if (dateType == 1 && year != null) {
            year = null; // 设置为空
@@ -586,13 +646,11 @@
        
        try {
            JSONArray line_list = new JSONArray();
            for (Integer type : channelList) {
                
                List<Map<String, Object>> list = hongBaoV2CountService.countHongBaoType(dateType,
                        type, year, startTime, endTime);
                List<Map<String, Object>> list = hongBaoV2CountService.countHongBaoType(dateType, type, year, startTime,
                        endTime);
                
                JSONObject innerList = new JSONObject();
                if (type == 1) {
@@ -618,7 +676,6 @@
                line_list.add(innerList);
            }
            JSONObject data = new JSONObject();
            if (objectDate != null) {
                data.put("xAxis_list", gson.toJson(objectDate));
@@ -638,6 +695,7 @@
    
    /**
     * 订单跟踪准确率(返利券用户订单/淘宝联盟订单)
     *
     * @param callback
     * @param dateType
     * @param year
@@ -646,9 +704,8 @@
     * @param out
     */
    @RequestMapping(value = "getTrackAccuracyRate")
    public void getTrackAccuracyRate(String callback, Integer dateType, String year,
            String startTime, String endTime, PrintWriter out) {
    public void getTrackAccuracyRate(String callback, Integer dateType, String year, String startTime, String endTime,
            PrintWriter out) {
        if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) {
            startTime = null;
@@ -683,8 +740,8 @@
            
            JSONArray line_list = new JSONArray();
            
            List<Map<String, Object>> list = commonOrderCountService.getTrackAccuracyRate(dateType,
                     year, startTime, endTime);
            List<Map<String, Object>> list = commonOrderCountService.getTrackAccuracyRate(dateType, year, startTime,
                    endTime);
            
            JSONObject innerList = new JSONObject();
            innerList.put("name", "总计");
@@ -703,7 +760,6 @@
            
            line_list.add(innerList);
            JSONObject data = new JSONObject();
            if (objectDate != null) {
                data.put("xAxis_list", gson.toJson(objectDate));
@@ -720,11 +776,12 @@
        }
    }
    
    /**
     * 当前未收货订单数
     *
     * @param callback
     * @param type 订单状态-暂未使用
     * @param type
     *            订单状态-暂未使用
     * @param out
     */
    @RequestMapping(value = "getHistoryUnreceived")
@@ -744,10 +801,9 @@
        }
    }
    
    /**
     * 维权订单数
     *
     * @param callback
     * @param dateType
     * @param year
@@ -756,8 +812,8 @@
     * @param out
     */
    @RequestMapping(value = "getWeiQaunOrderNumber")
    public void getWeiQaunOrderNumber(String callback, Integer dateType, String year,
            String startTime, String endTime, PrintWriter out) {
    public void getWeiQaunOrderNumber(String callback, Integer dateType, String year, String startTime, String endTime,
            PrintWriter out) {
        
        String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
        if (validateMsg != null) {
@@ -774,9 +830,9 @@
        }
    }
    
    /**
     * 维权订单金额
     *
     * @param callback
     * @param dateType
     * @param year
@@ -785,8 +841,8 @@
     * @param out
     */
    @RequestMapping(value = "getWeiQaunOrderMoney")
    public void getWeiQaunOrderMoney(String callback, Integer dateType, String year,
            String startTime, String endTime, PrintWriter out) {
    public void getWeiQaunOrderMoney(String callback, Integer dateType, String year, String startTime, String endTime,
            PrintWriter out) {
        
        String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
        if (validateMsg != null) {
@@ -803,10 +859,9 @@
        }
    }
    
    /**
     * 统计红包信息
     *
     * @param channelArray
     * @param dateType
     * @param state
@@ -816,8 +871,8 @@
     * @return
     * @throws Exception
     */
    public JSONObject countWeiQaunOrder(Integer dateType, String year, String startTime,
            String endTime, int countType) throws Exception {
    public JSONObject countWeiQaunOrder(Integer dateType, String year, String startTime, String endTime, int countType)
            throws Exception {
        if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) {
            startTime = null;
@@ -856,7 +911,6 @@
            list = commonOrderCountService.countWeiQaunOrderMoney(dateType, year, startTime, endTime);
        }
        
        JSONObject innerList = new JSONObject();
        innerList.put("name", "总计");
@@ -873,7 +927,6 @@
        }
        
        line_list.add(innerList);
        JSONObject data = new JSONObject();
        if (objectDate != null) {
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/CommonContentController.java
@@ -19,7 +19,6 @@
import com.yeshi.fanli.dto.common.CommonContentTypeEnum;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
import com.yeshi.fanli.entity.taobao.SearchFilter;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.service.inter.goods.CommonTemplateContentService;
import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/GoodsClassController.java
@@ -22,6 +22,7 @@
import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
import com.yeshi.fanli.entity.bus.clazz.GoodsSecondClass;
import com.yeshi.fanli.entity.bus.clazz.GoodsSubClass;
import com.yeshi.fanli.entity.bus.clazz.TaoBaoClass;
import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
import com.yeshi.fanli.entity.bus.lable.QualityFactory;
import com.yeshi.fanli.entity.system.BusinessSystem;
@@ -420,6 +421,84 @@
                goodsSubClassService.countClick(acceptData, goodsSubClass);
            }
            SearchFilter sf = new SearchFilter();
            String catesId = "";
            // 查询是否有淘宝分类ID
            List<TaoBaoClass> tbClassList = taoBaoClassService.listBySystemSubCid(0, 10, goodsSubClass.getId());
            if (tbClassList != null && tbClassList.size() > 0)
                for (TaoBaoClass tbc : tbClassList) {
                    catesId += tbc.getCategoryId() + ",";
                }
            if (catesId.endsWith(","))
                catesId = catesId.substring(0, catesId.length() - 1);
            sf.setCateIds(catesId);
            if (!StringUtil.isNullOrEmpty(catesId))// 按分类名称搜索
            {
                String searchParam = goodsSubClass.getSearchJson();
                Gson gs = new Gson();
                SearchFilter searchfilter = gs.fromJson(searchParam, SearchFilter.class);
                searchfilter.setCateIds(catesId);
                searchfilter.setPage(page);
                searchfilter.setPageSize(20);
                if (Integer.parseInt(order) == 0)
                    searchfilter.setMaterialId("6707");
                taoKeGoodsService.setSearchFilter(searchfilter, filter, order, startprice, endprice, fastFilter,
                        totalSales);
                TaoBaoSearchResult searchResult = TaoKeApiUtil.searchWuLiao(searchfilter);
                long count = searchResult.getPageEntity().getTotalCount();
                JSONObject result = new JSONObject();
                BigDecimal rate = hongBaoManageService.getFanLiRate();
                List<TaoBaoGoodsBrief> resultGoodsList = searchResult.getTaoBaoGoodsBriefs();
                // 查询是否超过了最大的商品数
                if ((resultGoodsList == null || resultGoodsList.size() < 20)
                        && !StringUtil.isNullOrEmpty(goodsSubClass.getKey())) {
                    if (resultGoodsList == null)
                        resultGoodsList = new ArrayList<>();
                    // 需要根据关键字查询
                    searchfilter.setCateIds(null);
                    searchfilter.setPage((int) (count % 20 == 0 ? count / 20 - 1 : count / 20));
                    searchfilter.setPageSize(20);
                    searchfilter.setKey(goodsSubClass.getKey());
                    TaoBaoSearchResult searchResult2 = TaoKeApiUtil.searchWuLiao(searchfilter);
                    if (searchResult2 != null) {
                        List<TaoBaoGoodsBrief> resultListTemp = searchResult2.getTaoBaoGoodsBriefs();
                        if (resultListTemp != null)
                            resultGoodsList.addAll(resultListTemp);
                    }
                }
                JSONArray array = new JSONArray();
                Gson gson2 = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                        .excludeFieldsWithoutExposeAnnotation().create();
                if (resultGoodsList != null)
                    for (TaoBaoGoodsBrief goods : resultGoodsList) {
                        array.add(gson2.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(goods, rate + "", null)));
                    }
                result.put("result", array);
                result.put("count", result.optLong("count") + count);
                out.print(JsonUtil.loadTrueResult(result));
                return;
            } else {
                String searchParam = goodsSubClass.getSearchJson();
                Gson gs = new Gson();
                SearchFilter searchfilter = gs.fromJson(searchParam, SearchFilter.class);
                searchfilter.setCateIds(catesId);
                searchfilter.setPage(page);
                searchfilter.setPageSize(20);
                if (Integer.parseInt(order) == 0)
                    searchfilter.setMaterialId("6707");
                searchfilter.setKey(goodsSubClass.getKey());
                taoKeGoodsService.setSearchFilter(searchfilter, filter, order, startprice, endprice, fastFilter,
                        totalSales);
                JSONObject result = taoKeGoodsService.searchWuLiao(searchfilter);
                if (1 > 0) {
                    out.print(JsonUtil.loadTrueResult(result));
                    return;
                }
            }
            /* 搜索关键词 */
            String searchKey = goodsSubClass.getName();
            String key = goodsSubClass.getKey();
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/SearchController.java
@@ -428,7 +428,11 @@
        // }
        if (!StringUtil.isNullOrEmpty(kw) && (kw.startsWith("http://") || kw.startsWith("https://"))) {
            out.print(JsonUtil.loadFalseResult("无法搜索链接"));
            JSONObject data = new JSONObject();
            data.put("result", new JSONArray());
            data.put("count", 0);
            data.put("nav", new JSONArray());
            out.print(JsonUtil.loadTrueResult(data));
            return;
        }
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java
@@ -558,13 +558,8 @@
            return;
        }
        String from = null;
        if (tljId != null) {
            from = "taolijin";
        }
        if (StringUtil.isNullOrEmpty(template))
            template = getShareTemplate(uid, hasCoupon, from);
            template = getShareTemplate(uid, hasCoupon, tljId);
        // 校验券模板是否正确
        if (hasCoupon) {
@@ -631,7 +626,7 @@
                                : goodsLink.getCouponLink());
        }
        String content = shareGoodsTextTemplateService.createContentByTemplate(template, uid, goods, token, shortLink,
                hasCoupon, from);
                hasCoupon, tljId);
        JSONObject data = new JSONObject();
        data.put("content", content);
        out.print(JsonUtil.loadTrueResult(data));
@@ -724,9 +719,9 @@
        out.print(JsonUtil.loadTrueResult(""));
    }
    private String getShareTemplate(Long uid, boolean hasCoupon, String from) {
    private String getShareTemplate(Long uid, boolean hasCoupon, Long tljId) {
        if (hasCoupon) {
            if (!StringUtil.isNullOrEmpty(from) && "taolijin".equals(from)) {
            if (tljId != null) {
                String template = shareGoodsTextTemplateService.getTaoLiJinTemplate(uid);
                if (StringUtil.isNullOrEmpty(template))
                    template = configTaoLiJinService.getValueByKey("goods_share_text");
@@ -756,13 +751,19 @@
     * @param out
     */
    @RequestMapping(value = "getShareTextTemplate", method = RequestMethod.POST)
    public void getShareTextTemplate(AcceptData acceptData, Long uid, String from, Boolean hasCoupon, PrintWriter out) {
    public void getShareTextTemplate(AcceptData acceptData, Long uid, Long tljId, Boolean hasCoupon, PrintWriter out) {
        if (uid == null) {
            out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
            return;
        }
        if (hasCoupon == null) {
            out.print(JsonUtil.loadFalseResult(1, "是否有券字段为空"));
            return;
        }
        JSONObject data = new JSONObject();
        data.put("template", getShareTemplate(uid, hasCoupon, from));
        data.put("template", getShareTemplate(uid, hasCoupon, tljId));
        out.print(JsonUtil.loadTrueResult(data));
    }
@@ -773,8 +774,8 @@
     * @param out
     */
    @RequestMapping(value = "getShareTextTemplateRules", method = RequestMethod.POST)
    public void getShareTextTemplateRules(AcceptData acceptData, String from, PrintWriter out) {
        if (!StringUtil.isNullOrEmpty(from) && "taolijin".equals(from)) {
    public void getShareTextTemplateRules(AcceptData acceptData, Long tljId, PrintWriter out) {
        if (tljId != null) {
            out.print(JsonUtil.loadTrueResult( configTaoLiJinService.getValueByKey("share_goods_rules")));
        } else {
            out.print(JsonUtil.loadTrueResult(configService.get("share_goods_template_rules")));
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserInfoController.java
@@ -84,6 +84,7 @@
import com.yeshi.fanli.service.inter.order.HongBaoOrderService;
import com.yeshi.fanli.service.inter.order.LostOrderService;
import com.yeshi.fanli.service.inter.order.OrderService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinDetailService;
import com.yeshi.fanli.service.inter.user.AccountMessageService;
import com.yeshi.fanli.service.inter.user.BindingAccountService;
import com.yeshi.fanli.service.inter.user.ExtractRecordService;
@@ -209,6 +210,9 @@
    
    @Resource
    private MaskKeyService maskKeyService;
    @Resource
    private UserTaoLiJinDetailService userTaoLiJinDetailService;
    
    private static final String PASSWORD_MAX_ERROR = "password_max_error";
@@ -2090,11 +2094,19 @@
            if (mySettings.getNoInvitationBonus() == null) {
                mySettings.setNoInvitationBonus(0);
            }
            if (mySettings.getOpenSpreadHongBao() == null) {
                if(userTaoLiJinDetailService.countDetail(uid) > 0) {
                    mySettings.setOpenSpreadHongBao(1);
                } else {
                mySettings.setOpenSpreadHongBao(0);
            }
            }
            data.put("moduleState", mySettings);
            int welfareCenterNews = 0;
            String invitCode = null;
            UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsClassControllerV2.java
fanli/src/main/java/com/yeshi/fanli/controller/h5/H5RecommendController.java
@@ -10,6 +10,7 @@
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.yeshi.utils.HttpUtil;
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.taobao.TbImgUtil;
@@ -148,6 +149,63 @@
    }
    /**
     * 处理条件
     *
     * @param uid
     * @param tid
     * @param out
     */
    private void doTaoLiJin(String callback, Long uid, Long tid, PrintWriter out) {
        String tljLink = "";
        Long auctionId = null;
        BigDecimal tljMoney=null;
        TaoBaoGoodsBrief goods = null;
        try {
            goods = redisManager.getTaoBaoGoodsBrief(auctionId);
        } catch (TaobaoGoodsDownException e) {
        }
        if (goods == null) {// 已经下线
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("商品信息获取失败")));
            return;
        }
        String token = redisManager.getTLJToken(tljLink);
        if (StringUtil.isNullOrEmpty(token)) {
            token = TaoKeApiUtil.getTKToken(goods.getPictUrl(), goods.getTitle(), tljLink);
        }
        // 券后价
        BigDecimal afterCouponPrice = TaoBaoUtil.getAfterUseCouplePrice(goods);
        TaoBaoLink link = new TaoBaoLink();
        link.setTaoToken(token);
        JSONObject data = new JSONObject();
        data.put("title", goods.getTitle());
        if (goods.getImgList() == null)
            goods.setImgList(new ArrayList<>());
        goods.getImgList().add(0, TbImgUtil.getTBSizeImg(goods.getPictUrl(), 300));
        data.put("imgs", goods.getImgList());
        data.put("couponPrice", afterCouponPrice);
        // 老版本兼容
        data.put("quanPrice", afterCouponPrice);
        data.put("zkPrice", goods.getZkPrice());
        data.put("shareContent", "长按复制本段文字,打开【手机淘宝】即可领取【特别优惠券】购买下单,");
        data.put("token", link.getTaoToken());
        data.put("reservePrice", goods.getReservePrice());
        data.put("shopType", goods.getUserType() == 1 ? 2 : 1);
        if (!StringUtil.isNullOrEmpty(goods.getCouponInfo()) && !"无".equalsIgnoreCase(goods.getCouponInfo())) {
            data.put("couponAmount", MoneyBigDecimalUtil.getWithNoZera(goods.getCouponAmount()));
            data.put("coupon", true);
        } else {
            data.put("coupon", false);
        }
        data.put("tljMoney", tljMoney);
        out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
    }
    /**
     * 
     * 方法说明: 获取商品详情
     * 
@@ -160,17 +218,24 @@
    @SuppressWarnings("unused")
    @RequestMapping(value = "getGoodsDetail", method = RequestMethod.GET)
    public void getGoodsDetail(final AcceptData acceptData, final String id, String uid, String callback,
    public void getGoodsDetail(final AcceptData acceptData, final String id, Long tid, String uid, String callback,
            PrintWriter out) {
        long begin = java.lang.System.currentTimeMillis();
        if (StringUtil.isNullOrEmpty(id)) {
            out.print(JsonUtil.loadFalseResult(1, "请上传id"));
            return;
        }
        if (!StringUtil.isNullOrEmpty(uid)) {
            uid = AESUtil.decrypt(uid, Constant.UIDAESKEY);
        }
        if (tid != null && tid != 0) {
            doTaoLiJin(callback, StringUtil.isNullOrEmpty(uid) || Long.parseLong(uid) == 0 ? null : Long.parseLong(uid),
                    tid, out);
            return;
        }
        TaoBaoGoodsBrief goods = null;
        String token = null;
        if (!StringUtil.isNullOrEmpty(uid)) {
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/money/UserMoneyDetailMapper.java
@@ -8,6 +8,7 @@
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.money.UserMoneyDetail;
import com.yeshi.fanli.entity.money.UserMoneyDetail.UserMoneyDetailTypeEnum;
import com.yeshi.fanli.vo.money.UserMonthMoneyVO;
public interface UserMoneyDetailMapper extends BaseMapper<UserMoneyDetail> {
@@ -93,4 +94,14 @@
    BigDecimal getTotalMoneyByTypeAndUidWithDate(@Param("uid") Long uid, @Param("typeList") List<String> typeList,
            @Param("minDate") Date minDate, @Param("maxDate") Date maxDate);
    /**
     * 根据类型,用户ID,唯一标识查询
     * @param type
     * @param uid
     * @param sourceIdentifyId
     * @return
     */
    UserMoneyDetail selectByTypeAndUidAndIdentifyCode(@Param("type") UserMoneyDetailTypeEnum type,
            @Param("uid") Long uid, @Param("sourceIdentifyId") Long sourceIdentifyId);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/order/HongBaoOrderMapper.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.dao.mybatis.order;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;
@@ -55,12 +56,14 @@
            @Param("sourceType") int sourceType);
    /**
     * 返利超过一定金额的订单数量
     * 返利超过100的,且最小时间
     * 
     * @param uid
     * @param minTime
     * @return
     */
    public int countHongBaoOrderCountMoreByUid(@Param("money") BigDecimal money, @Param("uid") Long uid);
    public int countOrderCountMoneyMoreByUidAndMinTime(@Param("uid") Long uid, @Param("minTime") Date minTime,
            @Param("money") BigDecimal money);
    /**
     * 维权订单数量(包含邀请赚)
@@ -68,7 +71,7 @@
     * @param uid
     * @return
     */
    public int countWeiQuanOrderByUid(Long uid);
    public int countWeiQuanOrderByUid(@Param("uid") Long uid, @Param("minTime") Date minTime);
    /**
     * 维权订单返还的金额
@@ -76,14 +79,15 @@
     * @param uid
     * @return
     */
    public BigDecimal sumWeiQuanOrderFanAmountByUid(Long uid);
    public BigDecimal sumWeiQuanOrderFanAmountByUid(@Param("uid") Long uid, @Param("minTime") Date minTime);
    /**
     * 安全订单数量
     *
     * 维权订单数量
     * @param uid
     * @param minMoney
     * @param minTime
     * @return
     */
    public int countSafeOrderByUid(Long uid);
    public int countWeiQuanOrderWithMinCommision(@Param("uid")Long uid,@Param("minMoney") BigDecimal minMoney,@Param("minTime") Date minTime);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/push/DeviceTokenHWMapper.java
@@ -29,4 +29,7 @@
    Long selectCount();
    List<DeviceTokenHW> selectByDevice(String device);
    int bindUidByDevice(@Param("uid") Long uid, @Param("device") String device);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/taobao/TaoBaoWeiQuanOrderMapper.java
@@ -25,13 +25,15 @@
    TaoBaoWeiQuanOrder selectByOrderIdAndOrderItemId(@Param("orderId") String orderId,
            @Param("orderItemId") String orderItemId);
    TaoBaoWeiQuanOrder selectByOrderItemId(String orderItemId);
    // 按订单号和维权状态查询
    List<TaoBaoWeiQuanOrder> selectListByOrderIdAndState(@Param("orderId") String orderId,
            @Param("state") String state);
    
    /**
     * 统计总金额
     *
     * @param dateType 
     * @param years
     * @param startTime
@@ -43,6 +45,7 @@
    
    /**
     * 统计总个数
     *
     * @param dateType 
     * @param years
     * @param startTime
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserInfoExtraMapper.java
@@ -36,4 +36,12 @@
     */
    long countByRankId(Long rankId);
    
    /**
     * 获取用户附加信息
     * @param uid
     * @return
     */
    UserInfoExtra gerUserRank(Long uid);
}
fanli/src/main/java/com/yeshi/fanli/dao/taobao/SuperTaoBaoGoodsDao.java
@@ -3,6 +3,7 @@
import java.math.BigDecimal;
import java.util.List;
import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Repository;
@@ -21,7 +22,7 @@
                Criteria.where("finalPrice").gte(minPrice.multiply(new BigDecimal(100)).intValue()));
        query.addCriteria(ca);
        query.limit(count);
        query.skip(start);
        query.skip(start).with(new Sort(Sort.Direction.DESC, "goods.biz30day"));
        return mongoTemplate.find(query, SuperTaoBaoGoods.class);
    }
fanli/src/main/java/com/yeshi/fanli/dto/money/ExtractOrderStatisticDTO.java
@@ -10,7 +10,9 @@
 */
public class ExtractOrderStatisticDTO {
    private int orderCount50More;// 返利超过超过50元的订单数量
    private int orderCount50More;// 返利超过50元的订单数量
    private Integer orderCount100More;// 返利超过100元的订单数量
    private int weiQuanOrderCount;// 维权订单数量
@@ -62,4 +64,12 @@
        this.safeOrderCount = safeOrderCount;
    }
    public Integer getOrderCount100More() {
        return orderCount100More;
    }
    public void setOrderCount100More(Integer orderCount100More) {
        this.orderCount100More = orderCount100More;
    }
}
fanli/src/main/java/com/yeshi/fanli/dto/pdd/PDDGoodsDetail.java
@@ -98,9 +98,28 @@
    private String salesTip;// 模糊销量
    @SerializedName("activity_type")
    private Integer activityType;// 活动类型,0-无活动;1-秒杀;3-限量折扣;12-限时折扣;13-大促活动;14-名品折扣;15-品牌清仓;16-食品超市;17-一元幸运团;18-爱逛街;19-时尚穿搭;20-男人帮;21-9块9;22-竞价活动;23-榜单活动;24-幸运半价购;25-定金预售;26-幸运人气购;27-特色主题活动;28-断码清仓;29-一元话费;30-电器城;31-每日好店;32-品牌卡;101-大促搜索池;102-大促品类分会场;
    @SerializedName("mall_id")
    private Long mallId;//店铺ID
    // mall_id:4217177,cps_sign:null,cat_id:null mall_rate:10
    private Integer state;//状态  1-下线  0-正常
    public Integer getState() {
        return state;
    }
    public void setState(Integer state) {
        this.state = state;
    }
    public Long getMallId() {
        return mallId;
    }
    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }
    public Long getGoodsId() {
        return goodsId;
    }
fanli/src/main/java/com/yeshi/fanli/dto/pdd/PDDOrderResult.java
@@ -8,14 +8,6 @@
    private int totalCount;// 总数量
    private List<PDDOrder> orderList;// 商品列表
    public PDDOrderResult() {
    }
    public PDDOrderResult(int totalCount, List<PDDOrder> orderList) {
        this.totalCount = totalCount;
        this.orderList = orderList;
    }
    public int getTotalCount() {
        return totalCount;
    }
@@ -24,11 +16,20 @@
        this.totalCount = totalCount;
    }
    public List<PDDOrder> getGoodsList() {
    public List<PDDOrder> getOrderList() {
        return orderList;
    }
    public void setGoodsList(List<PDDOrder> orderList) {
    public void setOrderList(List<PDDOrder> orderList) {
        this.orderList = orderList;
    }
    public PDDOrderResult() {
    }
    public PDDOrderResult(int totalCount, List<PDDOrder> orderList) {
        this.totalCount = totalCount;
        this.orderList = orderList;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/activity/ActivityRuleUser.java
@@ -33,6 +33,7 @@
    public final static int RULE_HOT_HUWAI = 100 + 13;
    public final static int RULE_HOT_XIANGBAO = 100 + 11;
    public final static int RULE_HAOHUO = 200;
    public final static int RULE_HAODIAN = 300;
    public static ActivityUserRule[] RULES = new ActivityUserRule[] { new ActivityUserRule(RULE_DEFAULT, "默认"),
            new ActivityUserRule(RULE_HOT, "单品热销"), new ActivityUserRule(RULE_HOT_JUJIA, "居家百货"),
fanli/src/main/java/com/yeshi/fanli/entity/bus/help/HelpCenter.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.entity.bus.help;
import java.io.Serializable;
import java.util.Date;
import org.yeshi.utils.mybatis.Column;
@@ -12,7 +13,12 @@
 * @date 2018年8月14日
 */
@org.yeshi.utils.mybatis.Table("yeshi_ec_help_center")
public class HelpCenter {
public class HelpCenter implements Serializable{
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    @Column(name = "h_id")
    private Long id;
fanli/src/main/java/com/yeshi/fanli/entity/bus/help/HelpInfo.java
@@ -1,5 +1,7 @@
package com.yeshi.fanli.entity.bus.help;
import java.io.Serializable;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.PersistenceConstructor;
import org.springframework.data.mongodb.core.mapping.Document;
@@ -11,7 +13,11 @@
 *
 */
@Document(collection = "helpInfo")
public class HelpInfo {
public class HelpInfo implements Serializable{
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    @Id
    private Long id;// 帮助中心ID
    private String content;// 具体内容
fanli/src/main/java/com/yeshi/fanli/entity/bus/lable/QualityFactory.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.entity.bus.lable;
import java.io.Serializable;
import java.util.Date;
import org.yeshi.utils.mybatis.Column;
@@ -16,8 +17,12 @@
 * @date 2018年7月3日
 */
@Table("yeshi_ec_quality_factory")
public class QualityFactory  {
public class QualityFactory  implements Serializable{
    
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    // 人工筛选入库
    public final static int MODE_MANUAL = 1;
    // 系统算法 -自动入库
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgOtherDetail.java
@@ -6,6 +6,7 @@
import org.yeshi.utils.mybatis.Table;
import com.yeshi.fanli.dto.msg.MsgOtherCouponContentDTO;
import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
import com.yeshi.fanli.entity.bus.user.UserInfo;
/**
@@ -17,7 +18,9 @@
@Table("yeshi_ec_msg_other")
public class MsgOtherDetail {
    public enum MsgTypeOtherTypeEnum {
        couponMianDan("免单券"), couponWelfareMianDan("福利免单券"), couponReward("奖励券");
        couponMianDan("免单券"), couponWelfareMianDan("福利免单券"), couponReward("奖励券"),
        taoLiJin("推广红包");
        private final String desc;
        private MsgTypeOtherTypeEnum(String desc) {
@@ -50,6 +53,10 @@
    // 券内容
    private MsgOtherCouponContentDTO coupnContent;
    // 淘礼金参数
    private MsgOtherTaoLiJinContentDTO taoLiJinContent;
    public MsgOtherCouponContentDTO getCoupnContent() {
        return coupnContent;
@@ -130,4 +137,12 @@
    public void setSourceId(Long sourceId) {
        this.sourceId = sourceId;
    }
    public MsgOtherTaoLiJinContentDTO getTaoLiJinContent() {
        return taoLiJinContent;
    }
    public void setTaoLiJinContent(MsgOtherTaoLiJinContentDTO taoLiJinContent) {
        this.taoLiJinContent = taoLiJinContent;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/Order.java
@@ -33,6 +33,7 @@
    public final static int ORDER_TYPE_TAOBAO = 1;// 淘宝
    public final static int ORDER_TYPE_JINGDONG = 2;// 京东
    public final static int ORDER_TYPE_PDD = 3;// 拼多多
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserCustomSettings.java
@@ -99,5 +99,4 @@
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/dynamic/DynamicInfo.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.entity.dynamic;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@@ -14,9 +15,13 @@
import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
@Document(collection = "dynamic_info")
public class DynamicInfo {
public class DynamicInfo implements Serializable{
    
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    // 分享类型      1:单图分享 、2:4图分享、 3:9图分享 、 4:邀请分享
    public final static int SHARE_TYPE_ONE = 1;
    public final static int SHARE_TYPE_FOUR = 2;
fanli/src/main/java/com/yeshi/fanli/entity/goods/CommonGoods.java
@@ -10,6 +10,7 @@
public class CommonGoods {
    public static int GOODS_TYPE_TB = 1;// 淘宝天猫
    public static int GOODS_TYPE_JD = 2;// 京东
    public static int GOODS_TYPE_PDD = 3;// 拼多多
    public static int SHOP_TYPE_TB = 1;// 淘宝
    public static int SHOP_TYPE_TM = 2;// 天猫
fanli/src/main/java/com/yeshi/fanli/entity/push/DeviceTokenHW.java
@@ -18,6 +18,8 @@
    private Long id;
    @Column(name = "dh_token")
    private String deviceToken;
    @Column(name = "dh_token_md5")
    private String deviceTokenMd5;
    @Column(name = "dh_device")
    private String device;
    @Column(name = "dh_uid")
@@ -64,4 +66,13 @@
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    public String getDeviceTokenMd5() {
        return deviceTokenMd5;
    }
    public void setDeviceTokenMd5(String deviceTokenMd5) {
        this.deviceTokenMd5 = deviceTokenMd5;
    }
}
fanli/src/main/java/com/yeshi/fanli/job/UpdateDaTaoKeJob.java
@@ -35,7 +35,6 @@
    @Resource
    private DaTaoKeGoodsDetailService daTaoKeGoodsService;
    
    /**
     * 限时秒杀 数据更新
     */
@@ -85,8 +84,8 @@
        }
    }
    // 20分钟更新一次
    @Scheduled(cron = "0 0/20 * * * ? ")
    // 1个小时更新一次
    @Scheduled(cron = "0 0 0/1 * * ? ")
    public void doSyncJob() {
        if (!Constant.IS_TASK)
            return;
@@ -104,8 +103,8 @@
        }
    }
    
    // 每天早上同步一次
    @Scheduled(cron = "0 0 6 * * ? ")
    public void doSyncJobNew() {
        if (!Constant.IS_TASK)
            return;
fanli/src/main/java/com/yeshi/fanli/job/UpdateTaoBaoGoodsJob.java
@@ -136,7 +136,6 @@
     */
    @Scheduled(cron = "0 15 0/6 * * ? ")
    public void removeFlashSaleGoods() {
        if (!Constant.IS_TASK) {
            return;
        }
@@ -158,6 +157,8 @@
    // 更新品牌商品,每天早上6点执行一次
    @Scheduled(cron = "0 0 6 * * ? ")
    public void updateBrandGoods() {
        if (!Constant.IS_TASK)
            return;
        brandClassShopService.updateShopGoods();
    }
@@ -166,6 +167,8 @@
     */
    @Scheduled(cron = "0 0 0/1 * * ?")
    public void update618() {
        if (!Constant.IS_TASK)
            return;
        LogHelper.test("更新618商品");
        taoBaoGoodsActivityService.sysncS618Goods();
    }
fanli/src/main/java/com/yeshi/fanli/mapping/money/UserMoneyDetailMapper.xml
@@ -101,14 +101,16 @@
                income ,if(b.money is null,0,b.money) as expend
                FROM
                (select #{item} as `time`) c
                (select #{item}
                as `time`) c
                left join
                (
                SELECT
                DATE_FORMAT(
                d.`umd_createtime`,'%Y-%m') AS
                d.`umd_createtime`,'%Y-%m')
                AS
                `time`,SUM(d.`umd_money`)
                AS money
                FROM
@@ -125,13 +127,16 @@
                LEFT JOIN
                (
                SELECT DATE_FORMAT(
                SELECT
                DATE_FORMAT(
                d.`umd_createtime`,'%Y-%m') AS
                `time`,SUM(d.`umd_money`) AS money
                `time`,SUM(d.`umd_money`)
                AS money
                FROM
                `yeshi_ec_user_money_detail`
                d
                WHERE d.`umd_uid`=#{uid} AND
                WHERE d.`umd_uid`=#{uid}
                AND
                d.`umd_money` <![CDATA[<0]]>
                AND DATE_FORMAT(
                d.`umd_createtime`,'%Y-%m')=#{item} GROUP BY
@@ -219,9 +224,13 @@
    <select id="selectByTypeAndUidAndIdentifyCode" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_user_money_detail where
        umd_uid=#{uid} and
        umd_type=#{type} and umd_source_identify_id=#{sourceIdentifyId}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
fanli/src/main/java/com/yeshi/fanli/mapping/order/HongBaoOrderMapper.xml
@@ -108,50 +108,98 @@
    </select>
    <select id="countWeiQuanOrderByUid" parameterType="java.lang.Long"
    <select id="countOrderCountMoneyMoreByUidAndMinTime" resultType="java.lang.Integer">
        SELECT COUNT(DISTINCT( h.id)) FROM
        (
        SELECT IF(v.`hb_pid` IS NOT
        NULL,v.`hb_pid`,v.`hb_id`) AS id FROM
        yeshi_ec_hongbao_v2 v WHERE
        v.`hb_uid`=#{uid}
        ) h LEFT JOIN yeshi_ec_hongbao_order ho ON
        h.id=ho.`ho_hongbao_id` LEFT
        JOIN yeshi_ec_common_order co ON
        co.`co_id`=ho.`ho_order_id` WHERE co.`co_third_create_time`>#{minTime}
        and
        (co.`co_estimate`>=#{money} OR co.`co_eIncome`>=#{money})
    </select>
    <select id="countWeiQuanOrderByUid"
        resultType="java.lang.Integer">
        SELECT COUNT(*) FROM
        (
        SELECT IF(v.`hb_pid` IS NOT NULL,p.`hb_id`,v.`hb_id`) AS id FROM
        yeshi_ec_hongbao_v2 v LEFT JOIN yeshi_ec_hongbao_v2 p ON
        p.`hb_id`=v.`hb_pid` WHERE v.`hb_uid`=#{0}
        ) a LEFT JOIN yeshi_ec_hongbao_order ho ON ho.`ho_hongbao_id`=a.id LEFT
        JOIN yeshi_ec_common_order co ON co.co_id=ho.`ho_order_id`
        LEFT JOIN `yeshi_ec_taobao_weiqaun_order` wo ON
        SELECT IF(v.`hb_pid` IS NOT
        NULL,p.`hb_id`,v.`hb_id`) AS id FROM
        yeshi_ec_hongbao_v2 v LEFT JOIN
        yeshi_ec_hongbao_v2 p ON
        p.`hb_id`=v.`hb_pid` WHERE v.`hb_uid`=#{uid} and
        v.`hb_create_time`>=#{minTime}
        ) a
        LEFT JOIN yeshi_ec_hongbao_order ho
        ON ho.`ho_hongbao_id`=a.id LEFT
        JOIN yeshi_ec_common_order co ON
        co.co_id=ho.`ho_order_id`
        LEFT JOIN
        `yeshi_ec_taobao_weiqaun_order` wo
        ON
        wo.`tmo_order_item_id`=co.`co_trade_id`
        WHERE co.`co_id`>0 AND wo.`tmo_id`>0
        WHERE co.`co_id`>0 AND
        wo.`tmo_id`>0
    </select>
    <select id="sumWeiQuanOrderFanAmountByUid" parameterType="java.lang.Long"
        resultType="java.math.BigDecimal">
        SELECT SUM(wo.`tmo_fan_money`) FROM
    <select id="sumWeiQuanOrderFanAmountByUid" resultType="java.math.BigDecimal">
        SELECT
        SUM(wo.`tmo_fan_money`) FROM
        (
        SELECT IF(v.`hb_pid` IS NOT NULL,p.`hb_id`,v.`hb_id`) AS id FROM
        yeshi_ec_hongbao_v2 v LEFT JOIN yeshi_ec_hongbao_v2 p ON
        p.`hb_id`=v.`hb_pid` WHERE v.`hb_uid`=#{0}
        ) a LEFT JOIN yeshi_ec_hongbao_order ho ON ho.`ho_hongbao_id`=a.id LEFT
        JOIN yeshi_ec_common_order co ON co.co_id=ho.`ho_order_id`
        SELECT IF(v.`hb_pid` IS
        NOT
        NULL,p.`hb_id`,v.`hb_id`) AS id FROM
        yeshi_ec_hongbao_v2 v LEFT
        JOIN
        yeshi_ec_hongbao_v2 p ON
        p.`hb_id`=v.`hb_pid` WHERE
        v.`hb_uid`=#{uid}
        ) a
        LEFT JOIN yeshi_ec_hongbao_order ho ON
        ho.`ho_hongbao_id`=a.id LEFT
        JOIN yeshi_ec_common_order co ON
        co.co_id=ho.`ho_order_id`
        LEFT JOIN `yeshi_ec_taobao_weiqaun_order` wo ON
        LEFT JOIN
        `yeshi_ec_taobao_weiqaun_order` wo
        ON
        wo.`tmo_order_item_id`=co.`co_trade_id`
        WHERE co.`co_id`>0 AND wo.`tmo_id`>0
        WHERE co.`co_id`>0 AND
        wo.`tmo_id`>0 and co_third_create_time>=#{minTime}
    </select>
    <select id="countSafeOrderByUid" parameterType="java.lang.Long"
        resultType="java.lang.Integer">
        SELECT COUNT(co.`co_id`) FROM
    <select id="countWeiQuanOrderWithMinCommision" resultType="java.lang.Integer">
        SELECT count(distinct(a.id)) FROM
        (
        SELECT IF(v.`hb_pid` IS NOT NULL,p.`hb_id`,v.`hb_id`) AS id FROM
        yeshi_ec_hongbao_v2 v LEFT JOIN yeshi_ec_hongbao_v2 p ON
        p.`hb_id`=v.`hb_pid` WHERE v.`hb_uid`=#{0}
        ) a LEFT JOIN yeshi_ec_hongbao_order ho ON ho.`ho_hongbao_id`=a.id LEFT
        JOIN yeshi_ec_common_order co ON co.co_id=ho.`ho_order_id`
        SELECT IF(v.`hb_pid` IS
        NOT
        NULL,p.`hb_id`,v.`hb_id`) AS id FROM
        yeshi_ec_hongbao_v2 v LEFT
        JOIN
        yeshi_ec_hongbao_v2 p ON
        p.`hb_id`=v.`hb_pid` WHERE
        v.`hb_uid`=#{0}
        ) a
        LEFT JOIN yeshi_ec_hongbao_order ho ON
        ho.`ho_hongbao_id`=a.id LEFT
        JOIN yeshi_ec_common_order co ON
        co.co_id=ho.`ho_order_id`
        WHERE co.`co_id`>0 AND co.`co_settle_time` IS NOT NULL AND
        (UNIX_TIMESTAMP()- UNIX_TIMESTAMP(co.`co_settle_time`))>180*24*60*60;
        LEFT JOIN
        `yeshi_ec_taobao_weiqaun_order` wo
        ON
        wo.`tmo_order_item_id`=co.`co_trade_id`
        WHERE co.`co_id`>0 AND
        tmo_fan_money>=#{minMoney} and co_third_create_time>=#{minTime}
        wo.`tmo_id`>0 and wo
    </select>
fanli/src/main/java/com/yeshi/fanli/mapping/pdd/PDDOrderMapper.xml
@@ -1,7 +1,7 @@
<?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.entity.dao.PDDOrderMapper">
<mapper namespace="com.yeshi.fanli.dao.mybatis.pdd.PDDOrderMapper">
    <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.pdd.PDDOrder">
        <id column="po_id" property="id" jdbcType="BIGINT" />
        <result column="po_order_sn" property="orderSn" jdbcType="VARCHAR" />
fanli/src/main/java/com/yeshi/fanli/mapping/push/DeviceTokenHWMapper.xml
@@ -7,65 +7,54 @@
        <result column="dh_token" property="deviceToken" jdbcType="VARCHAR" />
        <result column="dh_device" property="device" jdbcType="VARCHAR" />
        <result column="dh_updatetime" property="updateTime" jdbcType="TIMESTAMP" />
        <result column="dh_token_md5" property="deviceTokenMd5"
            jdbcType="VARCHAR" />
        <association property="user" column="dh_uid"
            resultMap="com.yeshi.fanli.dao.mybatis.UserInfoMapper.BaseResultMap" />
    </resultMap>
    <sql id="Base_Column_List">dh_id,dh_token,dh_device,dh_uid as id,dh_updatetime</sql>
    <sql id="Base_Column_List">dh_id,dh_token,dh_device,dh_uid as
        id,dh_updatetime,dh_token_md5
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_uid_devicetoken_hw where dh_id = #{id,jdbcType=BIGINT}
    </select>
    <select id="selectByDeviceAndUid" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_uid_devicetoken_hw where dh_device = #{device} and
        dh_uid=#{uid}
    </select>
    <select id="selectList" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_uid_devicetoken_hw limit #{start},#{count}
    </select>
    <select id="selectByUid" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_uid_devicetoken_hw where dh_uid = #{0}
    </select>
    <select id="selectCount" resultType="java.lang.Long">
        select
        count(dh_id)
        from
    <select id="selectCount" resultType="java.lang.Long">select count(dh_id) from
        yeshi_ec_uid_devicetoken_hw
    </select>
    <select id="selectByDevice" resultMap="BaseResultMap"
        parameterType="java.lang.String">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_uid_devicetoken_hw where dh_device = #{0}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_uid_devicetoken_hw where dh_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.push.DeviceTokenHW"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_uid_devicetoken_hw
        (dh_id,dh_token,dh_device,dh_uid,dh_updatetime) values
        (#{id,jdbcType=BIGINT},#{deviceToken,jdbcType=VARCHAR},#{device,jdbcType=VARCHAR},#{user.id,jdbcType=BIGINT},#{updateTime,jdbcType=TIMESTAMP})
        (dh_id,dh_token,dh_device,dh_uid,dh_updatetime,dh_token_md5) values
        (#{id,jdbcType=BIGINT},#{deviceToken,jdbcType=VARCHAR},#{device,jdbcType=VARCHAR},#{user.id,jdbcType=BIGINT},#{updateTime,jdbcType=TIMESTAMP},#{deviceTokenMd5,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.push.DeviceTokenHW"
        useGeneratedKeys="true" keyProperty="id">
@@ -76,6 +65,7 @@
            <if test="device != null">dh_device,</if>
            <if test="user != null">dh_uid,</if>
            <if test="updateTime != null">dh_updatetime,</if>
            <if test="deviceTokenMd5 != null">dh_token_md5,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -84,6 +74,7 @@
            <if test="device != null">#{device,jdbcType=VARCHAR},</if>
            <if test="user != null">#{user.id,jdbcType=BIGINT},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="deviceTokenMd5 != null">#{deviceTokenMd5,jdbcType=VARCHAR}</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.push.DeviceTokenHW">update
@@ -91,9 +82,11 @@
        #{deviceToken,jdbcType=VARCHAR},dh_device =
        #{device,jdbcType=VARCHAR},dh_uid =
        #{user.id,jdbcType=BIGINT},dh_updatetime =
        #{updateTime,jdbcType=TIMESTAMP} where dh_id =
        #{updateTime,jdbcType=TIMESTAMP} ,dh_token_md5
        =#{deviceTokenMd5,jdbcType=VARCHAR} where dh_id =
        #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.push.DeviceTokenHW">
        update yeshi_ec_uid_devicetoken_hw
        <set>
@@ -101,7 +94,18 @@
            <if test="device != null">dh_device=#{device,jdbcType=VARCHAR},</if>
            <if test="user != null">dh_uid=#{user.id,jdbcType=BIGINT},</if>
            <if test="updateTime != null">dh_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="deviceTokenMd5 !=null">dh_token_md5 =#{deviceTokenMd5,jdbcType=VARCHAR},</if>
        </set>
        where dh_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="bindUidByDevice">
        update yeshi_ec_uid_devicetoken_hw
        <set>
            dh_uid=#{uid}
        </set>
        where dh_device = #{device}
    </update>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/taobao/TaoBaoWeiQuanOrderMapper.xml
@@ -46,6 +46,13 @@
        tmo_state=#{state}
    </select>
    <select id="selectByOrderItemId" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_taobao_weiqaun_order where tmo_order_item_id =#{0}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_taobao_weiqaun_order where tmo_id = #{id,jdbcType=BIGINT}
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserInfoExtraMapper.xml
@@ -45,6 +45,29 @@
          
  </resultMap>
  
  <resultMap id="AllResultMap" type="com.yeshi.fanli.entity.bus.user.UserInfoExtra">
  <id column="uie_id" property="id" jdbcType="BIGINT"/>
    <result column="uie_rank_source" property="rankSource" jdbcType="INTEGER"/>
    <result column="uie_rank_order_num" property="rankOrderNum" jdbcType="INTEGER"/>
    <result column="uie_rank_update_time" property="rankUpdateTime" jdbcType="TIMESTAMP"/>
    <result column="uie_invite_code" property="inviteCode" jdbcType="VARCHAR"/>
    <result column="uie_lottery_newbies" property="lotteryNewbies" jdbcType="INTEGER"/>
    <result column="uie_coupon_news" property="couponNews" jdbcType="INTEGER"/>
    <result column="uie_synch_navbar" property="synchNavbar" jdbcType="VARCHAR"/>
    <result column="uie_first_login_time" property="firstLoginTime" jdbcType="TIMESTAMP"/>
    <result column="uie_create_time" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="uie_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
    <association property="userInfo" column="uie_uid" javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
        <id column="uie_uid" property="id" jdbcType="BIGINT" />
    </association>
    <association property="userRank" column="uie_rank_id"
         resultMap="com.yeshi.fanli.dao.mybatis.user.UserRankMapper.BaseResultMap"/>
  </resultMap>
  <sql id="Base_Column_List">uie_id,uie_uid,uie_rank_id,uie_rank_source,uie_rank_order_num,uie_rank_update_time,uie_invite_code,uie_lottery_newbies,uie_coupon_news,uie_synch_navbar,uie_first_login_time,uie_create_time,uie_update_time</sql>
 
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
@@ -140,5 +163,9 @@
        WHERE  t.`uie_rank_id` = #{rankId}
   </select>
    
   <select id="gerUserRank" resultMap="AllResultMap">
        SELECT * FROM yeshi_ec_user_info_extra ue
        LEFT JOIN yeshi_ec_user_rank rk ON rk.`ur_id` = ue.`uie_rank_id`
        WHERE ue.`uie_uid` = #{uid}
   </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/DynamicInfoServiceImpl.java
@@ -18,6 +18,7 @@
import com.yeshi.fanli.dao.dynamic.DynamicInfoDao;
import com.yeshi.fanli.dto.taobao.TaoBaoShopDTO;
import com.yeshi.fanli.entity.bus.activity.ActivityRuleUser;
import com.yeshi.fanli.entity.bus.activity.ActivityUser;
import com.yeshi.fanli.entity.bus.activity.RecommendActivity;
import com.yeshi.fanli.entity.bus.activity.RecommendActivityInviteInfo;
@@ -93,18 +94,15 @@
    @Resource
    private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
    
    @Override
    public void insert(DynamicInfo record) {
         dynamicInfoDao.insert(record);
    }
    
    @Override
    public DynamicInfo getById(String id) {
        return dynamicInfoDao.getById(id);
    }
    
    @Override
    public void insertTimeInvite() {
@@ -206,7 +204,6 @@
        inviteMaterialService.updateState(1, materialId);
    }
    @Override
    public void insertShopInfo() {
        List<String> brandIdList = DaTaoKeApiUtil.getBrandIdList();
@@ -214,7 +211,6 @@
            LogHelper.test("大淘客品牌id获取失败(DynamicInfoService-insertShopInfo)");
            return;
        }
        
        Long classId = 3L;
        Long subclassId = 0L;
@@ -252,7 +248,6 @@
            return;
        }
        
        List<TaoBaoGoodsBrief> listGoods = dynamicShopInfo.getListGoods();
        if (listGoods == null || listGoods.size() == 0) {
            LogHelper.test("大淘客品牌商品信息爬取失败(DynamicInfoService-insertShopInfo)");
@@ -277,7 +272,8 @@
        dynamicVO.setSubclassId(subclassId);
        dynamicVO.setShowType(DynamicInfo.SHOW_TYPE_TWO);
        dynamicVO.setShop(taoBaoShop);
        dynamicVO.setUser(activityUserService.listRand(1).get(0));
        List<ActivityRuleUser> userList = activityUserService.listByRuleCode(ActivityRuleUser.RULE_HAODIAN, 1, 50);
        dynamicVO.setUser(userList.get((int) (userList.size() * Math.random())).getActivityUser());
        dynamicVO.setCreateTime(DateUtil.reduceRandomMinute(new Date(), 8));    
        dynamicVO.setUpdateTime(new Date());
        
@@ -293,7 +289,8 @@
        List<GoodsPicture> listPicture = new ArrayList<GoodsPicture>();
        for (TaoBaoGoodsBrief goodsBrief : listGoods) {
            BigDecimal proportion = hongBaoManageService.getFanLiRate();
            TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(goodsBrief, proportion.toString(), null);
            TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(goodsBrief,
                    proportion.toString(), null);
            taoBaoGoodsBriefExtra.setCouponInfo(null);
            taoBaoGoodsBriefExtra.setUpdatetime(new Date());
            
@@ -320,8 +317,6 @@
        
        dynamicInfoDao.insert(dynamicVO);
    }
    
    @Override
    public void insertTimeRecommend() {
@@ -358,7 +353,8 @@
                TaoBaoGoodsBrief taoBaoGoodsBrief = TaoBaoUtil.convert(daTaoKe);
                listGoods.add(taoBaoGoodsBrief);
                
                TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null);
                TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief,
                        proportion.toString(), null);
                if (!taoBaoGoodsBriefExtra.isCoupon()) {
                    taoBaoGoodsBriefExtra.setState(1);
                }
@@ -465,7 +461,8 @@
        listGoods.add(taoBaoGoodsBrief);
        
        BigDecimal proportion = hongBaoManageService.getFanLiRate();
        TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null);
        TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief,
                proportion.toString(), null);
        if (!taoBaoGoodsBriefExtra.isCoupon()) {
            taoBaoGoodsBriefExtra.setState(1);
        }
@@ -594,8 +591,6 @@
        return goodsPicture;
    }
    @Override
    public void insertInviteActivity(RecommendActivity activity) throws Exception{
        
@@ -644,7 +639,6 @@
        dynamicVO.setShareType(DynamicInfo.SHARE_TYPE_INVITE);
        dynamicVO.setUpdateTime(new Date());
        
        Integer shareCount = activity.getShareCount();
        if (shareCount == null || shareCount <= 0) {
            dynamicVO.setShareCount(1000 + (int) (Math.random() * 8000));
@@ -660,7 +654,6 @@
            dynamicVO.setUser(activityUser);
        }
        
        // 介绍内容
        List<ClientTextStyleVO> listtitle = new ArrayList<ClientTextStyleVO>();
        if(!StringUtil.isNullOrEmpty(title)) {
@@ -669,7 +662,6 @@
            row1.setContent(title );
            listtitle.add(row1);
        }
        
        // 图片
        List<GoodsPicture> listImg = new ArrayList<GoodsPicture>();
@@ -712,7 +704,6 @@
        dynamicInfoDao.insert(dynamicVO);
    }
    
    @Override
    public void insertActivityRecommend(RecommendActivity activity) {
        if (activity == null || activity.getGoodsList() == null) {
@@ -736,7 +727,6 @@
            dynamicInfo.setActivityId(activity.getId());
            dynamicInfo.setUpdateTime(new Date());
            
            List<ClientTextStyleVO> listtitle = new ArrayList<ClientTextStyleVO>();
            String title = activity.getTitle();
            if (!StringUtil.isNullOrEmpty(title)) {
@@ -756,7 +746,6 @@
                listtitle.add(row1);
            }
            dynamicInfo.setTitle(listtitle);
            
            Integer shareCount = activity.getShareCount();
            if (shareCount == null || shareCount <= 0) {
@@ -789,7 +778,8 @@
                    try {
                        taoBaoGoodsBrief = redisManager.getTaoBaoGoodsBrief(Long.parseLong(auctionId));
                    
                        taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null);
                        taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief,
                                proportion.toString(), null);
                        if (!taoBaoGoodsBriefExtra.isCoupon()) {
                            taoBaoGoodsBriefExtra.setState(1);
                        }
@@ -798,7 +788,8 @@
                        shareMoney = MoneyBigDecimalUtil.add(shareMoney, money);
                    } catch (TaobaoGoodsDownException e) {
                         taoBaoGoodsBrief = activityGoods.getTaoBaoGoodsBrief();
                         taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null);
                        taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief,
                                proportion.toString(), null);
                         taoBaoGoodsBriefExtra.setState(1);
                         taoBaoGoodsBriefExtra.setCoupon(false);
                    }
@@ -841,7 +832,6 @@
                dynamicInfo.setShareType(DynamicInfo.SHARE_TYPE_NINE); // 分享类型9图
            }
            
            if (!StringUtil.isNullOrEmpty(dynamicInfoId)) {
                dynamicInfoDao.deleteById(dynamicInfoId);
            }
@@ -857,7 +847,6 @@
        }
    }
    
    @Override
    public void deleteActivity(Long activityId) {
        DynamicInfo dynamicInfo = dynamicInfoDao.getByActivityId(activityId);
@@ -866,7 +855,6 @@
            dynamicInfoDao.deleteById(dynamicInfo.getId());
        }
    }
    
    @Override
    public void removeByDate(Date createTime) {
@@ -899,7 +887,6 @@
        
        return list;
    }
    
    /**
     * 更新商品信息
@@ -980,7 +967,8 @@
                        dynamicInfo.setDesc(shareMoneyDesc);
                    }
                    
                    TaoBaoGoodsBriefExtra newExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(goodsBrief, proportion.toString(), null);
                    TaoBaoGoodsBriefExtra newExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(goodsBrief,
                            proportion.toString(), null);
                    
                    if (!newExtra.isCoupon()) {
                        newExtra.setState(1);
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/CommonTemplateContentServiceImpl.java
@@ -2,6 +2,7 @@
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.annotation.Resource;
@@ -28,6 +29,32 @@
    @Resource
    private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
    private static List<CommonContentNav> getCommonNav() {
        List<CommonContentNav> navList = new ArrayList<>();
        navList.add(new CommonContentNav("1", "综合"));
        navList.add(new CommonContentNav("2", "最新"));
        navList.add(new CommonContentNav("3", "热卖"));
        navList.add(new CommonContentNav("4", "销量"));
        navList.add(new CommonContentNav("5", "返利比"));
        return navList;
    }
    private static int getCommonSort(String cid) {
        int sort = DaTaoKeApiUtil.SORT_DEFAULT;
        if ("1".equalsIgnoreCase(cid))
            sort = DaTaoKeApiUtil.SORT_DEFAULT;
        else if ("2".equalsIgnoreCase(cid))
            sort = DaTaoKeApiUtil.SORT_CREATETIME;
        else if ("3".equalsIgnoreCase(cid))
            sort = DaTaoKeApiUtil.SORT_COUPON_NUM;
        else if ("4".equalsIgnoreCase(cid))
            sort = DaTaoKeApiUtil.SORT_SALES;
        else if ("5".equalsIgnoreCase(cid))
            sort = DaTaoKeApiUtil.SORT_COMMISSION;
        return sort;
    }
    @Override
    public List<CommonContentNav> getNavList(CommonContentTypeEnum type) {
        List<CommonContentNav> navList = new ArrayList<>();
@@ -49,17 +76,9 @@
            navList.add(new CommonContentNav("3", "30~50元券"));
            navList.add(new CommonContentNav("4", "50元以上券"));
        } else if (type == CommonContentTypeEnum.juJia) {
            navList.add(new CommonContentNav("1", "综合"));
            navList.add(new CommonContentNav("2", "最新"));
            navList.add(new CommonContentNav("3", "热卖"));
            navList.add(new CommonContentNav("4", "销量"));
            navList.add(new CommonContentNav("5", "返利比"));
            navList = getCommonNav();
        } else if (type == CommonContentTypeEnum.meiShi) {
            navList.add(new CommonContentNav("1", "综合"));
            navList.add(new CommonContentNav("2", "最新"));
            navList.add(new CommonContentNav("3", "热卖"));
            navList.add(new CommonContentNav("4", "销量"));
            navList.add(new CommonContentNav("5", "返利比"));
            navList = getCommonNav();
        } else if (type == CommonContentTypeEnum.muYin) {
            navList.add(new CommonContentNav("1", "精选"));
            navList.add(new CommonContentNav("2", "备孕"));
@@ -69,23 +88,48 @@
            navList.add(new CommonContentNav("6", "4~6岁"));
            navList.add(new CommonContentNav("7", "7~12岁"));
        } else if (type == CommonContentTypeEnum.reMai) {
            navList.add(new CommonContentNav("1", "综合"));
            navList.add(new CommonContentNav("2", "最新"));
            navList.add(new CommonContentNav("3", "热卖"));
            navList.add(new CommonContentNav("4", "销量"));
            navList.add(new CommonContentNav("5", "返利比"));
            navList = getCommonNav();
        } else if (type == CommonContentTypeEnum.chuanYiDaPei) {
            navList = getCommonNav();
        } else if (type == CommonContentTypeEnum.meiZhuangGehu) {
            navList = getCommonNav();
        } else if (type == CommonContentTypeEnum.jingPinXieBao) {
            navList = getCommonNav();
        } else if (type == CommonContentTypeEnum.chaoNanReMai) {
            navList = getCommonNav();
        } else if (type == CommonContentTypeEnum.shuMaShouJi) {
            navList = getCommonNav();
        } else if (type == CommonContentTypeEnum.yunDongKuXie) {
            navList = getCommonNav();
        }
        return navList;
    }
    
    @Cacheable(value = "commonContentCache", key = "#type+'-'+#cid+'-'+#page+'-'+#pageSize")
    @Override
    public CommonContentResult getContentList(CommonContentTypeEnum type, String cid, int page, int pageSize) {
        if (type == CommonContentTypeEnum._9k9)
        if (type == CommonContentTypeEnum._9k9) {
            return get9K9Content(cid, page, pageSize);
        } else if (type == CommonContentTypeEnum.chuanYiDaPei) {
            return getChuanYiDaPeiContent(cid, page, pageSize);
        } else if (type == CommonContentTypeEnum.meiZhuangGehu) {
            return getMeiZhuangGeHuContent(cid, page, pageSize);
        } else if (type == CommonContentTypeEnum.jingPinXieBao) {
            return getJingPinXieBaoContent(cid, page, pageSize);
        } else if (type == CommonContentTypeEnum.chaoNanReMai) {
            return getJingPinXieBaoContent(cid, page, pageSize);
        } else if (type == CommonContentTypeEnum.shuMaShouJi) {
            return getJingPinXieBaoContent(cid, page, pageSize);
        } else if (type == CommonContentTypeEnum.yunDongKuXie) {
            return getJingPinXieBaoContent(cid, page, pageSize);
        } else if (type == CommonContentTypeEnum.chaoNanReMai) {
            return getChaoNanReMaiContent(cid, page, pageSize);
        } else if (type == CommonContentTypeEnum.shuMaShouJi) {
            return getShuMaShouJiContent(cid, page, pageSize);
        } else if (type == CommonContentTypeEnum.yunDongKuXie) {
            return getYunDongKuXieContent(cid, page, pageSize);
        }
        return null;
    }
@@ -116,4 +160,163 @@
        return new CommonContentResult(goodsList, count);
    }
    /**
     * 穿衣搭配
     *
     * @param cid
     * @param page
     * @param pageSize
     * @return
     */
    private CommonContentResult getChuanYiDaPeiContent(String cid, int page, int pageSize) {
        DaTaoKeGoodsResult result = null;
        List<Integer> cidList = new ArrayList<>();
        cidList.add(1);// 女装
        int sort = getCommonSort(cid);
        result = DaTaoKeApiUtil.search("内衣 女", cidList, null, null, page, pageSize, sort);
        List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
        long count = 0;
        if (result != null) {
            count = result.getTotalCount();
            if (result.getGoodsList() != null)
                for (DaTaoKeDetailV2 detail : result.getGoodsList())
                    goodsList.add(TaoBaoUtil.convert(detail));
        }
        return new CommonContentResult(goodsList, count);
    }
    /**
     * 美妆个护
     *
     * @param cid
     * @param page
     * @param pageSize
     * @return
     */
    private CommonContentResult getMeiZhuangGeHuContent(String cid, int page, int pageSize) {
        DaTaoKeGoodsResult result = null;
        List<Integer> cidList = new ArrayList<>();
        cidList.add(3);// 美妆
        int sort = getCommonSort(cid);
        result = DaTaoKeApiUtil.search("洗护", cidList, null, null, page, pageSize, sort);
        List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
        long count = 0;
        if (result != null) {
            count = result.getTotalCount();
            if (result.getGoodsList() != null)
                for (DaTaoKeDetailV2 detail : result.getGoodsList())
                    goodsList.add(TaoBaoUtil.convert(detail));
        }
        return new CommonContentResult(goodsList, count);
    }
    /**
     * 精品鞋包
     *
     * @param cid
     * @param page
     * @param pageSize
     * @return
     */
    private CommonContentResult getJingPinXieBaoContent(String cid, int page, int pageSize) {
        DaTaoKeGoodsResult result = null;
        int sort = getCommonSort(cid);
        result = DaTaoKeApiUtil.search("鞋 女", null, null, null, page, pageSize, sort);
        DaTaoKeGoodsResult result1 = DaTaoKeApiUtil.search("包 女", null, null, null, page, pageSize, sort);
        List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
        long count = 0;
        if (result != null) {
            count = result.getTotalCount() + result1.getTotalCount();
            if (result.getGoodsList() != null)
                for (DaTaoKeDetailV2 detail : result.getGoodsList())
                    goodsList.add(TaoBaoUtil.convert(detail));
            if (result1.getGoodsList() != null)
                for (DaTaoKeDetailV2 detail : result1.getGoodsList())
                    goodsList.add(TaoBaoUtil.convert(detail));
        }
        Collections.shuffle(goodsList);
        return new CommonContentResult(goodsList, count);
    }
    /**
     * 潮男热卖
     *
     * @param cid
     * @param page
     * @param pageSize
     * @return
     */
    private CommonContentResult getChaoNanReMaiContent(String cid, int page, int pageSize) {
        DaTaoKeGoodsResult result = null;
        int sort = getCommonSort(cid);
        result = DaTaoKeApiUtil.search("潮 男", null, null, null, page, pageSize, sort);
        List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
        long count = 0;
        if (result != null) {
            count = result.getTotalCount();
            if (result.getGoodsList() != null)
                for (DaTaoKeDetailV2 detail : result.getGoodsList())
                    goodsList.add(TaoBaoUtil.convert(detail));
        }
        Collections.shuffle(goodsList);
        return new CommonContentResult(goodsList, count);
    }
    /**
     * 数码手机
     *
     * @param cid
     * @param page
     * @param pageSize
     * @return
     */
    private CommonContentResult getShuMaShouJiContent(String cid, int page, int pageSize) {
        DaTaoKeGoodsResult result = null;
        int sort = getCommonSort(cid);
        result = DaTaoKeApiUtil.search("电", null, null, null, page, pageSize, sort);
        DaTaoKeGoodsResult result1 = DaTaoKeApiUtil.search("手机", null, null, null, page, pageSize, sort);
        List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
        long count = 0;
        if (result != null) {
            count = result.getTotalCount() + result1.getTotalCount();
            if (result.getGoodsList() != null)
                for (DaTaoKeDetailV2 detail : result.getGoodsList())
                    goodsList.add(TaoBaoUtil.convert(detail));
            if (result1.getGoodsList() != null)
                for (DaTaoKeDetailV2 detail : result1.getGoodsList())
                    goodsList.add(TaoBaoUtil.convert(detail));
        }
        Collections.shuffle(goodsList);
        return new CommonContentResult(goodsList, count);
    }
    /**
     * 运动酷鞋
     *
     * @param cid
     * @param page
     * @param pageSize
     * @return
     */
    private CommonContentResult getYunDongKuXieContent(String cid, int page, int pageSize) {
        DaTaoKeGoodsResult result = null;
        int sort = getCommonSort(cid);
        result = DaTaoKeApiUtil.search("鞋 男", null, null, null, page, pageSize, sort);
        DaTaoKeGoodsResult result1 = DaTaoKeApiUtil.search("运动 男", null, null, null, page, pageSize, sort);
        List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
        long count = 0;
        if (result != null) {
            count = result.getTotalCount() + result1.getTotalCount();
            if (result.getGoodsList() != null)
                for (DaTaoKeDetailV2 detail : result.getGoodsList())
                    goodsList.add(TaoBaoUtil.convert(detail));
            if (result1.getGoodsList() != null)
                for (DaTaoKeDetailV2 detail : result1.getGoodsList())
                    goodsList.add(TaoBaoUtil.convert(detail));
        }
        Collections.shuffle(goodsList);
        return new CommonContentResult(goodsList, count);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/ShareGoodsTextTemplateServiceImpl.java
@@ -16,7 +16,6 @@
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.goods.ShareGoodsTextTemplateService;
import com.yeshi.fanli.service.inter.tlj.GoodsTaoLiJinRateService;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
/**
@@ -165,9 +164,9 @@
    
    @Override
    public String createContentByTemplate(String template, Long uid, TaoBaoGoodsBrief goods, String token,
            String shortLink, boolean hasCoupon, String from) {
            String shortLink, boolean hasCoupon, Long tljId) {
        
        if (!StringUtil.isNullOrEmpty(from) && "taolijin".equals(from)) {
        if (tljId != null) {
            BigDecimal spreadMoney = goodsTaoLiJinRateService.getGoodsSpreadMoney(goods);
            return template.replace("{标题}", goods.getTitle()).replace("{商品原价}", BigDecimalUtil.getWithNoZera( goods.getZkPrice()).toString())
                    .replace("{月销量}", TaoBaoUtil.getSaleCount(goods.getBiz30day())).replace("{领券短链}", shortLink)
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/ThreeSaleSerivceImpl.java
@@ -17,10 +17,12 @@
import com.yeshi.fanli.entity.bus.user.ThreeSaleExtraInfo;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.exception.ThreeSaleException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
import com.yeshi.fanli.service.inter.msg.MsgInviteDetailService;
import com.yeshi.fanli.service.inter.msg.UserInviteMsgNotificationService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
@@ -49,6 +51,10 @@
    @Resource
    private MsgInviteDetailService msgInviteDetailService;
    @Resource
    private UserTaoLiJinOriginService userTaoLiJinOriginService;
    public UserInfo getBoss(final long uid) {
        return threeSaleMapper.selectBoss(uid);
@@ -519,6 +525,20 @@
        // 邀请消息
        userInviteMsgNotificationService.inviteSuccess(inviter.getId(), threeSale);
        // 奖励淘礼金红包
        try {
            String inviteName= invitee.getNickName();
            if (StringUtil.isNullOrEmpty(inviteName)) {
                UserInfo userInfo = userInfoService.selectByPKey(invitee.getId());
                if (userInfo != null) {
                    inviteName= userInfo.getNickName();
                }
            }
            userTaoLiJinOriginService.addInviteWinMoney(inviter.getId(), inviteName);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    @Override
@@ -572,6 +592,21 @@
        ThreeSaleCMQManager.getInstance().addThreeSaleMsg(threeSale);
        // 邀请消息
        userInviteMsgNotificationService.inviteSuccess(threeSale.getBoss().getId(), threeSale);
        // 奖励淘礼金红包
        try {
            String inviteName= invitee.getNickName();
            if (StringUtil.isNullOrEmpty(inviteName)) {
                UserInfo userInfo = userInfoService.selectByPKey(invitee.getId());
                if (userInfo != null) {
                    inviteName= userInfo.getNickName();
                }
            }
            userTaoLiJinOriginService.addInviteWinMoney(inviterId, inviteName);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    
    /**
fanli/src/main/java/com/yeshi/fanli/service/impl/lable/TaoKeGoodsServiceImpl.java
@@ -269,6 +269,8 @@
        return data;
    }
    @Override
    @Cacheable(value = "searchWuLiaoCache", key = "'searchWuLiaoList-'+#sf")
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgOtherDetailServiceImpl.java
@@ -37,6 +37,9 @@
                detail.setCreateTime(new Date());
            msgOtherDetailMapper.insertSelective(detail);
            userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
        } else if (detail.getType() == MsgTypeOtherTypeEnum.taoLiJin) {
            msgOtherDetailMapper.insertSelective(detail);
            userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
        }
    }
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOrderMsgNotificationServiceImpl.java
@@ -80,11 +80,11 @@
        MsgOrderDetail detail = MsgOrderDetailFactory.createShareOrder(uid, orderId, 0, orderState, payMoney, money,
                null);
        // 暂时不推送
        try {
            msgOrderDetailService.updateMsgOrderDetail(detail, false);
        } catch (MsgOrderDetailException e) {
            e.printStackTrace();
        }
//        try {
//            msgOrderDetailService.updateMsgOrderDetail(detail, false);
//        } catch (MsgOrderDetailException e) {
//            e.printStackTrace();
//        }
    }
@@ -107,11 +107,11 @@
        MsgOrderDetail detail = MsgOrderDetailFactory.createInviteOrder(uid, orderId, 0, orderState, payMoney, money,
                null);
        // 暂时不推送
        try {
            msgOrderDetailService.updateMsgOrderDetail(detail, false);
        } catch (MsgOrderDetailException e) {
            e.printStackTrace();
        }
//        try {
//            msgOrderDetailService.updateMsgOrderDetail(detail, false);
//        } catch (MsgOrderDetailException e) {
//            e.printStackTrace();
//        }
    }
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java
@@ -1,13 +1,16 @@
package com.yeshi.fanli.service.impl.msg;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.google.gson.Gson;
import com.yeshi.fanli.dto.msg.MsgOtherCouponContentDTO;
import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail;
import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum;
import com.yeshi.fanli.entity.bus.user.UserInfo;
@@ -282,18 +285,21 @@
        }
    }
//    @Override
//    public void taoLiJinGet(UserSystemCoupon coupon, int percent) {
//        if (coupon == null || coupon.getUid() == null)
//            return;
//        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createRewardCouponGet(getLeftDay(coupon),
//                coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
//        try {
//            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
//                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, "返利已到账后再奖励返利的" + percent + "%"));
//        } catch (MsgOtherDetailException e) {
//            e.printStackTrace();
//        }
//    }
    @Override
    public void taoLiJinMsg(Long uid, String beiZhu, MsgOtherTaoLiJinContentDTO content) {
        try {
            MsgOtherDetail detail = new MsgOtherDetail();
            detail.setBeiZhu(beiZhu);
            detail.setCreateTime(new Date());
            detail.setRead(false);
            detail.setUser(new UserInfo(uid));
            detail.setContent(new Gson().toJson(content));
            detail.setType(MsgTypeOtherTypeEnum.taoLiJin);
            msgOtherDetailService.addMsgOtherDetail(detail);
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java
@@ -19,13 +19,18 @@
import com.yeshi.fanli.dao.mybatis.order.CommonOrderMapper;
import com.yeshi.fanli.dao.mybatis.order.CommonOrderTradeIdMapMapper;
import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoWeiQuanOrderMapper;
import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
import com.yeshi.fanli.entity.bus.user.HongBaoV2;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord;
import com.yeshi.fanli.entity.goods.CommonGoods;
import com.yeshi.fanli.entity.jd.JDGoods;
import com.yeshi.fanli.entity.jd.JDOrder;
import com.yeshi.fanli.entity.jd.JDOrderItem;
import com.yeshi.fanli.entity.order.CommonOrder;
import com.yeshi.fanli.entity.order.CommonOrderGoods;
import com.yeshi.fanli.entity.order.CommonOrderTradeIdMap;
import com.yeshi.fanli.entity.pdd.PDDOrder;
import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
@@ -45,6 +50,9 @@
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.factory.CommonOrderGoodsFactory;
import com.yeshi.fanli.util.factory.goods.CommonOrderFactory;
import com.yeshi.fanli.util.jd.JDApiUtil;
import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil;
import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
@@ -589,18 +597,15 @@
            wholeOrderState = CommonOrder.STATE_WHOLE_ORDER_BUFENYOUXIAO;
        for (TaoBaoOrder taoBaoOrder : taoBaoOrders) {
            CommonOrder commonOrder = commonOrderMapper.selectByOrderNoAndOrderTypeAndOrderBy(taoBaoOrder.getOrderId(),
                    Constant.SOURCE_TYPE_TAOBAO, taoBaoOrder.getOrderBy());
            if (commonOrder == null)// 新增
            {
                commonOrder = TaoBaoOrderUtil.convert(taoBaoOrder);
                CommonOrderGoods goods = new CommonOrderGoods();
                goods.setGoodsId(taoBaoOrder.getAuctionId() + "");
                goods.setGoodsType(Constant.SOURCE_TYPE_TAOBAO);
                // 商品是否已经插入
                List<CommonOrderGoods> commonGoodsList = commonOrderGoodsMapper
                        .listByGoodsIdAndGoodsType(goods.getGoodsId(), goods.getGoodsType());
            CommonOrder newCommonOrder = TaoBaoOrderUtil.convert(taoBaoOrder);
            CommonOrderGoods cog = new CommonOrderGoods();
            cog.setGoodsId(taoBaoOrder.getAuctionId() + "");
            cog.setGoodsType(Constant.SOURCE_TYPE_TAOBAO);
            newCommonOrder.setCommonOrderGoods(cog);
            newCommonOrder.setStateWholeOrder(wholeOrderState);
            // 订单商品插入
            List<CommonOrderGoods> commonGoodsList = commonOrderGoodsMapper.listByGoodsIdAndGoodsType(cog.getGoodsId(),
                    cog.getGoodsType());
                if (commonGoodsList.size() <= 0)// 不存在就插入商品
                {
                    TaoBaoGoodsBrief taoBaoGoods = null;
@@ -619,54 +624,186 @@
                        }
                    }
                    if (taoBaoGoods != null) {
                        goods = CommonOrderGoodsFactory.create(taoBaoGoods);
                    cog = CommonOrderGoodsFactory.create(taoBaoGoods);
                    }
                    goods.setCreateTime(new Date());
                    goods.setUpdateTime(new Date());
                    commonOrderGoodsMapper.insertSelective(goods);
                } else
                    goods.setId(commonGoodsList.get(commonGoodsList.size() - 1).getId());
                commonOrder.setCommonOrderGoods(goods);
                commonOrder.setUserInfo(new UserInfo(uid));
                commonOrder.setCreateTime(new Date());
                commonOrder.setStateWholeOrder(wholeOrderState);
                commonOrderMapper.insertSelective(commonOrder);
                cog.setCreateTime(new Date());
                cog.setUpdateTime(new Date());
                commonOrderGoodsMapper.insertSelective(cog);
            }
            newCommonOrder.setUserInfo(new UserInfo(uid));
            commonOrderList.add(addCommonOrder(newCommonOrder));
        }
        return commonOrderList;
    }
    @Transactional
    @Override
    public List<CommonOrder> addPDDOrder(List<PDDOrder> pddOrderList, Long uid) throws CommonOrderException {
        List<CommonOrder> commonOrderList = new ArrayList<>();
        // 判断所有的订单状态
        int invalidCount = 0;
        for (PDDOrder order : pddOrderList) {
            if (order.getOrderStatus() == -1 || order.getOrderStatus() == 4 || order.getOrderStatus() == 8) {
                invalidCount++;
            }
        }
        // 获取整体订单的状态
        int wholeOrderState = 0;
        if (pddOrderList.size() == invalidCount)
            wholeOrderState = CommonOrder.STATE_WHOLE_ORDER_SHIXIAO;
        else if (invalidCount == 0)
            wholeOrderState = CommonOrder.STATE_WHOLE_ORDER_YOUXIAO;
        else
            wholeOrderState = CommonOrder.STATE_WHOLE_ORDER_BUFENYOUXIAO;
        for (PDDOrder pddOrder : pddOrderList) {
            CommonOrder newCommonOrder = CommonOrderFactory.create(pddOrder);
            CommonOrderGoods cog = new CommonOrderGoods();
            cog.setGoodsId(pddOrder.getGoodsId() + "");
            cog.setGoodsType(Constant.SOURCE_TYPE_PDD);
            newCommonOrder.setCommonOrderGoods(cog);
            newCommonOrder.setStateWholeOrder(wholeOrderState);
            // 订单商品插入
            List<CommonOrderGoods> commonGoodsList = commonOrderGoodsMapper.listByGoodsIdAndGoodsType(cog.getGoodsId(),
                    cog.getGoodsType());
            if (commonGoodsList.size() <= 0)// 不存在就插入商品
            {
                PDDGoodsDetail pddGoods = null;
                pddGoods = PinDuoDuoApiUtil.getGoodsDetail(Long.parseLong(cog.getGoodsId()));
                if (pddGoods != null) {
                    cog = CommonOrderGoodsFactory.create(pddGoods);
                }
                cog.setCreateTime(new Date());
                cog.setUpdateTime(new Date());
                commonOrderGoodsMapper.insertSelective(cog);
                newCommonOrder.setCommonOrderGoods(cog);
            }
            newCommonOrder.setUserInfo(new UserInfo(uid));
            commonOrderList.add(addCommonOrder(newCommonOrder));
        }
        return commonOrderList;
    }
    @Transactional
    @Override
    public List<CommonOrder> addJDOrder(JDOrder jdOrder, Long uid) throws CommonOrderException {
        List<CommonOrder> commonOrderList = new ArrayList<>();
        // 判断所有的订单状态
        int invalidCount = 0;
        for (JDOrderItem tb : jdOrder.getOrderItemList()) {
            if (tb.getValidCode() < 16) {
                invalidCount++;
            }
        }
        // 获取整体订单的状态
        int wholeOrderState = 0;
        if (jdOrder.getOrderItemList().size() == invalidCount)
            wholeOrderState = CommonOrder.STATE_WHOLE_ORDER_SHIXIAO;
        else if (invalidCount == 0)
            wholeOrderState = CommonOrder.STATE_WHOLE_ORDER_YOUXIAO;
        else
            wholeOrderState = CommonOrder.STATE_WHOLE_ORDER_BUFENYOUXIAO;
        List<JDOrderItem> orderItemList = jdOrder.getOrderItemList();
        jdOrder.setOrderItemList(null);
        for (JDOrderItem itemOrder : orderItemList) {
            itemOrder.setOrder(jdOrder);
            CommonOrder newCommonOrder = CommonOrderFactory.create(itemOrder);
            CommonOrderGoods cog = new CommonOrderGoods();
            cog.setGoodsId(itemOrder.getSkuId() + "");
            cog.setGoodsType(Constant.SOURCE_TYPE_JD);
            newCommonOrder.setCommonOrderGoods(cog);
            newCommonOrder.setStateWholeOrder(wholeOrderState);
            // 订单商品插入
            List<CommonOrderGoods> commonGoodsList = commonOrderGoodsMapper.listByGoodsIdAndGoodsType(cog.getGoodsId(),
                    cog.getGoodsType());
            if (commonGoodsList.size() <= 0)// 不存在就插入商品
            {
                JDGoods goods = JDApiUtil.getGoodsDetail(itemOrder.getSkuId());
                if (goods != null) {
                    cog = CommonOrderGoodsFactory.create(goods);
                }
                cog.setCreateTime(new Date());
                cog.setUpdateTime(new Date());
                commonOrderGoodsMapper.insertSelective(cog);
            }
            newCommonOrder.setUserInfo(new UserInfo(uid));
            commonOrderList.add(addCommonOrder(newCommonOrder));
        }
        return commonOrderList;
    }
    /**
     * 添加订单
     *
     * @param commonOrder
     */
    @Transactional
    private CommonOrder addCommonOrder(CommonOrder commonOrder) throws CommonOrderException {
        // 判断商品是否存在
        if (commonOrder == null)
            throw new CommonOrderException(1, "订单为空");
        if (commonOrder.getUserInfo() == null)
            throw new CommonOrderException(2, "订单用户为空");
        if (commonOrder.getCommonOrderGoods() == null || commonOrder.getCommonOrderGoods().getGoodsId() == null
                || commonOrder.getCommonOrderGoods().getGoodsType() == null)
            throw new CommonOrderException(3, "订单商品为空");
        // 不存在就插入,存在就不管
        CommonOrderGoods goods = commonOrder.getCommonOrderGoods();
        // 之前不存在于数据库
        if (commonOrder.getCommonOrderGoods().getId() == null) {
            List<CommonOrderGoods> commonGoodsList = commonOrderGoodsMapper
                    .listByGoodsIdAndGoodsType(goods.getGoodsId(), goods.getGoodsType());
            if (commonGoodsList == null || commonGoodsList.size() < 1) {// 不存在
                commonOrderGoodsMapper.insertSelective(goods);
            } else {// 存在
                goods = commonGoodsList.get(0);
            }
            if (goods.getId() == null)
                throw new CommonOrderException(4, "商品插入失败");
            commonOrder.setCommonOrderGoods(goods);
        }
        CommonOrder oldCommonOrder = commonOrderMapper.selectByOrderNoAndOrderTypeAndOrderBy(commonOrder.getOrderNo(),
                commonOrder.getSourceType(), commonOrder.getOrderBy());
        if (oldCommonOrder == null)// 新增
        {
            commonOrder.setCreateTime(new Date());
            commonOrderMapper.insertSelective(commonOrder);
                // 插入映射,保证交易ID的完整性
                commonOrderTradeIdMapMapper.insertSelective(new CommonOrderTradeIdMap(commonOrder.getId(),
                        commonOrder.getTradeId(), new Date(), commonOrder.getSourceType()));
                commonOrderList.add(commonOrder);
                continue;
            return commonOrder;
            } else {// 修改
                // 已经结算或者已经失效的订单不处理
                if (commonOrder.getState() == CommonOrder.STATE_JS || commonOrder.getState() == CommonOrder.STATE_SX) {
                    commonOrderList.add(commonOrder);
                    continue;
            if (oldCommonOrder.getState() == CommonOrder.STATE_JS || oldCommonOrder.getState() == CommonOrder.STATE_SX) {
                return oldCommonOrder;
                }
                CommonOrder newCommonOrder = TaoBaoOrderUtil.convert(taoBaoOrder);
                // 交易ID一致才修改
                if (commonOrder.getTradeId() != null
                        && commonOrder.getTradeId().equalsIgnoreCase(newCommonOrder.getTradeId())) {
                    CommonOrder updateCommonOrder = new CommonOrder(commonOrder.getId());
                    updateCommonOrder.seteIncome(newCommonOrder.geteIncome());
                    updateCommonOrder.setEstimate(newCommonOrder.getEstimate());
                    updateCommonOrder.setPayment(newCommonOrder.getPayment());
                    updateCommonOrder.setSettlement(newCommonOrder.getSettlement());
                    updateCommonOrder.setSettleTime(newCommonOrder.getSettleTime());
                    updateCommonOrder.setState(newCommonOrder.getState());
                    updateCommonOrder.setStateWholeOrder(wholeOrderState);
                    && commonOrder.getTradeId().equalsIgnoreCase(oldCommonOrder.getTradeId())) {
                CommonOrder updateCommonOrder = new CommonOrder(oldCommonOrder.getId());
                updateCommonOrder.seteIncome(commonOrder.geteIncome());
                updateCommonOrder.setEstimate(commonOrder.getEstimate());
                updateCommonOrder.setPayment(commonOrder.getPayment());
                updateCommonOrder.setSettlement(commonOrder.getSettlement());
                updateCommonOrder.setSettleTime(commonOrder.getSettleTime());
                updateCommonOrder.setState(commonOrder.getState());
                updateCommonOrder.setStateWholeOrder(commonOrder.getStateWholeOrder());
                    updateCommonOrder.setUpdateTime(new Date());
                    updateCommonOrder.setTradeId(newCommonOrder.getTradeId());
                updateCommonOrder.setTradeId(commonOrder.getTradeId());
                    commonOrderMapper.updateByPrimaryKeySelective(updateCommonOrder);
                    commonOrderList.add(commonOrderMapper.selectByPrimaryKey(updateCommonOrder.getId()));
                return commonOrderMapper.selectByPrimaryKey(updateCommonOrder.getId());
                } else
                    commonOrderList.add(commonOrder);
                return oldCommonOrder;
            }
        }
        return commonOrderList;
    }
    @Override
@@ -1026,4 +1163,5 @@
        return commonOrderMapper.selectBySourceTypeAndTradeId(sourceType, tradeId);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java
@@ -296,6 +296,9 @@
            LogHelper.error("返利失败:" + hb1.getId());
            return;
        }
        if (hongBaoOrder.getCommonOrder() != null
                && hongBaoOrder.getCommonOrder().getSourceType() == Constant.SOURCE_TYPE_TAOBAO) {
        // 维权中的不返利
        List<TaoBaoWeiQuanOrder> taoBaoWeiQuanList = taoBaoWeiQuanOrderMapper
                .selectListByOrderIdAndState(hongBaoOrder.getCommonOrder().getOrderNo(), "维权创建");
@@ -306,6 +309,7 @@
                .selectListByOrderIdAndState(hongBaoOrder.getCommonOrder().getOrderNo(), "等待处理");
        if (taoBaoWeiQuanList != null && taoBaoWeiQuanList.size() > 0)
            return;
        }
        // 查询同一订单号的红包
        List<CommonOrder> orderList = commonOrderService.listBySourceTypeAndOrderId(
@@ -413,9 +417,8 @@
        if (hongBaoOrder.getCommonOrder().getSettleTime() != null && hongBaoOrder.getCommonOrder().getSettleTime()
                .getTime() >= TimeUtil.convertToTimeTemp("2018-08-05", "yyyy-MM-dd")) {
            try {
                if (hongBaoOrder.getCommonOrder().getSourceType() == Constant.SOURCE_TYPE_TAOBAO)
                taoBaoWeiQuanDrawBackService.doWeiQuanFanli(hongBaoOrder.getCommonOrder().getOrderNo());
            } catch (TaoBaoWeiQuanException e) {
                if (e.getCode() == TaoBaoWeiQuanException.CODE_NEDD_UPDATE_ORDER) {
                    List<TaoBaoOrder> olist = taoBaoOrderService
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderUserStatisticServiceImpl.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.service.impl.order;
import java.math.BigDecimal;
import java.util.Date;
import javax.annotation.Resource;
@@ -16,24 +17,24 @@
    private HongBaoOrderMapper hongBaoOrderMapper;
    @Override
    public int countHongBaoOrderCount50MoreByUid(Long uid) {
        return hongBaoOrderMapper.countHongBaoOrderCountMoreByUid(new BigDecimal(50), uid);
    public int countOrderCount100MoreByUidAndMinTime(Long uid, Date minTime) {
        return hongBaoOrderMapper.countOrderCountMoneyMoreByUidAndMinTime(uid, minTime, new BigDecimal(100));
    }
    @Override
    public int countWeiQuanOrderByUid(Long uid) {
        return hongBaoOrderMapper.countWeiQuanOrderByUid(uid);
    public int countWeiQuanOrderByUid(Long uid, Date minTime) {
        return hongBaoOrderMapper.countWeiQuanOrderByUid(uid, minTime);
    }
    @Override
    public BigDecimal sumWeiQuanOrderFanAmountByUid(Long uid) {
        BigDecimal money = hongBaoOrderMapper.sumWeiQuanOrderFanAmountByUid(uid);
    public BigDecimal sumWeiQuanOrderFanAmountByUid(Long uid,Date minTime) {
        BigDecimal money = hongBaoOrderMapper.sumWeiQuanOrderFanAmountByUid(uid,minTime);
        return money == null ? new BigDecimal(0) : money;
    }
    @Override
    public int countSafeOrderByUid(Long uid) {
        return hongBaoOrderMapper.countSafeOrderByUid(uid);
    public int countWeiQuanOrderWithMinCommision(Long uid, BigDecimal minMoney, Date minTime) {
        return hongBaoOrderMapper.countWeiQuanOrderWithMinCommision(uid, minMoney, minTime);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/push/DeviceTokenHWServiceImpl.java
@@ -43,6 +43,7 @@
            DeviceTokenHW deviceTokenHW = new DeviceTokenHW();
            deviceTokenHW.setDevice(device);
            deviceTokenHW.setDeviceToken(token);
            deviceTokenHW.setDeviceTokenMd5(StringUtil.Md5(token));
            deviceTokenHW.setUpdateTime(new Date());
            if (uid != null)
                deviceTokenHW.setUser(new UserInfo(uid));
@@ -51,8 +52,10 @@
            for (DeviceTokenHW deviceTokenHW : list) {
                DeviceTokenHW update = new DeviceTokenHW();
                update.setId(deviceTokenHW.getId());
                if (!StringUtil.isNullOrEmpty(token))
                if (!StringUtil.isNullOrEmpty(token)) {
                    update.setDeviceToken(token);
                    update.setDeviceTokenMd5(StringUtil.Md5(token));
                }
                update.setUpdateTime(new Date());
                if (uid != null)
                    update.setUser(new UserInfo(uid));
@@ -80,4 +83,9 @@
        }
    }
    @Override
    public void bindUid(String device, Long uid) {
        deviceTokenHWMapper.bindUidByDevice(uid, device);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoWeiQuanDrawBackServiceImpl.java
@@ -36,7 +36,6 @@
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.money.UserMoneyDebtService;
import com.yeshi.fanli.service.inter.msg.UserMoneyMsgNotificationService;
import com.yeshi.fanli.service.inter.order.CommonOrderService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoWeiQuanDrawBackService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoWeiQuanOrderService;
import com.yeshi.fanli.service.inter.user.UserMoneyService;
@@ -44,7 +43,6 @@
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TaoBaoConstant;
import com.yeshi.fanli.util.factory.UserMoneyDetailFactory;
import com.yeshi.fanli.vo.order.CommonOrderVO;
@@ -214,6 +212,8 @@
            // 退款金额
            BigDecimal drawBackMoney = MoneyBigDecimalUtil.div(userGetMoney.multiply(fanMoney), sumFee);
            if (drawBackMoney.compareTo(userGetMoney) > 0)
                drawBackMoney = userGetMoney;// 退款金额不能比获得的金额大
            // 计算资金是否充足
            UserInfo user = userInfoMapper.selectByPKey(uid);
            if (user != null && user.getMyHongBao().compareTo(drawBackMoney) < 0)// 资金不足
@@ -366,6 +366,8 @@
            // 退款金额
            BigDecimal drawBackMoney = MoneyBigDecimalUtil.div(userGetMoney.multiply(fanMoney), sumFee);
            if (drawBackMoney.compareTo(userGetMoney) > 0)
                drawBackMoney = userGetMoney;
            for (TaoBaoWeiQuanDrawBack drawBack : newWeiQuanDrawBackList)
                taoBaoWeiQuanDrawBackMapper.insertSelective(drawBack);
@@ -486,6 +488,8 @@
                    if (weiQuanDrawBack != null)
                        continue;
                    BigDecimal drawBackMoney = MoneyBigDecimalUtil.div(child.getMoney().multiply(fanMoney), sumFee);
                    if (drawBackMoney.compareTo(child.getMoney()) > 0)
                        drawBackMoney = child.getMoney();
                    weiQuanDrawBack = new TaoBaoWeiQuanDrawBack();
                    weiQuanDrawBack.setCreateTime(new Date());
                    weiQuanDrawBack.setDrawBackMoney(drawBackMoney);
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoWeiQuanOrderServiceImpl.java
@@ -81,4 +81,9 @@
        return taoBaoWeiQuanOrderMapper.selectListByOrderIdAndState(orderId, "维权成功");
    }
    @Override
    public TaoBaoWeiQuanOrder listByorderItemId(String tradeId) {
        return taoBaoWeiQuanOrderMapper.selectByOrderItemId(tradeId);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/ExtractServiceImpl.java
@@ -277,13 +277,15 @@
        auditRecord.setBeforeMoney(user.getMyHongBao());
        auditRecord.setExtract(extract);
        Date minTime = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24 * 180L);
        // 统计数据
        int orderCount50More = orderUserStatisticService.countHongBaoOrderCount50MoreByUid(user.getId());
        BigDecimal weiQuanOrderFanAmount = orderUserStatisticService.sumWeiQuanOrderFanAmountByUid(user.getId());
        int weiQuanOrderCount = orderUserStatisticService.countWeiQuanOrderByUid(user.getId());
        int safeOrderCount = orderUserStatisticService.countSafeOrderByUid(user.getId());
        auditRecord.setExtraInfoStr(new Gson().toJson(new ExtractOrderStatisticDTO(orderCount50More, weiQuanOrderCount,
                weiQuanOrderFanAmount, safeOrderCount)));
        int orderCount50More = orderUserStatisticService.countOrderCount100MoreByUidAndMinTime(user.getId(), minTime);
        BigDecimal weiQuanOrderFanAmount = orderUserStatisticService.sumWeiQuanOrderFanAmountByUid(user.getId(),
                minTime);
        int weiQuanOrderCount = orderUserStatisticService.countWeiQuanOrderByUid(user.getId(), minTime);
        auditRecord.setExtraInfoStr(new Gson()
                .toJson(new ExtractOrderStatisticDTO(orderCount50More, weiQuanOrderCount, weiQuanOrderFanAmount, 0)));
        extractAuditRecordMapper.insertSelective(auditRecord);
        // 新版资金详情
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java
@@ -566,4 +566,19 @@
        return isNew;
    }
    
    @Override
    public UserRank gerUserRank(Long uid) {
        if(uid == null) {
            return null;
        }
        UserInfoExtra userInfoExtra = userInfoExtraMapper.gerUserRank(uid);
        if (userInfoExtra == null) {
            return null;
        }
        return userInfoExtra.getUserRank();
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserMoneyDetailServiceImpl.java
@@ -207,4 +207,10 @@
        return money == null ? new BigDecimal(0) : money;
    }
    @Override
    public UserMoneyDetail selectByTypeAndUidAndIdentifyCode(UserMoneyDetailTypeEnum type, Long uid,
            Long sourceIdentifyId) {
        return userMoneyDetailMapper.selectByTypeAndUidAndIdentifyCode(type, uid, sourceIdentifyId);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/ShareGoodsTextTemplateService.java
@@ -64,7 +64,7 @@
     * @return
     */
    public String createContentByTemplate(String template, Long uid, TaoBaoGoodsBrief goods,String token,
            String shortLink, boolean hasCoupon, String from);
            String shortLink, boolean hasCoupon, Long tljId);
    /**
     * 还原普通模板
fanli/src/main/java/com/yeshi/fanli/service/inter/msg/UserOtherMsgNotificationService.java
@@ -2,6 +2,7 @@
import java.math.BigDecimal;
import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
@@ -168,4 +169,12 @@
     */
    public void rewardCouponAlreadyOutOfDate(UserSystemCoupon coupon);
    /**
     * 淘礼金消息
     * @param uid
     * @param beiZhu
     * @param content
     */
    public void taoLiJinMsg(Long uid, String beiZhu, MsgOtherTaoLiJinContentDTO content);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/order/CommonOrderService.java
@@ -5,7 +5,9 @@
import java.util.List;
import java.util.Map;
import com.yeshi.fanli.entity.jd.JDOrder;
import com.yeshi.fanli.entity.order.CommonOrder;
import com.yeshi.fanli.entity.pdd.PDDOrder;
import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
import com.yeshi.fanli.exception.order.CommonOrderException;
import com.yeshi.fanli.vo.order.CommonOrderVO;
@@ -135,15 +137,36 @@
    public List<CommonOrder> listBySourceTypeAndOrderId(int sourceType, String orderId);
    /**
     * 缓存普通订单
     * 缓存淘宝类普通订单
     * 
     * @param taoBaoOrder
     * @param uid
     * @return
     * @throws CommonOrderException
     */
    public List<CommonOrder> addTaoBaoOrder(List<TaoBaoOrder> taoBaoOrder, Long uid) throws CommonOrderException;
    /**
     * 缓存拼多多类普通订单
     *
     * @param pddOrderList
     * @param uid
     * @return
     * @throws CommonOrderException
     */
    public List<CommonOrder> addPDDOrder(List<PDDOrder> pddOrderList, Long uid) throws CommonOrderException;
    /**
     * 缓存京东普通订单
     *
     * @param jdOrderList
     * @param uid
     * @return
     * @throws CommonOrderException
     */
    public List<CommonOrder> addJDOrder(JDOrder jdOrder, Long uid) throws CommonOrderException;
    /**
     * 根据用户ID,订单状态,结算时间统计订单数量
     * 
     * @param uid
fanli/src/main/java/com/yeshi/fanli/service/inter/order/OrderUserStatisticService.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.service.inter.order;
import java.math.BigDecimal;
import java.util.Date;
/**
 * 用户订单统计服务
@@ -10,12 +11,13 @@
 */
public interface OrderUserStatisticService {
    /**
     * 返利超过超过50元的订单数量
     * 订单佣金大于100的数量(大于某个最小时间)
     * 
     * @param uid
     * @param minTime
     * @return
     */
    public int countHongBaoOrderCount50MoreByUid(Long uid);
    public int countOrderCount100MoreByUidAndMinTime(Long uid, Date minTime);
    /**
     * 维权订单数量(包含邀请赚)
@@ -23,7 +25,7 @@
     * @param uid
     * @return
     */
    public int countWeiQuanOrderByUid(Long uid);
    public int countWeiQuanOrderByUid(Long uid, Date minTime);
    /**
     * 维权订单返还的金额
@@ -31,14 +33,15 @@
     * @param uid
     * @return
     */
    public BigDecimal sumWeiQuanOrderFanAmountByUid(Long uid);
    public BigDecimal sumWeiQuanOrderFanAmountByUid(Long uid,Date minTime);
    /**
     * 安全订单数量
     *
     * 维权订单数量
     * @param uid
     * @param minMoney
     * @param minTime
     * @return
     */
    public int countSafeOrderByUid(Long uid);
    public int countWeiQuanOrderWithMinCommision(Long uid, BigDecimal minMoney, Date minTime);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/push/DeviceTokenHWService.java
@@ -47,4 +47,12 @@
     */
    void unBindDeviceToken(String device);
    /**
     * 将用户ID绑定到设备上
     *
     * @param device
     * @param uid
     */
    void bindUid(String device, Long uid);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/taobao/TaoBaoWeiQuanOrderService.java
@@ -20,5 +20,13 @@
     * @return
     */
    public List<TaoBaoWeiQuanOrder> getWeiQuanSuccessOrders(String orderId);
    /**
     * 根据交易ID查询维权状态
     * @param tradeId
     * @return
     */
    public TaoBaoWeiQuanOrder listByorderItemId(String tradeId);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInfoExtraService.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.service.inter.user;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.bus.user.UserRank;
import com.yeshi.fanli.exception.user.UserInfoExtraException;
import com.yeshi.fanli.vo.user.UserInfoExtraVO;
@@ -95,4 +96,11 @@
     */
    public void createUserInfoExtra(Long uid) throws UserInfoExtraException;
    
    /**
     * 获取用户等级
     * @param uid
     * @return
     */
    public UserRank gerUserRank(Long uid);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserMoneyDetailService.java
@@ -76,4 +76,15 @@
    public BigDecimal statisticUserTypeMoneyWithDate(Long uid, List<UserMoneyDetailTypeEnum> typeList, Date minDate,
            Date maxDate);
    /**
     * 根据类型,用户ID与唯一标识符查询
     *
     * @param type
     * @param uid
     * @param sourceIdentifyId
     * @return
     */
    public UserMoneyDetail selectByTypeAndUidAndIdentifyCode(UserMoneyDetailTypeEnum type, Long uid,
            Long sourceIdentifyId);
}
fanli/src/main/java/com/yeshi/fanli/util/RedisManager.java
@@ -510,6 +510,37 @@
    }
    /**
     * 保存淘礼金的口令
     *
     * @param url
     * @param token
     */
    public void saveTLJToken(String url, String token) {
        String key = "taobao-tlj-token-" + StringUtil.Md5(url);
        if (Constant.IS_OUTNET) {
            if (!StringUtil.isNullOrEmpty(token)) {
                // 口令缓存10天
                cacheCommonString(key, token, 60 * 60 * 24 * 10);
            }
        }
    }
    /**
     * 获取淘礼金口令
     *
     * @param url
     * @return
     */
    public String getTLJToken(String url) {
        String key = "taobao-common-token-" + StringUtil.Md5(url);
        if (Constant.IS_OUTNET) {
            return getCommonString(key);
        }
        return null;
    }
    /**
     * 保存对象
     * 
     * @param T
fanli/src/main/java/com/yeshi/fanli/util/StringUtil.java
@@ -4,6 +4,7 @@
import java.lang.reflect.Method;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -40,7 +41,7 @@
    // 是否为电话号码
    public static boolean isMobile(String mobile) {
        String regex = "^((13[0-9])|(17[0-9])|(15[^4,\\D])|(18[0-9])|(19[0-9])|(16[0-9]))\\d{8}$";
        String regex = "^((13[0-9])|(14[0-9])|(17[0-9])|(15[^4,\\D])|(18[0-9])|(19[0-9])|(16[0-9]))\\d{8}$";
        Pattern p = Pattern.compile(regex);
        Matcher m = p.matcher(mobile);
@@ -102,8 +103,6 @@
        }
        return code;
    }
    // ��ȡ���ŷ��͵ĸ�ʽ
    public static String getMessageStyle(String code) {
@@ -292,4 +291,16 @@
            return false;
        }
    }
    public static String concat(List list, String sperator) {
        if (list == null)
            return null;
        String str = "";
        for (Object obj : list) {
            str += obj + sperator;
        }
        if (str.endsWith(sperator))
            str = str.substring(0, str.length() - sperator.length());
        return str;
    }
}
fanli/src/main/java/com/yeshi/fanli/util/dataoke/DaTaoKeApiUtil.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.util.dataoke;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import java.util.ArrayList;
@@ -12,6 +13,9 @@
import java.util.Set;
import java.util.TreeMap;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.methods.GetMethod;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
@@ -27,7 +31,6 @@
import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.StringUtil;
@@ -61,13 +64,29 @@
    static Gson gson = new Gson();
    private static String get(String url) {
        HttpClient client = new HttpClient();
        try {
            client.getHttpConnectionManager().getParams().setConnectionTimeout(5000);
            client.getHttpConnectionManager().getParams().setSoTimeout(5000);
            GetMethod method = new GetMethod(url);
            client.executeMethod(method);
            return method.getResponseBodyAsString();
        } catch (HttpException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return "";
    }
    private static String request(String url) {
        String result = null;
        while (result == null) {
            try {
                result = HttpUtil.get(url);
                if (result != null && result.startsWith("<html>"))
                result = get(url);
                if ((result != null && result.startsWith("<html>")) || StringUtil.isNullOrEmpty(result))
                    result = null;
            } catch (Exception e) {
                try {
fanli/src/main/java/com/yeshi/fanli/util/factory/CommonGoodsFactory.java
@@ -1,7 +1,11 @@
package com.yeshi.fanli.util.factory;
import java.math.BigDecimal;
import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
import com.yeshi.fanli.entity.goods.CommonGoods;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
public class CommonGoodsFactory {
@@ -44,4 +48,51 @@
        return cg;
    }
    public static CommonGoods create(PDDGoodsDetail goods) {
        if (goods == null)
            return null;
        CommonGoods cg = new CommonGoods();
        if (goods.getCouponRemainQuantity() != null)
            cg.setCouponLeftCount(Integer.parseInt(goods.getCouponRemainQuantity() + ""));
        else
            cg.setCouponLeftCount(0);
        if (goods.getCouponMinOrderAmount() != null)
            cg.setCouponStartPrice(
                    MoneyBigDecimalUtil.div(new BigDecimal(goods.getCouponMinOrderAmount()), new BigDecimal(100)));
        else
            cg.setCouponStartPrice(new BigDecimal(0));
        if (goods.getCouponDiscount() != null && goods.getCouponDiscount() > 0) {
            cg.setCouponAmount(MoneyBigDecimalUtil.div(new BigDecimal(goods.getCouponDiscount()), new BigDecimal(100)));
            if (cg.getCouponStartPrice().compareTo(new BigDecimal(0)) > 0)
                cg.setCouponInfo(String.format("满%s元减%s元", cg.getCouponStartPrice() + "", cg.getCouponAmount() + ""));
            else
                cg.setCouponInfo(String.format("%s元无条件券", cg.getCouponAmount() + ""));
        } else {
            cg.setCouponAmount(new BigDecimal(0));
        }
        cg.setCouponTotalCount(Integer.parseInt(goods.getCouponTotalQuantity() + ""));
        cg.setGoodsId(goods.getGoodsId());
        cg.setGoodsType(CommonGoods.GOODS_TYPE_PDD);
        cg.setPicture(goods.getGoodsThumbnailUrl());
        cg.setPictureWhite(null);
        cg.setPrice(MoneyBigDecimalUtil.div(new BigDecimal(goods.getMinNormalPrice()), new BigDecimal(100)));
        cg.setSales(Integer.parseInt(goods.getSoldQuantity() + ""));
        cg.setRate(MoneyBigDecimalUtil.div(new BigDecimal(goods.getPromotionRate()), new BigDecimal(10)));
        cg.setSellerId(goods.getMallId());
        cg.setSellerName(goods.getMallName());
        cg.setShopType(goods.getMerchantType());
        cg.setState(CommonGoods.STATE_NORMAL);
        cg.setTitle(goods.getGoodsName());
        // 保留字段
        cg.setVideoCover(null);
        cg.setVideoUrl(null);
        cg.setState(goods.getState());
        cg.setMaterialLibType(1);
        return cg;
    }
}
fanli/src/main/java/com/yeshi/fanli/util/factory/CommonOrderGoodsFactory.java
@@ -1,8 +1,14 @@
package com.yeshi.fanli.util.factory;
import java.math.BigDecimal;
import java.util.Date;
import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
import com.yeshi.fanli.entity.jd.JDGoods;
import com.yeshi.fanli.entity.order.CommonOrderGoods;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
public class CommonOrderGoodsFactory {
@@ -24,4 +30,35 @@
        return orderGoods;
    }
    public static CommonOrderGoods create(PDDGoodsDetail detail) {
        CommonOrderGoods goods = new CommonOrderGoods();
        goods.setGoodsId(detail.getGoodsId() + "");
        goods.setCreateTime(new Date());
        goods.setGoodsType(Constant.SOURCE_TYPE_PDD);
        goods.setPicture(detail.getGoodsImageUrl());
        goods.setPrice(MoneyBigDecimalUtil.div(new BigDecimal(detail.getMinNormalPrice()), new BigDecimal(100)));
        goods.setShopId(detail.getMallId());
        goods.setShopName(detail.getMallName());
        goods.setShopType(detail.getMerchantType() + "");
        goods.setState(0);
        goods.setTitle(detail.getGoodsName());
        return goods;
    }
    public static CommonOrderGoods create(JDGoods jdGoods) {
        CommonOrderGoods goods = new CommonOrderGoods();
        goods.setGoodsId(jdGoods.getSkuId() + "");
        goods.setCreateTime(new Date());
        goods.setGoodsType(Constant.SOURCE_TYPE_JD);
        if (jdGoods.getImageList() != null && jdGoods.getImageList().size() > 0)
            goods.setPicture(jdGoods.getImageList().get(0));
        goods.setPrice(jdGoods.getPrice());
        goods.setShopId((long) jdGoods.getShopInfo().getShopId());
        goods.setShopName(jdGoods.getShopInfo().getShopName());
        goods.setShopType(jdGoods.getOwner());
        goods.setState(0);
        goods.setTitle(jdGoods.getSkuName());
        return goods;
    }
}
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOtherDetailFactory.java
@@ -32,5 +32,29 @@
        detail.setSourceId(userCouponId);
        return detail;
    }
    /**
     * 券相关信息的通知
     *
     * @param uid
     * @param content
     * @param type
     * @param beiZhu
     * @return
     */
    public static MsgOtherDetail createTaoLiJinMsg(Long uid, Long userCouponId, MsgOtherCouponContentDTO content,
            MsgTypeOtherTypeEnum type, String beiZhu) {
        if (uid == null)
            return null;
        MsgOtherDetail detail = new MsgOtherDetail();
        detail.setBeiZhu(beiZhu);
        detail.setCreateTime(new Date());
        detail.setRead(false);
        detail.setUser(new UserInfo(uid));
        detail.setCoupnContent(content);
        detail.setType(type);
        detail.setSourceId(userCouponId);
        return detail;
    }
}
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java
@@ -7,6 +7,7 @@
import com.google.gson.Gson;
import com.yeshi.fanli.dto.msg.MsgOtherCouponContentDTO;
import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail;
import com.yeshi.fanli.entity.bus.msg.MsgInviteDetail;
import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail;
@@ -477,6 +478,9 @@
     */
    public static UserMsgVO create(MsgOtherDetail msg) {
        List<CommonMsgItemVO> items = new ArrayList<>();
        String icon = null;
        if (msg.getType() == MsgTypeOtherTypeEnum.couponMianDan
                || msg.getType() == MsgTypeOtherTypeEnum.couponWelfareMianDan
                || msg.getType() == MsgTypeOtherTypeEnum.couponReward) {
@@ -486,6 +490,8 @@
            MsgOtherCouponContentDTO dto = new Gson().fromJson(msg.getContent(), MsgOtherCouponContentDTO.class);
            if (dto == null)
                return null;
            icon = "http://img.flqapp.com/resource/msg/icon_msg_other_coupon.png";
            List<ClientTextStyleVO> contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getState(), COLOR_CONTENT));
@@ -547,10 +553,42 @@
            contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
                    COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
        } else if (msg.getType() == MsgTypeOtherTypeEnum.taoLiJin) {
            if (StringUtil.isNullOrEmpty(msg.getContent()))
                return null;
            MsgOtherTaoLiJinContentDTO dto = new Gson().fromJson(msg.getContent(), MsgOtherTaoLiJinContentDTO.class);
            if (dto == null)
                return null;
            icon = "http://img.flqapp.com/resource/msg/icon_msg_other_tlj.png";
            List<ClientTextStyleVO> contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getState(), COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("状态", COLOR_TITLE), contentList));
            if (!StringUtil.isNullOrEmpty(dto.getSource())) {
                contentList = new ArrayList<>();
                contentList.add(new ClientTextStyleVO(dto.getSource() + "", COLOR_CONTENT));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("来源", COLOR_TITLE), contentList));
        }
        return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_other_coupon.png", msg.getType().getDesc(),
                msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
            if (dto.getMoney() != null) {
                contentList = new ArrayList<>();
                contentList.add(new ClientTextStyleVO("¥" + filterMoney(dto.getMoney().setScale(2)),
                        COLOR_HIGHLIGHT_CONTENT));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("面额", COLOR_TITLE), contentList));
            }
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
                    COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
        }
        return new UserMsgVO(icon, msg.getType().getDesc(),    msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
    }
}
fanli/src/main/java/com/yeshi/fanli/util/jd/JDUtil.java
@@ -154,6 +154,17 @@
        return searchResult;
    }
    public static JDGoods getGoodsDetail(Long skuId) {
        JDSearchFilter sf = new JDSearchFilter();
        sf.setKey(skuId + "");
        sf.setPageNo(1);
        sf.setPageSize(20);
        JDSearchResult result = searchByKey(sf);
        if (result != null && result.getGoodsList() != null && result.getGoodsList().size() > 0)
            return result.getGoodsList().get(0);
        return null;
    }
    private static JDGoods parseGoods(String data) {
        JDGoods goods = new JDGoods();
        JSONObject json = JSONObject.fromObject(data);
fanli/src/main/java/com/yeshi/fanli/util/pinduoduo/PinDuoDuoApiUtil.java
@@ -138,6 +138,17 @@
        System.out.println(result);
    }
    /**
     * 获取订单
     *
     * @param page
     *            -页码
     * @param pageSize-每页数量
     * @param startTime-开始时间
     * @param endTime-结束时间
     *            与开始时间不得大于24小时
     * @return
     */
    public static PDDOrderResult getOrders(int page, int pageSize, long startTime, long endTime) {
        Map<String, String> map = new HashMap<>();
        map.put("type", "pdd.ddk.order.list.increment.get");
fanli/src/main/java/com/yeshi/fanli/vo/goods/GoodsSubClassLabelVO.java
@@ -1,12 +1,17 @@
package com.yeshi.fanli.vo.goods;
import java.io.Serializable;
import java.util.List;
import com.google.gson.annotations.Expose;
import com.yeshi.fanli.entity.bus.clazz.GoodsSubClass;
import com.yeshi.fanli.entity.bus.clazz.GoodsSubClassLabel;
public class GoodsSubClassLabelVO extends GoodsSubClassLabel {
public class GoodsSubClassLabelVO extends GoodsSubClassLabel implements Serializable {
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    @Expose
    private List<GoodsSubClass> listSub;
fanli/src/main/java/com/yeshi/fanli/vo/order/CommonOrderVO.java
@@ -106,7 +106,25 @@
     // 二级收益人-金额
     private String levelTwoMoney;
     
     private String weiQuanState;//维权状态
     
     private String weiQuanBackMoney;//维权资金
    public String getWeiQuanState() {
        return weiQuanState;
    }
    public void setWeiQuanState(String weiQuanState) {
        this.weiQuanState = weiQuanState;
    }
    public String getWeiQuanBackMoney() {
        return weiQuanBackMoney;
    }
    public void setWeiQuanBackMoney(String weiQuanBackMoney) {
        this.weiQuanBackMoney = weiQuanBackMoney;
    }
    
    public Date getAccountTime() {
        return accountTime;