From 12c27fa77cdc61b36b34e6ada604ccb2ce61ad4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BD=90=E5=A4=A9=E5=A4=A7=E5=9C=A3?= <17615834396@163.com> Date: Wed, 6 Mar 2024 14:27:42 +0800 Subject: [PATCH] bug --- .../entity/ActiveConsumptionChild.java | 1 + .../impl/ActiveConsumptionServiceImpl.java | 61 +++++++++++++++++++ .../controller/CardExchangeController.java | 9 ++- .../cardExchange/entity/CardExchange.java | 2 +- .../controller/CardFavorableController.java | 26 ++++---- .../cardFavorable/entity/CardFavorable.java | 2 + .../impl/CardFavorableServiceImpl.java | 17 ++++-- 7 files changed, 97 insertions(+), 21 deletions(-) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/entity/ActiveConsumptionChild.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/entity/ActiveConsumptionChild.java index 2e9c71ccc..a3da2c07c 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/entity/ActiveConsumptionChild.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/entity/ActiveConsumptionChild.java @@ -23,6 +23,7 @@ public class ActiveConsumptionChild { * 活动奖品 0:赠送积分1:赠送优惠券 2. 赠送兑换券 3:赠送成长值 4. 赠送实物 */ private String activeGift; + private String instruction; /** * 商品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 d70d1439e..aed948d27 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 @@ -14,14 +14,24 @@ import com.fuint.business.marketingActivity.activeConsumption.service.ActiveCons 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.marketingActivity.cardExchange.entity.CardExchange; import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord; +import com.fuint.business.marketingActivity.cardExchange.mapper.CardExchangeMapper; import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService; +import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeService; +import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable; import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord; +import com.fuint.business.marketingActivity.cardFavorable.mapper.CardFavorableMapper; import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService; +import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService; +import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableVO; +import com.fuint.business.member.entity.LJStaff; +import com.fuint.business.member.service.ILJStaffService; import com.fuint.business.petrolStationManagement.service.OilNameService; import com.fuint.business.store.service.StoreService; import com.fuint.business.userManager.entity.LJUserGrade; import com.fuint.business.userManager.service.LJUserGradeService; +import com.fuint.common.dto.AccountInfo; import com.fuint.common.util.TokenUtil; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; @@ -49,18 +59,35 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl activeConsumptionChildList = activeConsumptionChildService.list(queryWrapper); BeanUtils.copyProperties(consumption,activeConsumptionVO); if (CollectionUtils.isNotEmpty(activeConsumptionChildList)){ + //更新子表卡券信息 + for (ActiveConsumptionChild activeConsumptionChild : activeConsumptionChildList) { + //优惠券 + if (activeConsumptionChild.getActiveGift().equals("1")){ + CardFavorable cardFavorable = cardFavorableMapper.selectById(activeConsumptionChild.getVouchersId()); + if (ObjectUtils.isNotEmpty(cardFavorable)){ + activeConsumptionChild.setGiftCardName(cardFavorable.getName()); + activeConsumptionChild.setGiftCardDetail(cardFavorable.getCardDetail()); + if (ObjectUtils.isNotEmpty(cardFavorable.getValidityZero())){ + activeConsumptionChild.setValidityZero(cardFavorable.getValidityZero()); + } + if (ObjectUtils.isNotEmpty(cardFavorable.getValidityOne())){ + activeConsumptionChild.setValidityOne(cardFavorable.getValidityOne()); + } + if (ObjectUtils.isNotEmpty(cardFavorable.getValidityTwo())){ + activeConsumptionChild.setValidityTwo(cardFavorable.getValidityTwo()); + } + activeConsumptionChild.setInstruction(cardFavorable.getInstruction()); + activeConsumptionChildService.updateById(activeConsumptionChild); + } + } + if (activeConsumptionChild.getActiveGift().equals("2")){ + //兑换券 + CardExchange cardExchange = cardExchangeMapper.selectById(activeConsumptionChild.getVouchersId()); + if (ObjectUtils.isNotEmpty(cardExchange)) { + activeConsumptionChild.setGiftCardName(cardExchange.getName()); + activeConsumptionChild.setGiftCardDetail(cardExchange.getCardDetail()); + activeConsumptionChild.setGiftCardTime(cardExchange.getValidity()); + activeConsumptionChildService.updateById(activeConsumptionChild); + activeConsumptionChild.setInstruction(cardExchange.getUseInstructions()); + } + } + } //封装VO返回 activeConsumptionVO.setParticipationConditionMoney(consumption.getParticipationConditionMoney().toString()); activeConsumptionVO.setDieselUserLevel(consumption.getDieselUserLevel().split(",")); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/controller/CardExchangeController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/controller/CardExchangeController.java index 71295197c..03d9a48b3 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/controller/CardExchangeController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/controller/CardExchangeController.java @@ -38,8 +38,8 @@ public class CardExchangeController extends BaseController { */ @GetMapping public ResponseObject selectAll(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo, - @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, - @Param("cardFuelDiesel") CardExchange cardExchange) { + @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, + @Param("cardFuelDiesel") CardExchange cardExchange) { Page page = new Page(pageNo, pageSize); return getSuccessResult(this.cardExchangeService.select(page, cardExchange)); } @@ -77,6 +77,11 @@ public class CardExchangeController extends BaseController { if (cardExchange.getIsonline().equals("1")){ cardExchange.setStatus("1"); } + if (cardExchange.getType().equals("0")){ + cardExchange.setCardDetail("可兑换-"+cardExchange.getGiftName()); + }else { + cardExchange.setCardDetail("可兑换-"+"洗车券"); + } return getSuccessResult(this.cardExchangeService.updateById(cardExchange)); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/entity/CardExchange.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/entity/CardExchange.java index 4f096341f..37eee07dd 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/entity/CardExchange.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/entity/CardExchange.java @@ -59,5 +59,5 @@ public class CardExchange extends Model { //更新时间 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") private Date updateTime; - } +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/controller/CardFavorableController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/controller/CardFavorableController.java index 3051bd2fe..bcb0c5284 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/controller/CardFavorableController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/controller/CardFavorableController.java @@ -55,8 +55,8 @@ public class CardFavorableController extends BaseController { */ @GetMapping("appletList") public ResponseObject selectAllApplet(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo, - @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, - @Param("cardFuelDiesel") CardFavorable cardFavorable) { + @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, + @Param("cardFuelDiesel") CardFavorable cardFavorable) { Page page = new Page(pageNo, pageSize); return getSuccessResult(this.cardFavorableService.selectAllApplet(page,cardFavorable)); } @@ -111,13 +111,13 @@ public class CardFavorableController extends BaseController { * @param pageSize * @param cardFavorableDTO * @return - @GetMapping("OwnApplet") - public ResponseObject selectAllOwnStore(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo, - @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, - @Param("cardFuelDiesel") CardFavorableDTO cardFavorableDTO) { - Page page = new Page(pageNo, pageSize); - return getSuccessResult(this.cardFavorableService.selectAllOwnStore(page,cardFavorableDTO)); - }*/ + @GetMapping("OwnApplet") + public ResponseObject selectAllOwnStore(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, + @Param("cardFuelDiesel") CardFavorableDTO cardFavorableDTO) { + Page page = new Page(pageNo, pageSize); + return getSuccessResult(this.cardFavorableService.selectAllOwnStore(page,cardFavorableDTO)); + }*/ /** @@ -129,8 +129,8 @@ public class CardFavorableController extends BaseController { */ @GetMapping("applet") public ResponseObject selectAllByCondition(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo, - @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, - @Param("cardFuelDiesel") CardFavorableDTOS cardFavorableDTOS) { + @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, + @Param("cardFuelDiesel") CardFavorableDTOS cardFavorableDTOS) { Page page = new Page(pageNo, pageSize); return getSuccessResult(this.cardFavorableService.selectAllByCondition(page,cardFavorableDTOS)); } @@ -144,8 +144,8 @@ public class CardFavorableController extends BaseController { */ @GetMapping("PC") public ResponseObject selectAllByConditionPC(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo, - @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, - @Param("cardFuelDiesel") CardFavorableDTOS cardFavorableDTOS) { + @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, + @Param("cardFuelDiesel") CardFavorableDTOS cardFavorableDTOS) { Page page = new Page(pageNo, pageSize); return getSuccessResult(this.cardFavorableService.selectAllByConditionPC(page,cardFavorableDTOS)); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/entity/CardFavorable.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/entity/CardFavorable.java index bd4b90d5f..b1e29c7cb 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/entity/CardFavorable.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/entity/CardFavorable.java @@ -68,6 +68,8 @@ public class CardFavorable extends Model { private String availablePeriod; //可用周期类型 day:每天可用 week:周可用 month:月可用 private String checkDateType; + //使用说明 + private String instruction; //可用日期 private String checkTime; //排除日期 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableServiceImpl.java index 65e7457e0..a570fefa0 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableServiceImpl.java @@ -71,10 +71,11 @@ public class CardFavorableServiceImpl extends ServiceImpl collect = records.stream().filter(s -> s.getEndTime().getTime() < System.currentTimeMillis()).collect(Collectors.toList()); if (ObjectUtils.isNotEmpty(collect)){ for (CouponVO couponVO : collect) { - CardFavorableRecord cardFavorableRecord = new CardFavorableRecord(); - cardFavorableRecord.setId(couponVO.getCardRecordId()); - cardFavorableRecord.setStatus("2"); - cardFavorableRecordMapper.updateById(cardFavorableRecord); + CardFavorableRecord cardFavorableRecord = new CardFavorableRecord(); + cardFavorableRecord.setId(couponVO.getCardRecordId()); + cardFavorableRecord.setStatus("2"); + cardFavorableRecordMapper.updateById(cardFavorableRecord); } } //couponVOS.setRecords(collect);