| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.yeshi.fanli.entity.SystemEnum;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import org.springframework.stereotype.Component;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | |
| | |
|
| | | /**
|
| | | * 团队分红来源管理
|
| | | * @author Administrator
|
| | | *
|
| | | * @author Administrator
|
| | | */
|
| | | @Component
|
| | | public class TeamDividentsSourceManager {
|
| | |
| | | @Resource
|
| | | private CommonOrderService commonOrderService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
|
| | | /**
|
| | | * @throws ParamsException |
| | | * 添加分红源
|
| | | * @param commonOrderList
|
| | | * @param bossList void 返回类型
|
| | | * @throws ParamsException 添加分红源
|
| | | * @throws
|
| | | * @Title: addSource
|
| | | * @Description:
|
| | | * @param commonOrderList
|
| | | * @param bossList |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void addSource(List<CommonOrder> commonOrderList, List<UserTeamLevel> bossList)
|
| | |
| | | if (count > 0)// 已存在
|
| | | return;
|
| | |
|
| | | SystemEnum system = userInfoService.getUserSystem(order.getUid());
|
| | |
|
| | | // 计算团队分红比例
|
| | | List<UserTeamRate> rateList = orderHongBaoMoneyComputeService.getTeamDividentsRates(level, bossList,
|
| | | placeOrderTime);
|
| | | placeOrderTime, system);
|
| | | if (rateList != null)
|
| | | for (UserTeamRate rate : rateList) {
|
| | | BigDecimal money = MoneyBigDecimalUtil.div(rate.getRate().multiply(order.getMoney()),
|
| | |
| | | }
|
| | | }
|
| | | // 计算二级外分红比例
|
| | | rateList = orderHongBaoMoneyComputeService.getTeamRewardMoreThan2LevelRates(level, bossList, placeOrderTime);
|
| | | rateList = orderHongBaoMoneyComputeService.getTeamRewardMoreThan2LevelRates(level, bossList, placeOrderTime, system);
|
| | | if (rateList != null)
|
| | | for (UserTeamRate rate : rateList) {
|
| | | BigDecimal money = MoneyBigDecimalUtil.div(rate.getRate().multiply(order.getMoney()),
|
| | |
| | |
|
| | | /**
|
| | | * 订单失效
|
| | | * @Title: invalidBySourceOrderId
|
| | | * @Description: |
| | | * @param sourceOrderId |
| | | * void 返回类型
|
| | | *
|
| | | * @throws
|
| | | * @Title: invalidBySourceOrderId
|
| | | * @Description: void 返回类型
|
| | | */
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void invalidByOrder(String orderNo, int sourceType, String beiZhu) {
|
| | |
| | |
|
| | | /**
|
| | | * 订单结算
|
| | | * @Title: orderSettle
|
| | | * @Description: |
| | | * @param sourceOrderId
|
| | | * @param income |
| | | * void 返回类型
|
| | | *
|
| | | * @throws
|
| | | * @Title: orderSettle
|
| | | * @Description: void 返回类型
|
| | | */
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void orderSettle(String orderNo, int sourceType) {
|