修改卡券Bug

This commit is contained in:
齐天大圣 2023-11-17 13:09:28 +08:00
parent 4ef7e1cdca
commit 9fee58ebd7
7 changed files with 63 additions and 15 deletions

View File

@ -21,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
@ -111,7 +112,9 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
List<ActiveConsumptionChild> activeConsumptionChildList = activeConsumptionChildService.list(queryWrappers);
BeanUtils.copyProperties(s,activeConsumptionVO);
activeConsumptionVO.setAdaptOil(s.getAdaptOil().split(","));
activeConsumptionVO.setAdaptOil(Arrays.stream(s.getAdaptOil().split(","))
.map(Integer::valueOf)
.toArray(Integer[]::new));
activeConsumptionVO.setActiveGift(s.getActiveGift().split(","));
activeConsumptionVO.setDieselUserLevel(s.getDieselUserLevel().split(","));
activeConsumptionVO.setGasolineUserLevel(s.getGasolineUserLevel().split(","));
@ -146,7 +149,9 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
activeConsumptionVO.setDieselUserLevel(consumption.getDieselUserLevel().split(","));
activeConsumptionVO.setGasolineUserLevel(consumption.getGasolineUserLevel().split(","));
activeConsumptionVO.setNaturalUserLevel(consumption.getNaturalUserLevel().split(","));
activeConsumptionVO.setAdaptOil(consumption.getAdaptOil().split(","));
activeConsumptionVO.setAdaptOil(Arrays.stream(consumption.getAdaptOil().split(","))
.map(Integer::valueOf)
.toArray(Integer[]::new));
activeConsumptionVO.setActiveGift(consumption.getActiveGift().split(","));
activeConsumptionVO.setActiveConsumptionChildList(activeConsumptionChildList);
}

View File

@ -33,7 +33,8 @@ public class ActiveConsumptionVO extends Model<ActiveConsumptionVO> {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date activeEndTime;
//适用油品092# 1: 95# 298# 30# 4-10# 5 LNG 6CNG 7京92# 8京95# 9京0#
private String[] adaptOil;
private String[] adaptOils;
private Integer[] adaptOil;
//适用会员类型 0:全部用户 1全部会员 2等级会员
private String adaptUserType;
//会员类型 0汽油会员 1柴油会员 2天然气会员
@ -155,11 +156,19 @@ public class ActiveConsumptionVO extends Model<ActiveConsumptionVO> {
this.activeEndTime = activeEndTime;
}
public String[] getAdaptOil() {
public String[] getAdaptOils() {
return adaptOils;
}
public void setAdaptOils(String[] adaptOils) {
this.adaptOils = adaptOils;
}
public Integer[] getAdaptOil() {
return adaptOil;
}
public void setAdaptOil(String[] adaptOil) {
public void setAdaptOil(Integer[] adaptOil) {
this.adaptOil = adaptOil;
}

View File

@ -24,6 +24,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
@ -112,7 +113,9 @@ public class ActiveDiscountServiceImpl extends ServiceImpl<ActiveDiscountMapper,
List<ActiveDiscountChild> activeDiscountChildList = activeDiscountChildService.list(queryWrappers);
BeanUtils.copyProperties(s,activeDiscountVO);
activeDiscountVO.setAdaptOil(s.getAdaptOil().split(","));
activeDiscountVO.setAdaptOil(Arrays.stream(s.getAdaptOil().split(","))
.map(Integer::valueOf)
.toArray(Integer[]::new));
activeDiscountVO.setDieselUserLevel(s.getDieselUserLevel().split(","));
activeDiscountVO.setGasolineUserLevel(s.getGasolineUserLevel().split(","));
activeDiscountVO.setNaturalUserLevel(s.getNaturalUserLevel().split(","));
@ -145,7 +148,9 @@ public class ActiveDiscountServiceImpl extends ServiceImpl<ActiveDiscountMapper,
activeDiscountVO.setDieselUserLevel(activeDiscount.getDieselUserLevel().split(","));
activeDiscountVO.setGasolineUserLevel(activeDiscount.getGasolineUserLevel().split(","));
activeDiscountVO.setNaturalUserLevel(activeDiscount.getNaturalUserLevel().split(","));
activeDiscountVO.setAdaptOil(activeDiscount.getAdaptOil().split(","));
activeDiscountVO.setAdaptOil(Arrays.stream(activeDiscount.getAdaptOil().split(","))
.map(Integer::valueOf)
.toArray(Integer[]::new));
activeDiscountVO.setActiveDiscountChildList(activeDiscountChildList);
}
}

View File

@ -26,7 +26,8 @@ public class ActiveDiscountVO implements Serializable{
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date activeEndTime;
//适用油品092# 1: 95# 298# 30# 4-10# 5 LNG 6CNG 7京92# 8京95# 9京0#
private String[] adaptOil;
private String[] adaptOils;
private Integer[] adaptOil;
//适用会员类型 0:全部用户 1全部会员 2等级会员
private String adaptUserType;
//会员类型 0汽油会员 1柴油会员 2天然气会员
@ -110,11 +111,19 @@ public class ActiveDiscountVO implements Serializable{
this.activeEndTime = activeEndTime;
}
public String[] getAdaptOil() {
public String[] getAdaptOils() {
return adaptOils;
}
public void setAdaptOils(String[] adaptOils) {
this.adaptOils = adaptOils;
}
public Integer[] getAdaptOil() {
return adaptOil;
}
public void setAdaptOil(String[] adaptOil) {
public void setAdaptOil(Integer[] adaptOil) {
this.adaptOil = adaptOil;
}

View File

@ -22,6 +22,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
@ -109,7 +110,9 @@ public class ActiveFullminusServiceImpl extends ServiceImpl<ActiveFullminusMappe
List<ActiveDiscountChild> activeDiscountChildList = activeDiscountChildService.list(queryWrappers);
BeanUtils.copyProperties(s,activeFullminusVO);
activeFullminusVO.setAdaptOil(s.getAdaptOil().split(","));
activeFullminusVO.setAdaptOil(Arrays.stream(s.getAdaptOil().split(","))
.map(Integer::valueOf)
.toArray(Integer[]::new));
activeFullminusVO.setDieselUserLevel(s.getDieselUserLevel().split(","));
activeFullminusVO.setGasolineUserLevel(s.getGasolineUserLevel().split(","));
activeFullminusVO.setNaturalUserLevel(s.getNaturalUserLevel().split(","));
@ -142,7 +145,9 @@ public class ActiveFullminusServiceImpl extends ServiceImpl<ActiveFullminusMappe
activeFullminusVO.setDieselUserLevel(activeFullminus.getDieselUserLevel().split(","));
activeFullminusVO.setGasolineUserLevel(activeFullminus.getGasolineUserLevel().split(","));
activeFullminusVO.setNaturalUserLevel(activeFullminus.getNaturalUserLevel().split(","));
activeFullminusVO.setAdaptOil(activeFullminus.getAdaptOil().split(","));
activeFullminusVO.setAdaptOil(Arrays.stream(activeFullminus.getAdaptOil().split(","))
.map(Integer::valueOf)
.toArray(Integer[]::new));
activeFullminusVO.setActiveDiscountChildList(activeDiscountChildList);
}
}

View File

@ -26,7 +26,8 @@ public class ActiveFullminusVO implements Serializable {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date activeEndTime;
//适用油品092# 1: 95# 298# 30# 4-10# 5 LNG 6CNG 7京92# 8京95# 9京0#
private String[] adaptOil;
private String[] adaptOils;
private Integer[] adaptOil;
//适用会员类型 0:全部用户 1全部会员 2等级会员
private String adaptUserType;
//会员类型 0汽油会员 1柴油会员 2天然气会员
@ -110,11 +111,19 @@ public class ActiveFullminusVO implements Serializable {
this.activeEndTime = activeEndTime;
}
public String[] getAdaptOil() {
public String[] getAdaptOils() {
return adaptOils;
}
public void setAdaptOils(String[] adaptOils) {
this.adaptOils = adaptOils;
}
public Integer[] getAdaptOil() {
return adaptOil;
}
public void setAdaptOil(String[] adaptOil) {
public void setAdaptOil(Integer[] adaptOil) {
this.adaptOil = adaptOil;
}

View File

@ -9,6 +9,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelDiesel;
import com.fuint.business.marketingActivity.cardFule.service.CardFuelDieselService;
import com.fuint.business.petrolStationManagement.entity.OilName;
import com.fuint.business.petrolStationManagement.service.OilNameService;
import com.fuint.business.store.service.StoreService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
@ -16,6 +18,7 @@ import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@ -39,6 +42,8 @@ public class CardFuelDieselController extends BaseController {
private CardFuelDieselService cardFuelDieselService;
@Resource
private StoreService storeService;
@Autowired
private OilNameService oilNameService;
/**
* 分页查询所有数据
@ -68,6 +73,7 @@ public class CardFuelDieselController extends BaseController {
List<CardFuelDiesel> records = page1.getRecords();
//返回囤油卡状态
for (CardFuelDiesel record : records) {
record.setOilType(oilNameService.selectOilNameById(Integer.parseInt(record.getOilType())).getOilName());
record.setStatus(record.getStatus().equals("1") ? "true" : "false");
if(ObjectUtils.isNotEmpty(record.getActiveTime()) && "1".equals(record.getActiveTime())){
record.setActivityProgress("1");