diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/controller/ActiveConsumptionController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/controller/ActiveConsumptionController.java index 2faef0233..6aa945cde 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/controller/ActiveConsumptionController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/controller/ActiveConsumptionController.java @@ -68,6 +68,17 @@ public class ActiveConsumptionController extends BaseController { return getSuccessResult(this.activeConsumptionService.getOneById(id)); } + /** + * 通过id查询数据集合 + * + * @param id 主键 + * @return 单条数据 + */ + @GetMapping("/list/{id}") + public ResponseObject selectList(@PathVariable Serializable id) { + return getSuccessResult(this.activeConsumptionChildService.selectList(id)); + } + /** * 新增数据 * diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/entity/ActiveConsumption.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/entity/ActiveConsumption.java index 3e6c832f6..b4566c640 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/entity/ActiveConsumption.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/entity/ActiveConsumption.java @@ -4,6 +4,7 @@ import java.util.Date; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.activerecord.Model; import com.fasterxml.jackson.annotation.JsonFormat; @@ -16,6 +17,7 @@ import java.io.Serializable; * @since 2023-11-10 10:44:58 */ @SuppressWarnings("serial") +@TableName("active_consumption") public class ActiveConsumption extends Model { //主键id @TableId(type = IdType.AUTO) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/mapper/ActiveConsumptionChildMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/mapper/ActiveConsumptionChildMapper.java index ce5c12d98..15882405c 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/mapper/ActiveConsumptionChildMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/mapper/ActiveConsumptionChildMapper.java @@ -3,6 +3,9 @@ package com.fuint.business.marketingActivity.activeConsumption.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumptionChild; +import java.io.Serializable; +import java.util.List; + /** * 消费有礼活动子表(存放兑换物品)(ActiveConsumptionChild)表数据库访问层 * @@ -11,4 +14,6 @@ import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsu */ public interface ActiveConsumptionChildMapper extends BaseMapper { + + List selectConsumptionChilds(Serializable id); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/mapper/ActiveConsumptionMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/mapper/ActiveConsumptionMapper.java index f890d91fb..8090731e9 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/mapper/ActiveConsumptionMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/mapper/ActiveConsumptionMapper.java @@ -1,7 +1,12 @@ package com.fuint.business.marketingActivity.activeConsumption.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumption; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 消费有礼活动(ActiveConsumption)表数据库访问层 @@ -11,5 +16,6 @@ import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsu */ public interface ActiveConsumptionMapper extends BaseMapper { + IPage selectConsumptions(Page page, @Param("activeConsumption") ActiveConsumption activeConsumption); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/mapper/xml/ActiveConsumptionChildMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/mapper/xml/ActiveConsumptionChildMapper.xml new file mode 100644 index 000000000..49ecd96a0 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/mapper/xml/ActiveConsumptionChildMapper.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/mapper/xml/ActiveConsumptionMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/mapper/xml/ActiveConsumptionMapper.xml index 31b5b7c30..9a4a82667 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/mapper/xml/ActiveConsumptionMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/mapper/xml/ActiveConsumptionMapper.xml @@ -2,46 +2,55 @@ - + - - - + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - select - og.id, og.gun_name, og.tank_id, og.status, og.store_id, og.create_time, og.update_time, og.create_by, og.update_by, og.number_id, ot.tank_name, - og.oil_machine_gun_number - from oil_gun og left join oil_tank ot on og.tank_id = ot.id + * + from active_consumption - - and og.id = #{oilGun.id} + + and status = #{activeConsumption.status} - - and og.gun_name = #{oilGun.gunName} + + and isonline = #{activeConsumption.isonline} - - and og.tank_id = #{oilGun.tankId} + + and store_id = #{activeConsumption.storeId} - - and og.status = #{oilGun.status} - - - and og.store_id = #{oilGun.storeId} - - - and og.update_by = #{oilGun.updateBy} + + and name like concat('%', #{activeConsumption.name}, '%') + order by create_time desc \ No newline at end of file diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/ActiveConsumptionChildService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/ActiveConsumptionChildService.java index d2e37755f..1702d4ed0 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/ActiveConsumptionChildService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/ActiveConsumptionChildService.java @@ -3,6 +3,9 @@ package com.fuint.business.marketingActivity.activeConsumption.service; import com.baomidou.mybatisplus.extension.service.IService; import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumptionChild; +import java.io.Serializable; +import java.util.List; + /** * 消费有礼活动子表(存放兑换物品)(ActiveConsumptionChild)表服务接口 * @@ -11,4 +14,6 @@ import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsu */ public interface ActiveConsumptionChildService extends IService { + + List selectList(Serializable id); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/ActiveConsumptionService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/ActiveConsumptionService.java index 40e47344a..341c5d878 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/ActiveConsumptionService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/ActiveConsumptionService.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.fuint.business.marketingActivity.activeConsumption.dto.ActiveConsumptionDTO; import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumption; +import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumptionChild; import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionAppletVO; import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionVO; diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionChildServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionChildServiceImpl.java index 532f0f4de..8ae507408 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionChildServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionChildServiceImpl.java @@ -6,6 +6,10 @@ import com.fuint.business.marketingActivity.activeConsumption.mapper.ActiveConsu import com.fuint.business.marketingActivity.activeConsumption.service.ActiveConsumptionChildService; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.io.Serializable; +import java.util.List; + /** * 消费有礼活动子表(存放兑换物品)(ActiveConsumptionChild)表服务实现类 * @@ -15,4 +19,10 @@ import org.springframework.stereotype.Service; @Service("activeConsumptionChildService") public class ActiveConsumptionChildServiceImpl extends ServiceImpl implements ActiveConsumptionChildService { + @Resource + private ActiveConsumptionChildMapper activeConsumptionChildMapper; + @Override + public List selectList(Serializable id) { + return activeConsumptionChildMapper.selectConsumptionChilds(id); + } } 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 b50ca521e..5fc6b4984 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 @@ -13,6 +13,7 @@ import com.fuint.business.marketingActivity.activeConsumption.service.ActiveCons import com.fuint.business.marketingActivity.activeConsumption.service.ActiveConsumptionService; import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionAppletVO; import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionVO; +import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionVOS; import com.fuint.business.petrolStationManagement.service.OilNameService; import com.fuint.business.store.service.StoreService; import com.fuint.business.userManager.entity.LJUserGrade; @@ -49,6 +50,8 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>(); - if(ObjectUtils.isNotEmpty(activeConsumption.getName())){ - queryWrapper.like(ActiveConsumption::getName,activeConsumption.getName()); - } - if(ObjectUtils.isNotEmpty(activeConsumption.getStatus())) { - queryWrapper.eq(ActiveConsumption::getStatus,activeConsumption.getStatus()); - } - if(ObjectUtils.isNotEmpty(activeConsumption.getIsonline())) { - queryWrapper.eq(ActiveConsumption::getIsonline,activeConsumption.getIsonline()); - } - queryWrapper.eq(ActiveConsumption::getStoreId,TokenUtil.getNowAccountInfo().getStoreId()); - queryWrapper.orderByDesc(ActiveConsumption::getCreateTime); - IPage page1 = page(page, queryWrapper); - //会员等级 - List records = page1.getRecords(); + public IPage select(Page page, ActiveConsumption activeConsumption) { + //所属店铺id + activeConsumption.setStoreId(TokenUtil.getNowAccountInfo().getStoreId()); + //查询活动及其兑换券 + IPage activeConsumptionVOSIPage = activeConsumptionMapper.selectConsumptions(page, activeConsumption); + List records = activeConsumptionVOSIPage.getRecords(); List activeConsumptionVOList = records.stream().map(s ->{ ActiveConsumptionVO activeConsumptionVO = new ActiveConsumptionVO(); - //获取兑换物品信息 - LambdaQueryWrapper queryWrappers = new LambdaQueryWrapper<>(); - queryWrappers.eq(ActiveConsumptionChild::getActiveConsumptionId,s.getId()); - queryWrappers.orderByDesc(ActiveConsumptionChild::getCreateTime); - List activeConsumptionChildList = activeConsumptionChildService.list(queryWrappers); - BeanUtils.copyProperties(s,activeConsumptionVO); activeConsumptionVO.setAdaptOil(Arrays.stream(s.getAdaptOil().split(",")) .map(Integer::valueOf) @@ -139,11 +125,10 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl activeConsumptionChildList; + //创建者 + private String createBy; + //创建时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + //更新者 + private String updateBy; + //更新时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java index da84218b0..f7785a2ca 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java @@ -31,6 +31,9 @@ import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable; import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord; import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService; import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService; +import com.fuint.business.marketingActivity.cardValue.entity.CardValue; +import com.fuint.business.marketingActivity.cardValue.service.CardValueService; +import com.fuint.business.marketingActivity.cardValue.vo.CardValueAppletVO; import com.fuint.business.userManager.service.LJUserGradeService; import org.apache.commons.lang3.ObjectUtils; import org.springframework.beans.BeanUtils; @@ -67,6 +70,8 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { private ActiveNewlywedsService activeNewlywedsService; @Resource private ActiveRecommendService activeRecommendService; + @Resource + private CardValueService cardValueService; /** * 分页查询所有 * @param @@ -339,6 +344,20 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { activeAppletVO.setDes("活动准备中,敬请期待!"); activeAppletVOS.add(activeAppletVO); } + //充值有礼 + List cardValueAppletVOS = cardValueService.selectAllApplet(new CardValue()); + if (CollectionUtils.isNotEmpty(cardValueAppletVOS)){ + ActiveAppletVO activeAppletVO = new ActiveAppletVO(); + activeAppletVO.setName("储值卡充值活动"); + activeAppletVO.setDes(cardValueAppletVOS.get(0).getDiscountActiveDescribe()); + activeAppletVO.setTime(cardValueAppletVOS.get(0).getTime()); + activeAppletVOS.add(activeAppletVO); + }else { + ActiveAppletVO activeAppletVO = new ActiveAppletVO(); + activeAppletVO.setName("储值卡充值活动"); + activeAppletVO.setDes("活动准备中,敬请期待!"); + activeAppletVOS.add(activeAppletVO); + } return activeAppletVOS; } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/controller/CardValueController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/controller/CardValueController.java index 2a1462899..9791d9b72 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/controller/CardValueController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/controller/CardValueController.java @@ -2,6 +2,7 @@ package com.fuint.business.marketingActivity.cardValue.controller; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumption; import com.fuint.business.marketingActivity.cardValue.dto.CardValueDTO; import com.fuint.business.marketingActivity.cardValue.entity.CardValue; import com.fuint.business.marketingActivity.cardValue.service.CardValueService; @@ -44,6 +45,16 @@ public class CardValueController extends BaseController { return getSuccessResult(this.cardValueService.select(page, cardValue)); } + /** + * 查询所有数据(小程序端) + * @param cardValue + * @return + */ + @GetMapping("appletList") + public ResponseObject selectAllApplet(@Param("cardValue") CardValue cardValue) { + return getSuccessResult(this.cardValueService.selectAllApplet(cardValue)); + } + /** * 通过主键查询单条数据 * diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/CardValueService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/CardValueService.java index 0a72d882d..b564419eb 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/CardValueService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/CardValueService.java @@ -5,9 +5,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.fuint.business.marketingActivity.cardValue.dto.CardValueDTO; import com.fuint.business.marketingActivity.cardValue.entity.CardValue; +import com.fuint.business.marketingActivity.cardValue.vo.CardValueAppletVO; import com.fuint.business.marketingActivity.cardValue.vo.CardValueVO; import java.io.Serializable; +import java.util.List; /** * 储值卡表(CardValue)表服务接口 @@ -45,5 +47,13 @@ public interface CardValueService extends IService { * @return */ boolean updateOneById(CardValueDTO cardValueDTO); + + + /** + * 查询所有数据(小程序端) + * @param cardValue + * @return + */ + List selectAllApplet(CardValue cardValue); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueServiceImpl.java index 974d9202f..bc20b1567 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueServiceImpl.java @@ -5,22 +5,33 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumptionChild; +import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionAppletVO; +import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionVO; +import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscount; +import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscountChild; +import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountVO; import com.fuint.business.marketingActivity.cardValue.dto.CardValueDTO; import com.fuint.business.marketingActivity.cardValue.entity.CardValueChild; import com.fuint.business.marketingActivity.cardValue.mapper.CardValueMapper; import com.fuint.business.marketingActivity.cardValue.entity.CardValue; import com.fuint.business.marketingActivity.cardValue.service.CardValueChildService; import com.fuint.business.marketingActivity.cardValue.service.CardValueService; +import com.fuint.business.marketingActivity.cardValue.vo.CardValueAppletVO; import com.fuint.business.marketingActivity.cardValue.vo.CardValueVO; import com.fuint.business.store.service.StoreService; +import com.fuint.business.userManager.service.LJUserGradeService; import com.fuint.common.util.TokenUtil; import org.apache.commons.lang3.ObjectUtils; import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.io.Serializable; +import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.stream.Collectors; @@ -38,6 +49,8 @@ public class CardValueServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>(); + //构建查询条件 + if (ObjectUtils.isNotEmpty(cardValue.getIsonline())){ + queryWrapper.eq(CardValue::getIsonline,cardValue.getIsonline()); + } + if (ObjectUtils.isNotEmpty(cardValue.getActiveStatus())){ + queryWrapper.eq(CardValue::getActiveStatus,cardValue.getActiveStatus()); + } + queryWrapper.eq(CardValue::getStoreId, TokenUtil.getNowAccountInfo().getStoreId()); + queryWrapper.orderByDesc(CardValue::getCreateTime); + IPage page1 = page(page, queryWrapper); + List records = page1.getRecords(); + //会员等级 + List cardValueVOS = records.stream().map(s ->{ + CardValueVO cardValueVO = new CardValueVO(); + //获取兑换物品信息 + LambdaQueryWrapper queryWrappers = new LambdaQueryWrapper<>(); + queryWrappers.eq(CardValueChild::getCardValueId,s.getId()); + queryWrappers.orderByDesc(CardValueChild::getCreateTime); + List cardValueChildList = cardValueChildService.list(queryWrappers); + + BeanUtils.copyProperties(s,cardValueVO); + //获取会员等级 + String str = ""; + if (ObjectUtils.isNotEmpty(s.getMembershipLevel())){ + for (String gradeId : s.getMembershipLevel().split(",")) { + if (ObjectUtils.isNotEmpty(userGradeService.selectUserGradeById(Integer.parseInt(gradeId)))){ + str += userGradeService.selectUserGradeById(Integer.parseInt(gradeId)).getName() + ","; + } + } + cardValueVO.setMembershipLevel(str.split(",")); + } + cardValueVO.setCardValueChildList(cardValueChildList); + return cardValueVO; + }).collect(Collectors.toList()); + page1.setRecords(cardValueVOS); + return page1; + } + /** * 通过主键查询单条数据(充值) * @param id @@ -167,6 +220,49 @@ public class CardValueServiceImpl extends ServiceImpl selectAllApplet(CardValue cardValue) { + //获取本油站消费有礼活动列表 + IPage page = selectAll(new Page(1, 20), cardValue); + List cardValueAppletVOList = page.getRecords(); + List appletVOList = cardValueAppletVOList.stream().map(s -> { + CardValueAppletVO cardValueAppletVO = new CardValueAppletVO(); + //活动时间 + if (s.getActiveTime().equals("1")){ + cardValueAppletVO.setTime("不限时间"); + }else { + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd"); + String formatSt = dateFormat.format(s.getStartTime()); + String formatEd = dateFormat.format(s.getEndTime()); + cardValueAppletVO.setTime(formatSt+"-" + formatEd+""); + } + //适用用户名 + String adaptUserType = ""; + if (s.getGroupOriented().equals("1")){ + adaptUserType = "普通群体"; + }else { + adaptUserType = arrayToString(s.getMembershipLevel()); + //adaptUserType = s.getMembershipLevel(); + } + //赠送优惠券兑换券实物 + String card = ""; + if (CollectionUtils.isNotEmpty(s.getCardValueChildList())) { + for (CardValueChild cardValueChild : s.getCardValueChildList()) { + card = cardValueChild.getGiftCardDetail() + "的券"; + } + } + cardValueAppletVO.setDiscountActiveDescribe("本充值活动"+adaptUserType+"可用,充值满"+ + s.getBidBalance()+"元,赠送金额为:"+s.getGiftBalance()+"元,赠送券:"+card+" 赠送积分:"+s.getPoints()+"积分,赠送成长值为:"+s.getGrowthValue()+"。"); + return cardValueAppletVO; + }).collect(Collectors.toList()); + return appletVOList; + } + /** * 数组转字符串 * @param array diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/vo/CardValueAppletVO.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/vo/CardValueAppletVO.java new file mode 100644 index 000000000..394ffa7a9 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/vo/CardValueAppletVO.java @@ -0,0 +1,13 @@ +package com.fuint.business.marketingActivity.cardValue.vo; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class CardValueAppletVO implements Serializable { + //活动描述 + private String discountActiveDescribe; + //活动时间 + private String time; +} diff --git a/fuintBackend/fuint-application/src/main/resources/application.properties b/fuintBackend/fuint-application/src/main/resources/application.properties index 60ef3a4f9..88bd11856 100644 --- a/fuintBackend/fuint-application/src/main/resources/application.properties +++ b/fuintBackend/fuint-application/src/main/resources/application.properties @@ -1,7 +1,7 @@ # \u57FA\u672C\u914D\u7F6E -server.port=8008 +server.port=8080 env.profile=dev -env.properties.path=D:/oil/oil/oilSystem/fuintBackend/configure/ +env.properties.path=D:/office/proj/oilSystem/fuintBackend/configure/ # \u6570\u636E\u5E93\u914D\u7F6E diff --git a/gasStation-uni/pagesHome/Activity/index.vue b/gasStation-uni/pagesHome/Activity/index.vue index 601a4ec35..b76c851ba 100644 --- a/gasStation-uni/pagesHome/Activity/index.vue +++ b/gasStation-uni/pagesHome/Activity/index.vue @@ -57,9 +57,9 @@ }) }, getData() { - uni.showLoading({ - title: '加载中' - }); + /*uni.showLoading({ + //title: '加载中' + });*/ request({ url: 'business/marketingActivity/activeExchange/applet', method: 'get', diff --git a/gasStation-uni/pagesHome/activeIn/index.vue b/gasStation-uni/pagesHome/activeIn/index.vue index fc077398e..781e3556f 100644 --- a/gasStation-uni/pagesHome/activeIn/index.vue +++ b/gasStation-uni/pagesHome/activeIn/index.vue @@ -59,7 +59,7 @@ methods: { getData(name) { uni.showLoading({ - title: '加载中' + //title: '加载中' }); if (name == '消费有礼活动') { request({