Commit 59ad441e authored by zhaobiyan's avatar zhaobiyan

merge

parents 621eb138 bf15ac59
package cn.iocoder.yudao.module.ecw.controller.admin.currency.vo;
package cn.iocoder.yudao.module.ecw.api.vo;
import lombok.*;
import java.math.BigDecimal;
import java.util.*;
import io.swagger.annotations.*;
......
package cn.iocoder.yudao.module.ecw.controller.admin.currency.vo;
import cn.iocoder.yudao.module.ecw.api.vo.CurrencyBaseVO;
import lombok.*;
import io.swagger.annotations.*;
......
package cn.iocoder.yudao.module.ecw.controller.admin.currency.vo;
import cn.iocoder.yudao.module.ecw.api.vo.CurrencyBaseVO;
import lombok.*;
import io.swagger.annotations.*;
......
package cn.iocoder.yudao.module.ecw.controller.admin.currency.vo;
import cn.iocoder.yudao.module.ecw.api.vo.CurrencyBaseVO;
import lombok.*;
import io.swagger.annotations.*;
import javax.validation.constraints.*;
......
package cn.iocoder.yudao.module.member.api.user.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("管理后台 - 会员信息 VO")
public class MemberUserVo {
@ApiModelProperty(value = "会员信息")
private Long id;
private String name;
}
......@@ -36,6 +36,18 @@
<artifactId>yudao-module-member-api</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-system-api</artifactId>
<version>1.6.1-snapshot</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-ecw-api</artifactId>
<version>1.6.1-snapshot</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package cn.iocoder.yudao.module.reward.controller.admin.reward;
package cn.iocoder.yudao.module.reward.controller.admin.redeem;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
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.service.redeem.RewardRedeemService;
import cn.iocoder.yudao.module.reward.vo.reward.RewardRedeemPageReqVO;
import cn.iocoder.yudao.module.reward.vo.reward.RewardRedeemPageRespVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
......@@ -28,6 +33,16 @@ public class RedeemRewardController {
@Resource
private RedeemRewardApi redeemRewardApi;
@Resource
private RewardRedeemService rewardRedeemService;
@PostMapping("record/page")
@ApiOperation("兑换记录列表")
public CommonResult<PageResult<RewardRedeemPageRespVO>> pageInfo(@Valid @RequestBody RewardRedeemPageReqVO reqVO) {
return success(rewardRedeemService.pageInfo(reqVO));
}
@PostMapping("/single")
@ApiOperation("兑换礼品")
//@PreAuthorize("@ss.hasPermission('reward::redeem')")
......
......@@ -2,7 +2,12 @@ package cn.iocoder.yudao.module.reward.dal.mysql.redeem;
import cn.iocoder.yudao.framework.mybatis.core.mapper.AbstractMapper;
import cn.iocoder.yudao.module.reward.dal.dataobject.redeem.RewardRedeemDO;
import cn.iocoder.yudao.module.reward.vo.reward.RewardRedeemPageReqVO;
import cn.iocoder.yudao.module.reward.vo.reward.RewardRedeemPageRespVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 礼品 Mapper
......@@ -11,4 +16,7 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface RewardRedeemMapper extends AbstractMapper<RewardRedeemDO> {
List<RewardRedeemPageRespVO> pageInfo(@Param("start") int start, @Param("size") int size, @Param("req") RewardRedeemPageReqVO reqVO);
int pageCount(@Param("req") RewardRedeemPageReqVO reqVO);
}
package cn.iocoder.yudao.module.reward.service.redeem;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.service.IService;
import cn.iocoder.yudao.module.reward.dal.dataobject.redeem.RewardRedeemDO;
import cn.iocoder.yudao.module.reward.vo.reward.RewardRedeemPageReqVO;
import cn.iocoder.yudao.module.reward.vo.reward.RewardRedeemPageRespVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
* 礼品兑换 Service 接口
......@@ -10,4 +14,5 @@ import cn.iocoder.yudao.module.reward.dal.dataobject.redeem.RewardRedeemDO;
*/
public interface RewardRedeemService extends IService<RewardRedeemDO> {
PageResult<RewardRedeemPageRespVO> pageInfo(RewardRedeemPageReqVO reqVO);
}
package cn.iocoder.yudao.module.reward.service.redeem;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.service.AbstractService;
import cn.iocoder.yudao.framework.mybatis.core.service.IService;
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.module.reward.dal.dataobject.redeem.RewardRedeemDO;
import cn.iocoder.yudao.module.reward.dal.dataobject.reward.RewardDO;
import cn.iocoder.yudao.module.reward.dal.mysql.redeem.RewardRedeemMapper;
import cn.iocoder.yudao.module.reward.dal.mysql.reward.RewardMapper;
import cn.iocoder.yudao.module.reward.service.reward.RewardService;
import cn.iocoder.yudao.module.reward.vo.reward.RewardRedeemPageReqVO;
import cn.iocoder.yudao.module.reward.vo.reward.RewardRedeemPageRespVO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* 礼品兑换 Service
*
......@@ -18,5 +26,15 @@ import org.springframework.stereotype.Service;
@Service
@Slf4j
public class RewardRedeemServiceImpl extends AbstractService<RewardRedeemMapper, RewardRedeemDO> implements RewardRedeemService {
@Resource
private RewardRedeemMapper rewardRedeemMapper;
@Override
public PageResult<RewardRedeemPageRespVO> pageInfo(RewardRedeemPageReqVO reqVO) {
int start = (reqVO.getPageNo() - 1) * reqVO.getPageSize();
int size = reqVO.getPageSize();
List<RewardRedeemPageRespVO > result = rewardRedeemMapper.pageInfo(start, size, reqVO);
int total = rewardRedeemMapper.pageCount(reqVO);
return new PageResult<>(result, total, reqVO.getPageSize(), reqVO.getPageNo(), (total + reqVO.getPageSize() - 1) / reqVO.getPageSize());
}
}
package cn.iocoder.yudao.module.reward.vo.reward;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class RewardRedeemBaseVO {
@ApiModelProperty(value = "id")
private Long id;
/**
* 会员id
*/
@ApiModelProperty(value = "会员id")
private Long memberId;
/**
* 礼品id
*/
@ApiModelProperty(value = "礼品id")
private Long rewardId;
/**
* 兑换状态
*/
@ApiModelProperty(value = "兑换状态")
private Integer status;
/**
* 兑换数量
*/
@ApiModelProperty(value = "兑换数量")
private Integer rewardCount;
/**
* 兑换方式
*/
@ApiModelProperty(value = "兑换方式")
private Integer redeemType;
/**
* 兑换入口
*/
@ApiModelProperty(value = "兑换入口")
private Integer entrance;
/**
* 费用
*/
@ApiModelProperty(value = "费用")
private BigDecimal expenses;
/**
* 币种
*/
@ApiModelProperty(value = "币种")
private Integer currency;
/**
* 收件人姓名
*/
@ApiModelProperty(value = "收件人姓名")
private String recipientName;
/**
* 收件人电话
*/
@ApiModelProperty(value = "收件人电话")
private String recipientPhoneNum;
/**
* 收件人地址
*/
@ApiModelProperty(value = "收件人地址")
private String recipientAddress;
/**
* 兑换人
*/
@ApiModelProperty(value = "兑换人")
private String redeemer;
/**
* 兑换时间
*/
@ApiModelProperty(value = "兑换时间")
private Date redemptionTime;
/**
* 快递公司
*/
@ApiModelProperty(value = "快递公司")
private String courierCompany;
/**
* 快递单号
*/
@ApiModelProperty(value = "快递单号")
private String expressNo;
/**
* 快递日期
*/
@ApiModelProperty(value = "快递日期")
private String expressDate;
/**
* 快递寄出人
*/
@ApiModelProperty(value = "快递寄出人")
private String expressSender;
/**
* 上传附件
*/
@ApiModelProperty(value = "上传附件")
private String annex;
/**
* 备注
*/
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "创建人id")
private String creator;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "更新人id")
private String updater;
@ApiModelProperty(value = "更新时间")
private String updateTime;
@ApiModelProperty(value = "是否删除")
private Boolean deleted;
}
package cn.iocoder.yudao.module.reward.vo.reward;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@ApiModel("管理后台 - 礼品兑换记录查询 VO")
public class RewardRedeemPageReqVO extends PageParam {
@ApiModelProperty(value = "礼品名称")
private String rewardTitle;
@ApiModelProperty(value = "会员名称")
private String memberName;
@ApiModelProperty(value = "领取方式")
private Integer redeemType;
@ApiModelProperty(value = "状态")
private Integer status;
@ApiModelProperty(value = "数量")
private Integer rewardCount;
@ApiModelProperty(value = "数量操作")
private Integer rewardCountOperate;
@ApiModelProperty(value = "兑换开始时间")
private Date startTime;
@ApiModelProperty(value = "兑换结束时间")
private Date endTime;
@ApiModelProperty(value = "礼品id")
private String rewardCode;
@ApiModelProperty(value = "兑换入口")
private Integer entrance;
@ApiModelProperty(value = "兑换网点")
private Integer nodeId;
}
package cn.iocoder.yudao.module.reward.vo.reward;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("管理后台 - 礼品兑换记录分页结果 VO")
public class RewardRedeemPageRespVO extends RewardRedeemBaseVO {
@ApiModelProperty(value = "会员信息")
private String memberName;
@ApiModelProperty(value = "礼品ID")
private String rewardCode;
@ApiModelProperty(value = "礼品名称(中文)")
private String rewardTitleZh;
@ApiModelProperty(value = "礼品名称(英文)")
private String rewardTitleEn;
@ApiModelProperty(value = "礼品名称(法文)")
private String rewardTitleFr;
@ApiModelProperty(value = "兑换网点(中文)")
private String nodeTitleZh;
@ApiModelProperty(value = "兑换网点(英文)")
private String nodeTitleEn;
@ApiModelProperty(value = "兑换积分")
private Integer totalCount;
@ApiModelProperty(value = "创建人时间")
private String creatorName;
@ApiModelProperty(value = "更新人时间")
private String updaterName;
}
......@@ -9,4 +9,106 @@
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
-->
<select id="pageInfo" resultType="cn.iocoder.yudao.module.reward.vo.reward.RewardRedeemPageRespVO">
select
err.id ,
err.member_id as memberId,
err.reward_id as rewardId,
err.status,
err.reward_count as rewardCount,
err.redeem_type as redeemType,
err.entrance,
err.expenses,
err.currency,
err.recipient_name as recipientName,
err.recipient_phone_num as recipientPhoneNum,
err.recipient_address as recipientAddress,
err.redeemer,
err.redemption_time as redemptionTime,
err.courier_company as courierCompany,
err.express_no as expressNo,
err.express_date as expressDate,
err.express_sender as expressSender,
err.annex as annex,
err.remark as remark,
err.create_time as createTime,
err.update_time as updateTime,
err.creator as creator,
err.updater as updater,
err.deleted as deleted,
mu.nickname as memberName,
er.code as rewardCode,
er.title_zh as rewardTitleZh,
er.title_en as rewardTitleEn,
er.title_fr as rewardTitleFr,
en.title_zh as nodeTitleZh,
en.title_en as nodeTitleEn,
er.points_require*err.reward_count as totalCount,
suc.username as creatorName,
suu.username as updaterName,
(select username from system_user where id = er.updater) as updaterName
from ecw_reward_redeem err
left join ecw_reward er on err.reward_id = er.id
left join member_user mu on mu.id = err.member_id
left join ecw_node en on er.node_id = en.id
left join system_user suc on suc.id = er.creator
left join system_user suu on suu.id = er.updater
where 1=1
<include refid="pageCondition"/>
order by er.create_time desc
limit #{start}, #{size}
</select>
<select id="pageCount" resultType="java.lang.Integer">
select count(*)
from ecw_reward_redeem err
left join ecw_reward er on err.reward_id = er.id
left join member_user mu on mu.id = err.member_id
left join ecw_node en on er.node_id = en.id
left join system_user suc on suc.id = er.creator
left join system_user suu on suu.id = er.updater
where 1=1
<include refid="pageCondition"/>
</select>
<sql id="pageCondition">
<if test="req.rewardTitle != null and req.rewardTitle !=''">
and (er.title_zh like '%${req.rewardTitle}%' or er.title_en like '%${req.rewardTitle}%' or er.title_fr like '%${req.rewardTitle}%')
</if>
<if test="req.memberName != null and req.memberName !=''">
and mu.nickname like '%${req.memberName}%'
</if>
<if test="req.rewardCode != null and req.rewardCode !=''">
and er.code like '%${req.rewardCode}%'
</if>
<if test="req.redeemType != null">
and err.redeem_type = #{req.redeemType}
</if>
<if test="req.status != null">
and err.status = #{req.status}
</if>
<if test="req.entrance != null">
and err.entrance = #{req.entrance}
</if>
<if test="req.nodeId != null">
and er.node_id = #{req.nodeId}
</if>
<if test="req.rewardCount != null and req.rewardCountOperate != null">
<!--1:大于 2:等于 3:小于-->
<if test="req.rewardCountOperate == 1">
and err.reward_count &gt; #{req.rewardCount}
</if>
<if test="req.rewardCountOperate == 2">
and err.reward_count = #{req.rewardCount}
</if>
<if test="req.rewardCountOperate == 3">
and err.reward_count &lt; #{req.rewardCount}
</if>
</if>
<if test="req.startTime != null ">
and err.create_time &gt;= #{req.startTime}
</if>
<if test="req.endTime != null ">
and err.create_time &lt;= #{req.endTime}
</if>
</sql>
</mapper>
package cn.iocoder.yudao.module.system.controller.admin.dict.vo.data;
package cn.iocoder.yudao.module.system.api.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......
package cn.iocoder.yudao.module.system.controller.admin.dict.vo.data;
import cn.iocoder.yudao.module.system.api.vo.DictDataBaseVO;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
......
package cn.iocoder.yudao.module.system.controller.admin.dict.vo.data;
import cn.iocoder.yudao.module.system.api.vo.DictDataBaseVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......
package cn.iocoder.yudao.module.system.controller.admin.dict.vo.data;
import cn.iocoder.yudao.module.system.api.vo.DictDataBaseVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......
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