diff --git a/framework/src/main/java/cn/lili/modules/goods/entity/vos/GoodsParamsGroupVO.java b/framework/src/main/java/cn/lili/modules/goods/entity/vos/GoodsParamsGroupVO.java index 9202f9530..18d0a9d53 100644 --- a/framework/src/main/java/cn/lili/modules/goods/entity/vos/GoodsParamsGroupVO.java +++ b/framework/src/main/java/cn/lili/modules/goods/entity/vos/GoodsParamsGroupVO.java @@ -16,7 +16,7 @@ public class GoodsParamsGroupVO implements Serializable { private static final long serialVersionUID = 1450550797436233753L; @ApiModelProperty("参数组关联的参数集合") - private List params; + private List params; @ApiModelProperty("参数组名称") private String groupName; @ApiModelProperty("参数组id") diff --git a/framework/src/main/java/cn/lili/modules/goods/entity/vos/GoodsParamsDTOVO.java b/framework/src/main/java/cn/lili/modules/goods/entity/vos/GoodsParamsVO.java similarity index 95% rename from framework/src/main/java/cn/lili/modules/goods/entity/vos/GoodsParamsDTOVO.java rename to framework/src/main/java/cn/lili/modules/goods/entity/vos/GoodsParamsVO.java index 64deda4fb..8b9a41e41 100644 --- a/framework/src/main/java/cn/lili/modules/goods/entity/vos/GoodsParamsDTOVO.java +++ b/framework/src/main/java/cn/lili/modules/goods/entity/vos/GoodsParamsVO.java @@ -12,7 +12,7 @@ * @date 2020-02-26 23:24:13 */ @Data -public class GoodsParamsDTOVO extends GoodsParamsDTO { +public class GoodsParamsVO extends GoodsParamsDTO { private static final long serialVersionUID = -4904700751774005326L; @ApiModelProperty("1 输入项 2 选择项") diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/CategoryServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/CategoryServiceImpl.java index 93903d489..bc102fca9 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/CategoryServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/CategoryServiceImpl.java @@ -9,7 +9,7 @@ import cn.lili.modules.goods.entity.dos.CategoryParameterGroup; import cn.lili.modules.goods.entity.vos.CategoryVO; 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.service.CategoryService; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -268,13 +268,13 @@ private void findAllChild(CategoryVO category) { * @param paramList 参数列表 * @return 拼装后的返回值 */ - private List convertParamList(List groupList, List paramList) { - Map> map = new HashMap<>(16); - for (GoodsParamsDTOVO param : paramList) { + private List convertParamList(List groupList, List paramList) { + Map> map = new HashMap<>(16); + for (GoodsParamsVO param : paramList) { if (map.get(param.getGroupId()) != null) { map.get(param.getGroupId()).add(param); } else { - List list = new ArrayList<>(); + List list = new ArrayList<>(); list.add(param); map.put(param.getGroupId(), list); } diff --git a/framework/src/main/java/cn/lili/modules/member/entity/aop/interceptor/PointLogInterceptor.java b/framework/src/main/java/cn/lili/modules/member/entity/aop/interceptor/PointLogInterceptor.java index 425fcb72d..6699442f3 100644 --- a/framework/src/main/java/cn/lili/modules/member/entity/aop/interceptor/PointLogInterceptor.java +++ b/framework/src/main/java/cn/lili/modules/member/entity/aop/interceptor/PointLogInterceptor.java @@ -3,6 +3,7 @@ import cn.lili.common.utils.CurrencyUtil; import cn.lili.modules.member.entity.dos.Member; 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.MemberService; import lombok.extern.slf4j.Slf4j; @@ -55,9 +56,10 @@ public void doAfter(JoinPoint pjp) { MemberPointsHistory memberPointsHistory = new MemberPointsHistory(); memberPointsHistory.setMemberId(member.getId()); memberPointsHistory.setMemberName(member.getUsername()); - memberPointsHistory.setPointType(type ? 1 : 0); + memberPointsHistory.setPointType(type ? PointTypeEnum.INCREASE.name() : PointTypeEnum.REDUCE.name()); + 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.setContent(obj[3] == null ? "" : obj[3].toString()); memberPointsHistory.setCreateBy("系统"); diff --git a/framework/src/main/java/cn/lili/modules/member/entity/dos/MemberPointsHistory.java b/framework/src/main/java/cn/lili/modules/member/entity/dos/MemberPointsHistory.java index 7b11e00b5..8da788be2 100644 --- a/framework/src/main/java/cn/lili/modules/member/entity/dos/MemberPointsHistory.java +++ b/framework/src/main/java/cn/lili/modules/member/entity/dos/MemberPointsHistory.java @@ -73,9 +73,10 @@ public class MemberPointsHistory { @ApiModelProperty(value = "content") private String content; - @Min(message = "最小值为0", value = 0) - @Max(message = "最大值为1", value = 1) - @ApiModelProperty(value = "消费积分类型,1为增加,0为消费") - private Integer pointType; + /** + * @see cn.lili.modules.member.entity.enums.PointTypeEnum + */ + @ApiModelProperty(value = "消费积分类型") + private String pointType; } \ No newline at end of file diff --git a/framework/src/main/java/cn/lili/modules/member/entity/enums/PointTypeEnum.java b/framework/src/main/java/cn/lili/modules/member/entity/enums/PointTypeEnum.java new file mode 100644 index 000000000..3f965ae55 --- /dev/null +++ b/framework/src/main/java/cn/lili/modules/member/entity/enums/PointTypeEnum.java @@ -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; + } +} diff --git a/update-sql/version4.1to4.2.sql b/update-sql/version4.1to4.2.sql index c801755e4..ee0c78393 100644 --- a/update-sql/version4.1to4.2.sql +++ b/update-sql/version4.1to4.2.sql @@ -9,4 +9,8 @@ ALTER TABLE li_article_category alter column sort set default 0; INSERT INTO `lilishop`.`li_menu`(`id`, `create_by`, `create_time`, `delete_flag`, `update_by`, `update_time`, `description`, `front_route`, `icon`, `level`, `name`, `parent_id`, `path`, `sort_order`, `title`, `front_component`) VALUES (1410862675914764290, 'admin', '2021-07-02 15:27:29', b'0', 'admin', '2021-07-02 15:27:45', 'null', 'distribution/distributionCash', '', 2, 'distributionCash', '1374173575405109248', 'distributionCash', 5.00, '分销提现', 'null'); /** 促销商品添加商品类型**/ -ALTER TABLE li_promotion_goods ADD goods_type varchar (200); \ No newline at end of file +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; \ No newline at end of file