This commit is contained in:
齐天大圣 2024-03-05 09:20:04 +08:00
parent e8c9112aa8
commit 3492885ff2
6 changed files with 35 additions and 6 deletions

View File

@ -1,6 +1,9 @@
package com.fuint.business.marketingActivity.activeOneCoupon.entity;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
@ -16,6 +19,7 @@ import java.io.Serializable;
@Data
public class ActiveOneCoupon extends Model<ActiveOneCoupon> {
//主键id
@TableId(type = IdType.AUTO)
private Integer id;
private Integer storeId;
private String activeName;

View File

@ -28,6 +28,7 @@ import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import com.fuint.repository.mapper.MtUserGradeMapper;
import com.fuint.repository.model.MtUserGrade;
import com.fuint.repository.model.MtUserGradeVO;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@ -73,11 +74,11 @@ public class ActiveOneCouponServiceImpl extends ServiceImpl<ActiveOneCouponMappe
String gradeIdStr = "";
String gradeIdName = "";
Integer[] gradeIds = activeOneCouponDTO.getGradeIds();
/* for (Integer gradeId : gradeIds) {
for (Integer gradeId : gradeIds) {
gradeIdStr+=gradeId + ",";
MtUserGrade mtUserGrade = mtUserGradeMapper.selectById(gradeId);
MtUserGradeVO mtUserGrade = mtUserGradeMapper.selectByGradeId(gradeId);
gradeIdName += mtUserGrade.getName() + ",";
}*/
}
activeOneCoupon.setGradeId(gradeIdStr);
activeOneCoupon.setGradeName(gradeIdName);
activeOneCoupon.setStoreId(nowAccountInfo.getStoreId());
@ -129,7 +130,7 @@ public class ActiveOneCouponServiceImpl extends ServiceImpl<ActiveOneCouponMappe
String[] gradeId = gradeIds.split(",");
for (String s : gradeId) {
LJUserVos ljUserVos = new LJUserVos();
MtUserGrade mtUserGrade = mtUserGradeMapper.selectById(s);
MtUserGradeVO mtUserGrade = mtUserGradeMapper.selectByGradeId(Integer.parseInt(s));
ljUserVos.setGradeName(mtUserGrade.getName());
LJUserVo ljUserVo = new LJUserVo();
ljUserVo.setGradeId(Integer.parseInt(s));

View File

@ -2,6 +2,7 @@ package com.fuint.repository.mapper;
import com.fuint.repository.model.MtUserGrade;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fuint.repository.model.MtUserGradeVO;
/**
* Mapper 接口
@ -10,5 +11,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* CopyRight https://www.fuint.cn
*/
public interface MtUserGradeMapper extends BaseMapper<MtUserGrade> {
MtUserGradeVO selectByGradeId(Integer gradeId);
// empty
}

View File

@ -38,9 +38,9 @@ public class MtUserGrade implements Serializable {
@ApiModelProperty("等级名称")
private String name;
// @ApiModelProperty("升级会员等级条件描述")
/*// @ApiModelProperty("升级会员等级条件描述")
// private String catchCondition;
*/
@ApiModelProperty("升级会员等级条件init:默认获取;pay:付费升级frequency:消费次数amount:累积消费金额升级")
@TableField(exist = false)
private String catchType;

View File

@ -0,0 +1,18 @@
package com.fuint.repository.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class MtUserGradeVO {
@TableId(value = "ID", type = IdType.AUTO)
private Integer id;
@ApiModelProperty("等级")
private Integer grade;
@ApiModelProperty("等级名称")
private String name;
}

View File

@ -2,4 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fuint.repository.mapper.MtUserGradeMapper">
<select id="selectByGradeId" resultType="com.fuint.repository.model.MtUserGradeVO">
select id,grade,name from mt_user_grade where grade_id = #{gradeId}
</select>
</mapper>