admin
2019-10-16 9fc5a5bf46a7db97bec59a672cf2b16fb9b9d832
VIVO推送修改
21个文件已修改
2个文件已添加
805 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserAccountController.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/HongBaoV2Mapper.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/ThreeSaleMapper.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/ThreeSale.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/taobao/dataoke/DaTaoKeDetailV2.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/log/PushLogHelper.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/ThreeSaleMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/hongbao/HongBaoV2Mapper.xml 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoOrderServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoV2ServiceImpl.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/push/OPPOPushServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/push/PushServiceImpl.java 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/push/VIVOPushServiceImpl.java 236 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinOriginServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/ThreeSaleSerivceImpl.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/order/HongBaoOrderService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/order/HongBaoV2Service.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/push/VIVOPushService.java 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/invite/ThreeSaleSerivce.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/SpringContext.java 140 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/dataoke/DaTaoKeApiUtil.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/push/VIVOPushUtil.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserAccountController.java
@@ -47,6 +47,7 @@
import com.yeshi.fanli.service.inter.push.DeviceActiveService;
import com.yeshi.fanli.service.inter.push.DeviceTokenHWService;
import com.yeshi.fanli.service.inter.push.DeviceTokenOPPOService;
import com.yeshi.fanli.service.inter.push.DeviceTokenVIVOService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
@@ -129,6 +130,9 @@
    @Resource
    private DeviceTokenOPPOService deviceTokenOPPOService;
    @Resource
    private DeviceTokenVIVOService deviceTokenVIVOService;
    @Resource
    private TaoBaoUnionConfigService taoBaoUnionConfigService;
@@ -262,10 +266,11 @@
                            platformType = 2;
                        }
                        userSystemCouponService.copyLotteryPrize(uuser.getId(), platformType, acceptData.getDevice());
                        // 绑定oppo推送
                        // 绑定oppo,vivo推送
                        DeviceActive active = deviceActiveService.getFirstActiveInfo(acceptData.getDevice());
                        if (active != null) {
                            deviceTokenOPPOService.bindUid(uuser.getId(), active.getId());
                            deviceTokenVIVOService.bindUid(uuser.getId(), active.getId());
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
@@ -1149,6 +1154,8 @@
            if (deviceActive != null) {
                // 解绑OPPO推送的用户绑定
                deviceTokenOPPOService.unBindUid(uid, deviceActive.getId());
                // 解绑VIVO推送的用户绑定
                deviceTokenVIVOService.unBindUid(uid, deviceActive.getId());
            }
        }
        out.print(JsonUtil.loadTrueResult(""));
@@ -1234,6 +1241,7 @@
                        DeviceActive active = deviceActiveService.getFirstActiveInfo(acceptData.getDevice());
                        if (active != null) {
                            deviceTokenOPPOService.bindUid(uuser.getId(), active.getId());
                            deviceTokenVIVOService.bindUid(uuser.getId(), active.getId());
                        }
                    }
                });
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java
@@ -25,6 +25,7 @@
import com.yeshi.fanli.service.inter.push.DeviceActiveService;
import com.yeshi.fanli.service.inter.push.DeviceTokenHWService;
import com.yeshi.fanli.service.inter.push.DeviceTokenOPPOService;
import com.yeshi.fanli.service.inter.push.DeviceTokenVIVOService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
import com.yeshi.fanli.service.inter.user.BindRemindService;
@@ -94,6 +95,9 @@
    private DeviceTokenOPPOService deviceTokenOPPOService;
    @Resource
    private DeviceTokenVIVOService deviceTokenVIVOService;
    @Resource
    private TaoBaoUnionConfigService taoBaoUnionConfigService;
    @Resource
@@ -128,11 +132,9 @@
    @Resource
    private DeviceActiveService deviceActiveService;
    @Resource
    private BindRemindService bindRemindService;
    /**
     * 新版登录 V1.5.3
@@ -147,7 +149,7 @@
     * @param out
     */
    @RequestMapping(value = "login", method = RequestMethod.POST)
    public void login(AcceptData acceptData, int loginType, String vcode, String phone, String code,
    public void login(AcceptData acceptData, int loginType, String vcode, String phone, String code,
            HttpServletRequest request, PrintWriter out) {
        try {
            BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
@@ -194,11 +196,12 @@
                                e.printStackTrace();
                            }
                        }
                        // 绑定oppo推送
                        // 绑定oppo,VIVO推送
                        DeviceActive active = deviceActiveService.getFirstActiveInfo(acceptData.getDevice());
                        if (active != null) {
                            deviceTokenOPPOService.bindUid(uuser.getId(), active.getId());
                            deviceTokenVIVOService.bindUid(uuser.getId(), active.getId());
                        }
                    }
                });
@@ -221,7 +224,7 @@
                    e1.printStackTrace();
                }
            }
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult("登录失败"));
            try {
@@ -232,8 +235,6 @@
        }
    }
    /**
     * 绑定电话号码 V2.0.1 微信登录
     * 
@@ -244,7 +245,8 @@
     */
    @RequestSerializableByKey(key = "'bindPhoneLogin-'+#phone")
    @RequestMapping(value = "bindPhoneLogin")
    public void bindPhoneLogin(AcceptData acceptData,String vcode, String phone, String key, HttpServletRequest request, PrintWriter out) {
    public void bindPhoneLogin(AcceptData acceptData, String vcode, String phone, String key,
            HttpServletRequest request, PrintWriter out) {
        BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
                acceptData.getPackages());
        if (system == null) {
@@ -266,7 +268,7 @@
            out.print(JsonUtil.loadFalseResult("key值不能为空"));
            return;
        }
        phone = phone.replaceAll(" ", "");
        String oldVCode = redisManager.getSMSVCode(phone, SMSHistory.TYPE_BIND);
@@ -290,7 +292,7 @@
            out.print(JsonUtil.loadFalseResult(1, "绑定失败"));
        }
    }
    /**
     * 绑定电话号码 V2.0.1 微信登录
     * 
@@ -309,5 +311,5 @@
        bindRemindService.addBindPhone(uid);
        out.print(JsonUtil.loadTrueResult("记录成功"));
    }
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/HongBaoV2Mapper.java
@@ -127,11 +127,12 @@
     * @param count
     * @return
     */
    List<HongBaoV2> listCanBalanceHongBaoByTypeAndUid(@Param("types") List<Integer> type, @Param("uid") Long uid,@Param("start") long start,
            @Param("count") int count);
    List<HongBaoV2> listCanBalanceHongBaoByTypeAndUid(@Param("types") List<Integer> type, @Param("uid") Long uid,
            @Param("start") long start, @Param("count") int count);
    /**
     * 计算可以结算红包的数量
     *
     * @param type
     * @param uid
     * @return
@@ -206,14 +207,25 @@
     */
    long countByParentUidAndTypeAndState(@Param("uid") Long uid, @Param("typeList") List<Integer> typeList,
            @Param("stateList") List<Integer> stateList);
    /**
     * 根据订单来源类型与交易ID列表查询订单信息
     *
     * @param sourceType
     * @param tradeId
     * @return
     */
    List<HongBaoV2> listBySourceTypeAndTradeIdListAndUid(@Param("sourceType") int sourceType, @Param("uid")long uid, @Param("tradeIdList") List<String> tradeIdList);
    List<HongBaoV2> listBySourceTypeAndTradeIdListAndUid(@Param("sourceType") int sourceType, @Param("uid") long uid,
            @Param("tradeIdList") List<String> tradeIdList);
    /**
     * 根据状态,类型,用户ID检索
     * @param stateList
     * @param typeList
     * @param uid
     * @return
     */
    List<HongBaoV2> listByStateAndTypeAndUid(@Param("stateList") List<Integer> stateList,
            @Param("typeList") List<Integer> typeList, @Param("uid") Long uid,@Param("start") long start,@Param("count")int count);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/ThreeSaleMapper.java
@@ -249,5 +249,14 @@
     */
    List<ThreeSale> getSuccessByDate(@Param("bossId")Long bossId,@Param("minTime")Long minTime, @Param("maxTime")Long maxTime);
    
    /**
     * 查询最近的信息(根据下级ID与状态)
     * @param workerId
     * @param state
     * @return
     */
    ThreeSale selectLatestByWorkerIdAndState(@Param("workerId") Long workerId,@Param("state") int state);
    
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/ThreeSale.java
@@ -26,6 +26,8 @@
    public static int EXPIRE_NORMAL = 0;// 正常状态
    public static int EXPIRE_OUTOFDATE = 1;// 过期状态
    public static int STATE_SUCCESS = 1;// 成功
    public static int STATE_NOT_SUCCESS = 0;// 尚未成功
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
@@ -35,14 +37,12 @@
    public ThreeSale(Long id) {
        this.id = id;
    }
    public ThreeSale() {
    }
    @Column(name = "boss_id")
    private UserInfo boss;// 邀请者
    @Column(name = "worker_id")
    private UserInfo worker; // 被邀请者
fanli/src/main/java/com/yeshi/fanli/entity/taobao/dataoke/DaTaoKeDetailV2.java
@@ -52,6 +52,7 @@
    private BigDecimal couponPrice;// 优惠券金额
    @Field
    private String couponConditions;// 优惠券使用条件
    @Deprecated
    @Field
    private String couponId;// 券ID
    @Field
fanli/src/main/java/com/yeshi/fanli/log/PushLogHelper.java
@@ -92,6 +92,21 @@
        } catch (IOException e1) {
        }
    }
    public static void vivoError(Throwable e) {
        String date = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy_MM_dd");
        String os = System.getProperty("os.name");
        String filePath = String.format("/usr/local/tomcat8/logs/push/vivo_error_detail_%s.txt", date);
        if (os.toLowerCase().startsWith("win")) {
            filePath = String.format("C:/logs/push/vivo_error_detail_%s.txt", date);
        }
        try {
            saveErrorLog(e, filePath);
        } catch (IOException e1) {
        }
    }
    public static void saveErrorLog(Throwable e, String filePath) throws IOException {
        // 创建文件夹
fanli/src/main/java/com/yeshi/fanli/mapping/ThreeSaleMapper.xml
@@ -87,6 +87,12 @@
        LIMIT 1
    </select>
    
    <select id="selectLatestByWorkerIdAndState" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_threeSale s where worker_id = #{workerId} and state=#{state}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_threeSale where id = #{id,jdbcType=BIGINT}
fanli/src/main/java/com/yeshi/fanli/mapping/hongbao/HongBaoV2Mapper.xml
@@ -383,8 +383,26 @@
        b
        ON a.hb_id=b.hbId OR a.hb_pid=b.hbId WHERE b.hbId >0
    </select>
    <select id="listByStateAndTypeAndUid" resultMap="BaseResultMap">
        SELECT * FROM yeshi_ec_hongbao_v2 v where v.hb_uid=#{uid}
        <if test="stateList!=null">
            <foreach collection="stateList" open=" and (" item="state" separator=" or " close=")">
                hb_state=#{state}
            </foreach>
        </if>
        <if test="typeList!=null">
            <foreach collection="typeList" open=" and (" item="type" separator=" or " close=")">
                hb_type=#{type}
            </foreach>
        </if>
        order by hb_create_time asc,hb_id asc
        limit #{start},#{count}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_hongbao_v2 where hb_id = #{id,jdbcType=BIGINT}
    </delete>
fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoOrderServiceImpl.java
@@ -67,4 +67,9 @@
        return hongBaoOrderMapper.selectByCommonOrderId(commonOrderId);
    }
    @Override
    public HongBaoOrder selectDetailByHongBaoId(Long hongBaoId) {
        return hongBaoOrderMapper.selectByHongBaoId(hongBaoId);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoV2ServiceImpl.java
@@ -264,7 +264,7 @@
    private void updateHongBao(HongBaoOrder hongBaoOrder, CommonOrder commonOrder, int type,
            Map<Integer, HongBaoOrder> notificationMap) throws HongBaoException {
        System.out.println(commonOrder.getOrderNo());
        //锁行
        // 锁行
        HongBaoV2 oldHongBao = hongBaoV2Mapper.selectByPrimaryKeyForUpdate(hongBaoOrder.getHongBaoV2().getId());
        if (oldHongBao == null)
            throw new HongBaoException(10, "红包对象不存在");
@@ -943,24 +943,27 @@
                    child.setUrank(boss.getRank());
                    child.setVersion(2);
                    child.setCreateTime(new Date());
                    hongBaoV2Mapper.insertSelective(child);
                    // 添加通知
                    if (notificationMap.get(HongBaoV2.TYPE_SHARE_YIJI) == null) {
                        HongBaoV2 tempHongBao = new HongBaoV2(child.getId());
                        tempHongBao.setUserInfo(child.getUserInfo());
                        tempHongBao.setMoney(child.getMoney());
                        tempHongBao.setBeizhu(hongBao.getUserInfo().getNickName());
                        CommonOrder tempCommonOrder = new CommonOrder(commonOrder.getId());
                        tempCommonOrder.setPayment(commonOrder.getPayment());
                        notificationMap.put(HongBaoV2.TYPE_SHARE_YIJI, new HongBaoOrder(tempCommonOrder, tempHongBao));
                    } else {
                        // 增加付款金额与资金
                        HongBaoOrder tempHongBaoOrder = notificationMap.get(HongBaoV2.TYPE_SHARE_YIJI);
                        tempHongBaoOrder.getCommonOrder().setPayment(
                                tempHongBaoOrder.getCommonOrder().getPayment().add(commonOrder.getPayment()));
                        tempHongBaoOrder.getHongBaoV2()
                                .setMoney(tempHongBaoOrder.getHongBaoV2().getMoney().add(child.getMoney()));
                        notificationMap.put(HongBaoV2.TYPE_SHARE_YIJI, tempHongBaoOrder);
                    if (child.getMoney().compareTo(new BigDecimal(0)) > 0) {
                        hongBaoV2Mapper.insertSelective(child);
                        // 添加通知
                        if (notificationMap.get(HongBaoV2.TYPE_SHARE_YIJI) == null) {
                            HongBaoV2 tempHongBao = new HongBaoV2(child.getId());
                            tempHongBao.setUserInfo(child.getUserInfo());
                            tempHongBao.setMoney(child.getMoney());
                            tempHongBao.setBeizhu(hongBao.getUserInfo().getNickName());
                            CommonOrder tempCommonOrder = new CommonOrder(commonOrder.getId());
                            tempCommonOrder.setPayment(commonOrder.getPayment());
                            notificationMap.put(HongBaoV2.TYPE_SHARE_YIJI,
                                    new HongBaoOrder(tempCommonOrder, tempHongBao));
                        } else {
                            // 增加付款金额与资金
                            HongBaoOrder tempHongBaoOrder = notificationMap.get(HongBaoV2.TYPE_SHARE_YIJI);
                            tempHongBaoOrder.getCommonOrder().setPayment(
                                    tempHongBaoOrder.getCommonOrder().getPayment().add(commonOrder.getPayment()));
                            tempHongBaoOrder.getHongBaoV2()
                                    .setMoney(tempHongBaoOrder.getHongBaoV2().getMoney().add(child.getMoney()));
                            notificationMap.put(HongBaoV2.TYPE_SHARE_YIJI, tempHongBaoOrder);
                        }
                    }
                }
            }
@@ -1100,4 +1103,16 @@
            return null;
        return hongBaoV2Mapper.listBySourceTypeAndTradeIdListAndUid(sourceType, uid, tradeIdList);
    }
    @Override
    public HongBaoV2 getFirstValidHongBaoByTypeAndUid(List<Integer> typeList, Long uid) {
        List<Integer> stateList = new ArrayList<>();
        stateList.add(HongBaoV2.STATE_BUKELINGQU);
        stateList.add(HongBaoV2.STATE_KELINGQU);
        stateList.add(HongBaoV2.STATE_YILINGQU);
        List<HongBaoV2> hongBaoV2List = hongBaoV2Mapper.listByStateAndTypeAndUid(stateList, typeList, uid, 0, 1);
        if (hongBaoV2List != null && hongBaoV2List.size() > 0)
            return hongBaoV2List.get(0);
        return null;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/push/OPPOPushServiceImpl.java
@@ -15,7 +15,6 @@
import com.yeshi.fanli.entity.AppVersionInfo;
import com.yeshi.fanli.entity.bus.user.UserCustomSettings;
import com.yeshi.fanli.entity.bus.user.UserCustomSettings.UserSettingTypeEnum;
import com.yeshi.fanli.entity.push.DeviceTokenHW;
import com.yeshi.fanli.entity.push.DeviceTokenOPPO;
import com.yeshi.fanli.exception.push.PushException;
import com.yeshi.fanli.log.PushLogHelper;
@@ -24,7 +23,6 @@
import com.yeshi.fanli.service.inter.push.OPPOPushService;
import com.yeshi.fanli.service.inter.user.UserCustomSettingsService;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.push.HWPushUtil;
import com.yeshi.fanli.util.push.OPPOPushUtil;
@Service
@@ -42,7 +40,7 @@
    private List<Integer> getVersionCodeList(List<Integer> versionCodeList) {
        List<Integer> versionList = new ArrayList<>();
        if (versionCodeList == null) {// 全推
            List<AppVersionInfo> appInfoList = appVersionService.listByPlatformAndMinVersionCode("android", 49);
            List<AppVersionInfo> appInfoList = appVersionService.listByPlatformAndMinVersionCode("android", 51);
            if (appInfoList != null)
                for (AppVersionInfo version : appInfoList) {
                    versionList.add(version.getVersionCode());
@@ -50,7 +48,7 @@
        } else {// 按版本推送
            for (Integer versionCode : versionCodeList) {
                if (versionCode.intValue() >= 49) {// 2.0.1开始支持
                if (versionCode.intValue() >= 51) {// 2.0.1开始支持
                    versionList.add(versionCode);
                }
            }
fanli/src/main/java/com/yeshi/fanli/service/impl/push/PushServiceImpl.java
@@ -6,7 +6,6 @@
import org.springframework.stereotype.Service;
import com.yeshi.fanli.controller.admin.PushController;
import com.yeshi.fanli.dao.mybatis.AccountMessageMapper;
import com.yeshi.fanli.dao.mybatis.push.PushRecordMapper;
import com.yeshi.fanli.dto.push.PushTypeEnum;
@@ -23,6 +22,7 @@
import com.yeshi.fanli.service.inter.push.OPPOPushService;
import com.yeshi.fanli.service.inter.push.PushRecordService;
import com.yeshi.fanli.service.inter.push.PushService;
import com.yeshi.fanli.service.inter.push.VIVOPushService;
import com.yeshi.fanli.service.inter.push.XMPushService;
import com.yeshi.fanli.service.inter.user.SystemZnxService;
import com.yeshi.fanli.util.Constant;
@@ -59,6 +59,9 @@
    @Resource
    private OPPOPushService oPPOPushService;
    @Resource
    private VIVOPushService vIVOPushService;
    @Resource
    private PushRecordMapper pushRecordMapper;
@@ -111,6 +114,13 @@
                if (listAndroid != null)
                    versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid);
                oPPOPushService.pushGoods(uid, Long.parseLong(gid), title, content, versionCodeList);
            }
            // VIVO推送
            if (listAndroid == null || listAndroid.size() > 0) {
                List<Integer> versionCodeList = null;
                if (listAndroid != null)
                    versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid);
                vIVOPushService.pushGoods(uid, Long.parseLong(gid), title, content, versionCodeList);
            }
        }
@@ -169,6 +179,14 @@
                if (listAndroid != null)
                    versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid);
                oPPOPushService.pushUrl(uid, url, title, content, versionCodeList);
            }
            // VIVO推送
            if (listAndroid == null || listAndroid.size() > 0) {
                List<Integer> versionCodeList = null;
                if (listAndroid != null)
                    versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid);
                vIVOPushService.pushUrl(uid, url, title, content, versionCodeList);
            }
        }
@@ -245,6 +263,14 @@
                    versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid);
                oPPOPushService.pushZNX(uId, title, content, versionCodeList);
            }
            // VIVO推送
            if (listAndroid == null || listAndroid.size() > 0) {
                List<Integer> versionCodeList = null;
                if (listAndroid != null)
                    versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid);
                vIVOPushService.pushZNX(uId, title, content, versionCodeList);
            }
        }
        // 插入推送记录
@@ -300,6 +326,14 @@
            if (listAndroid != null)
                versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid);
            oPPOPushService.pushWEEX(uid, title, content, weexUrl, versionCodeList);
        }
        // VIVO推送
        if (listAndroid == null || listAndroid.size() > 0) {
            List<Integer> versionCodeList = null;
            if (listAndroid != null)
                versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid);
            vIVOPushService.pushWEEX(uid, title, content, weexUrl, versionCodeList);
        }
        // 插入推送记录
@@ -358,6 +392,14 @@
            oPPOPushService.pushBaiChuanUrl(uid, title, content, url, versionCodeList);
        }
        // VIVO推送
        if (listAndroid == null || listAndroid.size() > 0) {
            List<Integer> versionCodeList = null;
            if (listAndroid != null)
                versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid);
            vIVOPushService.pushBaiChuanUrl(uid, title, content, url, versionCodeList);
        }
        // 插入推送记录
        PushRecord pushRecord = new PushRecord();
        pushRecord.setUrl(url);
@@ -411,6 +453,14 @@
            if (listAndroid != null)
                versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid);
            oPPOPushService.pushWelfareCenter(uid, title, content, versionCodeList);
        }
        // VIVO推送
        if (listAndroid == null || listAndroid.size() > 0) {
            List<Integer> versionCodeList = null;
            if (listAndroid != null)
                versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid);
            vIVOPushService.pushWelfareCenter(uid, title, content, versionCodeList);
        }
        // 插入推送记录
@@ -546,6 +596,14 @@
            oPPOPushService.pushUserSignInNotification(uid, title, content, versionCodeList);
        }
        // VIVO推送
        if (listAndroid == null || listAndroid.size() > 0) {
            List<Integer> versionCodeList = null;
            if (listAndroid != null)
                versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid);
            vIVOPushService.pushUserSignInNotification(uid, title, content, versionCodeList);
        }
        // 插入推送记录
        PushRecord pushRecord = new PushRecord();
        pushRecord.setTitle(title);
fanli/src/main/java/com/yeshi/fanli/service/impl/push/VIVOPushServiceImpl.java
New file
@@ -0,0 +1,236 @@
package com.yeshi.fanli.service.impl.push;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.annotation.Resource;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dto.push.PushTypeEnum;
import com.yeshi.fanli.entity.AppVersionInfo;
import com.yeshi.fanli.entity.bus.user.UserCustomSettings;
import com.yeshi.fanli.entity.bus.user.UserCustomSettings.UserSettingTypeEnum;
import com.yeshi.fanli.entity.push.DeviceTokenVIVO;
import com.yeshi.fanli.exception.push.PushException;
import com.yeshi.fanli.log.PushLogHelper;
import com.yeshi.fanli.service.inter.config.AppVersionService;
import com.yeshi.fanli.service.inter.push.DeviceTokenVIVOService;
import com.yeshi.fanli.service.inter.push.VIVOPushService;
import com.yeshi.fanli.service.inter.user.UserCustomSettingsService;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.push.VIVOPushUtil;
@Service
public class VIVOPushServiceImpl implements VIVOPushService {
    @Resource
    private DeviceTokenVIVOService deviceTokenVIVOService;
    @Resource
    private AppVersionService appVersionService;
    @Resource
    private UserCustomSettingsService userCustomSettingsService;
    private List<Integer> getVersionCodeList(List<Integer> versionCodeList) {
        List<Integer> versionList = new ArrayList<>();
        if (versionCodeList == null) {// 全推
            List<AppVersionInfo> appInfoList = appVersionService.listByPlatformAndMinVersionCode("android", 51);
            if (appInfoList != null)
                for (AppVersionInfo version : appInfoList) {
                    versionList.add(version.getVersionCode());
                }
        } else {// 按版本推送
            for (Integer versionCode : versionCodeList) {
                if (versionCode.intValue() >= 51) {// 2.0.1开始支持
                    versionList.add(versionCode);
                }
            }
        }
        return versionList;
    }
    @Async("pushExecutor")
    @Override
    public void pushGoods(Long uid, Long auctionId, String title, String content, List<Integer> versionCodeList)
            throws PushException {
        push(PushTypeEnum.goodsdetail, uid, title, content, null, null, auctionId, versionCodeList);
    }
    @Async("pushExecutor")
    @Override
    public void pushUrl(Long uid, String url, String title, String content, List<Integer> versionCodeList)
            throws PushException {
        push(PushTypeEnum.url, uid, title, content, null, url, null, versionCodeList);
    }
    @Async("pushExecutor")
    @Override
    public void pushZNX(Long uid, String title, String content, List<Integer> versionCodeList) throws PushException {
        push(PushTypeEnum.ZNX, uid, title, content, null, null, null, versionCodeList);
    }
    @Async("pushExecutor")
    @Override
    public void pushWEEX(Long uid, String title, String content, String weexUrl, List<Integer> versionCodeList)
            throws PushException {
        push(PushTypeEnum.weex, uid, title, content, weexUrl, null, null, versionCodeList);
    }
    @Async("pushExecutor")
    @Override
    public void pushBaiChuanUrl(Long uid, String title, String content, String url, List<Integer> versionCodeList)
            throws PushException {
        push(PushTypeEnum.baichuan, uid, title, content, null, url, null, versionCodeList);
    }
    @Async("pushExecutor")
    @Override
    public void pushWelfareCenter(Long uid, String title, String content, List<Integer> versionCodeList)
            throws PushException {
        push(PushTypeEnum.welfare, uid, title, content, null, null, null, versionCodeList);
    }
    @Override
    public void pushUserSignInNotification(Long uid, String title, String content, List<Integer> versionCodeList)
            throws PushException {
        push(PushTypeEnum.signin, uid, title, content, null, null, null, versionCodeList);
    }
    private List<DeviceTokenVIVO> filterDeviceToken(List<DeviceTokenVIVO> deviceList, int hour) {
        // 处理消息免打扰
        if (hour >= 20 || hour < 8) {
            Set<Long> uidSets = new HashSet<>();
            for (DeviceTokenVIVO dt : deviceList)
                if (dt.getUid() != null)
                    uidSets.add(dt.getUid());
            List<Long> uidList = new ArrayList<>();
            uidList.addAll(uidSets);
            List<UserCustomSettings> settingList = userCustomSettingsService.listByUidListAndTypeAndState(uidList,
                    UserSettingTypeEnum.cancelNotice.name(), UserCustomSettings.STATE_VALID);
            uidSets.clear();
            if (settingList != null) {
                for (UserCustomSettings seeting : settingList)
                    uidSets.add(seeting.getUserInfo().getId());
            }
            if (uidSets.size() > 0)
                for (int i = 0; i < deviceList.size(); i++) {
                    if (deviceList.get(i).getUid() != null && uidSets.contains(deviceList.get(i).getUid())) {
                        deviceList.remove(i--);
                    }
                }
        }
        return deviceList;
    }
    /**
     * 推送
     *
     * @param type
     * @param uid
     * @param title
     * @param content
     * @param url
     * @param webUrl
     * @param versionCodeList
     */
    private void push(PushTypeEnum type, Long uid, String title, String content, String url, String webUrl,
            Long goodsId, List<Integer> versionCodeList) throws PushException {
        int hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
        List<Integer> newVersionList = getVersionCodeList(versionCodeList);
        // 2.0.1后开始推送
        for (int i = 0; i < newVersionList.size(); i++) {
            if (newVersionList.get(i) < 51)
                newVersionList.remove(i--);
        }
        if (uid == null || uid == 0) {
            int pageSize = 200;
            long deviceCount = deviceTokenVIVOService.countDeviceToken(newVersionList);
            int page = (int) (deviceCount % pageSize == 0 ? deviceCount / pageSize : deviceCount / pageSize + 1);
            for (int p = 1; p <= page; p++) {
                List<DeviceTokenVIVO> deviceList = deviceTokenVIVOService.listDeviceToken(p, pageSize, newVersionList);
                deviceList = filterDeviceToken(deviceList, hour);
                List<String> tokenList = new ArrayList<>();
                for (DeviceTokenVIVO token : deviceList)
                    tokenList.add(token.getRegisterId());
                try {
                    if (type == PushTypeEnum.goodsdetail) {// 商品详情
                        if (goodsId == null)
                            throw new PushException(2, "参数不完整");
                        VIVOPushUtil.pushGoods(tokenList, title, content, 1, goodsId);
                    } else if (type == PushTypeEnum.url) {// 链接
                        if (StringUtil.isNullOrEmpty(webUrl))
                            throw new PushException(2, "参数不完整");
                        VIVOPushUtil.pushUrl(tokenList, title, content, webUrl);
                    } else if (type == PushTypeEnum.ZNX) {// 站内信
                        VIVOPushUtil.pushZNX(tokenList, title, content);
                    } else if (type == PushTypeEnum.weex) {// weex
                        if (StringUtil.isNullOrEmpty(url))
                            throw new PushException(2, "参数不完整");
                        VIVOPushUtil.pushWEEX(tokenList, title, content, url);
                    } else if (type == PushTypeEnum.baichuan) {// 百川链接
                        if (StringUtil.isNullOrEmpty(webUrl))
                            throw new PushException(2, "参数不完整");
                        VIVOPushUtil.pushBaiChuanUrl(tokenList, title, content, webUrl);
                    } else if (type == PushTypeEnum.welfare) {// 福利中心
                        VIVOPushUtil.pushWelfareCenter(tokenList, title, content);
                    } else if (type == PushTypeEnum.signin) {// 签到
                        VIVOPushUtil.pushUserSignInNotification(tokenList, title, content);
                    }
                } catch (Exception e) {
                    PushLogHelper.hwError(e);
                }
            }
        } else {
            // 单推
            List<DeviceTokenVIVO> deviceList = deviceTokenVIVOService.listByUid(uid, newVersionList);
            List<String> tokenList = new ArrayList<>();
            if (deviceList != null) {
                deviceList = filterDeviceToken(deviceList, hour);
                for (DeviceTokenVIVO token : deviceList)
                    tokenList.add(token.getRegisterId());
            }
            if (tokenList.size() == 0)
                return;
            try {
                if (type == PushTypeEnum.goodsdetail) {// 商品详情
                    if (goodsId == null)
                        throw new PushException(2, "参数不完整");
                    VIVOPushUtil.pushGoods(tokenList, title, content, 1, goodsId);
                } else if (type == PushTypeEnum.url) {// 链接
                    if (StringUtil.isNullOrEmpty(webUrl))
                        throw new PushException(2, "参数不完整");
                    VIVOPushUtil.pushUrl(tokenList, title, content, webUrl);
                } else if (type == PushTypeEnum.ZNX) {// 站内信
                    VIVOPushUtil.pushZNX(tokenList, title, content);
                } else if (type == PushTypeEnum.weex) {// weex
                    if (StringUtil.isNullOrEmpty(url))
                        throw new PushException(2, "参数不完整");
                    VIVOPushUtil.pushWEEX(tokenList, title, content, url);
                } else if (type == PushTypeEnum.baichuan) {// 百川链接
                    if (StringUtil.isNullOrEmpty(webUrl))
                        throw new PushException(2, "参数不完整");
                    VIVOPushUtil.pushBaiChuanUrl(tokenList, title, content, webUrl);
                } else if (type == PushTypeEnum.welfare) {// 福利中心
                    VIVOPushUtil.pushWelfareCenter(tokenList, title, content);
                } else if (type == PushTypeEnum.signin) {// 签到
                    VIVOPushUtil.pushUserSignInNotification(tokenList, title, content);
                }
            } catch (Exception e) {
                PushLogHelper.vivoError(e);
            }
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinOriginServiceImpl.java
@@ -147,6 +147,8 @@
    @Override
    @Transactional
    public UserTaoLiJinOrigin addNewbiesWinMoney(Long uid) throws UserTaoLiJinOriginException{
        if(1>0)
            throw new UserTaoLiJinOriginException(1, "接口已下线");
        if (uid == null) {
            throw new UserTaoLiJinOriginException(1, "参数不能为空");
        }
@@ -198,6 +200,9 @@
            throw new UserTaoLiJinOriginException(1, "参数不能为空");
        }
        
        if(1>0)
            throw new UserTaoLiJinOriginException(1, "接口已下线");
        String key = "";
        if (userRank.getId() == 2) {
            key = "hongbao_rank_silver";
@@ -248,6 +253,9 @@
            throw new UserTaoLiJinOriginException(1, "参数不能为空");
        }
        
        if(1>0)
            throw new UserTaoLiJinOriginException(1, "接口已下线");
        String value = configTaoLiJinService.getValueByKey("hongbao_invite",null);
        if (StringUtil.isNullOrEmpty(value)) {
            throw new UserTaoLiJinOriginException(1, "系统红包不存在");
@@ -287,6 +295,9 @@
            throw new UserTaoLiJinOriginException(1, "用户未登录");
        }
        
        if(1>0)
            throw new UserTaoLiJinOriginException(1, "接口已下线");
        String value = configTaoLiJinService.getValueByKey("hongbao_share",null);
        if (StringUtil.isNullOrEmpty(value)) {
            throw new UserTaoLiJinOriginException(1, "系统红包不存在");
fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/ThreeSaleSerivceImpl.java
@@ -72,7 +72,6 @@
    @Resource
    private ThreeSaleExtraInfoSerivce threeSaleExtraInfoSerivce;
    @Lazy
    @Resource
    private IntegralGetService integralGetService;
@@ -679,7 +678,7 @@
                } catch (Exception e) {
                    LogHelper.errorDetailInfo(e);
                }
                // 邀请金币
                integralGetService.addInviteLevelOne(boss.getId(), invitee.getId());
            }
@@ -722,4 +721,10 @@
        return threeSaleMapper.listSecondTeam(start, count, uid, state);
    }
    @Override
    public ThreeSale selectLatestByWorkerIdAndState(Long workerId, int state) {
        return threeSaleMapper.selectLatestByWorkerIdAndState(workerId, state);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/inter/order/HongBaoOrderService.java
@@ -53,5 +53,13 @@
     * @return
     */
    public HongBaoOrder selectDetailByCommonOrderId(Long commonOrderId);
    /**
     * 获取详情
     * @param hongBaoId
     * @return
     */
    public HongBaoOrder selectDetailByHongBaoId(Long hongBaoId);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/order/HongBaoV2Service.java
@@ -155,4 +155,13 @@
     */
    public List<HongBaoV2> listBySourceTypeAndTradeIdListAndUid(int sourceType, long uid, List<String> tradeIdList);
    /**
     * 获取首次有效的红包(根据类型与用户ID)
     *
     * @param typeList
     * @param uid
     * @return
     */
    public HongBaoV2 getFirstValidHongBaoByTypeAndUid(List<Integer> typeList, Long uid);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/push/VIVOPushService.java
New file
@@ -0,0 +1,94 @@
package com.yeshi.fanli.service.inter.push;
import java.util.List;
import com.yeshi.fanli.exception.push.PushException;
/**
 * 华为推送服务
 *
 * @author Administrator
 *
 */
public interface VIVOPushService {
    /**
     * 推送商品
     *
     * @param uid
     * @param url
     * @param title
     * @param content
     * @throws PushException
     */
    void pushGoods(Long uid, Long auctionId, String title, String content, List<Integer> versionCodeList)
            throws PushException;
    /**
     * 推送链接
     *
     * @param uid
     * @param url
     * @param title
     * @param content
     * @throws PushException
     */
    void pushUrl(Long uid, String url, String title, String content, List<Integer> versionCodeList)
            throws PushException;
    /**
     * 推送站内信
     *
     * @param uId
     * @param title
     * @param content
     * @throws PushException
     */
    void pushZNX(Long uId, String title, String content, List<Integer> versionCodeList) throws PushException;
    /**
     * 适用版本 1.4.8及以后 推送weex页面
     *
     * @param uid
     * @param title
     * @param content
     * @param weexUrl
     * @throws PushException
     */
    void pushWEEX(Long uid, String title, String content, String weexUrl, List<Integer> versionCodeList)
            throws PushException;
    /**
     * 适用版本 1.4.8及以后 推送百川网页
     *
     * @param uid
     * @param title
     * @param content
     * @param url
     * @throws PushException
     */
    void pushBaiChuanUrl(Long uid, String title, String content, String url, List<Integer> versionCodeList)
            throws PushException;
    /**
     * 推送福利中心(版本号:1.5.1后)
     *
     * @param uid
     * @param title
     * @param content
     * @throws PushException
     */
    void pushWelfareCenter(Long uid, String title, String content, List<Integer> versionCodeList) throws PushException;
    /**
     * 推送签到提醒
     *
     * @param uid
     * @param title
     * @param content
     * @param versions
     * @throws PushException
     */
    void pushUserSignInNotification(Long uid, String title, String content,  List<Integer> versionCodeList) throws PushException;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/invite/ThreeSaleSerivce.java
@@ -252,6 +252,15 @@
     * @return
     */
    public ThreeSale selectByWorkerId(Long workerId);
    /**
     * 查询最近一条数据(根据下级用户ID与状态)
     * @param workerId
     * @param state
     * @return
     */
    public ThreeSale selectLatestByWorkerIdAndState(Long workerId,int state);
    /**
     * 时间段呢 邀请成功信息
fanli/src/main/java/com/yeshi/fanli/util/SpringContext.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.util;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -744,19 +745,138 @@
                                if (hongBaoV2 != null && hongBaoV2.getState() == HongBaoV2.STATE_YILINGQU
                                        && hongBaoV2.getMoney().compareTo(new BigDecimal(0)) > 0) {
                                    if (hongBaoV2.getType() == HongBaoV2.TYPE_ZIGOU) {// 自购
                                        integralGetService.addRebateOrder(hongBaoV2.getUserInfo().getId());
                                        // 判断是否为该用户的首笔红包
                                        List<Integer> typeList = new ArrayList<>();
                                        typeList.add(HongBaoV2.TYPE_ZIGOU);
                                        HongBaoV2 firstHongBao = hongBaoV2Service.getFirstValidHongBaoByTypeAndUid(
                                                typeList, hongBaoV2.getUserInfo().getId());
                                        if (firstHongBao != null
                                                && firstHongBao.getId().longValue() == hongBaoV2.getId()) {// 自购首单到账
                                            // 查询下级红包
                                            BigDecimal firstLevelMoney = new BigDecimal(0);
                                            BigDecimal secondLevelMoney = new BigDecimal(0);
                                            // 获取改单下面的红包
                                            List<HongBaoV2> hongBaoList = new ArrayList<>();
                                            HongBaoOrder hongBaoOrder = hongBaoOrderService
                                                    .selectDetailByHongBaoId(hongBaoV2.getId());
                                            if (hongBaoOrder != null && hongBaoOrder.getCommonOrder() != null) {// 计算改订单号下面的所有返利金额
                                                CommonOrder commonOrder = hongBaoOrder.getCommonOrder();
                                                List<CommonOrder> list = commonOrderService.listBySourceTypeAndOrderId(
                                                        commonOrder.getSourceType(), commonOrder.getOrderNo());
                                                for (CommonOrder co : list) {
                                                    HongBaoOrder hbo = hongBaoOrderService
                                                            .selectDetailByCommonOrderId(co.getId());
                                                    if (hbo != null && hbo.getHongBaoV2() != null)
                                                        hongBaoList.add(hbo.getHongBaoV2());
                                                }
                                            }
                                            for (HongBaoV2 hb : hongBaoList) {
                                                List<HongBaoV2> children = hongBaoV2Service
                                                        .listChildrenById(hb.getId());
                                                if (children != null)
                                                    for (HongBaoV2 child : children)
                                                        if (child.getType() == HongBaoV2.TYPE_YIJI) {
                                                            firstLevelMoney = firstLevelMoney.add(child.getMoney());
                                                        } else if (child.getType() == HongBaoV2.TYPE_ERJI) {
                                                            secondLevelMoney = secondLevelMoney.add(child.getMoney());
                                                        }
                                            }
                                            // 查询下级的生效时间
                                            ThreeSale threeSale = threeSaleSerivce.selectLatestByWorkerIdAndState(
                                                    hongBaoV2.getUserInfo().getId(), ThreeSale.STATE_SUCCESS);
                                            if (threeSale != null && threeSale.getSucceedTime() != null && threeSale
                                                    .getSucceedTime() < hongBaoV2.getCreateTime().getTime()) {// 邀请成功的时间是否在下单的时间之前
                                                // 成功时间要大于20190910日才开始送金币
                                                if (threeSale.getSucceedTime() > TimeUtil.convertToTimeTemp("20190901",
                                                        "yyyyMMdd")) {
                                                    if (firstLevelMoney.compareTo(new BigDecimal("0.01")) < 0) {// 一级返利小于0.01
//                                                        integralTaskRecordService.firstRebateOrderRewardBoss(threeSale.getBoss().getId(),
//                                                                hongBaoV2.getUserInfo().getId(), null);
                                                        LogHelper.test("自购-一级用户-" + threeSale.getBoss().getId()
                                                                + "-hongBaoId:" + hongBaoV2.getId());
                                                    }
                                                }
                                            }
                                            // 查询下下级生效时间
                                            if (threeSale != null) {
                                                threeSale = threeSaleSerivce.selectLatestByWorkerIdAndState(
                                                        threeSale.getBoss().getId(), ThreeSale.STATE_SUCCESS);
                                                if (threeSale != null && threeSale.getSucceedTime() != null && threeSale
                                                        .getSucceedTime() < hongBaoV2.getCreateTime().getTime()) {// 邀请成功的时间是否在下单的时间之前
                                                    // 成功时间要大于20190910日才开始送金币
                                                    if (threeSale.getSucceedTime() > TimeUtil
                                                            .convertToTimeTemp("20190901", "yyyyMMdd")) {
                                                        if (secondLevelMoney.compareTo(new BigDecimal("0.01")) < 0) {// 二级返利小于0.01
//                                                            integralTaskRecordService.firstRebateOrderRewardBossSuper(threeSale.getBoss().getId(),
//                                                                    hongBaoV2.getUserInfo().getId(), null);
                                                            LogHelper.test("自购-二级用户-" + threeSale.getBoss().getId()
                                                                    + "-hongBaoId:" + hongBaoV2.getId());
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    } else if (hongBaoV2.getType() == HongBaoV2.TYPE_SHARE_GOODS) {// 分享赚
                                        integralGetService.addShareOrder(hongBaoV2.getUserInfo().getId());
                                    } else if (hongBaoV2.getType() == HongBaoV2.TYPE_YIJI
                                            || hongBaoV2.getType() == HongBaoV2.TYPE_SHARE_YIJI) {// 一级邀请赚
                                        integralGetService.addInviteOrderLevelOne(hongBaoV2.getUserInfo().getId());
                                    } else if (hongBaoV2.getType() == HongBaoV2.TYPE_ERJI
                                            || hongBaoV2.getType() == HongBaoV2.TYPE_SHARE_ERJI) {// 二级邀请赚
                                        integralGetService.addInviteOrderLevelOne(hongBaoV2.getUserInfo().getId());
                                        // 判断是否为该用户的首笔红包
                                        List<Integer> typeList = new ArrayList<>();
                                        typeList.add(HongBaoV2.TYPE_SHARE_GOODS);
                                        HongBaoV2 firstHongBao = hongBaoV2Service.getFirstValidHongBaoByTypeAndUid(
                                                typeList, hongBaoV2.getUserInfo().getId());
                                        if (firstHongBao != null
                                                && firstHongBao.getId().longValue() == hongBaoV2.getId()) // 分享首笔到账
                                        {
                                            // 查询下级红包
                                            BigDecimal firstLevelMoney = new BigDecimal(0);
                                            // 获取改单下面的红包
                                            List<HongBaoV2> hongBaoList = new ArrayList<>();
                                            HongBaoOrder hongBaoOrder = hongBaoOrderService
                                                    .selectDetailByHongBaoId(hongBaoV2.getId());
                                            if (hongBaoOrder != null && hongBaoOrder.getCommonOrder() != null) {// 计算改订单号下面的所有返利金额
                                                CommonOrder commonOrder = hongBaoOrder.getCommonOrder();
                                                List<CommonOrder> list = commonOrderService.listBySourceTypeAndOrderId(
                                                        commonOrder.getSourceType(), commonOrder.getOrderNo());
                                                for (CommonOrder co : list) {
                                                    HongBaoOrder hbo = hongBaoOrderService
                                                            .selectDetailByCommonOrderId(co.getId());
                                                    if (hbo != null && hbo.getHongBaoV2() != null)
                                                        hongBaoList.add(hbo.getHongBaoV2());
                                                }
                                            }
                                            for (HongBaoV2 hb : hongBaoList) {
                                                List<HongBaoV2> children = hongBaoV2Service
                                                        .listChildrenById(hb.getId());
                                                if (children != null)
                                                    for (HongBaoV2 child : children)
                                                        if (child.getType() == HongBaoV2.TYPE_SHARE_YIJI) {
                                                            firstLevelMoney = firstLevelMoney.add(child.getMoney());
                                                        }
                                            }
                                            ThreeSale threeSale = threeSaleSerivce.selectLatestByWorkerIdAndState(
                                                    hongBaoV2.getUserInfo().getId(), ThreeSale.STATE_SUCCESS);
                                            if (threeSale != null && threeSale.getSucceedTime() != null && threeSale
                                                    .getSucceedTime() < hongBaoV2.getCreateTime().getTime()) {// 邀请成功的时间是否在下单的时间之前
                                                // 成功时间要大于20190910日才开始送金币
                                                if (threeSale.getSucceedTime() > TimeUtil.convertToTimeTemp("20190901",
                                                        "yyyyMMdd")) {
                                                    if (firstLevelMoney.compareTo(new BigDecimal("0.01")) < 0) {// 一级返利小于0.01
//                                                        integralTaskRecordService.firstSharerOrderRewardBoss(threeSale.getBoss().getId(),
//                                                                hongBaoV2.getUserInfo().getId(), null);
                                                        LogHelper.test("分享-一级用户-" + threeSale.getBoss().getId()
                                                                + "-hongBaoId:" + hongBaoV2.getId());
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                                HongBaoRecieveCMQManager.getInstance()
                                        .deleteQueueMsg(HongBaoRecieveCMQManager.QUEUE_INTEGRAL, key);
                                // HongBaoRecieveCMQManager.getInstance()
                                // .deleteQueueMsg(HongBaoRecieveCMQManager.QUEUE_INTEGRAL,
                                // key);
                            } catch (Exception e) {
                                try {
                                    LogHelper.errorDetailInfo(e);
fanli/src/main/java/com/yeshi/fanli/util/dataoke/DaTaoKeApiUtil.java
@@ -213,7 +213,7 @@
        TaoKeAppInfo app = getRandomApp();
        DaTaoKeGoodsResult daTaoKeGoodsResult = new DaTaoKeGoodsResult();
        Map<String, String> params = new TreeMap<>();
        params.put("version", "v1.0.0");
        params.put("version", "v1.1.0");
        params.put("appKey", app.getAppKey());
        params.put("pageSize", 200 + "");
        // params.put("sort", "1");
@@ -246,7 +246,7 @@
        TaoKeAppInfo app = getRandomApp();
        DaTaoKeGoodsResult daTaoKeGoodsResult = new DaTaoKeGoodsResult();
        Map<String, String> params = new TreeMap<>();
        params.put("version", "v1.0.0");
        params.put("version", "v1.0.1");
        params.put("appKey", app.getAppKey());
        params.put("pageSize", 200 + "");
        if (!StringUtil.isNullOrEmpty(startTime))
@@ -280,7 +280,7 @@
        TaoKeAppInfo app = getRandomApp();
        DaTaoKeGoodsResult daTaoKeGoodsResult = new DaTaoKeGoodsResult();
        Map<String, String> params = new TreeMap<>();
        params.put("version", "v1.0.0");
        params.put("version", "v1.1.0");
        params.put("appKey", app.getAppKey());
        params.put("pageSize", 200 + "");
        if (!StringUtil.isNullOrEmpty(startTime))
@@ -314,7 +314,7 @@
        TaoKeAppInfo app = getRandomApp();
        DaTaoKeGoodsResult daTaoKeGoodsResult = new DaTaoKeGoodsResult();
        Map<String, String> params = new TreeMap<>();
        params.put("version", "v1.0.0");
        params.put("version", "v1.1.0");
        params.put("appKey", app.getAppKey());
        params.put("pageSize", 200 + "");
        if (!StringUtil.isNullOrEmpty(startTime))
@@ -345,7 +345,7 @@
    public static DaTaoKeDetailV2 getGoodsDetail(Long id) {
        TaoKeAppInfo app = getRandomApp();
        Map<String, String> params = new TreeMap<>();
        params.put("version", "v1.0.0");
        params.put("version", "v1.1.0");
        params.put("appKey", app.getAppKey());
        params.put("id", id + "");
        params.put("sign", getSign(params, app.getAppSecret()));
@@ -365,7 +365,7 @@
        TaoKeAppInfo app = getRandomApp();
        DaTaoKeGoodsResult daTaoKeGoodsResult = new DaTaoKeGoodsResult();
        Map<String, String> params = new TreeMap<>();
        params.put("version", "v1.0.0");
        params.put("version", "v2.1.0");
        params.put("appKey", app.getAppKey());
        params.put("pageSize", pageSize + "");
        params.put("pageId", page + "");
@@ -490,7 +490,7 @@
        TaoKeAppInfo app = getRandomApp();
        DaTaoKeGoodsResult daTaoKeGoodsResult = new DaTaoKeGoodsResult();
        Map<String, String> params = new TreeMap<>();
        params.put("version", "v1.0.0");
        params.put("version", "v1.1.0");
        params.put("appKey", app.getAppKey());
        params.put("rankType", type + "");
        if (cid != null)
fanli/src/main/java/com/yeshi/fanli/util/push/VIVOPushUtil.java
@@ -5,6 +5,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import com.vivo.push.sdk.notofication.Message;
import com.vivo.push.sdk.notofication.Result;
@@ -64,7 +65,9 @@
    private static Message.Builder getBaseMessageBuidler(String title, String content,
            Map<String, String> customParams) {
        Message.Builder buidler = new Message.Builder();
        buidler = buidler.title(title).content(content).skipType(4).skipContent("").notifyType(3);
        buidler = buidler.title(title).content(content).skipType(4).skipContent("todo").notifyType(3)
                .requestId(UUID.randomUUID().toString());
        buidler = buidler.clientCustomMap(customParams);
        return buidler;
    }
@@ -114,20 +117,27 @@
            Sender sender = new Sender(APP_SECRET);
            sender.initPool(20, 10);// 设置连接池参数,可选项
            sender.setAuthToken(authToken);// 设置推送的必要参数authToken(调用鉴权方法获得)
            Message saveList = builder.build();// 构建要保存的批量推送消息体
            Result result = sender.saveListPayLoad(saveList);// 发送保存群推消息请求
            String taskId = result.getTaskId();
            Set<String> regIds = new HashSet<>();// 构建批量推送用户群
            for (String regId : regIdList)
                regIds.add(regId);
            TargetMessage targetMessage = new TargetMessage.Builder().regIds(regIds).taskId(taskId).build();// 构建批量推送的消息体
            result = sender.sendToList(targetMessage);// 批量推送给用户
            Message saveList = builder.timeToLive(3600).build();// 构建要保存的批量推送消息体
            Result result = null;
            if (regIdList.size() > 1) {
                result = sender.saveListPayLoad(saveList);// 发送保存群推消息请求
                String taskId = result.getTaskId();
                Set<String> regIds = new HashSet<>();// 构建批量推送用户群
                for (String regId : regIdList)
                    regIds.add(regId);
                TargetMessage targetMessage = new TargetMessage.Builder().requestId(UUID.randomUUID().toString())
                        .regIds(regIds).taskId(taskId).build();// 构建批量推送的消息体
                result = sender.sendToList(targetMessage);// 批量推送给用户
            } else
            {
                result = sender.sendSingle(builder.regId(regIdList.get(0)).timeToLive(3600).build());
            }
            if (result.getResult() == 0)// 成功
            {
                return true;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }