!66 店铺流水相关代码优化,流水与结算单业务隔离。联合登陆信息查询代码优化,更优雅的实现,优化规范余额相关模型传递问题
Merge pull request !66 from chopper711/liushuai
This commit is contained in:
commit
9c2738399e
@ -1,4 +1,4 @@
|
||||
package cn.lili.controller.system;
|
||||
package cn.lili.controller.message;
|
||||
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.security.context.UserContext;
|
@ -1,4 +1,4 @@
|
||||
package cn.lili.modules.system.aspect.annotation;
|
||||
package cn.lili.common.aop.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
@ -1,9 +1,9 @@
|
||||
package cn.lili.modules.system.aspect.interceptor;
|
||||
package cn.lili.common.aop.interceptor;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.properties.SystemSettingProperties;
|
||||
import cn.lili.modules.system.aspect.annotation.DemoSite;
|
||||
import cn.lili.common.aop.annotation.DemoSite;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Before;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
@ -5,6 +5,7 @@ import cn.lili.common.security.token.Token;
|
||||
import cn.lili.modules.connect.entity.Connect;
|
||||
import cn.lili.modules.connect.entity.dto.ConnectAuthUser;
|
||||
import cn.lili.modules.connect.entity.dto.WechatMPLoginParams;
|
||||
import cn.lili.modules.member.entity.dto.ConnectQueryDTO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import javax.naming.NoPermissionException;
|
||||
@ -103,4 +104,12 @@ public interface ConnectService extends IService<Connect> {
|
||||
* @return token
|
||||
*/
|
||||
Token miniProgramAutoLogin(WechatMPLoginParams params);
|
||||
|
||||
/**
|
||||
* 根据查询dto获取查询对象
|
||||
*
|
||||
* @param connectQueryDTO
|
||||
* @return
|
||||
*/
|
||||
Connect queryConnect(ConnectQueryDTO connectQueryDTO);
|
||||
}
|
@ -21,6 +21,7 @@ import cn.lili.modules.connect.entity.enums.ConnectEnum;
|
||||
import cn.lili.modules.connect.mapper.ConnectMapper;
|
||||
import cn.lili.modules.connect.service.ConnectService;
|
||||
import cn.lili.modules.member.entity.dos.Member;
|
||||
import cn.lili.modules.member.entity.dto.ConnectQueryDTO;
|
||||
import cn.lili.modules.member.service.MemberService;
|
||||
import cn.lili.modules.member.token.MemberTokenGenerate;
|
||||
import cn.lili.modules.system.entity.dos.Setting;
|
||||
@ -232,6 +233,16 @@ public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> impl
|
||||
return memberTokenGenerate.createToken(newMember.getUsername(), true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Connect queryConnect(ConnectQueryDTO connectQueryDTO) {
|
||||
|
||||
LambdaQueryWrapper<Connect> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(connectQueryDTO.getUserId()), Connect::getUserId, connectQueryDTO.getUserId())
|
||||
.eq(StringUtils.isNotEmpty(connectQueryDTO.getUnionType()), Connect::getUnionType, connectQueryDTO.getUnionType())
|
||||
.eq(StringUtils.isNotEmpty(connectQueryDTO.getUnionId()), Connect::getUnionId, connectQueryDTO.getUnionId());
|
||||
return this.getOne(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员绑定 绑定微信小程序
|
||||
* <p>
|
||||
|
@ -2,6 +2,7 @@ package cn.lili.modules.distribution.serviceimpl;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.modules.wallet.entity.dto.MemberWalletUpdateDTO;
|
||||
import cn.lili.modules.wallet.entity.enums.WithdrawStatusEnum;
|
||||
import cn.lili.rocketmq.RocketmqSendCallbackBuilder;
|
||||
import cn.lili.rocketmq.tags.MemberTagsEnum;
|
||||
@ -130,7 +131,7 @@ public class DistributionCashServiceImpl extends ServiceImpl<DistributionCashMap
|
||||
distributorCash.setDistributionCashStatus(WithdrawStatusEnum.VIA_AUDITING.name());
|
||||
distributorCash.setPayTime(new Date());
|
||||
//提现到余额
|
||||
memberWalletService.increase(distributorCash.getPrice(), distribution.getMemberId(), "分销[" + distributorCash.getSn() + "]佣金提现到余额[" + distributorCash.getPrice() + "]", DepositServiceTypeEnum.WALLET_COMMISSION.name());
|
||||
memberWalletService.increase(new MemberWalletUpdateDTO(distributorCash.getPrice(), distribution.getMemberId(), "分销[" + distributorCash.getSn() + "]佣金提现到余额[" + distributorCash.getPrice() + "]", DepositServiceTypeEnum.WALLET_COMMISSION.name()));
|
||||
} else {
|
||||
memberWithdrawalMessage.setStatus(WithdrawStatusEnum.FAIL_AUDITING.name());
|
||||
//分销员可提现金额退回
|
||||
|
@ -0,0 +1,33 @@
|
||||
package cn.lili.modules.member.entity.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* ConnectQueryDTO
|
||||
*
|
||||
* @author Chopper
|
||||
* @version v1.0
|
||||
* 2021-12-01 14:34
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
public class ConnectQueryDTO {
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 第三方id
|
||||
*/
|
||||
private String unionId;
|
||||
|
||||
/**
|
||||
* 联合登陆类型
|
||||
*/
|
||||
private String unionType;
|
||||
|
||||
}
|
@ -34,19 +34,8 @@ import java.util.Optional;
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
|
||||
public class GoodsCollectionServiceImpl extends ServiceImpl<GoodsCollectionMapper, GoodsCollection> implements GoodsCollectionService {
|
||||
|
||||
/**
|
||||
* rocketMq
|
||||
*/
|
||||
@Autowired
|
||||
private RocketMQTemplate rocketMQTemplate;
|
||||
/**
|
||||
* rocketMq配置
|
||||
*/
|
||||
@Autowired
|
||||
private RocketmqCustomProperties rocketmqCustomProperties;
|
||||
|
||||
@Override
|
||||
public IPage<GoodsCollectionVO> goodsCollection(PageVO pageVo) {
|
||||
|
@ -21,14 +21,12 @@ import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.modules.connect.config.ConnectAuthEnum;
|
||||
import cn.lili.modules.connect.entity.Connect;
|
||||
import cn.lili.modules.connect.entity.dto.ConnectAuthUser;
|
||||
import cn.lili.modules.connect.entity.enums.ConnectEnum;
|
||||
import cn.lili.modules.connect.service.ConnectService;
|
||||
import cn.lili.common.utils.UuidUtils;
|
||||
import cn.lili.modules.member.aop.annotation.PointLogPoint;
|
||||
import cn.lili.modules.member.entity.dos.Member;
|
||||
import cn.lili.modules.member.entity.dto.ManagerMemberEditDTO;
|
||||
import cn.lili.modules.member.entity.dto.MemberAddDTO;
|
||||
import cn.lili.modules.member.entity.dto.MemberEditDTO;
|
||||
import cn.lili.modules.member.entity.dto.MemberPointMessage;
|
||||
import cn.lili.modules.member.entity.dto.*;
|
||||
import cn.lili.modules.member.entity.enums.PointTypeEnum;
|
||||
import cn.lili.modules.member.entity.vo.MemberDistributionVO;
|
||||
import cn.lili.modules.member.entity.vo.MemberSearchVO;
|
||||
@ -469,10 +467,9 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
||||
* @param type 状态
|
||||
*/
|
||||
private void loginBindUser(Member member, String unionId, String type) {
|
||||
LambdaQueryWrapper<Connect> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(Connect::getUnionId, unionId);
|
||||
queryWrapper.eq(Connect::getUnionType, type);
|
||||
Connect connect = connectService.getOne(queryWrapper);
|
||||
Connect connect = connectService.queryConnect(
|
||||
ConnectQueryDTO.builder().unionId(unionId).unionType(type).build()
|
||||
);
|
||||
if (connect == null) {
|
||||
connect = new Connect(member.getId(), unionId, type);
|
||||
connectService.save(connect);
|
||||
@ -496,11 +493,9 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
||||
if (connectAuthUser == null) {
|
||||
return;
|
||||
}
|
||||
//检测是否已经绑定过用户
|
||||
LambdaQueryWrapper<Connect> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(Connect::getUnionId, connectAuthUser.getUuid());
|
||||
queryWrapper.eq(Connect::getUnionType, connectType);
|
||||
Connect connect = connectService.getOne(queryWrapper);
|
||||
Connect connect = connectService.queryConnect(
|
||||
ConnectQueryDTO.builder().unionId(connectAuthUser.getUuid()).unionType(connectType).build()
|
||||
);
|
||||
if (connect == null) {
|
||||
connect = new Connect(member.getId(), connectAuthUser.getUuid(), connectType);
|
||||
connectService.save(connect);
|
||||
@ -543,9 +538,9 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
||||
}
|
||||
//检测是否已经绑定过用户
|
||||
LambdaQueryWrapper<Connect> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(Connect::getUnionId, connectAuthUser.getUuid());
|
||||
queryWrapper.eq(Connect::getUnionType, connectType);
|
||||
Connect connect = connectService.getOne(queryWrapper);
|
||||
Connect connect = connectService.queryConnect(
|
||||
ConnectQueryDTO.builder().unionType(connectType).unionId(connectAuthUser.getUuid()).build()
|
||||
);
|
||||
//没有关联则返回true,表示可以继续绑定
|
||||
if (connect == null) {
|
||||
connectAuthUser.setConnectEnum(authInterface);
|
||||
|
@ -11,6 +11,7 @@ import cn.lili.common.enums.ClientTypeEnum;
|
||||
import cn.lili.modules.connect.entity.Connect;
|
||||
import cn.lili.modules.connect.entity.enums.ConnectEnum;
|
||||
import cn.lili.modules.connect.service.ConnectService;
|
||||
import cn.lili.modules.member.entity.dto.ConnectQueryDTO;
|
||||
import cn.lili.modules.message.entity.dos.WechatMPMessage;
|
||||
import cn.lili.modules.message.entity.dos.WechatMessage;
|
||||
import cn.lili.modules.message.entity.enums.WechatMessageItemEnums;
|
||||
@ -87,11 +88,9 @@ public class WechatMessageUtil {
|
||||
return;
|
||||
}
|
||||
|
||||
QueryWrapper<Connect> queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("user_id", order.getMemberId());
|
||||
queryWrapper.eq("union_type", ConnectEnum.WECHAT.name());
|
||||
|
||||
Connect connect = connectService.getOne(queryWrapper);
|
||||
Connect connect = connectService.queryConnect(
|
||||
ConnectQueryDTO.builder().userId(order.getMemberId()).unionType(ConnectEnum.WECHAT.name()).build()
|
||||
);
|
||||
if (connect == null) {
|
||||
return;
|
||||
}
|
||||
@ -147,11 +146,9 @@ public class WechatMessageUtil {
|
||||
return;
|
||||
}
|
||||
|
||||
QueryWrapper<Connect> queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("user_id", order.getMemberId());
|
||||
queryWrapper.eq("union_type", ConnectEnum.WECHAT_MP_OPEN_ID.name());
|
||||
|
||||
Connect connect = connectService.getOne(queryWrapper);
|
||||
Connect connect = connectService.queryConnect(
|
||||
ConnectQueryDTO.builder().userId(order.getMemberId()).unionType(ConnectEnum.WECHAT_MP_OPEN_ID.name()).build()
|
||||
);
|
||||
if (connect == null) {
|
||||
return;
|
||||
}
|
||||
|
@ -66,4 +66,25 @@ public interface StoreFlowService extends IService<StoreFlow> {
|
||||
*/
|
||||
List<StoreFlowRefundDownloadVO> getStoreFlowRefundDownloadVO(Wrapper<StoreFlow> queryWrapper);
|
||||
|
||||
|
||||
/**
|
||||
* 根据结算单ID获取商家流水
|
||||
*
|
||||
* @param pageVO 分页
|
||||
* @param id 结算单ID
|
||||
* @param type 类型
|
||||
* @return 商家流水
|
||||
*/
|
||||
IPage<StoreFlow> getStoreFlow(String id, String type, PageVO pageVO);
|
||||
|
||||
/**
|
||||
* 根据结算单ID获取商家流水
|
||||
*
|
||||
* @param pageVO 分页
|
||||
* @param id 结算单ID
|
||||
* @return 商家流水
|
||||
*/
|
||||
IPage<StoreFlow> getDistributionFlow(String id, PageVO pageVO);
|
||||
|
||||
|
||||
}
|
@ -15,8 +15,10 @@ import cn.lili.modules.order.order.service.OrderService;
|
||||
import cn.lili.modules.order.order.service.StoreFlowService;
|
||||
import cn.lili.modules.payment.entity.RefundLog;
|
||||
import cn.lili.modules.payment.service.RefundLogService;
|
||||
import cn.lili.modules.store.entity.dos.Bill;
|
||||
import cn.lili.modules.store.entity.vos.StoreFlowPayDownloadVO;
|
||||
import cn.lili.modules.store.entity.vos.StoreFlowRefundDownloadVO;
|
||||
import cn.lili.modules.store.service.BillService;
|
||||
import cn.lili.mybatis.util.PageUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@ -59,6 +61,9 @@ public class StoreFlowServiceImpl extends ServiceImpl<StoreFlowMapper, StoreFlow
|
||||
@Autowired
|
||||
private RefundLogService refundLogService;
|
||||
|
||||
@Autowired
|
||||
private BillService billService;
|
||||
|
||||
@Override
|
||||
public void payOrder(String orderSn) {
|
||||
//根据订单编号获取子订单列表
|
||||
@ -181,4 +186,18 @@ public class StoreFlowServiceImpl extends ServiceImpl<StoreFlowMapper, StoreFlow
|
||||
public List<StoreFlowRefundDownloadVO> getStoreFlowRefundDownloadVO(Wrapper<StoreFlow> queryWrapper) {
|
||||
return baseMapper.getStoreFlowRefundDownloadVO(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<StoreFlow> getStoreFlow(String id, String type, PageVO pageVO) {
|
||||
Bill bill = billService.getById(id);
|
||||
return this.getStoreFlow(bill.getStoreId(), type, false, pageVO, bill.getStartTime(), bill.getCreateTime());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<StoreFlow> getDistributionFlow(String id, PageVO pageVO) {
|
||||
Bill bill = billService.getById(id);
|
||||
return this.getStoreFlow(bill.getStoreId(), null, true, pageVO, bill.getStartTime(), bill.getCreateTime());
|
||||
}
|
||||
|
||||
}
|
@ -5,6 +5,7 @@ import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.wallet.entity.dto.MemberWalletUpdateDTO;
|
||||
import cn.lili.modules.wallet.service.MemberWalletService;
|
||||
import cn.lili.modules.wallet.entity.enums.DepositServiceTypeEnum;
|
||||
import cn.lili.modules.payment.entity.RefundLog;
|
||||
@ -77,7 +78,7 @@ public class WalletPlugin implements Payment {
|
||||
|
||||
@Override
|
||||
public ResultMessage<Object> nativePay(HttpServletRequest request, PayParam payParam) {
|
||||
if(payParam.getOrderType().equals(CashierEnum.RECHARGE.name())){
|
||||
if (payParam.getOrderType().equals(CashierEnum.RECHARGE.name())) {
|
||||
throw new ServiceException(ResultCode.CAN_NOT_RECHARGE_WALLET);
|
||||
}
|
||||
savePaymentLog(payParam);
|
||||
@ -95,14 +96,14 @@ public class WalletPlugin implements Payment {
|
||||
public void cancel(RefundLog refundLog) {
|
||||
|
||||
try {
|
||||
memberWalletService.increase(refundLog.getTotalAmount(),
|
||||
memberWalletService.increase(new MemberWalletUpdateDTO(refundLog.getTotalAmount(),
|
||||
refundLog.getMemberId(),
|
||||
"取消[" + refundLog.getOrderSn() + "]订单,退还金额[" + refundLog.getTotalAmount() + "]",
|
||||
DepositServiceTypeEnum.WALLET_REFUND.name());
|
||||
DepositServiceTypeEnum.WALLET_REFUND.name()));
|
||||
refundLog.setIsRefund(true);
|
||||
refundLogService.save(refundLog);
|
||||
} catch (Exception e) {
|
||||
log.error("订单取消错误",e);
|
||||
log.error("订单取消错误", e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -120,13 +121,14 @@ public class WalletPlugin implements Payment {
|
||||
@Override
|
||||
public void refund(RefundLog refundLog) {
|
||||
try {
|
||||
memberWalletService.increase(refundLog.getTotalAmount(),
|
||||
memberWalletService.increase(new MemberWalletUpdateDTO(refundLog.getTotalAmount(),
|
||||
refundLog.getMemberId(),
|
||||
"售后[" + refundLog.getAfterSaleNo() + "]审批,退还金额[" + refundLog.getTotalAmount() + "]", DepositServiceTypeEnum.WALLET_REFUND.name());
|
||||
"售后[" + refundLog.getAfterSaleNo() + "]审批,退还金额[" + refundLog.getTotalAmount() + "]",
|
||||
DepositServiceTypeEnum.WALLET_REFUND.name()));
|
||||
refundLog.setIsRefund(true);
|
||||
refundLogService.save(refundLog);
|
||||
} catch (Exception e) {
|
||||
log.error("退款失败",e);
|
||||
log.error("退款失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -143,11 +145,12 @@ public class WalletPlugin implements Payment {
|
||||
if (UserContext.getCurrentUser() == null) {
|
||||
throw new ServiceException(ResultCode.USER_NOT_LOGIN);
|
||||
}
|
||||
boolean result = memberWalletService.reduce(
|
||||
cashierParam.getPrice(),
|
||||
UserContext.getCurrentUser().getId(),
|
||||
"订单[" + cashierParam.getOrderSns() + "]支付金额[" + cashierParam.getPrice() + "]",
|
||||
DepositServiceTypeEnum.WALLET_PAY.name()
|
||||
boolean result = memberWalletService.reduce(new MemberWalletUpdateDTO(
|
||||
cashierParam.getPrice(),
|
||||
UserContext.getCurrentUser().getId(),
|
||||
"订单[" + cashierParam.getOrderSns() + "]支付金额[" + cashierParam.getPrice() + "]",
|
||||
DepositServiceTypeEnum.WALLET_PAY.name()
|
||||
)
|
||||
);
|
||||
if (result) {
|
||||
try {
|
||||
@ -162,11 +165,11 @@ public class WalletPlugin implements Payment {
|
||||
log.info("支付回调通知:余额支付:{}", payParam);
|
||||
} catch (ServiceException e) {
|
||||
//业务异常,则支付手动回滚
|
||||
memberWalletService.increase(
|
||||
memberWalletService.increase(new MemberWalletUpdateDTO(
|
||||
cashierParam.getPrice(),
|
||||
UserContext.getCurrentUser().getId(),
|
||||
"订单[" + cashierParam.getOrderSns() + "]支付异常,余额返还[" + cashierParam.getPrice() + "]",
|
||||
DepositServiceTypeEnum.WALLET_REFUND.name()
|
||||
DepositServiceTypeEnum.WALLET_REFUND.name())
|
||||
);
|
||||
throw e;
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import cn.lili.common.enums.ClientTypeEnum;
|
||||
import cn.lili.modules.connect.entity.Connect;
|
||||
import cn.lili.modules.connect.entity.enums.ConnectEnum;
|
||||
import cn.lili.modules.connect.service.ConnectService;
|
||||
import cn.lili.modules.member.entity.dto.ConnectQueryDTO;
|
||||
import cn.lili.modules.order.order.service.OrderService;
|
||||
import cn.lili.modules.payment.entity.RefundLog;
|
||||
import cn.lili.modules.payment.kit.CashierSupport;
|
||||
@ -166,10 +167,9 @@ public class WechatPlugin implements Payment {
|
||||
public ResultMessage<Object> jsApiPay(HttpServletRequest request, PayParam payParam) {
|
||||
|
||||
try {
|
||||
LambdaQueryWrapper<Connect> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(Connect::getUserId, UserContext.getCurrentUser().getId())
|
||||
.eq(Connect::getUnionType, ConnectEnum.WECHAT.name());
|
||||
Connect connect = connectService.getOne(queryWrapper);
|
||||
Connect connect = connectService.queryConnect(
|
||||
ConnectQueryDTO.builder().userId(UserContext.getCurrentUser().getId()).unionType(ConnectEnum.WECHAT.name()).build()
|
||||
);
|
||||
if (connect == null) {
|
||||
return null;
|
||||
}
|
||||
@ -359,10 +359,9 @@ public class WechatPlugin implements Payment {
|
||||
public ResultMessage<Object> mpPay(HttpServletRequest request, PayParam payParam) {
|
||||
|
||||
try {
|
||||
LambdaQueryWrapper<Connect> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(Connect::getUserId, UserContext.getCurrentUser().getId())
|
||||
.eq(Connect::getUnionType, ConnectEnum.WECHAT_MP_OPEN_ID.name());
|
||||
Connect connect = connectService.getOne(queryWrapper);
|
||||
Connect connect = connectService.queryConnect(
|
||||
ConnectQueryDTO.builder().userId(UserContext.getCurrentUser().getId()).unionType(ConnectEnum.WECHAT_MP_OPEN_ID.name()).build()
|
||||
);
|
||||
if (connect == null) {
|
||||
return null;
|
||||
}
|
||||
|
@ -12,53 +12,14 @@ import java.util.Date;
|
||||
|
||||
/**
|
||||
* 店铺流水下载
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date: 2021/8/13 4:14 下午
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class StoreFlowRefundDownloadVO {
|
||||
|
||||
@CreatedDate
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建时间", hidden = true)
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "订单sn")
|
||||
private String orderSn;
|
||||
public class StoreFlowRefundDownloadVO extends StoreFlowPayDownloadVO {
|
||||
|
||||
@ApiModelProperty(value = "售后SN")
|
||||
private String refundSn;
|
||||
|
||||
@ApiModelProperty(value = "店铺名称 ")
|
||||
private String storeName;
|
||||
|
||||
@ApiModelProperty(value = "商品名称")
|
||||
private String goodsName;
|
||||
|
||||
@ApiModelProperty(value = "销售量")
|
||||
private Integer num;
|
||||
|
||||
@ApiModelProperty(value = "流水金额")
|
||||
private Double finalPrice;
|
||||
|
||||
@ApiModelProperty(value = "平台收取交易佣金")
|
||||
private Double commissionPrice;
|
||||
|
||||
@ApiModelProperty(value = "平台优惠券 使用金额")
|
||||
private Double siteCouponPrice;
|
||||
|
||||
@ApiModelProperty(value = "单品分销返现支出")
|
||||
private Double distributionRebate;
|
||||
|
||||
@ApiModelProperty(value = "积分活动商品结算价格")
|
||||
private Double pointSettlementPrice;
|
||||
|
||||
@ApiModelProperty(value = "砍价活动商品结算价格")
|
||||
private Double kanjiaSettlementPrice;
|
||||
|
||||
@ApiModelProperty(value = "最终结算金额")
|
||||
private Double billPrice;
|
||||
}
|
||||
|
@ -42,25 +42,6 @@ public interface BillService extends IService<Bill> {
|
||||
*/
|
||||
void immediatelyBill(String storeId, Long endTime);
|
||||
|
||||
/**
|
||||
* 根据结算单ID获取商家流水
|
||||
*
|
||||
* @param pageVO 分页
|
||||
* @param id 结算单ID
|
||||
* @param type 类型
|
||||
* @return 商家流水
|
||||
*/
|
||||
IPage<StoreFlow> getStoreFlow(String id, String type, PageVO pageVO);
|
||||
|
||||
/**
|
||||
* 根据结算单ID获取商家流水
|
||||
*
|
||||
* @param pageVO 分页
|
||||
* @param id 结算单ID
|
||||
* @return 商家流水
|
||||
*/
|
||||
IPage<StoreFlow> getDistributionFlow(String id, PageVO pageVO);
|
||||
|
||||
/**
|
||||
* 获取结算单分页
|
||||
*
|
||||
|
@ -161,18 +161,6 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements Bi
|
||||
// this.createBill(storeId, startTime, endTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<StoreFlow> getStoreFlow(String id, String type, PageVO pageVO) {
|
||||
Bill bill = this.getById(id);
|
||||
return storeFlowService.getStoreFlow(bill.getStoreId(), type, false, pageVO, bill.getStartTime(), bill.getCreateTime());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<StoreFlow> getDistributionFlow(String id, PageVO pageVO) {
|
||||
Bill bill = this.getById(id);
|
||||
return storeFlowService.getStoreFlow(bill.getStoreId(), null, true, pageVO, bill.getStartTime(), bill.getCreateTime());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<BillListVO> billPage(BillSearchParams billSearchParams) {
|
||||
QueryWrapper<BillListVO> queryWrapper = billSearchParams.queryWrapper();
|
||||
@ -282,11 +270,11 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements Bi
|
||||
writer.setColumnWidth(12, 20);
|
||||
|
||||
//存放入账列表
|
||||
LambdaQueryWrapper<StoreFlow> storeFlowlambdaQueryWrapper = Wrappers.lambdaQuery();
|
||||
storeFlowlambdaQueryWrapper.eq(StoreFlow::getStoreId, bill.getStoreId());
|
||||
storeFlowlambdaQueryWrapper.between(StoreFlow::getCreateTime, bill.getStartTime(), bill.getCreateTime());
|
||||
storeFlowlambdaQueryWrapper.eq(StoreFlow::getFlowType, FlowTypeEnum.PAY.name());
|
||||
List<StoreFlowRefundDownloadVO> storeFlowRefundDownloadVOList = storeFlowService.getStoreFlowRefundDownloadVO(storeFlowlambdaQueryWrapper);
|
||||
LambdaQueryWrapper<StoreFlow> storeFlowLambdaQueryWrapper = Wrappers.lambdaQuery();
|
||||
storeFlowLambdaQueryWrapper.eq(StoreFlow::getStoreId, bill.getStoreId());
|
||||
storeFlowLambdaQueryWrapper.between(StoreFlow::getCreateTime, bill.getStartTime(), bill.getCreateTime());
|
||||
storeFlowLambdaQueryWrapper.eq(StoreFlow::getFlowType, FlowTypeEnum.PAY.name());
|
||||
List<StoreFlowRefundDownloadVO> storeFlowRefundDownloadVOList = storeFlowService.getStoreFlowRefundDownloadVO(storeFlowLambdaQueryWrapper);
|
||||
writer.write(storeFlowRefundDownloadVOList, true);
|
||||
|
||||
ServletOutputStream out = null;
|
||||
|
@ -15,11 +15,9 @@ import cn.lili.modules.goods.entity.enums.GoodsStatusEnum;
|
||||
import cn.lili.modules.goods.service.GoodsService;
|
||||
import cn.lili.modules.goods.service.GoodsSkuService;
|
||||
import cn.lili.modules.member.entity.dos.Member;
|
||||
import cn.lili.modules.member.entity.dos.StoreCollection;
|
||||
import cn.lili.modules.member.entity.dto.CollectionDTO;
|
||||
import cn.lili.modules.member.service.MemberService;
|
||||
import cn.lili.modules.member.service.StoreCollectionService;
|
||||
import cn.lili.modules.page.service.PageDataService;
|
||||
import cn.lili.modules.store.entity.dos.Store;
|
||||
import cn.lili.modules.store.entity.dos.StoreDetail;
|
||||
import cn.lili.modules.store.entity.dto.*;
|
||||
@ -63,21 +61,11 @@ public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements
|
||||
*/
|
||||
@Autowired
|
||||
private GoodsService goodsService;
|
||||
/**
|
||||
* 商品SKU
|
||||
*/
|
||||
@Autowired
|
||||
private GoodsSkuService goodsSkuService;
|
||||
/**
|
||||
* 店铺详情
|
||||
*/
|
||||
@Autowired
|
||||
private StoreDetailService storeDetailService;
|
||||
/**
|
||||
* 店铺收藏
|
||||
*/
|
||||
@Autowired
|
||||
private StoreCollectionService storeCollectionService;
|
||||
|
||||
@Override
|
||||
public IPage<StoreVO> findByConditionPage(StoreSearchParams storeSearchParams, PageVO page) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.lili.modules.wallet.entity.dos;
|
||||
|
||||
import cn.lili.modules.wallet.entity.dto.MemberWalletUpdateDTO;
|
||||
import cn.lili.modules.wallet.entity.enums.DepositServiceTypeEnum;
|
||||
import cn.lili.mybatis.BaseIdEntity;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
@ -64,17 +65,30 @@ public class WalletLog extends BaseIdEntity {
|
||||
/**
|
||||
* 构建新的预存款日志对象
|
||||
*
|
||||
* @param memberId 会员id
|
||||
* @param memberName 会员名称
|
||||
* @param money 金额
|
||||
* @param detail 备注
|
||||
* @param memberName 会员名称
|
||||
* @param memberWalletUpdateDTO 变动模型
|
||||
*/
|
||||
public WalletLog(String memberId, String memberName, Double money, String detail, String serviceType) {
|
||||
this.setMemberId(memberId);
|
||||
public WalletLog(String memberName, MemberWalletUpdateDTO memberWalletUpdateDTO) {
|
||||
this.setMemberId(memberWalletUpdateDTO.getMemberId());
|
||||
this.setMemberName(memberName);
|
||||
this.setMoney(money);
|
||||
this.setDetail(detail);
|
||||
this.setServiceType(serviceType);
|
||||
this.setMoney(memberWalletUpdateDTO.getMoney());
|
||||
this.setDetail(memberWalletUpdateDTO.getDetail());
|
||||
this.setServiceType(memberWalletUpdateDTO.getServiceType());
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建新的预存款日志对象
|
||||
*
|
||||
* @param memberName 会员名称
|
||||
* @param memberWalletUpdateDTO 变动模型
|
||||
* @param isReduce 是否是消费
|
||||
*/
|
||||
public WalletLog(String memberName, MemberWalletUpdateDTO memberWalletUpdateDTO, boolean isReduce) {
|
||||
this.setMemberId(memberWalletUpdateDTO.getMemberId());
|
||||
this.setMemberName(memberName);
|
||||
this.setMoney(isReduce ? -memberWalletUpdateDTO.getMoney() : memberWalletUpdateDTO.getMoney());
|
||||
this.setDetail(memberWalletUpdateDTO.getDetail());
|
||||
this.setServiceType(memberWalletUpdateDTO.getServiceType());
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package cn.lili.modules.wallet.entity.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 会员余额变动模型
|
||||
*
|
||||
* @author Chopper
|
||||
* @version v1.0
|
||||
* 2021-12-01 09:35
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class MemberWalletUpdateDTO {
|
||||
|
||||
@ApiModelProperty(value = "变动金额")
|
||||
private Double money;
|
||||
@ApiModelProperty(value = "变动会员id")
|
||||
private String memberId;
|
||||
@ApiModelProperty(value = "日志详情")
|
||||
private String detail;
|
||||
|
||||
/**
|
||||
* @see cn.lili.modules.wallet.entity.enums.DepositServiceTypeEnum
|
||||
*/
|
||||
@ApiModelProperty(value = "变动业务原因")
|
||||
private String serviceType;
|
||||
}
|
@ -4,6 +4,7 @@ package cn.lili.modules.wallet.service;
|
||||
import cn.lili.modules.member.entity.dos.Member;
|
||||
import cn.lili.modules.wallet.entity.dos.MemberWallet;
|
||||
import cn.lili.modules.wallet.entity.dos.MemberWithdrawApply;
|
||||
import cn.lili.modules.wallet.entity.dto.MemberWalletUpdateDTO;
|
||||
import cn.lili.modules.wallet.entity.vo.MemberWalletVO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
@ -26,57 +27,42 @@ public interface MemberWalletService extends IService<MemberWallet> {
|
||||
/**
|
||||
* 增加用户预存款余额
|
||||
*
|
||||
* @param money 金额
|
||||
* @param memberId 会员id
|
||||
* @param serviceType 业务类型 @see DepositServiceTypeEnum
|
||||
* @param detail 操作描述
|
||||
* @return 返回增加结果 true:增加成功 false:增加失败
|
||||
* @param memberWalletUpdateDTO 变动模型
|
||||
* @return 返回增加结果 true:成功 false:失败
|
||||
*/
|
||||
Boolean increase(Double money, String memberId, String detail, String serviceType);
|
||||
Boolean increase(MemberWalletUpdateDTO memberWalletUpdateDTO);
|
||||
|
||||
/**
|
||||
* 从冻结金额到余额
|
||||
*
|
||||
* @param money 金额
|
||||
* @param memberId 会员id
|
||||
* @param serviceType 业务类型 @see DepositServiceTypeEnum
|
||||
* @param detail 操作描述
|
||||
* @return 返回增加结果 true:增加成功 false:增加失败
|
||||
* @param memberWalletUpdateDTO 变动模型
|
||||
* @return 返回冻结结果 true:成功 false:失败
|
||||
*/
|
||||
Boolean increaseWithdrawal(Double money, String memberId, String detail, String serviceType);
|
||||
Boolean increaseWithdrawal(MemberWalletUpdateDTO memberWalletUpdateDTO);
|
||||
|
||||
/**
|
||||
* 扣减用户预存款余额
|
||||
*
|
||||
* @param money 金额
|
||||
* @param memberId 会员id
|
||||
* @param detail 操作描述
|
||||
* @param serviceType 业务类型 @see DepositServiceTypeEnum
|
||||
* @return 操作状态
|
||||
* @param memberWalletUpdateDTO 变动模型
|
||||
* @return 操作状态 true:成功 false:失败
|
||||
*/
|
||||
Boolean reduce(Double money, String memberId, String detail, String serviceType);
|
||||
Boolean reduce(MemberWalletUpdateDTO memberWalletUpdateDTO);
|
||||
|
||||
/**
|
||||
* 提现扣减余额到冻结金额
|
||||
*
|
||||
* @param money 金额
|
||||
* @param memberId 会员id
|
||||
* @param detail 操作描述
|
||||
* @param serviceType 业务类型 @see DepositServiceTypeEnum
|
||||
* @return 操作状态
|
||||
* @param memberWalletUpdateDTO 变动模型
|
||||
* @return 操作状态 true:成功 false:失败
|
||||
*/
|
||||
Boolean reduceWithdrawal(Double money, String memberId, String detail, String serviceType);
|
||||
Boolean reduceWithdrawal(MemberWalletUpdateDTO memberWalletUpdateDTO);
|
||||
|
||||
/**
|
||||
* 提现扣减冻结金额
|
||||
*
|
||||
* @param money 金额
|
||||
* @param memberId 会员id
|
||||
* @param detail 操作描述
|
||||
* @param serviceType 类型
|
||||
* @param memberWalletUpdateDTO 变动模型
|
||||
* @return 操作状态
|
||||
*/
|
||||
Boolean reduceFrozen(Double money, String memberId, String detail, String serviceType);
|
||||
Boolean reduceFrozen(MemberWalletUpdateDTO memberWalletUpdateDTO);
|
||||
|
||||
/**
|
||||
* 设置支付密码
|
||||
|
@ -12,6 +12,7 @@ import cn.lili.common.utils.StringUtils;
|
||||
import cn.lili.modules.member.entity.dos.Member;
|
||||
import cn.lili.modules.wallet.entity.dos.MemberWallet;
|
||||
import cn.lili.modules.wallet.entity.dos.MemberWithdrawApply;
|
||||
import cn.lili.modules.wallet.entity.dto.MemberWalletUpdateDTO;
|
||||
import cn.lili.modules.wallet.entity.dto.MemberWithdrawalMessage;
|
||||
import cn.lili.modules.wallet.entity.enums.MemberWithdrawalDestinationEnum;
|
||||
import cn.lili.modules.wallet.entity.enums.WithdrawStatusEnum;
|
||||
@ -94,82 +95,82 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean increaseWithdrawal(Double money, String memberId, String detail, String serviceType) {
|
||||
public Boolean increaseWithdrawal(MemberWalletUpdateDTO memberWalletUpdateDTO) {
|
||||
//检测会员预存款讯息是否存在,如果不存在则新建
|
||||
MemberWallet memberWallet = this.checkMemberWallet(memberId);
|
||||
MemberWallet memberWallet = this.checkMemberWallet(memberWalletUpdateDTO.getMemberId());
|
||||
//余额变动
|
||||
memberWallet.setMemberWallet(CurrencyUtil.add(memberWallet.getMemberWallet(), money));
|
||||
memberWallet.setMemberFrozenWallet(CurrencyUtil.sub(memberWallet.getMemberFrozenWallet(), money));
|
||||
memberWallet.setMemberWallet(CurrencyUtil.add(memberWallet.getMemberWallet(), memberWalletUpdateDTO.getMoney()));
|
||||
memberWallet.setMemberFrozenWallet(CurrencyUtil.sub(memberWallet.getMemberFrozenWallet(), memberWalletUpdateDTO.getMoney()));
|
||||
this.updateById(memberWallet);
|
||||
//新增预存款日志
|
||||
WalletLog walletLog = new WalletLog(memberWallet.getMemberId(), memberWallet.getMemberName(), money, detail, serviceType);
|
||||
WalletLog walletLog = new WalletLog(memberWallet.getMemberName(), memberWalletUpdateDTO);
|
||||
walletLogService.save(walletLog);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean increase(Double money, String memberId, String detail, String serviceType) {
|
||||
public Boolean increase(MemberWalletUpdateDTO memberWalletUpdateDTO) {
|
||||
//检测会员预存款讯息是否存在,如果不存在则新建
|
||||
MemberWallet memberWallet = this.checkMemberWallet(memberId);
|
||||
MemberWallet memberWallet = this.checkMemberWallet(memberWalletUpdateDTO.getMemberId());
|
||||
//新增预存款
|
||||
memberWallet.setMemberWallet(CurrencyUtil.add(memberWallet.getMemberWallet(), money));
|
||||
memberWallet.setMemberWallet(CurrencyUtil.add(memberWallet.getMemberWallet(), memberWalletUpdateDTO.getMoney()));
|
||||
this.baseMapper.updateById(memberWallet);
|
||||
//新增预存款日志
|
||||
WalletLog walletLog = new WalletLog(memberWallet.getMemberId(), memberWallet.getMemberName(), money, detail, serviceType);
|
||||
WalletLog walletLog = new WalletLog(memberWallet.getMemberName(), memberWalletUpdateDTO);
|
||||
walletLogService.save(walletLog);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean reduce(Double money, String memberId, String detail, String serviceType) {
|
||||
public Boolean reduce(MemberWalletUpdateDTO memberWalletUpdateDTO) {
|
||||
//检测会员预存款讯息是否存在,如果不存在则新建
|
||||
MemberWallet memberWallet = this.checkMemberWallet(memberId);
|
||||
MemberWallet memberWallet = this.checkMemberWallet(memberWalletUpdateDTO.getMemberId());
|
||||
//减少预存款,需要校验 如果不够扣减预存款
|
||||
if (0 > CurrencyUtil.sub(memberWallet.getMemberWallet(), money)) {
|
||||
if (0 > CurrencyUtil.sub(memberWallet.getMemberWallet(), memberWalletUpdateDTO.getMoney())) {
|
||||
return false;
|
||||
}
|
||||
memberWallet.setMemberWallet(CurrencyUtil.sub(memberWallet.getMemberWallet(), money));
|
||||
memberWallet.setMemberWallet(CurrencyUtil.sub(memberWallet.getMemberWallet(), memberWalletUpdateDTO.getMoney()));
|
||||
//保存记录
|
||||
this.updateById(memberWallet);
|
||||
//新增预存款日志
|
||||
WalletLog walletLog = new WalletLog(memberWallet.getMemberId(), memberWallet.getMemberName(), -money, detail, serviceType);
|
||||
WalletLog walletLog = new WalletLog(memberWallet.getMemberName(), memberWalletUpdateDTO, true);
|
||||
walletLogService.save(walletLog);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean reduceWithdrawal(Double money, String memberId, String detail, String serviceType) {
|
||||
public Boolean reduceWithdrawal(MemberWalletUpdateDTO memberWalletUpdateDTO) {
|
||||
//检测会员预存款讯息是否存在,如果不存在则新建
|
||||
MemberWallet memberWallet = this.checkMemberWallet(memberId);
|
||||
MemberWallet memberWallet = this.checkMemberWallet(memberWalletUpdateDTO.getMemberId());
|
||||
//减少预存款,需要校验 如果不够扣减预存款
|
||||
if (0 > CurrencyUtil.sub(memberWallet.getMemberWallet(), money)) {
|
||||
if (0 > CurrencyUtil.sub(memberWallet.getMemberWallet(), memberWalletUpdateDTO.getMoney())) {
|
||||
throw new ServiceException(ResultCode.WALLET_WITHDRAWAL_INSUFFICIENT);
|
||||
}
|
||||
memberWallet.setMemberWallet(CurrencyUtil.sub(memberWallet.getMemberWallet(), money));
|
||||
memberWallet.setMemberFrozenWallet(CurrencyUtil.add(memberWallet.getMemberFrozenWallet(), money));
|
||||
memberWallet.setMemberWallet(CurrencyUtil.sub(memberWallet.getMemberWallet(), memberWalletUpdateDTO.getMoney()));
|
||||
memberWallet.setMemberFrozenWallet(CurrencyUtil.add(memberWallet.getMemberFrozenWallet(), memberWalletUpdateDTO.getMoney()));
|
||||
//修改余额
|
||||
this.updateById(memberWallet);
|
||||
//新增预存款日志
|
||||
WalletLog walletLog = new WalletLog(memberWallet.getMemberId(), memberWallet.getMemberName(), -money, detail, serviceType);
|
||||
WalletLog walletLog = new WalletLog(memberWallet.getMemberName(), memberWalletUpdateDTO, true);
|
||||
walletLogService.save(walletLog);
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean reduceFrozen(Double money, String memberId, String detail, String serviceType) {
|
||||
public Boolean reduceFrozen(MemberWalletUpdateDTO memberWalletUpdateDTO) {
|
||||
//检测会员预存款讯息是否存在,如果不存在则新建
|
||||
MemberWallet memberWallet = this.checkMemberWallet(memberId);
|
||||
MemberWallet memberWallet = this.checkMemberWallet(memberWalletUpdateDTO.getMemberId());
|
||||
//校验此金额是否超过冻结金额
|
||||
if (0 > CurrencyUtil.sub(memberWallet.getMemberWallet(), money)) {
|
||||
if (0 > CurrencyUtil.sub(memberWallet.getMemberWallet(), memberWalletUpdateDTO.getMoney())) {
|
||||
throw new ServiceException(ResultCode.WALLET_WITHDRAWAL_INSUFFICIENT);
|
||||
}
|
||||
memberWallet.setMemberFrozenWallet(CurrencyUtil.sub(memberWallet.getMemberFrozenWallet(), money));
|
||||
memberWallet.setMemberFrozenWallet(CurrencyUtil.sub(memberWallet.getMemberFrozenWallet(), memberWalletUpdateDTO.getMoney()));
|
||||
this.updateById(memberWallet);
|
||||
//新增预存款日志
|
||||
WalletLog walletLog = new WalletLog(memberWallet.getMemberId(), memberWallet.getMemberName(), -money, "提现金额已冻结,审核通过提现成功", serviceType);
|
||||
WalletLog walletLog = new WalletLog(memberWallet.getMemberName(), memberWalletUpdateDTO, true);
|
||||
walletLogService.save(walletLog);
|
||||
return true;
|
||||
}
|
||||
@ -273,12 +274,12 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
|
||||
//微信零钱提现
|
||||
Boolean result = withdrawal(memberWithdrawApply);
|
||||
if (result) {
|
||||
this.reduce(price, authUser.getId(), "余额提现成功", DepositServiceTypeEnum.WALLET_WITHDRAWAL.name());
|
||||
this.reduce(new MemberWalletUpdateDTO(price, authUser.getId(), "余额提现成功", DepositServiceTypeEnum.WALLET_WITHDRAWAL.name()));
|
||||
}
|
||||
} else {
|
||||
memberWithdrawalMessage.setStatus(WithdrawStatusEnum.APPLY.name());
|
||||
//扣减余额到冻结金额
|
||||
this.reduceWithdrawal(price, authUser.getId(), "提现金额已冻结,审核成功后到账", DepositServiceTypeEnum.WALLET_WITHDRAWAL.name());
|
||||
this.reduceWithdrawal(new MemberWalletUpdateDTO(price, authUser.getId(), "提现金额已冻结,审核成功后到账", DepositServiceTypeEnum.WALLET_WITHDRAWAL.name()));
|
||||
}
|
||||
//发送余额提现申请消息
|
||||
|
||||
|
@ -4,6 +4,7 @@ package cn.lili.modules.wallet.serviceimpl;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.properties.RocketmqCustomProperties;
|
||||
import cn.lili.modules.wallet.entity.dto.MemberWalletUpdateDTO;
|
||||
import cn.lili.modules.wallet.entity.dto.MemberWithdrawalMessage;
|
||||
import cn.lili.modules.wallet.entity.enums.MemberWithdrawalDestinationEnum;
|
||||
import cn.lili.mybatis.util.PageUtil;
|
||||
@ -75,7 +76,9 @@ public class MemberWithdrawApplyServiceImpl extends ServiceImpl<MemberWithdrawAp
|
||||
//保存修改审核记录
|
||||
this.updateById(memberWithdrawApply);
|
||||
//记录日志
|
||||
memberWalletService.reduceFrozen(memberWithdrawApply.getApplyMoney(), memberWithdrawApply.getMemberId(), "审核通过,余额提现", DepositServiceTypeEnum.WALLET_WITHDRAWAL.name());
|
||||
memberWalletService.reduceFrozen(
|
||||
new MemberWalletUpdateDTO(memberWithdrawApply.getApplyMoney(), memberWithdrawApply.getMemberId(), "审核通过,余额提现", DepositServiceTypeEnum.WALLET_WITHDRAWAL.name()))
|
||||
;
|
||||
} else {
|
||||
//如果提现失败则无法审核
|
||||
throw new ServiceException(ResultCode.WALLET_APPLY_ERROR);
|
||||
@ -90,7 +93,7 @@ public class MemberWithdrawApplyServiceImpl extends ServiceImpl<MemberWithdrawAp
|
||||
//保存修改审核记录
|
||||
this.updateById(memberWithdrawApply);
|
||||
//需要从冻结金额扣减到余额
|
||||
memberWalletService.increaseWithdrawal(memberWithdrawApply.getApplyMoney(), memberWithdrawApply.getMemberId(), "审核拒绝,提现金额解冻到余额", DepositServiceTypeEnum.WALLET_WITHDRAWAL.name());
|
||||
memberWalletService.increaseWithdrawal(new MemberWalletUpdateDTO(memberWithdrawApply.getApplyMoney(), memberWithdrawApply.getMemberId(), "审核拒绝,提现金额解冻到余额", DepositServiceTypeEnum.WALLET_WITHDRAWAL.name()));
|
||||
}
|
||||
//发送审核消息
|
||||
memberWithdrawalMessage.setMemberId(memberWithdrawApply.getMemberId());
|
||||
|
@ -5,6 +5,7 @@ import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.security.AuthUser;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.modules.wallet.entity.dto.MemberWalletUpdateDTO;
|
||||
import cn.lili.mybatis.util.PageUtil;
|
||||
import cn.lili.common.utils.SnowFlake;
|
||||
import cn.lili.common.utils.StringUtils;
|
||||
@ -90,7 +91,7 @@ public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> i
|
||||
//执行保存操作
|
||||
this.updateById(recharge);
|
||||
//增加预存款余额
|
||||
memberWalletService.increase(recharge.getRechargeMoney(), recharge.getMemberId(), "会员余额充值,充值单号为:" + recharge.getRechargeSn(), DepositServiceTypeEnum.WALLET_RECHARGE.name());
|
||||
memberWalletService.increase(new MemberWalletUpdateDTO(recharge.getRechargeMoney(), recharge.getMemberId(), "会员余额充值,充值单号为:" + recharge.getRechargeSn(), DepositServiceTypeEnum.WALLET_RECHARGE.name()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@ import cn.lili.modules.member.entity.dto.MemberAddDTO;
|
||||
import cn.lili.modules.member.entity.vo.MemberSearchVO;
|
||||
import cn.lili.modules.member.entity.vo.MemberVO;
|
||||
import cn.lili.modules.member.service.MemberService;
|
||||
import cn.lili.modules.system.aspect.annotation.DemoSite;
|
||||
import cn.lili.common.aop.annotation.DemoSite;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package cn.lili.controller.member;
|
||||
package cn.lili.controller.message;
|
||||
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
@ -1,4 +1,4 @@
|
||||
package cn.lili.controller.member;
|
||||
package cn.lili.controller.message;
|
||||
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.mybatis.util.PageUtil;
|
@ -1,4 +1,4 @@
|
||||
package cn.lili.controller.member;
|
||||
package cn.lili.controller.message;
|
||||
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.security.context.UserContext;
|
@ -1,4 +1,4 @@
|
||||
package cn.lili.controller.member;
|
||||
package cn.lili.controller.message;
|
||||
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.mybatis.util.PageUtil;
|
@ -3,12 +3,11 @@ package cn.lili.controller.other;
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.system.aspect.annotation.DemoSite;
|
||||
import cn.lili.common.aop.annotation.DemoSite;
|
||||
import cn.lili.modules.page.entity.dos.PageData;
|
||||
import cn.lili.modules.page.entity.dto.PageDataDTO;
|
||||
import cn.lili.modules.page.entity.vos.PageDataListVO;
|
||||
import cn.lili.modules.page.service.PageDataService;
|
||||
import cn.lili.modules.system.aspect.annotation.DemoSite;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
|
@ -4,7 +4,7 @@ import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.common.vo.SearchVO;
|
||||
import cn.lili.modules.system.aspect.annotation.DemoSite;
|
||||
import cn.lili.common.aop.annotation.DemoSite;
|
||||
import cn.lili.modules.verification.entity.dos.VerificationSource;
|
||||
import cn.lili.modules.verification.service.VerificationSourceService;
|
||||
import cn.lili.mybatis.util.PageUtil;
|
||||
|
@ -17,7 +17,7 @@ import cn.lili.modules.permission.entity.dto.AdminUserDTO;
|
||||
import cn.lili.modules.permission.entity.vo.AdminUserVO;
|
||||
import cn.lili.modules.permission.service.AdminUserService;
|
||||
import cn.lili.modules.permission.service.DepartmentService;
|
||||
import cn.lili.modules.system.aspect.annotation.DemoSite;
|
||||
import cn.lili.common.aop.annotation.DemoSite;
|
||||
import cn.lili.modules.verification.entity.enums.VerificationEnums;
|
||||
import cn.lili.modules.verification.service.VerificationService;
|
||||
import cn.lili.mybatis.util.PageUtil;
|
||||
|
@ -6,7 +6,7 @@ import cn.lili.modules.permission.entity.dos.Menu;
|
||||
import cn.lili.modules.permission.entity.dto.MenuSearchParams;
|
||||
import cn.lili.modules.permission.entity.vo.MenuVO;
|
||||
import cn.lili.modules.permission.service.MenuService;
|
||||
import cn.lili.modules.system.aspect.annotation.DemoSite;
|
||||
import cn.lili.common.aop.annotation.DemoSite;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
@ -2,7 +2,7 @@ package cn.lili.controller.setting;
|
||||
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.system.aspect.annotation.DemoSite;
|
||||
import cn.lili.common.aop.annotation.DemoSite;
|
||||
import cn.lili.modules.system.service.RegionService;
|
||||
import cn.lili.modules.system.entity.dos.Region;
|
||||
import io.swagger.annotations.Api;
|
||||
|
@ -5,7 +5,7 @@ import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.system.aspect.annotation.DemoSite;
|
||||
import cn.lili.common.aop.annotation.DemoSite;
|
||||
import cn.lili.modules.system.entity.dos.Setting;
|
||||
import cn.lili.modules.system.entity.dto.*;
|
||||
import cn.lili.modules.system.entity.dto.connect.QQConnectSetting;
|
||||
|
@ -4,6 +4,7 @@ import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.order.order.entity.dos.StoreFlow;
|
||||
import cn.lili.modules.order.order.service.StoreFlowService;
|
||||
import cn.lili.modules.store.entity.dos.Bill;
|
||||
import cn.lili.modules.store.entity.dto.BillSearchParams;
|
||||
import cn.lili.modules.store.entity.vos.BillListVO;
|
||||
@ -31,6 +32,9 @@ public class BillManagerController {
|
||||
@Autowired
|
||||
private BillService billService;
|
||||
|
||||
@Autowired
|
||||
private StoreFlowService storeFlowService;
|
||||
|
||||
@ApiOperation(value = "通过id获取结算单")
|
||||
@ApiImplicitParam(name = "id", value = "结算单ID", required = true, paramType = "path")
|
||||
@GetMapping(value = "/get/{id}")
|
||||
@ -51,7 +55,7 @@ public class BillManagerController {
|
||||
})
|
||||
@GetMapping(value = "/{id}/getStoreFlow")
|
||||
public ResultMessage<IPage<StoreFlow>> getStoreFlow(@PathVariable String id, String flowType, PageVO pageVO) {
|
||||
return ResultUtil.data(billService.getStoreFlow(id, flowType, pageVO));
|
||||
return ResultUtil.data(storeFlowService.getStoreFlow(id, flowType, pageVO));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "支付结算单")
|
||||
|
@ -12,7 +12,7 @@ import cn.lili.modules.store.entity.vos.StoreSearchParams;
|
||||
import cn.lili.modules.store.entity.vos.StoreVO;
|
||||
import cn.lili.modules.store.service.StoreDetailService;
|
||||
import cn.lili.modules.store.service.StoreService;
|
||||
import cn.lili.modules.system.aspect.annotation.DemoSite;
|
||||
import cn.lili.common.aop.annotation.DemoSite;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package cn.lili.controller.settings;
|
||||
package cn.lili.controller.message;
|
||||
|
||||
|
||||
import cn.lili.common.enums.ResultUtil;
|
@ -6,6 +6,7 @@ import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.order.order.entity.dos.StoreFlow;
|
||||
import cn.lili.modules.order.order.service.StoreFlowService;
|
||||
import cn.lili.modules.store.entity.dos.Bill;
|
||||
import cn.lili.modules.store.entity.dto.BillSearchParams;
|
||||
import cn.lili.modules.store.entity.vos.BillListVO;
|
||||
@ -36,6 +37,9 @@ public class BillStoreController {
|
||||
@Autowired
|
||||
private BillService billService;
|
||||
|
||||
@Autowired
|
||||
private StoreFlowService storeFlowService;
|
||||
|
||||
@ApiOperation(value = "获取结算单分页")
|
||||
@GetMapping(value = "/getByPage")
|
||||
public ResultMessage<IPage<BillListVO>> getByPage(BillSearchParams billSearchParams) {
|
||||
@ -59,7 +63,7 @@ public class BillStoreController {
|
||||
@GetMapping(value = "/{id}/getStoreFlow")
|
||||
public ResultMessage<IPage<StoreFlow>> getStoreFlow(@PathVariable String id, String flowType, PageVO pageVO) {
|
||||
OperationalJudgment.judgment(billService.getById(id));
|
||||
return ResultUtil.data(billService.getStoreFlow(id, flowType, pageVO));
|
||||
return ResultUtil.data(storeFlowService.getStoreFlow(id, flowType, pageVO));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取商家分销订单流水分页")
|
||||
@ -69,7 +73,7 @@ public class BillStoreController {
|
||||
@GetMapping(value = "/{id}/getDistributionFlow")
|
||||
public ResultMessage<IPage<StoreFlow>> getDistributionFlow(@PathVariable String id, PageVO pageVO) {
|
||||
OperationalJudgment.judgment(billService.getById(id));
|
||||
return ResultUtil.data(billService.getDistributionFlow(id, pageVO));
|
||||
return ResultUtil.data(storeFlowService.getDistributionFlow(id, pageVO));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "核对结算单")
|
||||
@ -81,13 +85,13 @@ public class BillStoreController {
|
||||
return ResultUtil.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "下载结算单",produces="application/octet-stream")
|
||||
@ApiOperation(value = "下载结算单", produces = "application/octet-stream")
|
||||
@ApiImplicitParam(name = "id", value = "结算单ID", required = true, paramType = "path", dataType = "String")
|
||||
@GetMapping(value = "/downLoad/{id}")
|
||||
public void downLoadDeliverExcel(@PathVariable String id) {
|
||||
OperationalJudgment.judgment(billService.getById(id));
|
||||
HttpServletResponse response = ThreadContextHolder.getHttpResponse();
|
||||
billService.download(response,id);
|
||||
billService.download(response, id);
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user