Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop

This commit is contained in:
Chopper 2021-07-15 14:17:58 +08:00
commit caacb9e201
7 changed files with 50 additions and 14 deletions

View File

@ -16,7 +16,7 @@ import java.util.List;
public class GoodsParamsGroupVO implements Serializable { public class GoodsParamsGroupVO implements Serializable {
private static final long serialVersionUID = 1450550797436233753L; private static final long serialVersionUID = 1450550797436233753L;
@ApiModelProperty("参数组关联的参数集合") @ApiModelProperty("参数组关联的参数集合")
private List<GoodsParamsDTOVO> params; private List<GoodsParamsVO> params;
@ApiModelProperty("参数组名称") @ApiModelProperty("参数组名称")
private String groupName; private String groupName;
@ApiModelProperty("参数组id") @ApiModelProperty("参数组id")

View File

@ -12,7 +12,7 @@ import lombok.Data;
* @date 2020-02-26 23:24:13 * @date 2020-02-26 23:24:13
*/ */
@Data @Data
public class GoodsParamsDTOVO extends GoodsParamsDTO { public class GoodsParamsVO extends GoodsParamsDTO {
private static final long serialVersionUID = -4904700751774005326L; private static final long serialVersionUID = -4904700751774005326L;
@ApiModelProperty("1 输入项 2 选择项") @ApiModelProperty("1 输入项 2 选择项")

View File

@ -9,7 +9,7 @@ import cn.lili.modules.goods.entity.dos.Category;
import cn.lili.modules.goods.entity.dos.CategoryParameterGroup; import cn.lili.modules.goods.entity.dos.CategoryParameterGroup;
import cn.lili.modules.goods.entity.vos.CategoryVO; import cn.lili.modules.goods.entity.vos.CategoryVO;
import cn.lili.modules.goods.entity.vos.GoodsParamsGroupVO; import cn.lili.modules.goods.entity.vos.GoodsParamsGroupVO;
import cn.lili.modules.goods.entity.vos.GoodsParamsDTOVO; import cn.lili.modules.goods.entity.vos.GoodsParamsVO;
import cn.lili.modules.goods.mapper.CategoryMapper; import cn.lili.modules.goods.mapper.CategoryMapper;
import cn.lili.modules.goods.service.CategoryService; import cn.lili.modules.goods.service.CategoryService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -268,13 +268,13 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
* @param paramList 参数列表 * @param paramList 参数列表
* @return 拼装后的返回值 * @return 拼装后的返回值
*/ */
private List<GoodsParamsGroupVO> convertParamList(List<CategoryParameterGroup> groupList, List<GoodsParamsDTOVO> paramList) { private List<GoodsParamsGroupVO> convertParamList(List<CategoryParameterGroup> groupList, List<GoodsParamsVO> paramList) {
Map<String, List<GoodsParamsDTOVO>> map = new HashMap<>(16); Map<String, List<GoodsParamsVO>> map = new HashMap<>(16);
for (GoodsParamsDTOVO param : paramList) { for (GoodsParamsVO param : paramList) {
if (map.get(param.getGroupId()) != null) { if (map.get(param.getGroupId()) != null) {
map.get(param.getGroupId()).add(param); map.get(param.getGroupId()).add(param);
} else { } else {
List<GoodsParamsDTOVO> list = new ArrayList<>(); List<GoodsParamsVO> list = new ArrayList<>();
list.add(param); list.add(param);
map.put(param.getGroupId(), list); map.put(param.getGroupId(), list);
} }

View File

@ -3,6 +3,7 @@ package cn.lili.modules.member.entity.aop.interceptor;
import cn.lili.common.utils.CurrencyUtil; import cn.lili.common.utils.CurrencyUtil;
import cn.lili.modules.member.entity.dos.Member; import cn.lili.modules.member.entity.dos.Member;
import cn.lili.modules.member.entity.dos.MemberPointsHistory; import cn.lili.modules.member.entity.dos.MemberPointsHistory;
import cn.lili.modules.member.entity.enums.PointTypeEnum;
import cn.lili.modules.member.service.MemberPointsHistoryService; import cn.lili.modules.member.service.MemberPointsHistoryService;
import cn.lili.modules.member.service.MemberService; import cn.lili.modules.member.service.MemberService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -55,9 +56,10 @@ public class PointLogInterceptor {
MemberPointsHistory memberPointsHistory = new MemberPointsHistory(); MemberPointsHistory memberPointsHistory = new MemberPointsHistory();
memberPointsHistory.setMemberId(member.getId()); memberPointsHistory.setMemberId(member.getId());
memberPointsHistory.setMemberName(member.getUsername()); memberPointsHistory.setMemberName(member.getUsername());
memberPointsHistory.setPointType(type ? 1 : 0); memberPointsHistory.setPointType(type ? PointTypeEnum.INCREASE.name() : PointTypeEnum.REDUCE.name());
memberPointsHistory.setVariablePoint(point); memberPointsHistory.setVariablePoint(point);
memberPointsHistory.setBeforePoint(new Double(CurrencyUtil.sub(member.getPoint(), point)).longValue()); memberPointsHistory.setBeforePoint(true ? new Double(CurrencyUtil.sub(member.getPoint(), point)).longValue() : new Double(CurrencyUtil.add(member.getPoint(), point)).longValue());
memberPointsHistory.setPoint(member.getPoint()); memberPointsHistory.setPoint(member.getPoint());
memberPointsHistory.setContent(obj[3] == null ? "" : obj[3].toString()); memberPointsHistory.setContent(obj[3] == null ? "" : obj[3].toString());
memberPointsHistory.setCreateBy("系统"); memberPointsHistory.setCreateBy("系统");

View File

@ -73,9 +73,10 @@ public class MemberPointsHistory {
@ApiModelProperty(value = "content") @ApiModelProperty(value = "content")
private String content; private String content;
@Min(message = "最小值为0", value = 0) /**
@Max(message = "最大值为1", value = 1) * @see cn.lili.modules.member.entity.enums.PointTypeEnum
@ApiModelProperty(value = "消费积分类型1为增加0为消费") */
private Integer pointType; @ApiModelProperty(value = "消费积分类型")
private String pointType;
} }

View File

@ -0,0 +1,29 @@
package cn.lili.modules.member.entity.enums;
/**
* 积分类型枚举
*
* @author Chopper
* @date 2021/3/20 10:44
*/
public enum PointTypeEnum {
/**
* 增加
*/
INCREASE("增加"),
/**
* 减少
*/
REDUCE("减少");
private String description;
public String description() {
return description;
}
PointTypeEnum(String description) {
this.description = description;
}
}

View File

@ -10,3 +10,7 @@ INSERT INTO `lilishop`.`li_menu`(`id`, `create_by`, `create_time`, `delete_flag`
/** 促销商品添加商品类型**/ /** 促销商品添加商品类型**/
ALTER TABLE li_promotion_goods ADD goods_type varchar (200); ALTER TABLE li_promotion_goods ADD goods_type varchar (200);
/** 修改历史积分积分类型的字段类型 **/
alter table li_member_points_history modify column point_type varchar(50);
update li_member_points_history set point_type = 'INCREASE' where point_type=1;
update li_member_points_history set point_type = 'REDUCE' where point_type=0;