修改消费有礼bug
This commit is contained in:
parent
6400889d3c
commit
925c8cc402
@ -56,6 +56,14 @@ public class ActiveConsumptionChild {
|
||||
* 券数量
|
||||
*/
|
||||
private Integer giftCardTotal;
|
||||
//有效期0
|
||||
private Integer validityZero;
|
||||
//有效期1
|
||||
private Integer validityOne;
|
||||
//有效期2
|
||||
private Integer validityTwo;
|
||||
|
||||
private String timeType;
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@ -73,6 +81,38 @@ public class ActiveConsumptionChild {
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
public String getTimeType() {
|
||||
return timeType;
|
||||
}
|
||||
|
||||
public void setTimeType(String timeType) {
|
||||
this.timeType = timeType;
|
||||
}
|
||||
|
||||
public Integer getValidityZero() {
|
||||
return validityZero;
|
||||
}
|
||||
|
||||
public void setValidityZero(Integer validityZero) {
|
||||
this.validityZero = validityZero;
|
||||
}
|
||||
|
||||
public Integer getValidityOne() {
|
||||
return validityOne;
|
||||
}
|
||||
|
||||
public void setValidityOne(Integer validityOne) {
|
||||
this.validityOne = validityOne;
|
||||
}
|
||||
|
||||
public Integer getValidityTwo() {
|
||||
return validityTwo;
|
||||
}
|
||||
|
||||
public void setValidityTwo(Integer validityTwo) {
|
||||
this.validityTwo = validityTwo;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
|
||||
@Resource
|
||||
private StoreService storeService;
|
||||
@Resource
|
||||
private ActiveConsumptionChildService consumptionChildService;
|
||||
private ActiveConsumptionChildService activeConsumptionChildService;
|
||||
/**
|
||||
* 新增数据
|
||||
* @param activeConsumptionDTO
|
||||
@ -74,7 +74,7 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
|
||||
s.setActiveConsumptionId(activeConsumption.getId());
|
||||
return s;
|
||||
}).collect(Collectors.toList());
|
||||
save = consumptionChildService.saveBatch(list);
|
||||
save = activeConsumptionChildService.saveBatch(list);
|
||||
}
|
||||
return save;
|
||||
}
|
||||
@ -108,7 +108,7 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
|
||||
LambdaQueryWrapper<ActiveConsumptionChild> queryWrappers = new LambdaQueryWrapper<>();
|
||||
queryWrappers.eq(ActiveConsumptionChild::getActiveConsumptionId,s.getId());
|
||||
queryWrappers.orderByDesc(ActiveConsumptionChild::getCreateTime);
|
||||
List<ActiveConsumptionChild> activeConsumptionChildList = consumptionChildService.list(queryWrappers);
|
||||
List<ActiveConsumptionChild> activeConsumptionChildList = activeConsumptionChildService.list(queryWrappers);
|
||||
|
||||
BeanUtils.copyProperties(s,activeConsumptionVO);
|
||||
activeConsumptionVO.setAdaptOil(s.getAdaptOil().split(","));
|
||||
@ -134,11 +134,12 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
|
||||
if (ObjectUtils.isNotEmpty(id)){
|
||||
//获取消费有礼活动信息
|
||||
ActiveConsumption consumption = getById(id);
|
||||
|
||||
//获取兑换物品信息
|
||||
LambdaQueryWrapper<ActiveConsumptionChild> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ActiveConsumptionChild::getActiveConsumptionId,id);
|
||||
queryWrapper.orderByDesc(ActiveConsumptionChild::getCreateTime);
|
||||
List<ActiveConsumptionChild> activeConsumptionChildList = consumptionChildService.list(queryWrapper);
|
||||
List<ActiveConsumptionChild> activeConsumptionChildList = activeConsumptionChildService.list(queryWrapper);
|
||||
if (CollectionUtils.isNotEmpty(activeConsumptionChildList)){
|
||||
//封装VO返回
|
||||
BeanUtils.copyProperties(consumption,activeConsumptionVO);
|
||||
@ -146,6 +147,7 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
|
||||
activeConsumptionVO.setGasolineUserLevel(consumption.getGasolineUserLevel().split(","));
|
||||
activeConsumptionVO.setNaturalUserLevel(consumption.getNaturalUserLevel().split(","));
|
||||
activeConsumptionVO.setAdaptOil(consumption.getAdaptOil().split(","));
|
||||
activeConsumptionVO.setActiveGift(consumption.getActiveGift().split(","));
|
||||
activeConsumptionVO.setActiveConsumptionChildList(activeConsumptionChildList);
|
||||
}
|
||||
}
|
||||
@ -160,6 +162,7 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
|
||||
@Override
|
||||
@Transactional
|
||||
public Boolean updateOneById(ActiveConsumptionDTO activeConsumptionDTO) {
|
||||
boolean update = false;
|
||||
//更新消费有礼
|
||||
ActiveConsumption activeConsumption = new ActiveConsumption();
|
||||
BeanUtils.copyProperties(activeConsumptionDTO,activeConsumption);
|
||||
@ -171,7 +174,22 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
|
||||
activeConsumption.setGasolineUserLevel(arrayToString(activeConsumptionDTO.getGasolineUserLevel()));
|
||||
//天然气会员等级
|
||||
activeConsumption.setNaturalUserLevel(arrayToString(activeConsumptionDTO.getNaturalUserLevel()));
|
||||
return updateById(activeConsumption);
|
||||
|
||||
//更新子表数据
|
||||
update = updateById(activeConsumption);
|
||||
LambdaQueryWrapper<ActiveConsumptionChild> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ActiveConsumptionChild::getActiveConsumptionId,activeConsumptionDTO.getId());
|
||||
activeConsumptionChildService.remove(queryWrapper);
|
||||
//新增兑换物品
|
||||
List<ActiveConsumptionChild> activeConsumptionChildList1 = activeConsumptionDTO.getActiveConsumptionChildList();
|
||||
if (CollectionUtils.isNotEmpty(activeConsumptionChildList1)){
|
||||
activeConsumptionChildList1.stream().map(s ->{
|
||||
s.setActiveConsumptionId(activeConsumption.getId());
|
||||
return s;
|
||||
}).collect(Collectors.toList());
|
||||
update = activeConsumptionChildService.saveBatch(activeConsumptionChildList1);
|
||||
}
|
||||
return update;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user