Compare commits

..

11 Commits

Author SHA1 Message Date
khy
0621b9823b 交易订单 2024-10-25 17:46:26 +08:00
khy
35cea73266 Merge branch 'master' of http://101.43.112.107:3000/root/allLikeMall into khy1 2024-10-25 16:42:50 +08:00
b24c6d3157 Merge pull request 'sjy-two' (#84) from sjy-two into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #84
2024-10-25 16:39:13 +08:00
khy
36b7469e1e Merge branch 'master' of http://101.43.112.107:3000/root/allLikeMall into khy1 2024-10-25 16:38:55 +08:00
67459fe554 Merge branch 'master' of http://101.43.112.107:3000/root/allLikeMall into sjy-two 2024-10-25 16:23:44 +08:00
a521d1c674 Merge pull request '交易订单' (#83) from khy1 into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #83
2024-10-25 16:20:39 +08:00
21a0e43cc1 Merge pull request '新增交易订单' (#82) from khy1 into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #82
2024-10-25 16:16:52 +08:00
c58893d335 Merge branch 'master' of http://101.43.112.107:3000/root/allLikeMall into sjy-two 2024-10-25 16:05:47 +08:00
aa3d6de962 调整积分商城,我的积分数据显示,兑换记录详情 2024-10-25 15:51:43 +08:00
45b6bf142e Merge pull request '支付bug' (#79) from khy1 into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #79
2024-10-25 14:48:48 +08:00
f6b2ffb401 Merge branch 'master' of http://101.43.112.107:3000/root/allLikeMall into sjy-two 2024-10-25 09:18:11 +08:00
12 changed files with 54 additions and 14 deletions

View File

@ -132,10 +132,10 @@ public interface TradeOrderMapper extends BaseMapperX<TradeOrderDO> {
return selectList(wrapperX); return selectList(wrapperX);
} }
@Select(" SELECT a.status,d.label,a.create_time,a.pay_price,a.use_point,c.name,c.pic_url,b.count FROM trade_order a " + @Select(" SELECT a.id,a.status,d.label,a.create_time,a.pay_price,a.use_point,c.name,c.pic_url,b.count FROM trade_order a " +
" inner join trade_order_item b on a.id = b.order_id " + " inner join trade_order_item b on a.id = b.order_id " +
" inner join (SELECT sort, label, value, dict_type, css_class FROM system_dict_data WHERE dict_type = 'trade_order_status') d on d.sort = a.status "+ " inner join (SELECT sort, label, value, dict_type, css_class FROM system_dict_data WHERE dict_type = 'trade_order_status') d on d.sort = a.status "+
" inner join product_spu c on b.spu_id = c.id " + " inner join product_spu c on b.spu_id = c.id " +
" where a.user_id = #{userId} and a.use_point > 0 order by a.create_time ASC ") " where a.user_id = #{userId} and a.use_point > 0 order by a.create_time DESC ")
List<AppPointOrderVO> getPointOrder(Long userId); List<AppPointOrderVO> getPointOrder(Long userId);
} }

View File

@ -21,6 +21,6 @@ public interface TradeMemberUserService {
void updateUserDo(TradeMemberUserDO user); void updateUserDo(TradeMemberUserDO user);
void updateActivate(String cardName); void updateActivate(String cardName,Long userId);
} }

View File

@ -93,8 +93,8 @@ public class TradeMemberUserServiceImpl implements TradeMemberUserService {
} }
@Override @Override
public void updateActivate(String cardName) { public void updateActivate(String cardName,Long userId) {
TradeMemberUserDO tradeMemberUserDO = getUser(getLoginUserId()); TradeMemberUserDO tradeMemberUserDO = getUser(userId);
//设置个人信息的会员状态0未开通1试用2有效期3永久 //设置个人信息的会员状态0未开通1试用2有效期3永久
if(cardName.equals("永久")){ if(cardName.equals("永久")){
tradeMemberUserDO.setActivate(3); tradeMemberUserDO.setActivate(3);

View File

@ -78,7 +78,6 @@ import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionU
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*;
import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.minusTime; import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.minusTime;
import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getClientIP; import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getClientIP;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getTerminal; import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getTerminal;
import static cn.iocoder.yudao.module.trade.enums.ErrorCodeConstants.*; import static cn.iocoder.yudao.module.trade.enums.ErrorCodeConstants.*;
import static cn.iocoder.yudao.module.trade.enums.ErrorCodeConstants.ORDER_NOT_FOUND; import static cn.iocoder.yudao.module.trade.enums.ErrorCodeConstants.ORDER_NOT_FOUND;
@ -338,7 +337,7 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
PayOrderRespDTO payOrder = orderResult.getValue(); PayOrderRespDTO payOrder = orderResult.getValue();
System.out.println("交易订单成功id"+id+"和payOrderId"+payOrderId); System.out.println("交易订单成功id"+id+"和payOrderId"+payOrderId);
//会员用户信息支付状态修改 //会员用户信息支付状态修改
TradeMemberUserDO tradeMemberUserDO = tradeMemberUserService.getUser(getLoginUserId()); TradeMemberUserDO tradeMemberUserDO = tradeMemberUserService.getUser(order.getUserId());
TradePaidMemberUserDO tradePaidMemberUserDO = tradePaidMemberUserService.getByPayOrderId(payOrderId); TradePaidMemberUserDO tradePaidMemberUserDO = tradePaidMemberUserService.getByPayOrderId(payOrderId);
if(tradePaidMemberUserDO != null ){ if(tradePaidMemberUserDO != null ){
System.out.println("进入会员支付修改操作paid"+tradePaidMemberUserDO+"和member"+tradeMemberUserDO); System.out.println("进入会员支付修改操作paid"+tradePaidMemberUserDO+"和member"+tradeMemberUserDO);
@ -355,7 +354,7 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
tradePaidMemberUserService.update(tradePaidMemberUserDO); tradePaidMemberUserService.update(tradePaidMemberUserDO);
System.out.println("成功更新会员订单paid"+tradePaidMemberUserDO); System.out.println("成功更新会员订单paid"+tradePaidMemberUserDO);
//更新用户会员状态 //更新用户会员状态
tradeMemberUserService.updateActivate(tradePaidMemberUserDO.getPayMemberType()); tradeMemberUserService.updateActivate(tradePaidMemberUserDO.getPayMemberType(),order.getUserId());
System.out.println("成功更新用户的会员状态member"+tradeMemberUserDO); System.out.println("成功更新用户的会员状态member"+tradeMemberUserDO);
} }
System.out.println("会员修改操作结束!!!"); System.out.println("会员修改操作结束!!!");

View File

@ -41,4 +41,15 @@ public class AppMemberPointRecordController {
return success(BeanUtils.toBean(pageResult, AppMemberPointRecordRespVO.class)); return success(BeanUtils.toBean(pageResult, AppMemberPointRecordRespVO.class));
} }
@GetMapping("/getPointInfo")
public CommonResult<MemberPointRecordDO> getPointInfo() {
MemberPointRecordDO pointInfo = pointRecordService.getPointInfo(getLoginUserId());
return success(pointInfo);
}
} }

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.member.dal.dataobject.point;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.module.member.enums.point.MemberPointBizTypeEnum; import cn.iocoder.yudao.module.member.enums.point.MemberPointBizTypeEnum;
import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField;
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 lombok.*; import lombok.*;
@ -66,4 +67,13 @@ public class MemberPointRecordDO extends BaseDO {
*/ */
private Integer totalPoint; private Integer totalPoint;
//总共获得的积分
@TableField(exist = false)
private Integer addUp;
//总共消费的积分
@TableField(exist = false)
private Integer reduce;
} }

View File

@ -39,4 +39,6 @@ public interface MemberPointRecordService {
* @param bizId 业务编号 * @param bizId 业务编号
*/ */
void createPointRecord(Long userId, Integer point, MemberPointBizTypeEnum bizType, String bizId); void createPointRecord(Long userId, Integer point, MemberPointBizTypeEnum bizType, String bizId);
MemberPointRecordDO getPointInfo(Long userId);
} }

View File

@ -92,4 +92,24 @@ public class MemberPointRecordServiceImpl implements MemberPointRecordService {
memberPointRecordMapper.insert(record); memberPointRecordMapper.insert(record);
} }
@Override
public MemberPointRecordDO getPointInfo(Long userId) {
List<MemberPointRecordDO> memberPointRecordDOList = memberPointRecordMapper.selectList("user_id", userId);
Integer addUp = 0;
Integer reduce = 0;
for (int i = 0; i < memberPointRecordDOList.size(); i++) {
MemberPointRecordDO memberPointRecordDO = memberPointRecordDOList.get(i);
if (memberPointRecordDO.getPoint() > 0){ //获得积分
addUp = addUp + memberPointRecordDO.getPoint();
}
if (memberPointRecordDO.getPoint() < 0){ //消费积分
reduce = reduce + memberPointRecordDO.getPoint();
}
}
MemberPointRecordDO memberPointRecordDO = new MemberPointRecordDO();
memberPointRecordDO.setAddUp(addUp);
memberPointRecordDO.setReduce(reduce);
return memberPointRecordDO;
}
} }

View File

@ -189,6 +189,6 @@ public interface MemberUserService {
void updateUserDo(MemberUserDO user); void updateUserDo(MemberUserDO user);
void updateActivate(String cardName); void updateActivate(String cardName,Long userId);
} }

View File

@ -38,7 +38,6 @@ import java.util.List;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getClientIP; import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getClientIP;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*; import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*;
/** /**
@ -330,8 +329,8 @@ public class MemberUserServiceImpl implements MemberUserService {
} }
@Override @Override
public void updateActivate(String cardName) { public void updateActivate(String cardName,Long userId) {
MemberUserDO memberUserDO = getUser(getLoginUserId()); MemberUserDO memberUserDO = getUser(userId);
//设置个人信息的会员状态0未开通1试用2有效期3永久 //设置个人信息的会员状态0未开通1试用2有效期3永久
if(cardName.equals("永久")){ if(cardName.equals("永久")){
memberUserDO.setActivate(3); memberUserDO.setActivate(3);

View File

@ -36,7 +36,6 @@ import cn.iocoder.yudao.module.member.dal.mysql.user.PaidMemberUserMapper;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getClientIP; import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getClientIP;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getTerminal; import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getTerminal;
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*; import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*;

View File

@ -186,7 +186,7 @@ public class AppPaidMembeController {
//更新会员订单 //更新会员订单
paidMemberUserService.update(paidMemberUserDO); paidMemberUserService.update(paidMemberUserDO);
//更新用户会员状态 //更新用户会员状态
memberUserService.updateActivate(paidMemberUserDO.getPayMemberType()); memberUserService.updateActivate(paidMemberUserDO.getPayMemberType(),getLoginUserId());
// return success(PayMemberOrderConvert.INSTANCE.convert(paidMemberUserDO.getId(),payOrderId // return success(PayMemberOrderConvert.INSTANCE.convert(paidMemberUserDO.getId(),payOrderId
// ,paidMemberUserDO.getCardExpirationTime(),memberUserDO.getActivate())); // ,paidMemberUserDO.getCardExpirationTime(),memberUserDO.getActivate()));
return success(true); return success(true);