Skip to content

Commit

Permalink
Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop
Browse files Browse the repository at this point in the history
  • Loading branch information
chopper711 committed Jul 15, 2021
2 parents 844bff9 + 9ee5b45 commit caacb9e
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public class GoodsParamsGroupVO implements Serializable {
private static final long serialVersionUID = 1450550797436233753L;
@ApiModelProperty("参数组关联的参数集合")
private List<GoodsParamsDTOVO> params;
private List<GoodsParamsVO> params;
@ApiModelProperty("参数组名称")
private String groupName;
@ApiModelProperty("参数组id")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 选择项")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -268,13 +268,13 @@ private void findAllChild(CategoryVO category) {
* @param paramList 参数列表
* @return 拼装后的返回值
*/
private List<GoodsParamsGroupVO> convertParamList(List<CategoryParameterGroup> groupList, List<GoodsParamsDTOVO> paramList) {
Map<String, List<GoodsParamsDTOVO>> map = new HashMap<>(16);
for (GoodsParamsDTOVO param : paramList) {
private List<GoodsParamsGroupVO> convertParamList(List<CategoryParameterGroup> groupList, List<GoodsParamsVO> paramList) {
Map<String, List<GoodsParamsVO>> map = new HashMap<>(16);
for (GoodsParamsVO param : paramList) {
if (map.get(param.getGroupId()) != null) {
map.get(param.getGroupId()).add(param);
} else {
List<GoodsParamsDTOVO> list = new ArrayList<>();
List<GoodsParamsVO> list = new ArrayList<>();
list.add(param);
map.put(param.getGroupId(), list);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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("系统");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

}
Original file line number Diff line number Diff line change
@@ -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;
}
}
6 changes: 5 additions & 1 deletion update-sql/version4.1to4.2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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);
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;

0 comments on commit caacb9e

Please sign in to comment.