diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/entity/ActiveRecommendRecords.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/entity/ActiveRecommendRecords.java index de9da036c..06fee4766 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/entity/ActiveRecommendRecords.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/entity/ActiveRecommendRecords.java @@ -34,6 +34,8 @@ public class ActiveRecommendRecords extends Model { private String inviteeUserId; //被邀请人姓名 private String inviteeUserName; + //来源 + private String type; //创建者 private String createBy; //创建时间 @@ -44,96 +46,5 @@ public class ActiveRecommendRecords extends Model { //更新时间 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date updateTime; - - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public Integer getActiveNewlywedsId() { - return activeNewlywedsId; - } - - public void setActiveNewlywedsId(Integer activeNewlywedsId) { - this.activeNewlywedsId = activeNewlywedsId; - } - - public Integer getChainStoreId() { - return chainStoreId; - } - - public void setChainStoreId(Integer chainStoreId) { - this.chainStoreId = chainStoreId; - } - - public Integer getStoreId() { - return storeId; - } - - public void setStoreId(Integer storeId) { - this.storeId = storeId; - } - - public String getUserId() { - return userId; - } - - public void setUserId(String userId) { - this.userId = userId; - } - - public String getInviteeUserId() { - return inviteeUserId; - } - - public void setInviteeUserId(String inviteeUserId) { - this.inviteeUserId = inviteeUserId; - } - - public String getCreateBy() { - return createBy; - } - - public void setCreateBy(String createBy) { - this.createBy = createBy; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public String getUpdateBy() { - return updateBy; - } - - public void setUpdateBy(String updateBy) { - this.updateBy = updateBy; - } - - public Date getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } - - /** - * 获取主键值 - * - * @return 主键值 - */ - @Override - protected Serializable pkVal() { - return this.id; - } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/xml/CardFavorableRecordMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/xml/CardFavorableRecordMapper.xml index d89773cdf..ca17cfaa6 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/xml/CardFavorableRecordMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/xml/CardFavorableRecordMapper.xml @@ -61,11 +61,12 @@ card_favorables.couponName, card_favorables.id, card_favorables.couponAmount, - card_favorables.couponContent + card_favorables.couponContent, + card_favorables.cardRecordId from (SELECT '优惠券' AS couponType, - cf.NAME couponName ,cf.id id,cf.discount_amount couponAmount,cf.satisfied_amount couponContent + cf.NAME couponName ,cf.id id,cf.discount_amount couponAmount,cf.satisfied_amount couponContent,cfr.id cardRecordId FROM card_favorable cf LEFT JOIN card_favorable_record cfr ON cf.id = cfr.card_favorable_id @@ -75,7 +76,7 @@ and cfr.store_id = #{cardFavorableDTOS.storeId} UNION ALL SELECT '兑换券' AS couponType, - ce.NAME couponName, ce.id id, ce.count couponAmount, ce.use_instructions couponContent + ce.NAME couponName, ce.id id, ce.count couponAmount, ce.use_instructions couponContent,cer.id cardRecordId FROM card_exchange_record cer LEFT JOIN card_exchange ce ON cer.card_exchange_id = ce.id @@ -86,7 +87,7 @@ and cer.store_id = #{cardFavorableDTOS.storeId} UNION ALL SELECT '洗车券' AS couponType, - ce.NAME couponName, ce.id id, ce.count couponAmount, ce.use_instructions couponContent + ce.NAME couponName, ce.id id, ce.count couponAmount, ce.use_instructions couponContent,cer.id cardRecordId FROM card_exchange_record cer LEFT JOIN card_exchange ce ON cer.card_exchange_id = ce.id @@ -97,7 +98,7 @@ and cer.store_id = #{cardFavorableDTOS.storeId} UNION ALL SELECT '洗车卡' AS couponType, - ce.NAME couponName, ce.id id, ce.count couponAmount, ce.use_instructions couponContent + ce.NAME couponName, ce.id id, ce.count couponAmount, ce.use_instructions couponContent,cer.id cardRecordId FROM card_exchange_record cer LEFT JOIN card_exchange ce ON cer.card_exchange_id = ce.id diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/CardFavorableRecordService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/CardFavorableRecordService.java index f0f15ecf1..12092cb70 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/CardFavorableRecordService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/CardFavorableRecordService.java @@ -48,5 +48,12 @@ public interface CardFavorableRecordService extends IService cardValueVouchers = getCardValueVouchers(cardValue); - //筛选符合条件的优惠券并计算优惠金额 - if (CollectionUtils.isNotEmpty(cardValueVouchers)) { - for (CardFavorable cardValueVoucher : cardValueVouchers) { - if (ObjectUtils.isNotEmpty(cardValueVoucher)){ - cardValueOrders.setCardFavorableId(cardValueVoucher.getId()); - CardFavorableRecord cardFavorableRecord = new CardFavorableRecord(); - cardFavorableRecord.setCardFavorableId(cardValueVoucher.getId()); - cardFavorableRecord.setStoreId(nowAccountInfo.getStoreId()); - cardFavorableRecord.setMtUserId(nowAccountInfo.getId()); - cardFavorableRecord.setName(nowAccountInfo.getRealName()); - cardFavorableRecord.setMobile(ljUserVo.getMobile()); - cardFavorableRecord.setStatus("0"); - cardFavorableRecord.setExchangeFrom("充值送券"); - cardFavorableRecordService.save(cardFavorableRecord); - } - *//* - if (cardValue.getRechargeBalance() >= cardValueVoucher.getSatisfiedAmount()) { - cardFavorableValue += cardValueVoucher.getDiscountAmount(); - }*//* + //优惠券优惠金额 + if (ObjectUtils.isNotEmpty(cardValueRecordDTO.getCardFavorableId())){ + CardFavorable cardFavorable = cardFavorableService.getById(cardValueRecordDTO.getCardFavorableId()); + if (cardValue.getRechargeBalance() >= cardFavorable.getSatisfiedAmount()) { + cardFavorableValue += cardFavorable.getDiscountAmount(); } - }*/ - /*//查询储值卡对应的兑换券列表 - List cardExchangeVouchers = getCardExchangeVouchers(cardValue); - if (CollectionUtils.isNotEmpty(cardExchangeVouchers)){ - for (CardExchange cardExchangeVoucher : cardExchangeVouchers) { - if (ObjectUtils.isNotEmpty(cardExchangeVoucher)){ - CardExchangeRecord cardExchangeRecord = new CardExchangeRecord(); - cardValueOrders.setCardExchangeId(cardExchangeVoucher.getId()); - cardExchangeRecord.setCardExchangeId(cardExchangeVoucher.getId()); - cardExchangeRecord.setStoreId(ljUserVo.getStoreId()); - cardExchangeRecord.setMtUserId(ljUserVo.getId()); - cardExchangeRecord.setName(ljUserVo.getName()); - cardExchangeRecord.setMobile(ljUserVo.getMobile()); - cardExchangeRecord.setPhoto(ljUserVo.getAvatar()); - cardExchangeRecord.setMtStaffId(ljStaff.getId()); - cardExchangeRecord.setRealName(ljStaff.getRealName()); - cardExchangeRecord.setStaffMobile(ljStaff.getMobile()); - cardExchangeRecord.setExchangeName(cardExchangeVoucher.getName()); - cardExchangeRecord.setExchangeFrom("充值送券"); - cardExchangeRecord.setGiftName(cardExchangeVoucher.getGiftName()); - cardExchangeRecord.setDescription(cardExchangeVoucher.getUseInstructions()); - cardExchangeRecord.setStatus("0"); - cardExchangeRecord.setStartTime(cardExchangeVoucher.getCreateTime()); - cardExchangeRecord.setEndTime(cardExchangeVoucher.getOutTime()); - cardExchangeRecordService.save(cardExchangeRecord); - } - } - }*/ + } //订单号 SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); String timestamp = dateFormat.format(new Date()); @@ -222,6 +180,14 @@ public class CardValueRecordServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(CardFavorableRecord::getId,cardValueOrders.getCardRecordId()); + lambdaQueryWrapper.eq(CardFavorableRecord::getStatus,"1");*/ + cardFavorableRecordService.updateById(cardFavorableRecord); + } //查询储值卡对应的优惠券列表 List cardValueVouchers = getCardValueVouchers(cardValue); //送优惠券兑换券 @@ -789,7 +749,6 @@ public class CardValueRecordServiceImpl extends ServiceImpl { private Integer cardFavorableId; //兑换券id private Integer cardExchangeId; + //卡券领取记录id + private Integer cardRecordId; //创建者 private String createBy; //创建时间 diff --git a/gasStation-uni/pagesHome/oilRecharge/oilRecharge.vue b/gasStation-uni/pagesHome/oilRecharge/oilRecharge.vue index 5ba07927b..368752d8e 100644 --- a/gasStation-uni/pagesHome/oilRecharge/oilRecharge.vue +++ b/gasStation-uni/pagesHome/oilRecharge/oilRecharge.vue @@ -149,6 +149,8 @@ export default { data() { return { + cardRecordId: '', + cardFavorableId: '', storeId: '', staffId: '', carValueId: '', @@ -198,6 +200,9 @@ onLoad(option) { this.storeId = uni.getStorageSync("storeId") this.actinput = option.id + this.cardFavorableId = option.cardFavorableId + this.cardRecordId = option.cardRecordId + console.log('11111111111111', this.cardRecordId); if (option.id == 0) { this.getValueCars(); } @@ -235,7 +240,9 @@ payType: 'WECHAT', mtStaffId: this.staffId, id: this.carValueId, - storeId: this.storeId + storeId: this.storeId, + cardFavorableId: this.cardFavorableId, + cardRecordId: this.cardRecordId }, }).then(res => { if (res.code === 200) { diff --git a/gasStation-uni/pagesMy/Coupons/Coupons.vue b/gasStation-uni/pagesMy/Coupons/Coupons.vue index 2ceda3c01..0323402b3 100644 --- a/gasStation-uni/pagesMy/Coupons/Coupons.vue +++ b/gasStation-uni/pagesMy/Coupons/Coupons.vue @@ -26,7 +26,8 @@ {{item.couponContent}} 有效期:2023-11-30 - + 立即使用 @@ -104,7 +105,6 @@ onShow() { this.query.storeId = uni.getStorageSync("storeId") this.isDrawDown(); - console.log(this.query); }, @@ -164,9 +164,10 @@ this.getAllCardFavorables(); }) }, - goRecharge() { + goRecharge(id, cardRecordId) { uni.navigateTo({ - url: '/pagesHome/oilRecharge/oilRecharge?id=0' + url: '/pagesHome/oilRecharge/oilRecharge?id=0&cardFavorableId=' + id + '&cardRecordId=' + + cardRecordId }) }, click(item) {