| | |
| | | import java.util.Calendar;
|
| | | import java.util.Date;
|
| | |
|
| | | import com.yeshi.fanli.dto.HongBao;
|
| | | import com.yeshi.fanli.entity.bus.user.AlipayAccountValidNormalHistory;
|
| | | import com.yeshi.fanli.entity.bus.user.Extract;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBao;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail.UserMoneyDetailTypeEnum;
|
| | |
| | | * @param hongBaoList
|
| | | * @return
|
| | | */
|
| | | public static UserMoneyDetail createFanLi(Long uid, String orderId, int orderType, Long hbId, BigDecimal money)
|
| | | public static UserMoneyDetail createFanLi(Long uid, String orderId, int orderType, String hbIds, BigDecimal money)
|
| | | throws UserMoneyDetailException {
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(orderId))
|
| | |
| | | UserMoneyDetail detail = new UserMoneyDetail();
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setIdentifyCode(StringUtil
|
| | | .Md5(UserMoneyDetailTypeEnum.fanli.name() + "-" + uid + "-" + orderType + "-" + orderId + "-" + hbId));
|
| | | .Md5(UserMoneyDetailTypeEnum.fanli.name() + "-" + uid + "-" + orderType + "-" + orderId + "-" + hbIds));
|
| | | detail.setMoney(money);
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.fanli.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.fanli);
|
| | |
| | | detail.setUserInfo(new UserInfo(uid));
|
| | | return detail;
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 返利维权
|
| | |
| | | return createHongBaoDeduct(hb, "新人红包扣除");
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | /**
|
| | | * 返利奖励
|
| | | *
|
| | |
| | | detail.setType(UserMoneyDetailTypeEnum.orderReward);
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setUserInfo(user);
|
| | | // detail.setDescInfo("订单号:" + orderId);
|
| | | // detail.setDescInfo("订单号:" + orderId);
|
| | | return detail;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 订单重复统计退款
|
| | | * |
| | | * @param orderId
|
| | | * @param money
|
| | | * @param user
|
| | | * @return
|
| | | * @throws UserMoneyDetailException
|
| | | */
|
| | | public static UserMoneyDetail createRepeatStatistic(String orderId, BigDecimal money, UserInfo user)
|
| | | throws UserMoneyDetailException {
|
| | | if (StringUtil.isNullOrEmpty(orderId))
|
| | | throw new UserMoneyDetailException(1, "订单号不能为空");
|
| | | if (user == null)
|
| | | throw new UserMoneyDetailException(1, "UID不能为空");
|
| | | if (money == null)
|
| | | throw new UserMoneyDetailException(1, "金额不能为空");
|
| | |
|
| | | UserMoneyDetail detail = new UserMoneyDetail();
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setIdentifyCode(
|
| | | StringUtil.Md5(UserMoneyDetailTypeEnum.repeatStatistic.name() + "-" + orderId + "-" + user.getId()));
|
| | | detail.setMoney(money);
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.repeatStatistic.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.repeatStatistic);
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setUserInfo(user);
|
| | | detail.setDescInfo("订单号:" + orderId);
|
| | | return detail;
|
| | | }
|
| | |
|