From 226cab681e850d0a48b69ead2c53f1867a286d85 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: Tue, 21 May 2024 09:50:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E6=83=A0=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/FavorableRecordsServiceImpl.java | 25 ++-- .../pagesHome/oilRecharge/oilRecharge.vue | 134 ++++++++++-------- 2 files changed, 91 insertions(+), 68 deletions(-) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/favorableRecords/service/impl/FavorableRecordsServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/favorableRecords/service/impl/FavorableRecordsServiceImpl.java index 856550a4e..3a947af90 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/favorableRecords/service/impl/FavorableRecordsServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/favorableRecords/service/impl/FavorableRecordsServiceImpl.java @@ -9,13 +9,13 @@ import com.fuint.business.marketingActivity.favorableRecords.entity.FavorableRec import com.fuint.business.marketingActivity.favorableRecords.service.FavorableRecordsService; import com.fuint.common.dto.AccountInfo; import com.fuint.common.util.TokenUtil; -import com.sun.org.apache.bcel.internal.generic.NEW; -import org.apache.commons.lang3.ObjectUtils; import org.springframework.stereotype.Service; -import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; +import java.util.stream.Collectors; + /** * 优惠记录表(FavorableRecords)表服务实现类 @@ -55,17 +55,18 @@ public class FavorableRecordsServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(FavorableRecords::getStoreId, nowAccountInfo.getStoreId()); - queryWrapper.eq(FavorableRecords::getChainStoreId, nowAccountInfo.getChainStoreId()); - if (ObjectUtils.isNotEmpty(favorableRecords.getFavFrom())){ - queryWrapper.eq(FavorableRecords::getFavFrom, favorableRecords.getFavFrom()); - } - if (ObjectUtils.isNotEmpty(favorableRecords.getFavType())){ - queryWrapper.eq(FavorableRecords::getFavType, favorableRecords.getFavType()); - } - if (ObjectUtils.isNotEmpty(favorableRecords.getFavConsumptionType())){ - queryWrapper.eq(FavorableRecords::getFavConsumptionType, favorableRecords.getFavConsumptionType()); + List list = list(queryWrapper); + //优惠次数 + objectObjectHashMap.put("count", list.size()); + + double allTotalCount = 0.0; + + for (FavorableRecords records : list) { + allTotalCount += records.getFavMoney(); } + objectObjectHashMap.put("allMoney",allTotalCount); return objectObjectHashMap; } + } diff --git a/gasStation-uni/pagesHome/oilRecharge/oilRecharge.vue b/gasStation-uni/pagesHome/oilRecharge/oilRecharge.vue index 0a8cd8a41..8ec5fa5ed 100644 --- a/gasStation-uni/pagesHome/oilRecharge/oilRecharge.vue +++ b/gasStation-uni/pagesHome/oilRecharge/oilRecharge.vue @@ -18,9 +18,9 @@ - - + + {{item.discountActiveDescribe || ''}} @@ -89,26 +89,42 @@ - - + + {{item.discountActiveDescribe || ''}} - - {{item.oilType}} + + {{item.oilType}} - 国标油价{{item.gbPrice}}¥/L - 本站油价{{item.oilPrice}}¥/L - 锁价{{item.lockupPrice}}¥/L - 总升数{{item.incomeLitres || 0}}L - 总价¥{{item.rechargeBalance}} + + 国标油价 + {{item.gbPrice}}¥/L + + + 本站油价 + {{item.oilPrice}}¥/L + + + 锁价活动价 + {{item.lockPrice}}¥/L + + + 锁价满足金额 + {{item.rechargeBalance}}¥ + + + @@ -282,15 +298,16 @@ this.getStaffList() }, methods: { - changeBalance(){ - if (this.cardValueList.length>0) { - this.cardValueList.forEach((item,index) => { - console.log(this.balance>=item.rechargeBalance,111); - if (this.balance>=item.rechargeBalance){ - this.xzindex(index,this.balance,item.fringeBenefit,item.giftBalance,item.points,item.growthValue,item.count,item.id); + changeBalance() { + if (this.cardValueList.length > 0) { + this.cardValueList.forEach((item, index) => { + console.log(this.balance >= item.rechargeBalance, 111); + if (this.balance >= item.rechargeBalance) { + this.xzindex(index, this.balance, item.fringeBenefit, item.giftBalance, item.points, + item.growthValue, item.count, item.id); } }) - if (this.balance { if (res.code == 200) { - console.log(res,111); + console.log(res, 111); this.actList = res.data } }) @@ -349,14 +367,14 @@ if (res.code == 200) { console.log(res, _this.appltType) if (_this.appltType == "WECHAT") { - if(!res.data.reservedPayInfo){ + if (!res.data.reservedPayInfo) { uni.showToast({ - title:'支付失败,请联系商家', - icon:"none" + title: '支付失败,请联系商家', + icon: "none" }) return; } - + let payProvider = "wxpay" _this.orderInfo = JSON.parse(res.data.reservedPayInfo); uni.requestPayment({ @@ -393,10 +411,10 @@ } if (_this.appltType == "ALIPAY") { - if(!res.data.reservedTransactionId){ + if (!res.data.reservedTransactionId) { uni.showToast({ - title:'支付失败,请联系商家', - icon:"none" + title: '支付失败,请联系商家', + icon: "none" }) return; } @@ -433,7 +451,7 @@ }, //储值卡充值 addValueCarRecords() { - if (this.types==0){ + if (this.types == 0) { if (this.carValueId == '') { uni.showToast({ title: "当前店铺暂未设置电子囤油卡储值优惠,请先联系商家", @@ -441,8 +459,8 @@ }) return } - }else{ - if (!this.balance || this.balance<=0) { + } else { + if (!this.balance || this.balance <= 0) { uni.showToast({ title: "请填写充值金额,并确保充值金额大于0", icon: "error" @@ -450,8 +468,8 @@ return } } - - + + let _this = this request({ @@ -473,10 +491,10 @@ if (res.code === 200) { if (_this.appltType == "WECHAT") { - if(!res.data.reservedPayInfo){ + if (!res.data.reservedPayInfo) { uni.showToast({ - title:'支付失败,请联系商家', - icon:"none" + title: '支付失败,请联系商家', + icon: "none" }) return; } @@ -505,20 +523,20 @@ "status": "payFail" }, }).then((res) => {}) - uni.showToast({ - title: "支付失败!", - icon: "error" - }) + uni.showToast({ + title: "支付失败!", + icon: "error" + }) // console.log('fail:', err); } }); } } if (_this.appltType == "ALIPAY") { - if(!res.data.reservedTransactionId){ + if (!res.data.reservedTransactionId) { uni.showToast({ - title:'支付失败,请联系商家', - icon:"none" + title: '支付失败,请联系商家', + icon: "none" }) return; } @@ -605,8 +623,10 @@ this.types = index if (index == 0) { // this.getValueCars(); - if (this.cardValueList.length>0) - this.xzindex(0,this.cardValueList[0].rechargeBalance,this.cardValueList[0].fringeBenefit,this.cardValueList[0].giftBalance,this.cardValueList[0].points,this.cardValueList[0].growthValue,this.cardValueList[0].count,this.cardValueList[0].id) + if (this.cardValueList.length > 0) + this.xzindex(0, this.cardValueList[0].rechargeBalance, this.cardValueList[0].fringeBenefit, this + .cardValueList[0].giftBalance, this.cardValueList[0].points, this.cardValueList[0].growthValue, + this.cardValueList[0].count, this.cardValueList[0].id) } if (index == 1) { // this.getFuelCars(); @@ -637,7 +657,7 @@ // .growthValue, res.data.records[0] // .count, res.data.records[0].id) this.cardValueList = res.data - console.log(res.data,22); + console.log(res.data, 22); this.xzindex(0, res.data[0].rechargeBalance, res.data[0].fringeBenefit, res.data[0].giftBalance, res.data[0].points, res.data[0] .growthValue, res.data[0] @@ -666,11 +686,12 @@ //囤油卡 getFuelCarList() { request({ - url: 'business/marketingActivity/cardFuelDiesel/appletList?storeId='+uni.getStorageSync("storeId"), + url: 'business/marketingActivity/cardFuelDiesel/appletList?storeId=' + uni.getStorageSync( + "storeId"), method: 'get', }).then(res => { if (res.code == 200) { - console.log(res,111); + console.log(res, 111); this.cardList = res.data } }) @@ -678,7 +699,7 @@ //礼品卡兑换 exchangeGift() { request({ - url: '/business/marketingActivity/cardGift/exchange?number=' + this.number + "&cardPassword=" + + url: '/business/marketingActivity/cardGift/exchange?number=' + this.number + "&cardPassword=" + this.cardPassword + "&storeId=" + uni.getStorageSync("storeId"), method: 'get', }).then(res => { @@ -689,7 +710,7 @@ } else { this.shows = true this.message = '兑换成功!', - this.money = res.data.cardAmount + '元' + this.money = res.data.cardAmount + '元' this.number = "" this.cardPassword = "" } @@ -706,7 +727,7 @@ }, goRechargeRecords(val) { uni.navigateTo({ - url: '/pagesMy/Recharge/Recharge?index='+val + url: '/pagesMy/Recharge/Recharge?index=' + val }) }, //获取本店员工列表 @@ -872,6 +893,7 @@ //color: #e2e2e2; text-align: center; } + .min-size1 { font-size: 12px; //color: #e2e2e2; @@ -937,4 +959,4 @@ border-radius: 6px; background: #f4f5f6; } - \ No newline at end of file +