diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueRecordServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueRecordServiceImpl.java index 7085c3e66..415e0827f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueRecordServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueRecordServiceImpl.java @@ -19,6 +19,7 @@ import com.fuint.business.integral.entity.IntegralDetail; import com.fuint.business.integral.service.IntegralDetailService; import com.fuint.business.marketingActivity.cardExchange.entity.CardExchange; import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord; +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; @@ -102,6 +103,8 @@ public class CardValueRecordServiceImpl extends ServiceImpl= cardValueVoucher.getSatisfiedAmount()) { cardFavorableValue += cardValueVoucher.getDiscountAmount(); @@ -158,24 +163,27 @@ public class CardValueRecordServiceImpl extends ServiceImpl cardExchangeVouchers = getCardExchangeVouchers(cardValue); if (CollectionUtils.isNotEmpty(cardExchangeVouchers)){ for (CardExchange cardExchangeVoucher : cardExchangeVouchers) { - 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()); + 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); + } } } //订单号 @@ -228,7 +236,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl records = page1.getRecords(); diff --git a/gasStation-uni/pagesHome/MyCard/MyCard.vue b/gasStation-uni/pagesHome/MyCard/MyCard.vue index f41eb3a91..204e95569 100644 --- a/gasStation-uni/pagesHome/MyCard/MyCard.vue +++ b/gasStation-uni/pagesHome/MyCard/MyCard.vue @@ -75,10 +75,10 @@ 礼品卡 - + @@ -91,7 +91,7 @@ 礼品卡 - 卡号:**** **** **** **** + 卡号: **** **** **** **** 卡密: **** **** **** **** diff --git a/gasStation-uni/pagesHome/oilRecharge/oilRecharge.vue b/gasStation-uni/pagesHome/oilRecharge/oilRecharge.vue index c46e28047..5ba07927b 100644 --- a/gasStation-uni/pagesHome/oilRecharge/oilRecharge.vue +++ b/gasStation-uni/pagesHome/oilRecharge/oilRecharge.vue @@ -19,7 +19,7 @@ + @click="xzindex(index,item.rechargeBalance,item.fringeBenefit,item.giftBalance,item.points,item.growthValue,item.count,item.id)"> {{item.rechargeBalance}} 售价¥{{item.rechargeBalance}} @@ -75,8 +75,6 @@ 升数:{{item.incomeLitres}}L - - @@ -151,6 +149,9 @@ export default { data() { return { + storeId: '', + staffId: '', + carValueId: '', shows: false, money: '', message: '', @@ -160,7 +161,7 @@ actindex: 0, actInput: 0, index: 0, - text: "", + text: '', fringeBenefit: "", giftBalance: "", rechargeBalance: "", @@ -195,6 +196,7 @@ }, onLoad(option) { + this.storeId = uni.getStorageSync("storeId") this.actinput = option.id if (option.id == 0) { this.getValueCars(); @@ -204,22 +206,36 @@ this.getFuelCars(); } - }, - onShow() { - this.getValueCars(); this.getStaffList() - }, + methods: { //储值卡充值 addValueCarRecords() { + if (this.staffId == '') { + uni.showToast({ + title: "员工为必填项", + icon: Error + }) + return + } + if (this.carValueId == '') { + uni.showToast({ + title: "储值卡为必填项", + icon: Error + }) + return + } + + request({ url: 'business/marketingActivity/cardValueRecord', method: 'post', data: { payType: 'WECHAT', - mtStaffId: '4', - id: 68 + mtStaffId: this.staffId, + id: this.carValueId, + storeId: this.storeId }, }).then(res => { if (res.code === 200) { @@ -267,13 +283,16 @@ }, confirm(e) { console.log(e); + this.staffId = e.value[0].id this.show = false }, cancel() { this.show = false }, - xzindex(index, text, fringeBenefit, giftBalance, points, growthValue, count) { + xzindex(index, text, fringeBenefit, giftBalance, points, growthValue, count, id) { + console.log(text); this.shuomingList = [] + this.carValueId = id console.log(this.shuomingList); if (text) { this.text = text @@ -324,16 +343,18 @@ url: 'business/marketingActivity/cardValue/appletL', method: 'get', data: { - activeStatus: '1' + activeStatus: '1', + storeId: this.storeId, }, }).then(res => { this.cardValueList = [] if (res.code == 200) { this.cardValueList = res.data.records + console.log(res.data.records); this.xzindex(0, res.data.records[0].rechargeBalance, res.data.records[0].fringeBenefit, res.data.records[0].giftBalance, res.data.records[0].points, res.data.records[0] .growthValue, res.data.records[0] - .count) + .count, res.data.records[0].id) } }) },