| | |
| | | record.setRightsId(taoLiJinDTO.getRightsId());
|
| | | record.setSendUrl(taoLiJinDTO.getSendUrl());
|
| | | record.setCreateTime(new Date());
|
| | | if (origin == 1) { // 自购
|
| | | record.setUseType(1);
|
| | | } else { // 分享
|
| | | record.setUseType(2);
|
| | | }
|
| | | |
| | | userTaoLiJinRecordMapper.insertSelective(record);
|
| | |
|
| | | BigDecimal surplusTlj = MoneyBigDecimalUtil.sub(tlj, totalMoney); |
| | |
|
| | | UserMoneyExtra updateExtra = new UserMoneyExtra();
|
| | | updateExtra.setUid(uid);
|
| | | if (origin == 1) { // 剩余淘礼金-- 自购
|
| | | updateExtra.setTljSelf(MoneyBigDecimalUtil.sub(userMoneyExtra.getTljSelf(), totalMoney));
|
| | | }
|
| | | |
| | | // 剩余淘礼金
|
| | | BigDecimal surplusTlj = MoneyBigDecimalUtil.sub(tlj, totalMoney);
|
| | | updateExtra.setTlj(surplusTlj);
|
| | | updateExtra.setUpdateTime(new Date());
|
| | | userMoneyExtraService.updateByPrimaryKeySelective(updateExtra);
|
| | |
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | |
|
| | | // 创建报告
|
| | | try {
|
| | | userTaoLiJinReportService.insertDefault(rightsId);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | |
| | | |
| | | if (origin == 1) { |
| | | return; // 自购不推送消息
|
| | | }
|
| | | |
| | | |
| | | // 使用成功消息
|
| | | try {
|
| | | String beizhu = "未被领取/使用的部分将会退回";
|
| | |
| | | content.setMoney(totalMoney);
|
| | |
|
| | | userOtherMsgNotificationService.taoLiJinMsg(uid, beizhu, content);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | |
|
| | | // 创建报告
|
| | | try {
|
| | | userTaoLiJinReportService.insertDefault(rightsId);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | |
| | | // 计算分享奖金
|
| | | BigDecimal shareMoney = new BigDecimal(0);
|
| | | BigDecimal commission = userTaoLiJinRecordVO.getCommission();
|
| | | if (commission != null && commission.compareTo(shareMoney) > 1) {
|
| | | if (commission != null && commission.compareTo(shareMoney) > 0) {
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | shareMoney = MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil.mul(commission, new BigDecimal("0.01")),
|
| | | MoneyBigDecimalUtil.div(shareRate, new BigDecimal(100)));
|
| | | shareMoney = MoneyBigDecimalUtil.mul(commission, MoneyBigDecimalUtil.div(shareRate, new BigDecimal(100)));
|
| | | shareMoney = BigDecimalUtil.getWithNoZera(shareMoney);
|
| | | }
|
| | |
|