diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionServiceImpl.java index 86b2c0256..355950d48 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionServiceImpl.java @@ -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 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 { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date activeEndTime; //适用油品0:92# 1: 95# 2:98# 3:0# 4:-10# 5: LNG 6;CNG 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 { 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; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeDiscount/service/impl/ActiveDiscountServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeDiscount/service/impl/ActiveDiscountServiceImpl.java index d3614193e..a3d1915db 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeDiscount/service/impl/ActiveDiscountServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeDiscount/service/impl/ActiveDiscountServiceImpl.java @@ -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 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 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 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");