Commit 7fd2097c authored by zhangfeng's avatar zhangfeng

客户端兑换记录

parent 62f23b58
......@@ -4,13 +4,15 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.reward.api.reward.RedeemRewardApi;
import cn.iocoder.yudao.module.reward.api.reward.dto.RedeemRewardReqVO;
import cn.iocoder.yudao.module.reward.api.reward.dto.RedeemRewardRespDTO;
import cn.iocoder.yudao.module.reward.controller.app.redeem.vo.AppRewardRedeemDetailReqVO;
import cn.iocoder.yudao.module.reward.controller.app.redeem.vo.AppRewardRedeemDetailRespVO;
import cn.iocoder.yudao.module.reward.controller.app.redeem.vo.AppRewardRedeemListRespVO;
import cn.iocoder.yudao.module.reward.controller.app.redeem.vo.AppRewardRedeemReqVO;
import cn.iocoder.yudao.module.reward.service.redeem.RewardRedeemService;
import cn.iocoder.yudao.module.reward.vo.reward.RewardRedeemBaseVO;
import cn.iocoder.yudao.module.reward.vo.reward.RewardRedeemPageRespVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -19,7 +21,6 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
......@@ -38,15 +39,23 @@ public class AppRedeemRewardController {
@PostMapping("record/list")
@ApiOperation("兑换记录列表")
//@PreAuthenticated
public CommonResult<List<AppRewardRedeemListRespVO>> recordList(@Valid @RequestBody RewardRedeemBaseVO request) {
public CommonResult<List<AppRewardRedeemListRespVO>> recordList(@Valid @RequestBody AppRewardRedeemReqVO request) {
return success(rewardRedeemService.recordList(request.getMemberId()));
}
@PostMapping("record/detail")
@ApiOperation("兑换详情")
//@PreAuthenticated
public CommonResult<RewardRedeemPageRespVO> detail(@Valid @RequestBody RewardRedeemBaseVO request) {
return success(rewardRedeemService.detail(request.getId()));
public CommonResult<AppRewardRedeemDetailRespVO> detail(@Valid @RequestBody AppRewardRedeemDetailReqVO request) {
RewardRedeemPageRespVO detail = rewardRedeemService.detail(request.getRedeemId());
if (detail != null) {
AppRewardRedeemDetailRespVO appRewardRedeemDetailRespVO = new AppRewardRedeemDetailRespVO();
BeanUtils.copyProperties(detail, appRewardRedeemDetailRespVO);
return success(appRewardRedeemDetailRespVO);
}
return null;
}
@PostMapping("/single")
@ApiOperation("兑换礼品")
//@PreAuthenticated
......
package cn.iocoder.yudao.module.reward.controller.app.redeem.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
@ApiModel("客户端 - 礼品兑换记录详情 req VO")
public class AppRewardRedeemDetailReqVO {
@ApiModelProperty(value = "兑换记录id")
@NotNull(message = "兑换记录id不能为空")
private Long redeemId;
}
package cn.iocoder.yudao.module.reward.controller.app.redeem.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@ApiModel("客户端 - 礼品兑换记录详情 resp VO")
public class AppRewardRedeemDetailRespVO {
@ApiModelProperty(value = "id")
private Long id;
@ApiModelProperty(value = "会员id")
private Long memberId;
@ApiModelProperty(value = "礼品id")
private Long rewardId;
@ApiModelProperty(value = "兑换状态")
private Integer status;
@ApiModelProperty(value = "兑换积分")
private Integer totalCount;
@ApiModelProperty(value = "礼品名称(中文)")
private String rewardTitleZh;
@ApiModelProperty(value = "礼品名称(英文)")
private String rewardTitleEn;
@ApiModelProperty(value = "兑换数量")
private Integer rewardCount;
@ApiModelProperty(value = "活动开始日期")
private Date startTime;
@ApiModelProperty(value = "活动结束日期")
private Date endTime;
@ApiModelProperty(value = "兑换方式")
private Integer redeemType;
@ApiModelProperty(value = "兑换网点(中文)")
private String nodeTitleZh;
@ApiModelProperty(value = "兑换网点(英文)")
private String nodeTitleEn;
@ApiModelProperty(value = "收件人姓名")
private String recipientName;
@ApiModelProperty(value = "收件人电话")
private String recipientPhoneNum;
@ApiModelProperty(value = "收件人地址")
private String recipientAddress;
@ApiModelProperty(value = "快递日期")
private Date expressDate;
@ApiModelProperty(value = "快递公司名称")
private String courierCompanyName;
@ApiModelProperty(value = "快递单号")
private String expressNo;
@ApiModelProperty(value = "备注")
private String remark;
}
package cn.iocoder.yudao.module.reward.controller.app.redeem.vo;
import cn.iocoder.yudao.module.reward.vo.reward.RewardRedeemBaseVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -14,7 +13,7 @@ import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Data
@ApiModel("客户端 - 礼品兑换记录列表 VO")
@ApiModel("客户端 - 礼品兑换记录列表 resp VO")
@Builder
@AllArgsConstructor
@NoArgsConstructor
......
package cn.iocoder.yudao.module.reward.controller.app.redeem.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
@ApiModel("客户端 - 礼品兑换记录列表 req VO")
public class AppRewardRedeemReqVO {
@ApiModelProperty(value = "会员id")
@NotNull(message = "会员id不能为空")
private Long memberId;
}
......@@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
@Data
@ApiModel("管理后台 - 礼品兑换记录分页结果 VO")
@EqualsAndHashCode(callSuper = true)
......@@ -40,4 +42,9 @@ public class RewardRedeemPageRespVO extends RewardRedeemBaseVO {
private Integer holdScore;
private Integer pointsRequire;
@ApiModelProperty(value = "活动开始日期")
private Date startTime;
@ApiModelProperty(value = "活动结束日期")
private Date endTime;
}
......@@ -41,6 +41,8 @@
select
mus.hold_score as holdScore,
er.points_require as pointsRequire,
er.start_time as startTime,
er.end_time as endTime,
<include refid="columns"/>
from ecw_reward_redeem err
left join ecw_reward er on err.reward_id = er.id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment