记得上下班打卡 | git大法好,push需谨慎

Commit b7ff9820 authored by 张国柄's avatar 张国柄

后台管理会员价格编辑调整;

parent 550fae85
...@@ -20,22 +20,24 @@ public class AdamMemberPriceVo implements Serializable { ...@@ -20,22 +20,24 @@ public class AdamMemberPriceVo implements Serializable {
private String memberPriceId; private String memberPriceId;
@ApiModelProperty(position = 2, value = "会员类型ID") @ApiModelProperty(position = 2, value = "会员类型ID")
private String memberId; private String memberId;
@ApiModelProperty(position = 3, value = "价格状态[0-不可用,1-上线中,2-已下线]") // @ApiModelProperty(position = 3, value = "价格状态[0-不可用,1-上线中,2-已下线]")
private Integer state; // private Integer state;
@ApiModelProperty(position = 4, value = "价格包名称") @ApiModelProperty(position = 4, value = "价格包名称")
private String name; private String name;
@ApiModelProperty(position = 5, value = "原价") @ApiModelProperty(position = 5, value = "原价")
private BigDecimal price; private BigDecimal price;
@ApiModelProperty(position = 6, value = "折扣价") @ApiModelProperty(position = 6, value = "折扣价:购买价格")
private BigDecimal priceFixed; private BigDecimal priceFixed;
@ApiModelProperty(position = 7, value = "有效天数") @ApiModelProperty(position = 7, value = "特价:首次、首年优惠价")
private BigDecimal priceSpecial;
@ApiModelProperty(position = 8, value = "有效天数")
private Integer days; private Integer days;
@ApiModelProperty(position = 8, value = "会员包须知") // @ApiModelProperty(position = 8, value = "会员包须知")
private String detail; // private String detail;
@JsonFormat(shape=JsonFormat.Shape.STRING, pattern= DateUtil.DATE_FULL_STR) // @JsonFormat(shape=JsonFormat.Shape.STRING, pattern= DateUtil.DATE_FULL_STR)
private LocalDateTime createdAt; // private LocalDateTime createdAt;
@JsonFormat(shape=JsonFormat.Shape.STRING, pattern= DateUtil.DATE_FULL_STR) // @JsonFormat(shape=JsonFormat.Shape.STRING, pattern= DateUtil.DATE_FULL_STR)
private LocalDateTime updatedAt; // private LocalDateTime updatedAt;
private static final AdamMemberPriceVo obj = new AdamMemberPriceVo(); private static final AdamMemberPriceVo obj = new AdamMemberPriceVo();
...@@ -51,14 +53,15 @@ public class AdamMemberPriceVo implements Serializable { ...@@ -51,14 +53,15 @@ public class AdamMemberPriceVo implements Serializable {
if (null == source) return this; if (null == source) return this;
this.setMemberPriceId(source.getMemberPriceId()); this.setMemberPriceId(source.getMemberPriceId());
this.setMemberId(source.getMemberId()); this.setMemberId(source.getMemberId());
this.setState(source.getState()); // this.setState(source.getState());
this.setName(source.getName()); this.setName(source.getName());
this.setPrice(source.getPrice()); this.setPrice(source.getPrice());
this.setPriceFixed(source.getPriceFixed()); this.setPriceFixed(source.getPriceFixed());
this.setPriceSpecial(source.getPriceSpecial());
this.setDays(source.getDays()); this.setDays(source.getDays());
this.setDetail(source.getDetail()); // this.setDetail(source.getDetail());
this.setCreatedAt(source.getCreatedAt()); // this.setCreatedAt(source.getCreatedAt());
this.setUpdatedAt(source.getUpdatedAt()); // this.setUpdatedAt(source.getUpdatedAt());
return this; return this;
} }
} }
...@@ -50,7 +50,7 @@ public class AdamMemberPriceAdminServiceImpl extends ServiceImpl<AdamMemberPrice ...@@ -50,7 +50,7 @@ public class AdamMemberPriceAdminServiceImpl extends ServiceImpl<AdamMemberPrice
@Override @Override
@Transactional @Transactional
public boolean edit(AdamMemberPriceBuildParam param) { public boolean edit(AdamMemberPriceBuildParam param) {
String memberId = param.getMemberId(), memberPriceId = param.getMemberPriceId(); String memberId = param.getMemberId();
AdamMember updateInfo = new AdamMember(); AdamMember updateInfo = new AdamMember();
updateInfo.setIntegralRate(param.getIntegralRate()); updateInfo.setIntegralRate(param.getIntegralRate());
...@@ -93,8 +93,14 @@ public class AdamMemberPriceAdminServiceImpl extends ServiceImpl<AdamMemberPrice ...@@ -93,8 +93,14 @@ public class AdamMemberPriceAdminServiceImpl extends ServiceImpl<AdamMemberPrice
saveOrUpdateInfo = adamMemberPriceMapper.selectList(queryWrapper).get(0); saveOrUpdateInfo = adamMemberPriceMapper.selectList(queryWrapper).get(0);
} }
if (saveOrUpdateRst) { if (saveOrUpdateRst) {
AdamMemberPriceVo vo = AdamMemberPriceVo.getNew().copy(saveOrUpdateInfo); String memberPriceId = saveOrUpdateInfo.getMemberPriceId();
redisUtil.set(AdamRedisConst.INFO_MEMBER_PRICE.concat(vo.getMemberPriceId()), vo);
String mpKey = AdamRedisConst.INFO_MEMBER_PRICE.concat(memberId);
List<AdamMemberPriceVo> vos = (List<AdamMemberPriceVo>) redisUtil.get(mpKey);
vos.removeIf(r -> (r.getMemberId().equals(memberId) && r.getMemberPriceId().equals(memberPriceId)));
vos.add(AdamMemberPriceVo.getNew().copy(saveOrUpdateInfo));
redisUtil.set(mpKey, vos);
return true; return true;
} }
throw new LiquidnetServiceException("-1", "会员价格编辑失败"); throw new LiquidnetServiceException("-1", "会员价格编辑失败");
......
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