Compare commits
No commits in common. "0621b9823b011f19df716e5a74c91a60d248153b" and "a163a6490f8b89185402b576e86df0a363ed3318" have entirely different histories.
0621b9823b
...
a163a6490f
@ -132,10 +132,10 @@ public interface TradeOrderMapper extends BaseMapperX<TradeOrderDO> {
|
||||
return selectList(wrapperX);
|
||||
}
|
||||
|
||||
@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 " +
|
||||
@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 " +
|
||||
" 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 product_spu c on b.spu_id = c.id " +
|
||||
" where a.user_id = #{userId} and a.use_point > 0 order by a.create_time DESC ")
|
||||
" where a.user_id = #{userId} and a.use_point > 0 order by a.create_time ASC ")
|
||||
List<AppPointOrderVO> getPointOrder(Long userId);
|
||||
}
|
||||
|
@ -21,6 +21,6 @@ public interface TradeMemberUserService {
|
||||
|
||||
void updateUserDo(TradeMemberUserDO user);
|
||||
|
||||
void updateActivate(String cardName,Long userId);
|
||||
void updateActivate(String cardName);
|
||||
|
||||
}
|
||||
|
@ -93,8 +93,8 @@ public class TradeMemberUserServiceImpl implements TradeMemberUserService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateActivate(String cardName,Long userId) {
|
||||
TradeMemberUserDO tradeMemberUserDO = getUser(userId);
|
||||
public void updateActivate(String cardName) {
|
||||
TradeMemberUserDO tradeMemberUserDO = getUser(getLoginUserId());
|
||||
//设置个人信息的会员状态,0:未开通,1试用,2有效期,3永久
|
||||
if(cardName.equals("永久")){
|
||||
tradeMemberUserDO.setActivate(3);
|
||||
|
@ -78,6 +78,7 @@ 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.date.LocalDateTimeUtils.minusTime;
|
||||
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.module.trade.enums.ErrorCodeConstants.*;
|
||||
import static cn.iocoder.yudao.module.trade.enums.ErrorCodeConstants.ORDER_NOT_FOUND;
|
||||
@ -337,7 +338,7 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
|
||||
PayOrderRespDTO payOrder = orderResult.getValue();
|
||||
System.out.println("交易订单成功id:"+id+"和payOrderId:"+payOrderId);
|
||||
//会员用户信息,支付状态修改
|
||||
TradeMemberUserDO tradeMemberUserDO = tradeMemberUserService.getUser(order.getUserId());
|
||||
TradeMemberUserDO tradeMemberUserDO = tradeMemberUserService.getUser(getLoginUserId());
|
||||
TradePaidMemberUserDO tradePaidMemberUserDO = tradePaidMemberUserService.getByPayOrderId(payOrderId);
|
||||
if(tradePaidMemberUserDO != null ){
|
||||
System.out.println("进入会员支付修改操作paid:"+tradePaidMemberUserDO+"和member:"+tradeMemberUserDO);
|
||||
@ -354,7 +355,7 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
|
||||
tradePaidMemberUserService.update(tradePaidMemberUserDO);
|
||||
System.out.println("成功更新会员订单paid:"+tradePaidMemberUserDO);
|
||||
//更新用户会员状态
|
||||
tradeMemberUserService.updateActivate(tradePaidMemberUserDO.getPayMemberType(),order.getUserId());
|
||||
tradeMemberUserService.updateActivate(tradePaidMemberUserDO.getPayMemberType());
|
||||
System.out.println("成功更新用户的会员状态member:"+tradeMemberUserDO);
|
||||
}
|
||||
System.out.println("会员修改操作结束!!!");
|
||||
|
@ -41,15 +41,4 @@ public class AppMemberPointRecordController {
|
||||
return success(BeanUtils.toBean(pageResult, AppMemberPointRecordRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("/getPointInfo")
|
||||
public CommonResult<MemberPointRecordDO> getPointInfo() {
|
||||
MemberPointRecordDO pointInfo = pointRecordService.getPointInfo(getLoginUserId());
|
||||
return success(pointInfo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.member.dal.dataobject.point;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.module.member.enums.point.MemberPointBizTypeEnum;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
@ -67,13 +66,4 @@ public class MemberPointRecordDO extends BaseDO {
|
||||
*/
|
||||
private Integer totalPoint;
|
||||
|
||||
|
||||
//总共获得的积分
|
||||
@TableField(exist = false)
|
||||
private Integer addUp;
|
||||
|
||||
//总共消费的积分
|
||||
@TableField(exist = false)
|
||||
private Integer reduce;
|
||||
|
||||
}
|
||||
|
@ -39,6 +39,4 @@ public interface MemberPointRecordService {
|
||||
* @param bizId 业务编号
|
||||
*/
|
||||
void createPointRecord(Long userId, Integer point, MemberPointBizTypeEnum bizType, String bizId);
|
||||
|
||||
MemberPointRecordDO getPointInfo(Long userId);
|
||||
}
|
||||
|
@ -92,24 +92,4 @@ public class MemberPointRecordServiceImpl implements MemberPointRecordService {
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -189,6 +189,6 @@ public interface MemberUserService {
|
||||
|
||||
void updateUserDo(MemberUserDO user);
|
||||
|
||||
void updateActivate(String cardName,Long userId);
|
||||
void updateActivate(String cardName);
|
||||
|
||||
}
|
||||
|
@ -38,6 +38,7 @@ import java.util.List;
|
||||
|
||||
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.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
@ -329,8 +330,8 @@ public class MemberUserServiceImpl implements MemberUserService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateActivate(String cardName,Long userId) {
|
||||
MemberUserDO memberUserDO = getUser(userId);
|
||||
public void updateActivate(String cardName) {
|
||||
MemberUserDO memberUserDO = getUser(getLoginUserId());
|
||||
//设置个人信息的会员状态,0:未开通,1试用,2有效期,3永久
|
||||
if(cardName.equals("永久")){
|
||||
memberUserDO.setActivate(3);
|
||||
|
@ -36,6 +36,7 @@ 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.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.module.member.enums.ErrorCodeConstants.*;
|
||||
|
||||
|
@ -186,7 +186,7 @@ public class AppPaidMembeController {
|
||||
//更新会员订单
|
||||
paidMemberUserService.update(paidMemberUserDO);
|
||||
//更新用户会员状态
|
||||
memberUserService.updateActivate(paidMemberUserDO.getPayMemberType(),getLoginUserId());
|
||||
memberUserService.updateActivate(paidMemberUserDO.getPayMemberType());
|
||||
// return success(PayMemberOrderConvert.INSTANCE.convert(paidMemberUserDO.getId(),payOrderId
|
||||
// ,paidMemberUserDO.getCardExpirationTime(),memberUserDO.getActivate()));
|
||||
return success(true);
|
||||
|
Loading…
Reference in New Issue
Block a user