admin
2019-09-27 0b177e19cfc810ca12195c0b4e2d934566afb6b0
限时秒杀bug修改,淘宝成功订单状态处理
21个文件已修改
450 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/taobao/TaoBaoOrderMapper.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgOtherDetail.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/order/taobao/UpdateOrderJob.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/taobao/TaoBaoOrderMapper.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | 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/UserOtherMsgNotificationServiceImpl.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/tb/TaoBaoOrderServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/push/DeviceActiveServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserLotteryRecordServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java 162 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/msg/UserOtherMsgNotificationService.java 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/order/OrderProcessService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/order/tb/TaoBaoOrderService.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserSystemCouponService.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/SpringContext.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/DaTaoKeUtil.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java
@@ -206,8 +206,10 @@
    }
    private JSONObject getSpikeGoodsContent(AcceptData acceptData) {
        List<String> dtoList = DaTaoKeUtil.getDingDongQiangTime();
        long nowTime = System.currentTimeMillis();
        Calendar calendar=    Calendar.getInstance();
        calendar.setTimeInMillis(nowTime);
        List<String> dtoList = DaTaoKeUtil.getDingDongQiangTime(calendar);
        int dateNum = Integer.parseInt(TimeUtil.getGernalTime(nowTime, "ddHH"));
        String timeStr = null;
        int nextPos = 0;
@@ -218,6 +220,7 @@
                break;
            }
        }
        if (timeStr == null)
            timeStr = dtoList.get(dtoList.size() - 1);
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/taobao/TaoBaoOrderMapper.java
@@ -121,4 +121,15 @@
     * @return
     */
    Long countBySettlementTime(@Param("minTime") Long minTime, @Param("maxTime") Long maxTime);
    /**
     * 根据状态与创建时间检索
     *
     * @param state
     * @param minCreateTime
     * @param maxCreateTime
     * @return
     */
    List<TaoBaoOrder> listByStateAndCreateTime(@Param("state") String state, @Param("minCreateTime") Long minCreateTime,
            @Param("maxCreateTime") Long maxCreateTime);
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgOtherDetail.java
@@ -22,7 +22,7 @@
    public enum MsgTypeOtherTypeEnum {
        couponMianDan("免单券"), couponWelfareMianDan("福利免单券"), freeCouponBuy("自购免单券"), 
        freeCouponGive("赠送免单券"), couponReward("奖励券"), taoLiJin("推广红包"), give("赠送"), exchange("金币兑换")
        , couponActivate("免单券激活"), firstOrderReward("队员首单奖励邀请人金币");
        , couponActivate("免单券激活"), firstOrderReward("队员首单奖励邀请人金币"),systemGive("系统赠送");
        
        private final String desc;
fanli/src/main/java/com/yeshi/fanli/job/order/taobao/UpdateOrderJob.java
@@ -480,7 +480,6 @@
        Long endTime = System.currentTimeMillis() - 1000 * 60 * 10L;
        Long startTime = endTime - 1000 * 60 * 60 * 12L;
        updateLocalTaoBaoOrder(startTime, endTime, 1, 2000);
    }
    public void updateLocalTaoBaoOrder(Long startTime, Long endTime, int page, int count) {
@@ -513,6 +512,9 @@
        }
    }
    /**
     * 处理最近5天的本地订单
     */
    @Scheduled(cron = "30 13 3 * * ? ")
    public void doLatest5DayLocalTaoBaoOrder() {
        if (!Constant.IS_TASK)
@@ -527,4 +529,30 @@
        }
    }
    /**
     * 处理上月订单成功
     */
    @Scheduled(cron = "0 0 12 25 * ? ")
    public void doSellerNotPayOrder() {
        if (!Constant.IS_TASK)
            return;
        Calendar calender = Calendar.getInstance();
        long endTime = TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(calender.getTimeInMillis(), "yyyy-MM"),
                "yyyy-MM");
        calender.add(Calendar.MONTH, -1);
        long startTime = TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(calender.getTimeInMillis(), "yyyy-MM"),
                "yyyy-MM");
        // 商家未付款
        List<TaoBaoOrder> orderList = taoBaoOrderService.listByStateAndCreateTime("订单成功", new Date(startTime),
                new Date(endTime));
        if (orderList != null)
            for (TaoBaoOrder order : orderList)
                try {
                    orderProcessService.doTaoBaoSellerNotPaid(order);
                } catch (Exception e) {
                    LogHelper.errorDetailInfo(e);
                }
    }
}
fanli/src/main/java/com/yeshi/fanli/mapping/taobao/TaoBaoOrderMapper.xml
@@ -145,9 +145,18 @@
        <if test="maxTime!=null">
          and #{maxTime}>UNIX_TIMESTAMP(to_settlement_time)*1000
        </if>
    </select>
    
    <select id="listByStateAndCreateTime" resultMap="BaseResultMap">
        select * from yeshi_ec_taobao_order
        where to_order_state=#{state}
        <if test="minCreateTime!=null">
          and UNIX_TIMESTAMP(to_create_time)*1000>=#{minCreateTime}
        </if>
        <if test="maxCreateTime!=null">
          and #{maxCreateTime}>UNIX_TIMESTAMP(to_create_time)*1000
        </if>
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_taobao_order where to_id = #{id,jdbcType=BIGINT}
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgOtherDetailServiceImpl.java
@@ -52,6 +52,9 @@
        } else if (detail.getType() == MsgTypeOtherTypeEnum.firstOrderReward) {
            msgOtherDetailMapper.insertSelective(detail);
            userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
        }else if (detail.getType() == MsgTypeOtherTypeEnum.systemGive) {
            msgOtherDetailMapper.insertSelective(detail);
            userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
        }
    }
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java
@@ -13,6 +13,7 @@
import com.yeshi.fanli.dto.msg.MsgOtherExchangeContentDTO;
import com.yeshi.fanli.dto.msg.MsgOtherGiveContentDTO;
import com.yeshi.fanli.dto.msg.MsgOtherRewardIntegralDTO;
import com.yeshi.fanli.dto.msg.MsgOtherSystemGiveDTO;
import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail;
import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum;
@@ -433,4 +434,20 @@
            e.printStackTrace();
        }
    }
    @Override
    public void systemGiveRewardCoupon(Long uid, String beiZhu, MsgOtherSystemGiveDTO dto) {
        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(dto));
            detail.setType(MsgTypeOtherTypeEnum.systemGive);
            msgOtherDetailService.addMsgOtherDetail(detail);
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java
@@ -1443,4 +1443,54 @@
            return false;
    }
    @Transactional(rollbackFor = Exception.class)
    public void invalidHongBaoV2AndGiveGodenCorn(Long hongBaoId, Long uid, String orderId, int sourceType,
            String beiZhu) throws Exception {
        HongBaoV2 v2 = new HongBaoV2(hongBaoId);
        v2.setState(HongBaoV2.STATE_SHIXIAO);
        v2.setBeizhu(beiZhu);
        v2.setUpdateTime(new Date());
        hongBaoV2Service.updateByPrimaryKeySelective(v2);
        List<HongBaoV2> children = hongBaoV2Service.listChildrenById(hongBaoId);
        if (children != null)
            for (HongBaoV2 child : children) {
                HongBaoV2 update = new HongBaoV2(child.getId());
                update.setState(HongBaoV2.STATE_SHIXIAO);
                update.setBeizhu(beiZhu);
                update.setUpdateTime(new Date());
                hongBaoV2Service.updateByPrimaryKeySelective(update);
            }
        userSystemCouponService.systemGiveRewardCoupon(uid, 1, orderId, sourceType, "因商家违约未能结算返利或商家已经关店");
    }
    @Transactional
    @Override
    public void doTaoBaoSellerNotPaid(TaoBaoOrder order) {
        // 根据交易ID查询
        if (!StringUtil.isNullOrEmpty(order.getTradeId())) {
            List<CommonOrder> commonOrderList = commonOrderService
                    .listBySourceTypeAndTradeId(Constant.SOURCE_TYPE_TAOBAO, order.getTradeId());
            if (commonOrderList != null)
                // 查询主订单
                for (CommonOrder commonOrder : commonOrderList) {
                // 查询主红包
                HongBaoOrder hongBaoOrder = hongBaoOrderMapper.selectByCommonOrderId(commonOrder.getId());
                if (hongBaoOrder != null && hongBaoOrder.getHongBaoV2() != null) {
                if (hongBaoOrder.getHongBaoV2().getState() == HongBaoV2.STATE_BUKELINGQU) {
                // 订单失效,赠送金币
                try {
                invalidHongBaoV2AndGiveGodenCorn(hongBaoOrder.getHongBaoV2().getId(), hongBaoOrder.getHongBaoV2().getUserInfo().getId(), commonOrder.getOrderNo(), commonOrder.getSourceType(), "订单成功,商家未打款");
                } catch (Exception e) {
                e.printStackTrace();
                }
                }
                }
                }
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/order/tb/TaoBaoOrderServiceImpl.java
@@ -211,4 +211,9 @@
        return taoBaoOrderMapper.countBySettlementTime(minTime, maxTime);
    }
    @Override
    public List<TaoBaoOrder> listByStateAndCreateTime(String state, Date minCreateTime, Date maxCreateTime) {
        return taoBaoOrderMapper.listByStateAndCreateTime(state, minCreateTime.getTime(), maxCreateTime.getTime());
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/push/DeviceActiveServiceImpl.java
@@ -60,7 +60,7 @@
            }
            if (StringUtil.isNullOrEmpty(da.getMac()))
                updateDeviceActive.setImei(deviceActive.getMac());
                updateDeviceActive.setMac(deviceActive.getMac());
            deviceActiveMapper.updateByPrimaryKeySelective(updateDeviceActive);
        }
fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java
@@ -343,7 +343,7 @@
            UserSystemCoupon userSystemCoupon= null;
            try {
                userSystemCoupon = userSystemCouponService.insertUserCoupon(uid, CouponTypeEnum.freeCoupon.name(),
                        UserSystemCoupon.SOURCE_GIVE, null);
                        UserSystemCoupon.SOURCE_GIVE, null,true);
            } catch (Exception e) {
                LogHelper.errorDetailInfo(e);
                throw new TokenRecordException(1, "领取失败");
@@ -437,7 +437,7 @@
            UserSystemCoupon userSystemCoupon= null;
            try {
                userSystemCoupon = userSystemCouponService.insertUserCoupon(uid, CouponTypeEnum.rebatePercentCoupon.name(),
                        UserSystemCoupon.SOURCE_GIVE, systemCoupon.getPercent());
                        UserSystemCoupon.SOURCE_GIVE, systemCoupon.getPercent(),true);
            } catch (Exception e) {
                LogHelper.errorDetailInfo(e);
                throw new TokenRecordException(1, "领取失败");
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserLotteryRecordServiceImpl.java
@@ -196,7 +196,7 @@
            prize = "NoPrize";
        } else {
            try {
                userSystemCouponService.insertUserCoupon(uid, prize, UserSystemCoupon.SOURCE_NEWBIES, null);
                userSystemCouponService.insertUserCoupon(uid, prize, UserSystemCoupon.SOURCE_NEWBIES, null,true);
            } catch (UserSystemCouponException e) {
                e.printStackTrace();
            } catch (Exception e) {
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
@@ -20,6 +20,7 @@
import com.yeshi.fanli.dao.mybatis.user.UserSystemCouponMapper;
import com.yeshi.fanli.dto.msg.MsgOtherCouponActivateDTO;
import com.yeshi.fanli.dto.msg.MsgOtherGiveContentDTO;
import com.yeshi.fanli.dto.msg.MsgOtherSystemGiveDTO;
import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum;
import com.yeshi.fanli.entity.bus.user.HongBaoV2;
import com.yeshi.fanli.entity.bus.user.Order;
@@ -66,6 +67,7 @@
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TokenUtil;
import com.yeshi.fanli.util.factory.UserMoneyDetailFactory;
import com.yeshi.fanli.util.factory.msg.MsgOtherSystemGiveDTOFactory;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
import com.yeshi.fanli.vo.order.CommonOrderVO;
@@ -148,7 +150,6 @@
    @Resource
    private TokenRecordService tokenRecordService;
    
    @Override
    public int insertSelective(UserSystemCoupon record) {
        return userSystemCouponMapper.insertSelective(record);
@@ -196,15 +197,16 @@
    @Override
    @Transactional
    public UserSystemCoupon insertUserCoupon(Long uid, String couponType, String source, BigDecimal percent)
            throws UserSystemCouponException, Exception {
    public UserSystemCoupon insertUserCoupon(Long uid, String couponType, String source, BigDecimal percent,
            Boolean needNotify) throws UserSystemCouponException, Exception {
        if (couponType == null || uid == null) {
            throw new UserSystemCouponException(1, "参数不正确");
        }
        SystemCoupon coupon = null;
        if (couponType.equals(CouponTypeEnum.welfareFreeCoupon.name()) || couponType.equals(CouponTypeEnum.freeCoupon.name())
        if (couponType.equals(CouponTypeEnum.welfareFreeCoupon.name())
                || couponType.equals(CouponTypeEnum.freeCoupon.name())
                | couponType.equals(CouponTypeEnum.freeCouponBuy.name())) {
            // 免单券
            coupon = systemCouponService.getCouponByType(couponType);
@@ -286,6 +288,7 @@
        });
        // 消息推送
        if (needNotify) {
        try {
            if (coupon.getType() == CouponTypeEnum.welfareFreeCoupon) {
                userOtherMsgNotificationService.welfareCouponGet(userCoupon);
@@ -300,6 +303,7 @@
                LogHelper.errorDetailInfo(e);
            } catch (Exception e1) {
                e1.printStackTrace();
                }
            }
        }
        
@@ -548,7 +552,6 @@
        return listVO;
    }
    /**
     * 是否存在奖励券
     * 
@@ -648,7 +651,6 @@
        return list;
    }
    
    @Override
    public long countUsableFreeCouponForBuy (Long uid) {
        if (uid == null) 
@@ -665,7 +667,6 @@
        
        return userSystemCouponMapper.countUsableByUid(uid, listCouponId);
    }
    
    @Override
    public long countUsableRewardCoupon (Long uid) {
@@ -684,10 +685,10 @@
        return userSystemCouponMapper.countUsableByUid(uid, listCouponId);
    }
    
    @Transactional
    @Override
    public void useGoodsCoupon(Long uid, Long id, Long goodId, Integer sourceType) throws UserSystemCouponException, Exception {
    public void useGoodsCoupon(Long uid, Long id, Long goodId, Integer sourceType)
            throws UserSystemCouponException, Exception {
        if (uid == null) {
            throw new UserSystemCouponException(1, "用户未登录");
        }
@@ -763,7 +764,8 @@
    @Transactional
    @Override
    public void useOrderCoupon(Long uid, Long id, String orderNo, Integer sourceType) throws UserSystemCouponException, Exception {
    public void useOrderCoupon(Long uid, Long id, String orderNo, Integer sourceType)
            throws UserSystemCouponException, Exception {
        if (id == null) {
            throw new UserSystemCouponException(1, "券id不存在");
@@ -807,7 +809,8 @@
        }
        // 订单
        CommonOrderVO orderVO = commonOrderService.getCommonOrderByOrderNo(uid, orderNo, CommonOrder.STATE_JS, sourceType);
        CommonOrderVO orderVO = commonOrderService.getCommonOrderByOrderNo(uid, orderNo, CommonOrder.STATE_JS,
                sourceType);
        if (orderVO == null) {
            throw new UserSystemCouponException(1, "订单信息获取失败");
        }
@@ -890,7 +893,8 @@
    }
    @Override
    public UserSystemCouponRecordVO getRewardCouponRecord(String orderNo, Integer sourceType) throws UserSystemCouponException, Exception {
    public UserSystemCouponRecordVO getRewardCouponRecord(String orderNo, Integer sourceType)
            throws UserSystemCouponException, Exception {
        if (orderNo == null || orderNo.trim().length() == 0) {
            throw new UserSystemCouponException(1, "订单号不存在");
@@ -968,7 +972,8 @@
    }
    @Override
    public UserSystemCouponRecordVO getFreeCouponRecord(String orderNo, Integer sourceType) throws UserSystemCouponException, Exception {
    public UserSystemCouponRecordVO getFreeCouponRecord(String orderNo, Integer sourceType)
            throws UserSystemCouponException, Exception {
        if (orderNo == null || orderNo.trim().length() == 0) {
            throw new UserSystemCouponException(1, "订单号不存在");
@@ -996,7 +1001,8 @@
        }
        // 订单
        CommonOrderVO orderVO = commonOrderService.getCommonOrderByOrderNo(userSystemCoupon.getUid(), orderNo, null, sourceType);
        CommonOrderVO orderVO = commonOrderService.getCommonOrderByOrderNo(userSystemCoupon.getUid(), orderNo, null,
                sourceType);
        if (orderVO == null) {
            throw new UserSystemCouponException(1, "订单信息获取失败");
        }
@@ -1266,7 +1272,8 @@
        } else if (CouponTypeEnum.freeCoupon.name().equals(record.getCouponType())) {
            userOtherMsgNotificationService.freeSheetCouponUsed(record.getUserSystemCoupon(), orderNo);
        } else if (CouponTypeEnum.freeCouponBuy.name().equals(record.getCouponType())) {
            userOtherMsgNotificationService.couponUsedFreeSheet(record.getUserSystemCoupon(), orderNo, MsgTypeOtherTypeEnum.freeCouponBuy);
            userOtherMsgNotificationService.couponUsedFreeSheet(record.getUserSystemCoupon(), orderNo,
                    MsgTypeOtherTypeEnum.freeCouponBuy);
        }
    }
@@ -1274,7 +1281,6 @@
    public List<UserSystemCoupon> getCounponNowInvalid(int count) {
        return userSystemCouponMapper.getCounponNowInvalid(count);
    }
    
    @Transactional
    @Override
@@ -1346,15 +1352,14 @@
                } else if (CouponTypeEnum.freeCoupon.name().equals(couponType)) {
                    userOtherMsgNotificationService.freeSheetCouponUsing(userSystemCoupon, orderNo, payment);
                } else if (CouponTypeEnum.freeCouponBuy.name().equals(couponType)) {
                    userOtherMsgNotificationService.couponUsingFreeSheet(userSystemCoupon, orderNo, payment, MsgTypeOtherTypeEnum.freeCouponBuy);
                    userOtherMsgNotificationService.couponUsingFreeSheet(userSystemCoupon, orderNo, payment,
                            MsgTypeOtherTypeEnum.freeCouponBuy);
                }
            }
        }
        return isfree;
    }
    @Override
    @Transactional
@@ -1366,8 +1371,8 @@
         * if (uid == null || device == null) { return; }
         * 
         * // 未登陆之前抽奖记录 List<DeviceLotteryRecord> list =
         * deviceLotteryRecordService.listByPlatformAndDevice(platform, device); if
         * (list == null || list.size() == 0) { return; }
         * deviceLotteryRecordService.listByPlatformAndDevice(platform, device);
         * if (list == null || list.size() == 0) { return; }
         * 
         * // 获取额外信息 UserInfoExtra userInfoExtra =
         * userInfoExtraService.getUserInfoExtra(uid);
@@ -1383,40 +1388,44 @@
         * for (DeviceLotteryRecord reviceLotteryRecord : list) {
         * 
         * // 删除记录
         * deviceLotteryRecordService.deleteByPrimaryKey(reviceLotteryRecord.getId());
         * deviceLotteryRecordService.deleteByPrimaryKey(reviceLotteryRecord.
         * getId());
         * 
         * Long systemCouponId = reviceLotteryRecord.getSystemCouponId(); if
         * (systemCouponId == null) { continue; } SystemCoupon systemCoupon =
         * systemCouponService.selectByPrimaryKey(systemCouponId); if (systemCoupon ==
         * null) { continue; }
         * systemCouponService.selectByPrimaryKey(systemCouponId); if
         * (systemCoupon == null) { continue; }
         * 
         * int stateActivated = 1; if (systemCoupon.getType() ==
         * CouponTypeEnum.welfareFreeCoupon) { // 福利券状态 long countSuccess =
         * threeSaleSerivce.countSuccessFirstTeam(uid); // 没有下级队员 --待激活 if (countSuccess
         * == 0) { stateActivated = 0; } }
         * threeSaleSerivce.countSuccessFirstTeam(uid); // 没有下级队员 --待激活 if
         * (countSuccess == 0) { stateActivated = 0; } }
         * 
         * // 结束日期 // 今天在内 减去一天 String endDay =
         * DateUtil.plusDay(systemCoupon.getExpiryDay() - 1, new Date());
         * SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); if
         * (endDay != null && endDay.trim().length() > 0) { endDay += " 23:59:59"; }
         * Date endTime = format.parse(endDay);
         * SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"
         * ); if (endDay != null && endDay.trim().length() > 0) { endDay +=
         * " 23:59:59"; } Date endTime = format.parse(endDay);
         * 
         * UserSystemCoupon userCoupon = new UserSystemCoupon(); userCoupon.setUid(uid);
         * UserSystemCoupon userCoupon = new UserSystemCoupon();
         * userCoupon.setUid(uid);
         * userCoupon.setSource(UserSystemCoupon.SOURCE_NEWBIES);
         * userCoupon.setSystemCoupon(systemCoupon);
         * userCoupon.setState(UserSystemCoupon.STATE_CAN_USE);
         * userCoupon.setStateActivated(stateActivated); userCoupon.setStartTime(new
         * Date()); userCoupon.setEndTime(endTime); userCoupon.setCreateTime(new
         * Date()); userCoupon.setUpdateTime(new Date()); // 插入数据库
         * insertSelective(userCoupon);
         * userCoupon.setStateActivated(stateActivated);
         * userCoupon.setStartTime(new Date()); userCoupon.setEndTime(endTime);
         * userCoupon.setCreateTime(new Date()); userCoupon.setUpdateTime(new
         * Date()); // 插入数据库 insertSelective(userCoupon);
         * 
         * // 券数量 coupon++;
         * 
         * // 消息推送 try { if (systemCoupon.getType() == CouponTypeEnum.welfareFreeCoupon)
         * { userOtherMsgNotificationService.welfareCouponGet(userCoupon); } else if
         * (systemCoupon.getType() == CouponTypeEnum.freeCoupon) {
         * userOtherMsgNotificationService.freeSheetCouponGet(userCoupon); } else if
         * (systemCoupon.getType() == CouponTypeEnum.rebatePercentCoupon) {
         * // 消息推送 try { if (systemCoupon.getType() ==
         * CouponTypeEnum.welfareFreeCoupon) {
         * userOtherMsgNotificationService.welfareCouponGet(userCoupon); } else
         * if (systemCoupon.getType() == CouponTypeEnum.freeCoupon) {
         * userOtherMsgNotificationService.freeSheetCouponGet(userCoupon); }
         * else if (systemCoupon.getType() ==
         * CouponTypeEnum.rebatePercentCoupon) {
         * userOtherMsgNotificationService.rewardCouponGet(userCoupon,
         * systemCoupon.getPercent().intValue()); }
         * 
@@ -1435,7 +1444,6 @@
    }
    
    @Override
    @Transactional
    public void randomRewardCoupon(int num, Long uid, String source) throws Exception {
@@ -1448,8 +1456,8 @@
            // 返利比-随机
            BigDecimal percent = new BigDecimal(randomNum());
            // 查询奖励券
            SystemCoupon systemCoupon = systemCouponService.getCouponByTypeAndPercent(
                    CouponTypeEnum.rebatePercentCoupon.name(),percent);
            SystemCoupon systemCoupon = systemCouponService
                    .getCouponByTypeAndPercent(CouponTypeEnum.rebatePercentCoupon.name(), percent);
            if (systemCoupon == null) {
                return;
            }
@@ -1501,8 +1509,21 @@
        userInfoExtraService.saveUserInfoExtra(userInfoExtra);
    }
    
    @Override
    @Transactional(rollbackFor=Exception.class)
    public void systemGiveRewardCoupon(Long uid, int num, String orderId, Integer orderType, String reason)
            throws Exception {
        // 添加奖励券
        insertUserCoupon(uid, CouponTypeEnum.rebatePercentCoupon.name(), "系统赠送",
                new BigDecimal(configService.get("exchange_rebate_percent")),false);
        // 添加奖励券消息
        userOtherMsgNotificationService.systemGiveRewardCoupon(uid, null, MsgOtherSystemGiveDTOFactory
                .createRewardCouponGive(num, "请按照返利奖励券规则使用", "返利奖励券", orderId, orderType, reason));
    }
    /**
     * 随机券比例
     *
     * @return
     */
    public int randomNum() {
@@ -1551,7 +1572,8 @@
        public int num;//券值
        public int probability; // 概率
        
        RandomProportion () {}
        RandomProportion() {
        }
        
        RandomProportion (int num, int probability) {
            this.num = num;
@@ -1559,10 +1581,10 @@
        }
    }
    
    @Override
    @Transactional
    public void exchangeCoupon(Long uid, String couponType, String source, BigDecimal percent) throws UserSystemCouponException, Exception {
    public void exchangeCoupon(Long uid, String couponType, String source, BigDecimal percent)
            throws UserSystemCouponException, Exception {
        if (couponType == null || uid == null) {
            throw new UserSystemCouponException(1, "参数不正确");
        }
@@ -1581,10 +1603,10 @@
        int stateActivated = 1;
        if (couponType == CouponTypeEnum.freeCoupon.name()) {
            stateActivated = 0; //
        } else if (couponType == CouponTypeEnum.welfareFreeCoupon.name() && threeSaleSerivce.countSuccessFirstTeam(uid) <= 0) {
        } else if (couponType == CouponTypeEnum.welfareFreeCoupon.name()
                && threeSaleSerivce.countSuccessFirstTeam(uid) <= 0) {
            stateActivated = 0;  // 无下级队员 --待激活
        } 
        
        Integer expiryDay = null;
        if (stateActivated == 0) 
@@ -1592,7 +1614,6 @@
            
        if (expiryDay == null || expiryDay == 0) 
            expiryDay = coupon.getExpiryDay();
            
        //  计算结束日期:今天在内  减去一天
        String endDay = DateUtil.plusDay(expiryDay - 1, new Date());
@@ -1617,7 +1638,6 @@
        insertSelective(userCoupon);
    }
    
    @Transactional
    @Override
    public List<UserSystemCouponVO> getCouponList(long start, int count, Long uid)
@@ -1631,7 +1651,6 @@
        
        // 赠送的退回
        sendBackGiveUser(uid);
        
        List<UserSystemCouponVO> listVO = userSystemCouponMapper.getUserCouponVOList(start, count, uid);
        if (listVO == null || listVO.size() == 0) {
@@ -1796,15 +1815,18 @@
                }
                
                if (!StringUtil.isNullOrEmpty(tips) && tokenType != null) {
                    UserSystemCouponGiveRecord record = userSystemCouponGiveRecordService.getRecordByUidAndCouponId(uid, userCouponVO.getId());
                    UserSystemCouponGiveRecord record = userSystemCouponGiveRecordService.getRecordByUidAndCouponId(uid,
                            userCouponVO.getId());
                    if (record != null) {
                        TokenRecord tokenRecord = tokenRecordService.getNearByTypeAndIdentify(tokenType.name(), record.getId().toString());
                        TokenRecord tokenRecord = tokenRecordService.getNearByTypeAndIdentify(tokenType.name(),
                                record.getId().toString());
                        if (tokenRecord != null && !StringUtil.isNullOrEmpty(tokenRecord.getToken())) {
                            String projectChineseName = Constant.systemCommonConfig.getProjectChineseName();
                            while(tips.contains("{APP名称}")) {
                                tips = tips.replace("{APP名称}", projectChineseName);
                            }
                            tips = tips.replace("{口令}", tokenRecord.getToken()).replace("{下载链接}", configService.get("app_down_link"));
                            tips = tips.replace("{口令}", tokenRecord.getToken()).replace("{下载链接}",
                                    configService.get("app_down_link"));
                            userCouponVO.setGiveTips(tips);
                        }
                        
@@ -1863,7 +1885,6 @@
        return listVO;
    }
    
    @Transactional
    @Override
    public UserSystemCouponVO giveCoupon(Long uid, Long id) throws UserSystemCouponException {
@@ -1902,7 +1923,6 @@
        if (StringUtil.isNullOrEmpty(tips))
            throw new UserSystemCouponException(1, "tips数据缺失");
        
        // 是否最近生成口令有效
        UserSystemCouponGiveRecord record = userSystemCouponGiveRecordService.getRecordByUidAndCouponId(uid, id);
        if (record != null) {
@@ -1912,12 +1932,12 @@
                while(tips.contains("{APP名称}")) {
                    tips = tips.replace("{APP名称}", projectChineseName);
                }
                tips = tips.replace("{口令}", tokenRecord.getToken()).replace("{下载链接}", configService.get("app_down_link"));
                tips = tips.replace("{口令}", tokenRecord.getToken()).replace("{下载链接}",
                        configService.get("app_down_link"));
                
                return createUserCouponVOo(userSystemCoupon, systemCoupon, record, tips);
            }
        }
        
        Date nowDate = new Date();
        // 插入赠送记录
@@ -1967,7 +1987,6 @@
        return createUserCouponVOo(userSystemCoupon, systemCoupon, giveRecord, tips);
    }
    
    private UserSystemCouponVO createUserCouponVOo(UserSystemCoupon userSystemCoupon, SystemCoupon systemCoupon, 
            UserSystemCouponGiveRecord record, String tips) {
        UserSystemCouponVO userCouponVO = new UserSystemCouponVO();
@@ -1999,9 +2018,9 @@
        return userCouponVO;
    }
    /**
     * 免单券激活
     *
     * @param uid
     */
    public void freeCouponActivate(Long id,Long uid, Date date) {
@@ -2022,7 +2041,6 @@
            if (endTime2 != null && endTime2.getTime() <= nowDate.getTime())
                return;
            
            SystemCoupon systemCoupon = coupon.getSystemCoupon();
            if (systemCoupon == null)
                return;
@@ -2030,7 +2048,6 @@
            systemCoupon = systemCouponService.selectByPrimaryKey(systemCoupon.getId());
            if (systemCoupon == null || systemCoupon.getType() != CouponTypeEnum.freeCoupon)
                return;
            try {
                Integer expiryDay =  systemCoupon.getExpiryDay();
@@ -2076,7 +2093,6 @@
        }
    }
    
    @Transactional
    @Override
    public void updateInvalidSate(Long uid) {
@@ -2086,7 +2102,6 @@
        }
        updateCounponInvalid(list);
    }
    
    @Override
    public void updateCounponInvalid(List<UserSystemCoupon> list) {
@@ -2133,7 +2148,6 @@
        }
    }
    
    /**
     * 退回券 初始数据
     * 
@@ -2173,11 +2187,11 @@
            } else if (CouponTypeEnum.freeCoupon.name().equals(record.getCouponType())) {
                userOtherMsgNotificationService.freeSheetCouponDrawBack(userSystemCoupon, record.getOrderNo());
            } else if (CouponTypeEnum.freeCouponBuy.name().equals(record.getCouponType())) {
                userOtherMsgNotificationService.couponDrawBack(userSystemCoupon, record.getOrderNo(), MsgTypeOtherTypeEnum.freeCouponBuy);
                userOtherMsgNotificationService.couponDrawBack(userSystemCoupon, record.getOrderNo(),
                        MsgTypeOtherTypeEnum.freeCouponBuy);
            }
        }
    }
    
    @Async()
    @Transactional
@@ -2219,7 +2233,6 @@
            }
        }
    }
    
    @Transactional
    @Override
@@ -2290,7 +2303,6 @@
            if (systemCoupon == null)
                continue;
            
            // 退回消息
            String couponName = systemCoupon.getName();
            if (CouponTypeEnum.freeCouponGive == systemCoupon.getType()) {
@@ -2311,7 +2323,6 @@
        }
    }
    
    @Override
    public boolean getIncludeExchange(Long uid) {
        // 过期券
@@ -2320,12 +2331,12 @@
        String percent = configService.get("exchange_rebate_percent");
        if (StringUtil.isNullOrEmpty(percent)) 
            percent = "35";
        List<UserSystemCoupon> listCoupon = userSystemCouponMapper.getIncludeExchange(uid, Integer.parseInt(percent), CouponTypeEnum.rebatePercentCoupon.name());
        List<UserSystemCoupon> listCoupon = userSystemCouponMapper.getIncludeExchange(uid, Integer.parseInt(percent),
                CouponTypeEnum.rebatePercentCoupon.name());
        if (listCoupon == null || listCoupon.size() == 0)
            return false;
        return true;
    }
    
    @Override
    public boolean getIncludeNotExchange(Long uid) {
@@ -2335,12 +2346,12 @@
        String percent = configService.get("exchange_rebate_percent");
        if (StringUtil.isNullOrEmpty(percent)) 
            percent = "35";
        List<UserSystemCouponVO> listCoupon = userSystemCouponMapper.getIncludeNotExchange(uid, Integer.parseInt(percent), CouponTypeEnum.rebatePercentCoupon.name());
        List<UserSystemCouponVO> listCoupon = userSystemCouponMapper.getIncludeNotExchange(uid,
                Integer.parseInt(percent), CouponTypeEnum.rebatePercentCoupon.name());
        if (listCoupon == null || listCoupon.size() == 0)
            return false;
        return true;
    }
    
    @Override
    public List<UserSystemCouponVO> listIncludeNotExchange(Long uid) throws Exception{
@@ -2354,7 +2365,8 @@
        if (StringUtil.isNullOrEmpty(percent)) 
            percent = "35";
        
        List<UserSystemCouponVO> listCoupon = userSystemCouponMapper.getIncludeNotExchange(uid, Integer.parseInt(percent), CouponTypeEnum.rebatePercentCoupon.name());
        List<UserSystemCouponVO> listCoupon = userSystemCouponMapper.getIncludeNotExchange(uid,
                Integer.parseInt(percent), CouponTypeEnum.rebatePercentCoupon.name());
        if (listCoupon == null || listCoupon.size() == 0)
            return null;
@@ -2418,9 +2430,9 @@
        return listCoupon;
    }
    
    @Override
    public List<UserSystemCoupon> getFreeCouponByType(Long uid, String type) {
        return userSystemCouponMapper.getFreeCouponByType(uid, type);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/inter/msg/UserOtherMsgNotificationService.java
@@ -6,6 +6,7 @@
import com.yeshi.fanli.dto.msg.MsgOtherExchangeContentDTO;
import com.yeshi.fanli.dto.msg.MsgOtherGiveContentDTO;
import com.yeshi.fanli.dto.msg.MsgOtherRewardIntegralDTO;
import com.yeshi.fanli.dto.msg.MsgOtherSystemGiveDTO;
import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum;
import com.yeshi.fanli.entity.bus.user.UserInfo;
@@ -73,9 +74,9 @@
     */
    public void welfareCouponAlreadyOutOfDate(UserSystemCoupon coupon);
    
    /**
     * 福利免单券已经退回
     *
     * @param coupon
     */
    public void welfareCouponDrawBack(UserSystemCoupon coupon,String orderId);
@@ -132,28 +133,31 @@
    
    /**
     * 已退回
     *
     * @param coupon
     */
    public void freeSheetCouponDrawBack(UserSystemCoupon coupon,String orderId);
    // 奖励券
    /**
     *  奖励券获得
     *
     * @param coupon
     * @param percent -百分比
     * @param percent
     *            -百分比
     */
    public void rewardCouponGet(UserSystemCoupon coupon,int percent);
    /**
     * 奖励券使用成功
     *
     * @param coupon
     * @param oldFanLiMoney-原始返利金额
     * @param rewardMoney-奖励金额
     */
    public void rewardCouponUsed(UserSystemCoupon coupon,BigDecimal oldFanLiMoney,BigDecimal rewardMoney,String orderId);
    public void rewardCouponUsed(UserSystemCoupon coupon, BigDecimal oldFanLiMoney, BigDecimal rewardMoney,
            String orderId);
    /**
     * 奖励券即将过期
@@ -174,18 +178,18 @@
     */
    public void rewardCouponAlreadyOutOfDate(UserSystemCoupon coupon);
    /**
     * 淘礼金消息
     *
     * @param uid
     * @param beiZhu
     * @param content
     */
    public void taoLiJinMsg(Long uid, String beiZhu, MsgOtherTaoLiJinContentDTO content);
    /**
     * 口令赠送领取
     *
     * @param uid
     * @param beiZhu
     * @param content
@@ -194,6 +198,7 @@
    /**
     * 兑换消息
     *
     * @param uid
     * @param beiZhu
     * @param content
@@ -202,6 +207,7 @@
    /**
     * 券退回
     *
     * @param coupon
     * @param orderId
     * @param type
@@ -210,6 +216,7 @@
    /**
     * 券
     *
     * @param coupon
     * @param type
     */
@@ -222,13 +229,14 @@
     * @param startTime
     * @param endTime
     */
    public void couponUsingFreeSheet(UserSystemCoupon coupon,String orderId,BigDecimal money, MsgTypeOtherTypeEnum type);
    public void couponUsingFreeSheet(UserSystemCoupon coupon, String orderId, BigDecimal money,
            MsgTypeOtherTypeEnum type);
    
    public void couponUsedFreeSheet(UserSystemCoupon coupon, String orderId, MsgTypeOtherTypeEnum type);
    /**
     * 赠送的免单券激活
     *
     * @param uid
     * @param beiZhu
     * @param content
@@ -237,10 +245,19 @@
    /**
     * 队员首单奖励邀请人
     *
     * @param uid
     * @param beiZhu
     * @param content
     */
    public void firstOrderRewardMsg(Long uid, String beiZhu, MsgOtherRewardIntegralDTO content);
    /**
     * 系统赠送的免单券
     * @param uid
     * @param beiZhu
     * @param dto
     */
    public void systemGiveRewardCoupon(Long uid, String beiZhu, MsgOtherSystemGiveDTO dto);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/order/OrderProcessService.java
@@ -118,4 +118,9 @@
     */
    public boolean isShareOrder(CommonOrder commonOrder);
    /**
     * 处理淘宝商家未付款的情况
     */
    public void doTaoBaoSellerNotPaid(TaoBaoOrder order);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/order/tb/TaoBaoOrderService.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.service.inter.order.tb;
import java.util.Date;
import java.util.List;
import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
@@ -105,4 +106,13 @@
     */
    public Long countBySettlementTime(Long minTime, Long maxTime);
    /**
     * 根据状态和创建时间检索
     *
     * @param state
     * @param minCreateTime
     * @param maxCreateTime
     * @return
     */
    public List<TaoBaoOrder> listByStateAndCreateTime(String state, Date minCreateTime, Date maxCreateTime);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserSystemCouponService.java
@@ -134,7 +134,7 @@
     * @throws UserSystemCouponException
     * @throws Exception
     */
    public UserSystemCoupon insertUserCoupon(Long uid, String couponType, String source, BigDecimal percent) throws UserSystemCouponException, Exception;
    public UserSystemCoupon insertUserCoupon(Long uid, String couponType, String source, BigDecimal percent,Boolean needNotify) throws UserSystemCouponException, Exception;
    /**
@@ -201,6 +201,22 @@
     */
    public void randomRewardCoupon(int num, Long uid, String source) throws Exception;
    /**
     * 系统赠送奖励券
     * @param num
     * @param uid
     * @param source
     * @throws Exception
     */
    public void systemGiveRewardCoupon(Long uid,int num,String orderId,Integer orderType,String reason) throws Exception;
    /**
     * 添加券
     * @param uid
fanli/src/main/java/com/yeshi/fanli/util/SpringContext.java
@@ -174,7 +174,7 @@
            doImportantTaoBaoGoodsUpdateJob();// 淘宝重要商品的信息更新
            doHongBaoRecieveIntegralGetJob();// 返利到账,金币增加
//            doPlaceOrderIntegralJob();// 下单赠送金币任务
//            doDouYinDeviceActiveJob();// 抖音设备激活广告监测
            doDouYinDeviceActiveJob();// 抖音设备激活广告监测
        }
    }
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java
@@ -12,6 +12,7 @@
import com.yeshi.fanli.dto.msg.MsgOtherExchangeContentDTO;
import com.yeshi.fanli.dto.msg.MsgOtherGiveContentDTO;
import com.yeshi.fanli.dto.msg.MsgOtherRewardIntegralDTO;
import com.yeshi.fanli.dto.msg.MsgOtherSystemGiveDTO;
import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail;
import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail.MsgTypeAccountTypeEnum;
@@ -66,7 +67,6 @@
        List<ClientTextStyleVO> contentList = new ArrayList<>();
        if (msg.getType() == MsgTypeOrderTypeEnum.found) {
            
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(Constant.getSourceName(msg.getOrderType()), COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("渠道来源", COLOR_TITLE), contentList));
@@ -98,7 +98,6 @@
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(Constant.getSourceName(msg.getOrderType()), COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("渠道来源", COLOR_TITLE), contentList));
            String orderId = msg.getOrderId();
            MsgTypeOrderTypeEnum type = msg.getType();
@@ -370,7 +369,6 @@
            
            contentList = new ArrayList<>();
            
            contentList.add(new ClientTextStyleVO(msg.getOrderId(), COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("邀请订单", COLOR_TITLE), contentList));
@@ -559,20 +557,17 @@
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("状态", COLOR_TITLE), contentList));
            }
            
            if (!StringUtil.isNullOrEmpty(dto.getCode())) {
                contentList = new ArrayList<>();
                contentList.add(new ClientTextStyleVO(dto.getCode() + "", COLOR_CONTENT));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("邀请码", COLOR_TITLE), contentList));
            }
            
            if (!StringUtil.isNullOrEmpty(dto.getInviter())) {
                contentList = new ArrayList<>();
                contentList.add(new ClientTextStyleVO(dto.getInviter() + "", COLOR_CONTENT));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("邀请人", COLOR_TITLE), contentList));
            }
            
            if (!StringUtil.isNullOrEmpty(dto.getMode())) {
                contentList = new ArrayList<>();
@@ -770,7 +765,6 @@
                icon = "http://img.flqapp.com/resource/msg/icon_msg_other_tlj.png";
            }
            
            List<ClientTextStyleVO> contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getGiveType(), COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("赠送类别", COLOR_TITLE), contentList));
@@ -786,7 +780,6 @@
                contentList.add(new ClientTextStyleVO(dto.getGiveTime() + "", COLOR_CONTENT));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("赠送时间", COLOR_TITLE), contentList));
            }
            if (!StringUtil.isNullOrEmpty(dto.getReceiveTime())) {
                contentList = new ArrayList<>();
@@ -943,8 +936,61 @@
            userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
            userMsgVO.setContentItems(items);
            return userMsgVO;
        } else if (msg.getType() == MsgTypeOtherTypeEnum.systemGive) {
            if (StringUtil.isNullOrEmpty(msg.getContent()))
                return null;
            MsgOtherSystemGiveDTO dto = new Gson().fromJson(msg.getContent(), MsgOtherSystemGiveDTO.class);
            if (dto == null)
                return null;
            icon = "http://img.flqapp.com/resource/msg/icon_msg_other_system_give.png";
            List<ClientTextStyleVO> contentList = new ArrayList<>();
            if (!StringUtil.isNullOrEmpty(dto.getName())) {
                contentList = new ArrayList<>();
                contentList.add(new ClientTextStyleVO(dto.getName() + "", COLOR_CONTENT));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("赠品", COLOR_TITLE), contentList));
        }
            if (dto.getCount() != null) {
                contentList = new ArrayList<>();
                contentList.add(new ClientTextStyleVO(dto.getCount() + "张", COLOR_CONTENT));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("数量", COLOR_TITLE), contentList));
            }
            if (!StringUtil.isNullOrEmpty(dto.getReason())) {
                contentList = new ArrayList<>();
                contentList.add(new ClientTextStyleVO(dto.getReason() + "", COLOR_CONTENT));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("原因", COLOR_TITLE), contentList));
            }
            if (!StringUtil.isNullOrEmpty(dto.getOrderId())) {
                contentList = new ArrayList<>();
                contentList.add(new ClientTextStyleVO(
                        "[" + Constant.getSourceName(dto.getOrderType()) + "]" + dto.getOrderId() + "", COLOR_CONTENT));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("订单", COLOR_TITLE), contentList));
            }
            if (!StringUtil.isNullOrEmpty(dto.getDesc())) {
                contentList = new ArrayList<>();
                contentList.add(new ClientTextStyleVO(dto.getDesc(), COLOR_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));
            UserMsgVO userMsgVO = new UserMsgVO();
            userMsgVO.setIcon(icon);
            userMsgVO.setTitle(msg.getType().getDesc());
            userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
            userMsgVO.setContentItems(items);
            return userMsgVO;
        }
        return new UserMsgVO(icon, msg.getType().getDesc(),
                msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
fanli/src/main/java/com/yeshi/fanli/util/taobao/DaTaoKeUtil.java
@@ -6,6 +6,7 @@
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
@@ -579,14 +580,13 @@
        return detail;
    }
    public static List<String> getDingDongQiangTime() {
    public static List<String> getDingDongQiangTime(Calendar nowDate) {
        // 获取当前的小时数
        DingDongTime[] times = new DingDongTime[] { new DingDongTime("0", "00:00"), new DingDongTime("8", "08:00"),
                new DingDongTime("10", "10:00"), new DingDongTime("13", "13:00"), new DingDongTime("15", "15:00"),
                new DingDongTime("17", "17:00"), new DingDongTime("19", "19:00"), new DingDongTime("20", "20:00"),
                new DingDongTime("21", "21:00") };
        Calendar nowDate = Calendar.getInstance();
        Calendar preDate = Calendar.getInstance();
        preDate.setTimeInMillis(nowDate.getTimeInMillis() - 24 * 60 * 60 * 1000L);
@@ -601,7 +601,7 @@
                ? "0" + nowDate.get(Calendar.DAY_OF_MONTH) : nowDate.get(Calendar.DAY_OF_MONTH) + "";
        int hour = nowDate.get(Calendar.HOUR_OF_DAY);
        int pos = 0;
        int pos = times.length - 1;
        for (int i = 0; i < times.length - 1; i++) {
            if (hour >= Integer.parseInt(times[i].getKey()) && hour < Integer.parseInt(times[i + 1].getKey())) {
                pos = i;
@@ -611,6 +611,7 @@
        List<DingDongTime> list = new ArrayList<>();
        //获取当前时间之前的5个数据
        for (int i = 5; i >= 0; i--) {
            int p = pos - i < 0 ? (times.length + pos - i) : pos - i;
            DingDongTime itemData = new DingDongTime(times[p].getKey(), times[p].getValue());
@@ -623,6 +624,7 @@
            list.add(itemData);
        }
        //向后添加剩下的
        if (pos + 1 < times.length)
            for (int i = pos + 1; i < times.length; i++) {
                DingDongTime itemData = new DingDongTime(times[i].getKey(), times[i].getValue());
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java
@@ -1502,9 +1502,13 @@
        Map<String, String> map = new HashMap<>();
        map.put("method", "taobao.tbk.item.click.extract");
        map.put("click_url", link + "");
        TaoKeAppInfo app = new TaoKeAppInfo(TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET,
                TaoBaoConstant.TAOBAO_RELATION_AS_SPECIAL_PID);
        JSONObject resultJSON = null;
        try {
            resultJSON = TaoKeBaseUtil.baseRequest(map, true);
            resultJSON = TaoKeBaseUtil.baseRequest(map, app);
            System.out.println(resultJSON);
        } catch (TaoKeApiException e) {
            e.printStackTrace();
        }