admin
2020-04-15 ee5c8055b1c0dd7c67a9025a76b10bd287c93d9a
资金明细增加团队分红
2个文件已修改
43 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/entity/money/UserMoneyDetail.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/UserMoneyDetailFactory.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/money/UserMoneyDetail.java
@@ -61,6 +61,7 @@
        
        
        teamReward("团队收益", "http://img.flqapp.com/resource/money_detail/icon_invite.png", ""),
        teamDividents("团队分红", "http://img.flqapp.com/resource/money_detail/icon_invite.png", ""),
        fanliNew("自购返利", "http://img.flqapp.com/resource/money_detail/icon_fanli.png", ""),
        orderRewardNew("返利再返", "http://img.flqapp.com/resource/money_detail/icon_order_reward.png", ""),
        shareNew("分享奖金", "http://img.flqapp.com/resource/money_detail/icon_share.png", ""),
fanli/src/main/java/com/yeshi/fanli/util/factory/UserMoneyDetailFactory.java
@@ -680,5 +680,47 @@
        detail.setUserInfo(new UserInfo(uid));
        return detail;
    }
    /**
     * 团队分红
     * @Title: createTeamDividents
     * @Description:
     * @param uid
     * @param money
     * @param time
     * @return
     * @throws UserMoneyDetailException
     * UserMoneyDetail 返回类型
     * @throws
     */
    public static UserMoneyDetail createTeamDividents(Long uid, BigDecimal money, Date time)
            throws UserMoneyDetailException {
        if (money == null)
            throw new UserMoneyDetailException(1, "返利金额为空");
        if (uid == null)
            throw new UserMoneyDetailException(1, "UID为空");
        if (time == null)
            throw new UserMoneyDetailException(1, "发生时间为空");
        Calendar ca = Calendar.getInstance();
        ca.setTime(time);
        ca.add(Calendar.MONTH, -1);
        String timeF = TimeUtil.getGernalTime(ca.getTimeInMillis(), "yyyy年M月");
        UserMoneyDetail detail = new UserMoneyDetail();
        detail.setCreateTime(new Date());
        detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.teamDividents.name() + "-" + uid + "-" + timeF));
        detail.setMoney(money);
        detail.setTitle(UserMoneyDetailTypeEnum.teamDividents.getDesc());
        detail.setType(UserMoneyDetailTypeEnum.teamDividents);
        detail.setDescInfo(timeF);
        detail.setUpdateTime(new Date());
        detail.setUserInfo(new UserInfo(uid));
        return detail;
    }
}