diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/vo/PaymentActiveVO.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/vo/PaymentActiveVO.java index 1beb4c41e..e3781646c 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/vo/PaymentActiveVO.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/vo/PaymentActiveVO.java @@ -27,4 +27,10 @@ public class PaymentActiveVO implements Serializable { private BigDecimal cardFavorableAmount; //等级会员优惠金额 private BigDecimal memberFavorableAmount; + //订单金额 + private BigDecimal orderAmount; + //可用油品Id + private Integer oilId; + //会员等级 + private Integer mtUserLevel; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableRecordServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableRecordServiceImpl.java index 55b236276..ff68cdff0 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableRecordServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableRecordServiceImpl.java @@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.fuint.business.marketingActivity.activeDiscountRecords.entity.ActiveDiscountRecords; import com.fuint.business.marketingActivity.activeDiscountRecords.mapper.ActiveDiscountRecordsMapper; import com.fuint.business.marketingActivity.activeDiscountRecords.service.ActiveDiscountRecordsService; +import com.fuint.business.marketingActivity.activeExchange.dto.PaymentActiveDTO; +import com.fuint.business.marketingActivity.activeExchange.service.ActiveExchangeService; import com.fuint.business.marketingActivity.activeExchange.vo.PaymentActiveVO; import com.fuint.business.marketingActivity.activeFullminusRecords.entity.ActiveFullminusRecords; import com.fuint.business.marketingActivity.activeFullminusRecords.mapper.ActiveFullminusRecordsMapper; @@ -27,6 +29,7 @@ import com.fuint.common.dto.AccountInfo; import com.fuint.common.util.TokenUtil; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; +import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -57,6 +60,9 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl { + if (item.includes("storeId")) { + storeId = item.split("=")[1] + }else { + staffId = item.split("=")[1] + } + }) + }else{ + if (str.includes("storeId")) { + storeId = str.split("=")[1] + } + } + uni.setStorageSync("storeId", storeId) + uni.setStorageSync("inviteStaffId", staffId) + uni.showLoading({ + title:uni.getStorageSync("storeId") + "staffId" + uni.getStorageSync("inviteStaffId") + }) + } + } // #endif }, onShow: function() { diff --git a/gasStation-uni/pages/refuel/refuel.vue b/gasStation-uni/pages/refuel/refuel.vue index 202c7d3fe..331438966 100644 --- a/gasStation-uni/pages/refuel/refuel.vue +++ b/gasStation-uni/pages/refuel/refuel.vue @@ -175,33 +175,40 @@ tabbar }, onLoad(query) { - const q = decodeURIComponent(query.q) // 获取到二维码原始链接内容 - if (query.q) { - let str = q.split("?")[1]; - let storeId = "19"; - - let staffId = ""; - if (str.includes("&")){ - let arr = str.split("&"); - arr.forEach(item => { - if (item.includes("storeId")) { - storeId = item.split("=")[1] - } else { - staffId = item.split("=")[1] - } - }) - }else{ - storeId = str.split("=")[1] + if (uni.getStorageSync("appltType") == "WECHAT"){ + const q = decodeURIComponent(query.q) // 获取到二维码原始链接内容 + if (query.q) { + let str = q.split("?")[1]; + let storeId = "19"; + + let staffId = ""; + if (str.includes("&")){ + let arr = str.split("&"); + arr.forEach(item => { + if (item.includes("storeId")) { + storeId = item.split("=")[1] + } else { + staffId = item.split("=")[1] + } + }) + }else{ + storeId = str.split("=")[1] + } + uni.setStorageSync("storeId", storeId) + uni.setStorageSync("inviteStaffId", staffId) + this.storeId = uni.getStorageSync("storeId") + this.staffId = uni.getStorageSync("inviteStaffId") + this.getStore(uni.getStorageSync("storeId")); + } + }else{ + if (uni.getStorageSync("storeId")){ + this.getStore(uni.getStorageSync("storeId")); } - - - uni.setStorageSync("storeId", storeId) - uni.setStorageSync("inviteStaffId", staffId) - this.storeId = uni.getStorageSync("storeId") - this.staffId = uni.getStorageSync("inviteStaffId") - this.getStore(uni.getStorageSync("storeId")); } + + + }, onShow() { // this.isExistStoreId(); @@ -333,7 +340,22 @@ // 跳转订单详情页,并支付 getSIndex(index,id) { this.sindex = index - this.toPayment(id) + // 校验油罐内油量是否足够 + request({ + url: "business/petrolStationManagement/oilTank/" + uni.getStorageSync('tankId'), + method: 'get', + }).then((res)=>{ + if (res.data.storedQuantity-this.liters<0){ + uni.showToast({ + title:"所加油的升数大于油罐内的升数,请重新选择加油升数", + icon:"none" + }) + return; + }else { + this.toPayment(id) + } + + }) }, toPayment(id){ this.oilOrder.orderAmount = this.value diff --git a/gasStation-uni/pagesRefuel/orderDetail/index.vue b/gasStation-uni/pagesRefuel/orderDetail/index.vue index 31c9928c4..27f6fefa2 100644 --- a/gasStation-uni/pagesRefuel/orderDetail/index.vue +++ b/gasStation-uni/pagesRefuel/orderDetail/index.vue @@ -324,6 +324,9 @@ } if(res.data.success == "ok"){ _this.preferentialData.storeId = _this.oilOrder.storeId + _this.preferentialData.orderAmount = _this.oilOrder.orderAmount + _this.preferentialData.oilId = _this.oilOrder.oils + _this.preferentialData.mtUserLevel = _this.user.gradeId request({ url: "business/marketingActivity/cardFavorableRecord/updateCardAndActiveById", method: 'post', @@ -361,6 +364,9 @@ console.log('success'); // 支付成功后调用修改使用后的优惠券情况 _this.preferentialData.storeId = _this.oilOrder.storeId + _this.preferentialData.orderAmount = _this.oilOrder.orderAmount + _this.preferentialData.oilId = _this.oilOrder.oils + _this.preferentialData.mtUserLevel = _this.user.gradeId request({ url: "business/marketingActivity/cardFavorableRecord/updateCardAndActiveById", method: 'post', @@ -393,6 +399,9 @@ console.log("支付成功") // 支付成功后调用修改使用后的优惠券情况 _this.preferentialData.storeId = _this.oilOrder.storeId + _this.preferentialData.orderAmount = _this.oilOrder.orderAmount + _this.preferentialData.oilId = _this.oilOrder.oils + _this.preferentialData.mtUserLevel = _this.user.gradeId request({ url: "business/marketingActivity/cardFavorableRecord/updateCardAndActiveById", method: 'post',