Compare commits
No commits in common. "b24c6d315750f3dded4b5fc6a60c8be284c5d7e4" and "a521d1c674ef67ec5bfd9cf93dd4d4fe48a9ab85" have entirely different histories.
b24c6d3157
...
a521d1c674
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user