init
This commit is contained in:
@@ -56,9 +56,12 @@ public class AccountCashController extends BaseController {
|
|||||||
@SaCheckPermission("cai:accountCash:export")
|
@SaCheckPermission("cai:accountCash:export")
|
||||||
@Log(title = "用户提现记录", businessType = BusinessType.EXPORT)
|
@Log(title = "用户提现记录", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(AccountCash bo, HttpServletResponse response) {
|
public void export(AccountCashAdminVo bo, HttpServletResponse response) {
|
||||||
List<AccountCash> list = accountCashService.list(Wrappers.lambdaQuery(bo));
|
PageQuery query = new PageQuery();
|
||||||
ExcelUtil.exportExcel(list, "用户提现记录", AccountCash.class, response);
|
query.setPageSize(Integer.MAX_VALUE);
|
||||||
|
query.setPageNum(1);
|
||||||
|
List<AccountCashAdminVo> list = accountCashService.pageAdmin(query,bo).getRecords();
|
||||||
|
ExcelUtil.exportExcel(list, "用户提现记录", AccountCashAdminVo.class, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import com.ruoyi.cai.pay.PayManager;
|
|||||||
import com.ruoyi.cai.service.RechargeOrderService;
|
import com.ruoyi.cai.service.RechargeOrderService;
|
||||||
import com.ruoyi.cai.service.VipOrderService;
|
import com.ruoyi.cai.service.VipOrderService;
|
||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -19,6 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/cai/test/pay")
|
@RequestMapping("/cai/test/pay")
|
||||||
|
@Tag(name = "测试接口,正式环境取消")
|
||||||
public class TestPayController {
|
public class TestPayController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -29,6 +32,7 @@ public class TestPayController {
|
|||||||
private PayManager payManager;
|
private PayManager payManager;
|
||||||
|
|
||||||
@GetMapping("/vip")
|
@GetMapping("/vip")
|
||||||
|
@Operation(hidden = true)
|
||||||
public R<Void> vip(Long memberPriceId, Long userId){
|
public R<Void> vip(Long memberPriceId, Long userId){
|
||||||
AddVipOrderDto addVipOrderDto = new AddVipOrderDto();
|
AddVipOrderDto addVipOrderDto = new AddVipOrderDto();
|
||||||
addVipOrderDto.setUserId(userId);
|
addVipOrderDto.setUserId(userId);
|
||||||
@@ -39,6 +43,7 @@ public class TestPayController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/recharge")
|
@GetMapping("/recharge")
|
||||||
|
@Operation(hidden = true)
|
||||||
public R<Void> recharge(Long goodId, Long userId){
|
public R<Void> recharge(Long goodId, Long userId){
|
||||||
AddRechargeOrderDto dto = new AddRechargeOrderDto();
|
AddRechargeOrderDto dto = new AddRechargeOrderDto();
|
||||||
dto.setUserId(userId);
|
dto.setUserId(userId);
|
||||||
|
|||||||
@@ -1,9 +1,17 @@
|
|||||||
package com.ruoyi.cai.domain;
|
package com.ruoyi.cai.domain;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||||
|
import com.alibaba.excel.annotation.write.style.ContentFontStyle;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.ruoyi.cai.enums.AccountCashStatusEnum;
|
||||||
|
import com.ruoyi.cai.enums.IsAnchorEnum;
|
||||||
|
import com.ruoyi.common.annotation.ExcelEnumFormat;
|
||||||
|
import com.ruoyi.common.convert.ExcelEnumConvert;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.apache.poi.ss.usermodel.Font;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@@ -38,10 +46,13 @@ public class AccountCash implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 提现紫贝
|
* 提现紫贝
|
||||||
*/
|
*/
|
||||||
|
@ExcelProperty(value = "提现紫贝")
|
||||||
private Long withdrawCoin;
|
private Long withdrawCoin;
|
||||||
/**
|
/**
|
||||||
* 提现金额
|
* 提现金额
|
||||||
*/
|
*/
|
||||||
|
@ExcelProperty(value = "提现金额")
|
||||||
|
@ContentFontStyle(color = Font.COLOR_RED)
|
||||||
private BigDecimal cashMoney;
|
private BigDecimal cashMoney;
|
||||||
/**
|
/**
|
||||||
* 真实提现金额
|
* 真实提现金额
|
||||||
@@ -54,18 +65,23 @@ public class AccountCash implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 银行名称
|
* 银行名称
|
||||||
*/
|
*/
|
||||||
|
@ExcelProperty(value = "银行名称")
|
||||||
private String bank;
|
private String bank;
|
||||||
/**
|
/**
|
||||||
* 账户名称
|
* 账户名称
|
||||||
*/
|
*/
|
||||||
|
@ExcelProperty(value = "账户名称")
|
||||||
private String cardName;
|
private String cardName;
|
||||||
/**
|
/**
|
||||||
* 账户
|
* 账户
|
||||||
*/
|
*/
|
||||||
|
@ExcelProperty(value = "账户")
|
||||||
private String cardAccount;
|
private String cardAccount;
|
||||||
/**
|
/**
|
||||||
* 1 申请 2 审核通过 3 审核不通过 4 提现取消
|
* 1 申请 2 审核通过 3 审核不通过 4 提现取消
|
||||||
*/
|
*/
|
||||||
|
@ExcelProperty(value = "状态",converter = ExcelEnumConvert.class)
|
||||||
|
@ExcelEnumFormat(enumClass = AccountCashStatusEnum.class,codeField = "code",textField = "text")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -92,7 +108,8 @@ public class AccountCash implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private LocalDateTime exportTime;
|
private LocalDateTime exportTime;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "申请时间")
|
||||||
|
@ColumnWidth(value = 20)
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +1,32 @@
|
|||||||
package com.ruoyi.cai.dto.admin.vo;
|
package com.ruoyi.cai.dto.admin.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import com.ruoyi.cai.domain.AccountCash;
|
import com.ruoyi.cai.domain.AccountCash;
|
||||||
|
import com.ruoyi.cai.enums.IsAnchorEnum;
|
||||||
|
import com.ruoyi.common.annotation.ExcelEnumFormat;
|
||||||
import com.ruoyi.common.annotation.Sensitive;
|
import com.ruoyi.common.annotation.Sensitive;
|
||||||
|
import com.ruoyi.common.convert.ExcelEnumConvert;
|
||||||
import com.ruoyi.common.enums.SensitiveStrategy;
|
import com.ruoyi.common.enums.SensitiveStrategy;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
public class AccountCashAdminVo extends AccountCash {
|
public class AccountCashAdminVo extends AccountCash {
|
||||||
/**
|
|
||||||
* 用户号/ID号
|
@ExcelProperty(value = "蜜瓜号")
|
||||||
*/
|
|
||||||
private String usercode;
|
private String usercode;
|
||||||
/**
|
/**
|
||||||
* 昵称
|
* 昵称
|
||||||
*/
|
*/
|
||||||
|
@ExcelProperty(value = "昵称")
|
||||||
private String nickname;
|
private String nickname;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手机号
|
* 手机号
|
||||||
*/
|
*/
|
||||||
@Sensitive(strategy = SensitiveStrategy.PHONE)
|
@Sensitive(strategy = SensitiveStrategy.PHONE)
|
||||||
|
@ExcelProperty(value = "手机号")
|
||||||
private String mobile;
|
private String mobile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -31,5 +38,7 @@ public class AccountCashAdminVo extends AccountCash {
|
|||||||
*/
|
*/
|
||||||
private Integer gender;
|
private Integer gender;
|
||||||
private Integer age;
|
private Integer age;
|
||||||
|
@ExcelProperty(value = "主播",converter = ExcelEnumConvert.class)
|
||||||
|
@ExcelEnumFormat(enumClass = IsAnchorEnum.class,codeField = "code",textField = "message")
|
||||||
private Integer isAnchor;
|
private Integer isAnchor;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ public enum AccountBusinessEnum {
|
|||||||
/**
|
/**
|
||||||
* 提现
|
* 提现
|
||||||
*/
|
*/
|
||||||
WITHDRAW(AccountChangeEnum.WITHDRAW,null,null,null),
|
// WITHDRAW(AccountChangeEnum.WITHDRAW,null,null,null),
|
||||||
/**
|
/**
|
||||||
* 守护
|
* 守护
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.ruoyi.cai.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1 申请 2 审核通过 3 审核不通过 4 提现取消
|
||||||
|
* <p>created on 2024/1/14 21:55</p>
|
||||||
|
* @author duet
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum AccountCashStatusEnum {
|
||||||
|
|
||||||
|
READY(1,"申请中"),
|
||||||
|
SUCCESS(2,"审核通过"),
|
||||||
|
FAIL(3,"审核未通过"),
|
||||||
|
CLOSE(4,"提现取消"),
|
||||||
|
;
|
||||||
|
private final Integer code;
|
||||||
|
private final String text;
|
||||||
|
|
||||||
|
AccountCashStatusEnum(Integer code, String text) {
|
||||||
|
this.code = code;
|
||||||
|
this.text = text;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.ruoyi.cai.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
public enum IsAnchorEnum {
|
||||||
|
YES(1,"是"),
|
||||||
|
NO(0,"否"),
|
||||||
|
;
|
||||||
|
private final Integer code;
|
||||||
|
private final String message;
|
||||||
|
|
||||||
|
IsAnchorEnum(Integer code, String message) {
|
||||||
|
this.code = code;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -38,7 +38,11 @@ public class AmqpConsumer {
|
|||||||
,containerFactory = "customContainerFactory")
|
,containerFactory = "customContainerFactory")
|
||||||
public void calculateSalesQueue(String message) {
|
public void calculateSalesQueue(String message) {
|
||||||
log.info("接受到到分销处理请求: message=" + message);
|
log.info("接受到到分销处理请求: message=" + message);
|
||||||
consumeLogService.dealFenxiao(Long.valueOf(message));
|
try {
|
||||||
|
consumeLogService.dealFenxiao(Long.valueOf(message),true);
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("处理分销失败: message=" + message,e);
|
||||||
|
}
|
||||||
log.info("分销处理完成: message=" + message);
|
log.info("分销处理完成: message=" + message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.cai.pay;
|
package com.ruoyi.cai.pay;
|
||||||
|
|
||||||
|
import com.ruoyi.cai.manager.ConsumerManager;
|
||||||
import com.ruoyi.cai.service.RechargeOrderService;
|
import com.ruoyi.cai.service.RechargeOrderService;
|
||||||
import com.ruoyi.cai.service.VipOrderService;
|
import com.ruoyi.cai.service.VipOrderService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -13,7 +14,7 @@ public class PayManager {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private VipOrderService vipOrderService;
|
private VipOrderService vipOrderService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private RechargeOrderService rechargeOrderService;
|
private ConsumerManager consumerManager;
|
||||||
|
|
||||||
public void callBack(String orderNo){
|
public void callBack(String orderNo){
|
||||||
OrderTypeEnum orderTypeEnum = OrderNoUtil.getType(orderNo);
|
OrderTypeEnum orderTypeEnum = OrderNoUtil.getType(orderNo);
|
||||||
@@ -26,7 +27,7 @@ public class PayManager {
|
|||||||
vipOrderService.orderSuccess(orderNo);
|
vipOrderService.orderSuccess(orderNo);
|
||||||
break;
|
break;
|
||||||
case RECHARGE_ORDER_SUB:
|
case RECHARGE_ORDER_SUB:
|
||||||
rechargeOrderService.orderSuccess(orderNo);
|
consumerManager.rechargeOrderSuccess(orderNo);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import com.ruoyi.cai.domain.ConsumeLog;
|
|||||||
*/
|
*/
|
||||||
public interface ConsumeLogService extends IService<ConsumeLog> {
|
public interface ConsumeLogService extends IService<ConsumeLog> {
|
||||||
|
|
||||||
void dealFenxiao(Long id);
|
void dealFenxiao(Long id,boolean system);
|
||||||
|
|
||||||
ConsumeLog calculateInitFenxiao(ConsumeLog consumeLog);
|
ConsumeLog calculateInitFenxiao(ConsumeLog consumeLog);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -181,13 +181,13 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
|||||||
if(!incs){
|
if(!incs){
|
||||||
throw new ServiceException("需"+incomeCoin+caiProperties.getCoinName()+"才可提现");
|
throw new ServiceException("需"+incomeCoin+caiProperties.getCoinName()+"才可提现");
|
||||||
}
|
}
|
||||||
accountChangeLogService.saveLogNoAdmin(user.getId(),user.getUsercode(), RechargeTypeEnum.COIN_INCOME,AccountBusinessEnum.WITHDRAW.getSourceEnum(),incomeCoin,traceId);
|
accountChangeLogService.saveLogNoAdmin(user.getId(),user.getUsercode(), RechargeTypeEnum.COIN_INCOME,AccountChangeEnum.WITHDRAW,incomeCoin,traceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void recharge(ConsumeLog consumeLog){
|
public void recharge(ConsumeLog consumeLog){
|
||||||
log.info("开始扣费 consumeLog={}", JSON.toJSONString(consumeLog));
|
log.info("开始充值 consumeLog={}", JSON.toJSONString(consumeLog));
|
||||||
Long userId = consumeLog.getSourceUserId();
|
Long userId = consumeLog.getSourceUserId();
|
||||||
Long amount = consumeLog.getAmount();
|
Long amount = consumeLog.getAmount();
|
||||||
User user = userService.getById(userId);
|
User user = userService.getById(userId);
|
||||||
@@ -195,8 +195,8 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
|||||||
if(account == null || user == null){
|
if(account == null || user == null){
|
||||||
throw new ServiceException("无效账号");
|
throw new ServiceException("无效账号");
|
||||||
}
|
}
|
||||||
baseMapper.incsIncomeCoin(userId, amount);
|
baseMapper.incsCoin(userId, amount);
|
||||||
accountChangeLogService.saveLogNoAdmin(user.getId(),user.getUsercode(), RechargeTypeEnum.COIN,AccountBusinessEnum.RECHARGE.getOneEnum(),amount,consumeLog.getTraceId());
|
accountChangeLogService.saveLogNoAdmin(user.getId(),user.getUsercode(), RechargeTypeEnum.COIN,AccountBusinessEnum.RECHARGE.getSourceEnum(),amount,consumeLog.getTraceId());
|
||||||
// 获取分销的比例和用户
|
// 获取分销的比例和用户
|
||||||
consumeLogService.calculateInitFenxiao(consumeLog);
|
consumeLogService.calculateInitFenxiao(consumeLog);
|
||||||
consumeLogService.save(consumeLog);
|
consumeLogService.save(consumeLog);
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.cai.service.impl;
|
package com.ruoyi.cai.service.impl;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.stp.StpUtil;
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
@@ -11,6 +12,7 @@ import com.ruoyi.cai.mapper.ConsumeLogMapper;
|
|||||||
import com.ruoyi.cai.service.*;
|
import com.ruoyi.cai.service.*;
|
||||||
import com.ruoyi.cai.util.NumCaUtil;
|
import com.ruoyi.cai.util.NumCaUtil;
|
||||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||||
|
import com.ruoyi.common.exception.ServiceException;
|
||||||
import com.ruoyi.common.helper.LoginHelper;
|
import com.ruoyi.common.helper.LoginHelper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.BooleanUtils;
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
@@ -42,7 +44,7 @@ public class ConsumeLogServiceImpl extends ServiceImpl<ConsumeLogMapper, Consume
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void dealFenxiao(Long id){
|
public void dealFenxiao(Long id,boolean system){
|
||||||
ConsumeLog consumer = this.getById(id);
|
ConsumeLog consumer = this.getById(id);
|
||||||
if(consumer == null){
|
if(consumer == null){
|
||||||
return;
|
return;
|
||||||
@@ -63,13 +65,21 @@ public class ConsumeLogServiceImpl extends ServiceImpl<ConsumeLogMapper, Consume
|
|||||||
this.updateById(consumer);
|
this.updateById(consumer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
String opName = "system";
|
||||||
|
Long opId = null;
|
||||||
|
if(!system){
|
||||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||||
|
if(loginUser != null){
|
||||||
|
opName = loginUser.getUsername();
|
||||||
|
opId = loginUser.getUserId();
|
||||||
|
}
|
||||||
|
}
|
||||||
// 在分销
|
// 在分销
|
||||||
boolean update = this.update(Wrappers.lambdaUpdate(ConsumeLog.class)
|
boolean update = this.update(Wrappers.lambdaUpdate(ConsumeLog.class)
|
||||||
.eq(ConsumeLog::getId, id)
|
.eq(ConsumeLog::getId, id)
|
||||||
.eq(ConsumeLog::getStatus, ConsumeLogStatus.READY.getCode())
|
.eq(ConsumeLog::getStatus, ConsumeLogStatus.READY.getCode())
|
||||||
.set(ConsumeLog::getOpName, loginUser!=null?loginUser.getUsername():"system")
|
.set(ConsumeLog::getOpName, opName)
|
||||||
.set(ConsumeLog::getOpId, loginUser!=null?loginUser.getUserId():"-1")
|
.set(ConsumeLog::getOpId, opId)
|
||||||
.set(ConsumeLog::getStatus, ConsumeLogStatus.ALREADY.getCode()));
|
.set(ConsumeLog::getStatus, ConsumeLogStatus.ALREADY.getCode()));
|
||||||
if(!update){
|
if(!update){
|
||||||
log.error("无需分销 consumer={}", JSON.toJSONString(consumer));
|
log.error("无需分销 consumer={}", JSON.toJSONString(consumer));
|
||||||
@@ -78,7 +88,7 @@ public class ConsumeLogServiceImpl extends ServiceImpl<ConsumeLogMapper, Consume
|
|||||||
AccountBusinessEnum accountBusinessEnum = AccountBusinessEnum.getByName(consumer.getBusinessEnum());
|
AccountBusinessEnum accountBusinessEnum = AccountBusinessEnum.getByName(consumer.getBusinessEnum());
|
||||||
if(accountBusinessEnum == null){
|
if(accountBusinessEnum == null){
|
||||||
log.error("分销失败 BusinessEnum状态错误! consumerLog={}",JSON.toJSONString(consumer));
|
log.error("分销失败 BusinessEnum状态错误! consumerLog={}",JSON.toJSONString(consumer));
|
||||||
return;
|
throw new ServiceException("分销失败!请联系管理员排查问题!");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
// 计算一级
|
// 计算一级
|
||||||
|
|||||||
@@ -111,6 +111,7 @@ public class GuardTotalServiceImpl extends ServiceImpl<GuardTotalMapper, GuardTo
|
|||||||
consumeLog.init(fromUser,toUser);
|
consumeLog.init(fromUser,toUser);
|
||||||
consumeLog.setTraceId(tractId);
|
consumeLog.setTraceId(tractId);
|
||||||
consumeLog.setType(ConsumeLogType.GUARD.getCode());
|
consumeLog.setType(ConsumeLogType.GUARD.getCode());
|
||||||
|
consumeLog.setBusinessEnum(AccountBusinessEnum.GUARD.name());
|
||||||
consumeLog.setAmount(guardValue);
|
consumeLog.setAmount(guardValue);
|
||||||
consumeLog.setTargetRate(anchor.getGuardRate());
|
consumeLog.setTargetRate(anchor.getGuardRate());
|
||||||
consumeLog = accountService.decr(consumeLog, AccountBusinessEnum.GUARD);
|
consumeLog = accountService.decr(consumeLog, AccountBusinessEnum.GUARD);
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ public class RechargeOrderServiceImpl extends ServiceImpl<RechargeOrderMapper,Re
|
|||||||
consumeLog.init(user,null);
|
consumeLog.init(user,null);
|
||||||
consumeLog.setTraceId(traceId);
|
consumeLog.setTraceId(traceId);
|
||||||
consumeLog.setType(ConsumeLogType.RECHARGE.getCode());
|
consumeLog.setType(ConsumeLogType.RECHARGE.getCode());
|
||||||
|
consumeLog.setBusinessEnum(AccountBusinessEnum.RECHARGE.name());
|
||||||
consumeLog.setAmount(rechargeOrder.getRechargeCoin());
|
consumeLog.setAmount(rechargeOrder.getRechargeCoin());
|
||||||
accountService.recharge(consumeLog);
|
accountService.recharge(consumeLog);
|
||||||
ConsumeResp resp = new ConsumeResp();
|
ConsumeResp resp = new ConsumeResp();
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ public class UserGiftServiceImpl extends ServiceImpl<UserGiftMapper, UserGift> i
|
|||||||
consumeLog.init(fromUser,toUser);
|
consumeLog.init(fromUser,toUser);
|
||||||
consumeLog.setTraceId(traceId);
|
consumeLog.setTraceId(traceId);
|
||||||
consumeLog.setType(ConsumeLogType.GIFT.getCode());
|
consumeLog.setType(ConsumeLogType.GIFT.getCode());
|
||||||
|
consumeLog.setBusinessEnum(AccountBusinessEnum.GIFT.name());
|
||||||
consumeLog.setAmount(giftAmount);
|
consumeLog.setAmount(giftAmount);
|
||||||
consumeLog.setTargetRate(anchor.getGiftRate());
|
consumeLog.setTargetRate(anchor.getGiftRate());
|
||||||
consumeLog = accountService.decr(consumeLog, AccountBusinessEnum.GIFT);
|
consumeLog = accountService.decr(consumeLog, AccountBusinessEnum.GIFT);
|
||||||
|
|||||||
@@ -22,7 +22,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* VIP订单Service业务层处理
|
* VIP订单Service业务层处理
|
||||||
@@ -152,13 +154,14 @@ public class VipOrderServiceImpl extends ServiceImpl<VipOrderMapper,VipOrder> im
|
|||||||
userMember.setMemberType(memberType);
|
userMember.setMemberType(memberType);
|
||||||
userMember.setExpire(expire);
|
userMember.setExpire(expire);
|
||||||
userMember.setLongs(longs);
|
userMember.setLongs(longs);
|
||||||
userMember.setExpireDate(createTime.plusDays(expire));
|
LocalDate expireDate = createTime.plusDays(expire).plusDays(1).toLocalDate();
|
||||||
|
userMember.setExpireDate(LocalDateTime.of(expireDate, LocalTime.MIN));
|
||||||
userMember.setCreateTime(createTime);
|
userMember.setCreateTime(createTime);
|
||||||
userMember.setMemberStatus(MemberStatusEnum.NORMAL.getCode());
|
userMember.setMemberStatus(MemberStatusEnum.NORMAL.getCode());
|
||||||
userMemberService.saveOrUpdate(userMember);
|
userMemberService.saveOrUpdate(userMember);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if(longs == 1){ // 已经是永久会员还买? 傻逼
|
if(userMember.getLongs() == 1){ // 已经是永久会员还买? 傻逼
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
userMember.setCreateTime(createTime);
|
userMember.setCreateTime(createTime);
|
||||||
|
|||||||
@@ -40,8 +40,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="bo.usercode != null and bo.usercode != ''">
|
<if test="bo.usercode != null and bo.usercode != ''">
|
||||||
and t2.usercode = #{bo.usercode}
|
and t2.usercode = #{bo.usercode}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="bo.status != null">
|
||||||
|
and t1.status = #{bo.status}
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
order by t1.create_time
|
order by t1.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user