@@ -823,7 +812,7 @@
checkedCities3: [],
cities3: cityOptions,
// 储值卡全选
- checkAll4: true,
+ checkAll4: false,
isIndeterminate4: true,
checkedCities4: [],
cities4: cityOptions,
@@ -900,6 +889,7 @@
// 会员列表信息
memberList:[],
select1:'会员手机号',
+ storeId:"",
// 查询会员信息参数
userNo:"",
// 查询的商品信息
@@ -1022,7 +1012,7 @@
menu:1,
index:0,
// 是否支付
- isPay:true,
+ isPay:false,
isPaySuccess:false,
// 订单号
orderNo:'',
@@ -1244,7 +1234,7 @@
}
this.checkedCities1 = val ? list : [];
this.isIndeterminate1 = false;
- this.isExclusion();
+ this.isDefaultUseCard();
},
handleCheckedCitiesChange1(value) {
this.fullReduction = 0;
@@ -1260,7 +1250,7 @@
let checkedCount = value.length;
this.checkAll1 = checkedCount === this.fullReduceDiscount.length;
this.isIndeterminate1 = checkedCount > 0 && checkedCount < this.fullReduceDiscount.length;
- this.isExclusion();
+ this.isDefaultUseCard();
},
handleCheckAllChange2(val) {
let list = []
@@ -1276,7 +1266,7 @@
}
this.checkedCities2 = val ? list : [];
this.isIndeterminate2 = false;
- this.isExclusion();
+ this.isDefaultUseCard();
},
handleCheckedCitiesChange2(value) {
this.oilDiscount = 0
@@ -1292,7 +1282,7 @@
let checkedCount = value.length;
this.checkAll2 = checkedCount === this.gradeDiscount.length;
this.isIndeterminate2 = checkedCount > 0 && checkedCount < this.gradeDiscount.length;
- this.isExclusion();
+ this.isDefaultUseCard();
},
handleCheckAllChange3(val) {
if (val==false){
@@ -1303,7 +1293,7 @@
this.isOilStorageCard = true;
this.changeRefuelMoney()
}
- this.isExclusion();
+ this.isDefaultUseCard();
},
handleCheckedCitiesChange3(value) {
let checkedCount = value.length;
@@ -1317,7 +1307,7 @@
}else {
this.isUseBalance = false;
}
- this.isExclusion();
+ this.isDefaultUseCard();
},
handleCheckedCitiesChange4(value) {
let checkedCount = value.length;
@@ -1361,7 +1351,7 @@
this.couponAmount = 0
this.checkedCities5 = ""
}
- this.isExclusion();
+ this.isDefaultUseCard();
},
handleCheckedCitiesChange5(value) {
this.couponAmount = 0;
@@ -1377,7 +1367,7 @@
}
})
this.checkAll5 = true;
- this.isExclusion();
+ this.isDefaultUseCard();
},
// 模糊查询商品信息
querySearch(queryString, cb) {
@@ -1910,7 +1900,7 @@
}
_this.oilDiscount = gasolineDiscount + dieselDiscount + naturalGasDiscount
_this.checkAll2 = true;
- _this.isExclusion();
+ _this.isDefaultUseCard();
})
},
// 选择会员
@@ -1920,10 +1910,14 @@
this.map.payUser = data.mobile;
this.map.userId = data.id;
this.balance = this.member.cardBalance;
+ if (data.refuelMoney){
+ // 使用囤油卡
+ this.refuelMoney = JSON.parse(data.refuelMoney)
+ this.changeRefuelMoney();
+ }else
this.getGrade(data.id,data.gradeId)
- this.changeRefuelMoney();
- this.handleChange();
- this.preferentialData.storeId = data.storeId;
+ // this.handleChange();
+ this.preferentialData.storeId = this.storeId;
this.preferentialData.userId = data.id;
this.preferentialData.gradeId = data.gradeId;
if (this.oilOrder.length>0){
@@ -2017,24 +2011,25 @@
})
}
_this.checkAll5 = true;
- _this.isExclusion();
+ _this.isDefaultUseCard();
})
})
},
// 使用囤油卡 囤油卡不参与任何优惠
countOilCard(){
- if (this.hoardAmount!=0){
- if (this.balance!=0 && this.balance >= (this.oilAmount - this.hoardAmount)){
+ if (this.hoardAmount>0){
+ if (this.balance!=0 && this.balance >= this.hoardAmount){
this.oilActualPay = 0
this.consumeAmount = this.hoardAmount
}else {
- this.oilActualPay = (this.oilAmount - this.hoardAmount -this.balance).toFixed(2)
+ this.oilActualPay = (this.hoardAmount -this.balance).toFixed(2)
+ this.consumeAmount = this.balance
}
}else {
this.oilActualPay = 0
this.consumeAmount = 0
}
- console.log("囤油卡",this.hoardAmount,this.balance,this.oilAmount,this.oilActualPay,this.consumeAmount)
+ console.log("囤油卡",this.isOilStorageCard,this.hoardAmount,this.balance,this.oilAmount,this.oilActualPay,this.consumeAmount)
},
// 使用优惠券不使用满减
countAmountFull(){
@@ -2050,6 +2045,7 @@
}else {
this.oilActualPay = (this.oilAmount - this.oilDiscount).toFixed(2)
}
+ console.log("优惠券",this.oilAmount, this.oilDiscount,this.couponAmount)
},
// 使用优惠券和满减不使用储值卡
countAmountUnBalance(){
@@ -2059,6 +2055,7 @@
this.oilActualPay = (this.oilAmount - this.oilDiscount).toFixed(2)
}
this.consumeAmount = 0
+ console.log("优惠券和满减",this.oilAmount , this.fullReduction , this.oilDiscount , this.couponAmount)
},
// 使用储值卡不使用优惠券 || 使用满减不使用优惠券
countAmountBalance(){
@@ -2073,6 +2070,7 @@
}else {
this.oilActualPay = (this.oilAmount - this.oilDiscount).toFixed(2)
}
+ console.log("储值卡满减",this.oilAmount, this.oilDiscount,this.fullReduction)
},
// 判断互斥限制
isExclusion(){
@@ -2117,20 +2115,39 @@
return;
}
// 使用囤油卡
- if (this.isOilStorageCard){
- this.checkAll1 = false;
- this.fullReduction = 0;
- this.checkAll2 = false;
- this.checkedCities2 = [],
- this.oilDiscount = 0;
- this.checkAll5 = false;
- this.couponAmount = 0;
- this.countOilCard();
- return;
- }
+ // if (this.isOilStorageCard){
+ // this.checkAll1 = false;
+ // this.fullReduction = 0;
+ // this.checkAll2 = false;
+ // this.checkedCities2 = [];
+ // this.oilDiscount = 0;
+ // this.checkAll5 = false;
+ // this.couponAmount = 0;
+ // this.countOilCard();
+ // return;
+ // }
this.countAmountBalance();
}
},
+ // 默认使用囤油卡
+ isDefaultUseCard(){
+ if (this.isOilStorageCard){
+ this.checkAll3 = true;
+ this.checkAll1 = false;
+ this.fullReduction = 0;
+ this.checkAll2 = false;
+ this.checkedCities2 = [];
+ this.oilDiscount = 0;
+ this.checkAll5 = false;
+ this.couponAmount = 0;
+ this.countOilCard();
+ if (this.hoardAmount>0 && this.balance > 0){
+ this.checkAll4 = true;
+ }
+ }else {
+ this.isExclusion()
+ }
+ },
// 调用优惠参数接口
preferential(){
let _this = this;
@@ -2188,7 +2205,7 @@
_this.checkedCities1 = []
_this.fullReduction = 0
}
- _this.isExclusion();
+ _this.isDefaultUseCard();
})
})
},
@@ -2196,9 +2213,9 @@
handleChoose(data) {
this.isSure = false;
this.member = data;
- if (data.refuelMoney != null && data.refuelMoney != ""){
- this.refuelMoney = JSON.parse(data.refuelMoney)
- }
+ // if (data.refuelMoney != null && data.refuelMoney != ""){
+ // this.refuelMoney = JSON.parse(data.refuelMoney)
+ // }
this.dialogVisibleMember = false;
},
// 清空商品订单列表
@@ -2278,8 +2295,10 @@
settlement(){
this.authCode = ""
this.seekZero = 0;
- this.isPay = true
+ this.isPay = false
+ console.log(this.isPay)
this.dialogVisiblej = true
+ this.getStaff()
},
// 重置油品订单
resetting(){
@@ -2362,13 +2381,17 @@
_this.consumeRefuelMoney = 0;
_this.oilActualPay = 0;
_this.hoardAmount = 0;
+ _this.oilAmount = 0;
_this.oilOrder.forEach(item => {
let conRefMon = 0;
let hoardAmount = 0;
- if (_this.refuelMoney!=null){
+ let id = ""
+ if (_this.refuelMoney){
for (let i = 0;i < _this.refuelMoney.length;i++){
// 囤油卡升数变化
- if (_this.refuelMoney[i].oilType==item.oilType){
+ if (_this.refuelMoney[i].oilType==item.oilType && _this.refuelMoney[i].refuelMoney>0){
+ id = item.id
+ _this.isOilStorageCard = true
if ((_this.refuelMoney[i].refuelMoney-item.liters)>=0){
conRefMon = item.liters
}else {
@@ -2376,18 +2399,34 @@
// 扣除升数后需要消费的金额
hoardAmount = item.amount - (_this.refuelMoney[i].refuelMoney * item.oilPrice).toFixed(2)
}
+ }else {
+ hoardAmount = item.amount
}
}
}
_this.consumeRefuelMoney += +conRefMon
- if (_this.consumeRefuelMoney!=0){
- _this.isOilStorageCard = true;
- _this.checkAll3 = true;
- _this.consumeAmount = 0;
- }
_this.hoardAmount += +hoardAmount
+ _this.oilAmount += +item.amount
+ // _this.changeBalance(_this.hoardAmount,id)
+ // if (_this.consumeRefuelMoney!=0){
+ // _this.isOilStorageCard = true;
+ // _this.checkAll3 = true;
+ // _this.consumeAmount = 0;
+ // }
+ _this.isDefaultUseCard();
})
- _this.isExclusion();
+ },
+ changeBalance(hoardAmount,id){
+ if (this.balance>0 && id != ""){
+ this.oilOrder.forEach(item => {
+ if (this.balance >= item.amount){
+ this.consumeAmount = item.amount
+ }else {
+ this.consumeAmount = this.balance
+ this.oilActualPay = item.amount - this.balance
+ }
+ })
+ }
},
// 选择“元”或“L”
changeSelect(){
@@ -2447,16 +2486,18 @@
getUserInfoMobile({mobile:this.userNo}).then( response => {
if (response.data!=null){
this.member = response.data
+ this.storeId = response.data.storeId
this.isSure = false
}else {
this.$modal.msgError("会员信息不存在")
}
})
}else {
- getUserVoName({name:this.userNo}).then( response => {
- this.memberList = response.data
- })
this.dialogVisibleMember = true;
+ getUserVoName({name:this.userNo}).then( response => {
+ this.memberList = response.data.userVo
+ this.storeId = response.data.storeId
+ })
}
},
// 查询所有商品信息
@@ -2527,13 +2568,13 @@
let _this = this;
if (this.payType=="APPLET_CODE"){
- this.loading = true;
scanAppletQrCode(_this.map).then( resp => {
- if (resp.data.success!=undefined){
+ if (resp.data.success=='success'){
+ this.loading = true;
setTimeout(function (){
_this.isPaySuccess = true;
- this.loading = false;
- _this.isPay = false;
+ _this.loading = false;
+ _this.isPay = true;
_this.resetting1();
},3000)
}else {
@@ -2577,7 +2618,7 @@
let timer = setInterval(function () {
if (_this.isQuery == false) {
_this.loading = false;
- _this.isPay = false;
+ _this.isPay = true;
clearInterval(_this.timer);
}
},500)
@@ -2704,22 +2745,11 @@
},500)
},
handClose(){
- if(this.isPaySuccess){
- this.oilAmount = 0;
- this.oilActualPay = 0;
- this.oilDiscount = 0;
- this.goodsAmount = 0;
- this.goodsActualPay = 0;
- this.goodsDiscount = 0;
- this.consumeAmount = 0;
- this.consumeRefuelMoney = 0;
- this.oilTotal = 0;
- this.goodsTotal = 0;
- this.isMember = false;
- }
- this.isPay = true;
- this.dialogVisiblej = false
+ this.resetting1()
+ this.member = {};
this.isPaySuccess = false;
+ this.isPay = false;
+ this.dialogVisiblej = false
},
// 支付方式
payMethod(payType){
From b5d5f6b1eb131fd246b317df2ef2bc54e9e08fb4 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: Fri, 12 Jan 2024 12:05:42 +0800
Subject: [PATCH 3/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../EventMarketing/Writeoffrecords/index.vue | 8 ++--
.../impl/ActiveExchangeServiceImpl.java | 3 --
.../service/ActiveNewlywedsService.java | 1 +
.../ActiveNewlywedsRecordsServiceImpl.java | 43 +++++++++++--------
.../impl/ActiveNewlywedsServiceImpl.java | 37 ++++++++++++++++
.../CardExchangeRecordController.java | 10 +++++
.../service/impl/CardGiftServiceImpl.java | 23 ++++++++++
.../impl/CardValueRecordServiceImpl.java | 1 +
8 files changed, 102 insertions(+), 24 deletions(-)
diff --git a/fuintAdmin/src/views/EventMarketing/Writeoffrecords/index.vue b/fuintAdmin/src/views/EventMarketing/Writeoffrecords/index.vue
index 6be83fd82..72d283a14 100644
--- a/fuintAdmin/src/views/EventMarketing/Writeoffrecords/index.vue
+++ b/fuintAdmin/src/views/EventMarketing/Writeoffrecords/index.vue
@@ -28,12 +28,12 @@
/>
-
+
搜索
@@ -62,9 +62,9 @@
-
+
-
+
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java
index b4a538567..894d44575 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java
@@ -290,9 +290,6 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
new Date().getTime() <= cardFavorable.getCreateTime().getTime() + Integer.parseInt(cardFavorable.getValidityDay()) * 86400000L + 86400000L * cardFavorable.getValidityTwo()) {
BeanUtils.copyProperties(cardFavorable, exchangeFavorableVO);
}
- /*if (){
-
- }*/
exchangeFavorableVOArrayList.add(exchangeFavorableVO);
}
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/ActiveNewlywedsService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/ActiveNewlywedsService.java
index 922059183..9143c2fe7 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/ActiveNewlywedsService.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/ActiveNewlywedsService.java
@@ -40,6 +40,7 @@ public interface ActiveNewlywedsService extends IService {
* @return
*/
ActiveNewlywedsVO getOneById(Serializable id);
+ ActiveNewlywedsVO getOneByStoreId(Serializable id);
ActiveNewlywedsVO getOneByIdApplet(ActiveConsumption activeConsumption);
/**
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsRecordsServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsRecordsServiceImpl.java
index db9a238ce..21f8a889c 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsRecordsServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsRecordsServiceImpl.java
@@ -14,11 +14,14 @@ import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRec
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
import com.fuint.business.marketingActivity.cardFavorable.mapper.CardFavorableRecordMapper;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
+import com.fuint.business.userManager.entity.UserBalance;
import com.fuint.business.userManager.service.LJUserService;
+import com.fuint.business.userManager.service.UserBalanceService;
import com.fuint.business.userManager.vo.LJUserVo;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import com.sun.xml.bind.v2.TODO;
+import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -43,6 +46,8 @@ public class ActiveNewlywedsRecordsServiceImpl extends ServiceImpl activeNewlywedsChildList = activeNewlyweds.getActiveNewlywedsChildList();
if (CollectionUtils.isNotEmpty(activeNewlywedsChildList)){
for (ActiveNewlywedsChild activeNewlywedsChild : activeNewlywedsChildList) {
if (activeNewlywedsChild.getActiveGift().equals("1")){
- cardFavorableRecord.setCardFavorableId(activeNewlywedsChild.getActiveNewlywedsId());
- cardFavorableRecord.setChainStorId(nowAccountInfo.getChainStoreId());
+ CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
+ cardFavorableRecord.setCardFavorableId(activeNewlywedsChild.getVouchersId());
cardFavorableRecord.setStoreId(nowAccountInfo.getStoreId());
- cardFavorableRecord.setMtUserId(userId);
+ cardFavorableRecord.setMtUserId(ljUserVo.getId());
cardFavorableRecord.setName(ljUserVo.getName());
cardFavorableRecord.setMobile(ljUserVo.getMobile());
- cardFavorableRecord.setName(nowAccountInfo.getRealName());
+ cardFavorableRecord.setStatus("0");
cardFavorableRecord.setExchangeFrom("新人发券");
- save = cardFavorableRecordService.save(cardFavorableRecord);
+ save = cardFavorableRecordService.addCardFavorableRecord(cardFavorableRecord);
}else {
//兑换券
CardExchangeRecord cardExchangeRecord = new CardExchangeRecord();
- cardExchangeRecord.setCardExchangeId(activeNewlywedsChild.getActiveNewlywedsId());
- cardExchangeRecord.setChainStorId(nowAccountInfo.getChainStoreId());
+ cardExchangeRecord.setCardExchangeId(activeNewlywedsChild.getVouchersId());
cardExchangeRecord.setStoreId(nowAccountInfo.getStoreId());
- cardExchangeRecord.setMtUserId(userId);
+ cardExchangeRecord.setMtUserId(ljUserVo.getId());
cardExchangeRecord.setName(ljUserVo.getName());
cardExchangeRecord.setMobile(ljUserVo.getMobile());
- cardExchangeRecord.setExchangeName(activeNewlywedsChild.getGiftCardName());
+ cardExchangeRecord.setPhoto(ljUserVo.getAvatar());
+ cardExchangeRecord.setStatus("0");
cardExchangeRecord.setExchangeFrom("新人领券");
- cardExchangeRecord.setGiftName(activeNewlywedsChild.getGiftCardName());
- cardExchangeRecord.setDescription(activeNewlywedsChild.getGiftCardDetail());
- save = cardExchangeRecordService.save(cardExchangeRecord);
+ save = cardExchangeRecordService.addCardExchangeRecord(cardExchangeRecord);
}
}
+ //用户余额
+ UserBalance userBalance = userBalanceService.selectUserBalance(userId,ljUserVo.getChainStoreId());
//积分
- //成长值 TODO
+ if (ObjectUtils.isNotEmpty(userBalance.getPoints()) && ObjectUtils.isNotEmpty(activeNewlyweds.getPoints())){
+ userBalance.setPoints(userBalance.getPoints() + activeNewlyweds.getPoints());
+ }
+ //成长值
+ if (ObjectUtils.isNotEmpty(userBalance.getGrowthValue()) && ObjectUtils.isNotEmpty(activeNewlyweds.getGrowthValue())){
+ userBalance.setGrowthValue(userBalance.getGrowthValue() + activeNewlyweds.getGrowthValue());
+ }
+ userBalanceService.updateUserBalance(userBalance);
}
- //
-
return save;
}
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsServiceImpl.java
index 7d0b740ad..2b00d6c27 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsServiceImpl.java
@@ -183,6 +183,43 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>();
+ lambdaQueryWrapper.eq(ActiveNewlyweds::getStoreId,id);
+ ActiveNewlyweds activeNewlyweds = getOne(lambdaQueryWrapper);
+ //获取兑换物品信息
+ if (ObjectUtils.isNotEmpty(activeNewlyweds)){
+ LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>();
+ queryWrapper.eq(ActiveNewlywedsChild::getActiveNewlywedsId,activeNewlyweds.getId());
+ queryWrapper.orderByDesc(ActiveNewlywedsChild::getCreateTime);
+ List activeNewlywedsChildList = activeNewlywedsChildService.list(queryWrapper);
+ BeanUtils.copyProperties(activeNewlyweds,activeNewlywedsVO);
+ //封装VO返回
+ activeNewlywedsVO.setCourtesyReward(activeNewlyweds.getCourtesyReward().split(","));
+ if (CollectionUtils.isNotEmpty(activeNewlywedsChildList)){
+ activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildList);
+ }else {
+ ArrayList activeNewlywedsChildLists = new ArrayList<>();
+ activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildLists);
+ }
+ }else {
+ ArrayList activeNewlywedsChildList = new ArrayList<>();
+ activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildList);
+ }
+ }
+ return activeNewlywedsVO;
+ }
+
/**
* 通过店铺查询单条数据(小程序端)
* @param activeConsumption
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/controller/CardExchangeRecordController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/controller/CardExchangeRecordController.java
index c885a6aeb..75694a474 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/controller/CardExchangeRecordController.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/controller/CardExchangeRecordController.java
@@ -4,6 +4,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.cardExchange.dto.CardExchangeRecordDTO;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord;
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService;
+import com.fuint.business.member.entity.LJStaff;
+import com.fuint.business.member.service.ILJStaffService;
+import com.fuint.common.dto.AccountInfo;
+import com.fuint.common.util.TokenUtil;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.apache.ibatis.annotations.Param;
@@ -27,6 +31,8 @@ public class CardExchangeRecordController extends BaseController {
*/
@Resource
private CardExchangeRecordService cardExchangeRecordService;
+ @Resource
+ private ILJStaffService iljStaffService;
/**
* 分页查询所有数据
@@ -104,6 +110,10 @@ public class CardExchangeRecordController extends BaseController {
*/
@PutMapping
public ResponseObject update(@RequestBody CardExchangeRecord cardExchangeRecord) {
+ AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
+ LJStaff ljStaff = iljStaffService.selectStaffById(nowAccountInfo.getStaffId());
+ cardExchangeRecord.setRealName(ljStaff.getRealName());
+ cardExchangeRecord.setStaffMobile(ljStaff.getMobile());
return getSuccessResult(this.cardExchangeRecordService.updateById(cardExchangeRecord));
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardGift/service/impl/CardGiftServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardGift/service/impl/CardGiftServiceImpl.java
index 857140129..6d62c1a2f 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardGift/service/impl/CardGiftServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardGift/service/impl/CardGiftServiceImpl.java
@@ -11,13 +11,19 @@ import com.fuint.business.marketingActivity.cardGift.service.CardGiftService;
import com.fuint.business.oilDepotConfiguration.entity.OilDepotConfig;
import com.fuint.business.oilDepotConfiguration.service.OilDepotConfigService;
import com.fuint.business.store.service.StoreService;
+import com.fuint.business.userManager.entity.UserBalance;
+import com.fuint.business.userManager.mapper.LJUserMapper;
+import com.fuint.business.userManager.service.UserBalanceService;
+import com.fuint.business.userManager.vo.LJUserVo;
import com.fuint.common.util.TokenUtil;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
+import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
@@ -38,6 +44,10 @@ public class CardGiftServiceImpl extends ServiceImpl i
@Resource
private StoreService storeService;
+ @Resource
+ private UserBalanceService userBalanceService;
+ @Resource
+ private LJUserMapper ljUserMapper;
/**
* 新增数据
@@ -148,6 +158,7 @@ public class CardGiftServiceImpl extends ServiceImpl i
* @return
*/
@Override
+ @Transactional
public CardGift exchange(CardGift cardGift) {
//登录用户id
Integer userId = TokenUtil.getNowAccountInfo().getId();
@@ -161,6 +172,17 @@ public class CardGiftServiceImpl extends ServiceImpl i
one.setActivateStatus("1");
one.setUserId(userId);
updateById(one);
+ //更新用户余额
+ Double cardAmount = one.getCardAmount();
+ //会员信息
+ LJUserVo ljUserVo = ljUserMapper.selectUserById(userId);
+ UserBalance userBalance = userBalanceService.selectUserBalance(userId,ljUserVo.getChainStoreId());
+ Double cardBalance = userBalance.getCardBalance();
+ BigDecimal bigDecimal = BigDecimal.valueOf(cardAmount);
+ BigDecimal bigDecimal1 = BigDecimal.valueOf(cardBalance);
+ BigDecimal add = bigDecimal1.add(bigDecimal);
+ userBalance.setCardBalance(add.doubleValue());
+ userBalanceService.updateUserBalance(userBalance);
return one;
}else {
return cardGift;
@@ -179,6 +201,7 @@ public class CardGiftServiceImpl extends ServiceImpl i
Integer userId = TokenUtil.getNowAccountInfo().getId();
LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(CardGift::getUserId,userId);
+ queryWrapper.orderByDesc(CardGift::getUpdateTime);
return page(page,queryWrapper);
}
}
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 f72779333..b9353be42 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
@@ -768,6 +768,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl
Date: Fri, 12 Jan 2024 13:26:22 +0800
Subject: [PATCH 4/6] bug
---
.../controller/LJUserController.java | 10 ++++
.../userManager/service/LJUserService.java | 7 +++
.../service/impl/LJUserServiceImpl.java | 7 +++
.../views/cashier/NewComponents/homeindex.vue | 57 ++++++++++---------
4 files changed, 55 insertions(+), 26 deletions(-)
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/LJUserController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/LJUserController.java
index 79836430e..6eab3dfc3 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/LJUserController.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/LJUserController.java
@@ -126,6 +126,16 @@ public class LJUserController extends BaseController {
return getSuccessResult(map1);
}
+ /**
+ * 根据storeId查询会员信息
+ * @param storeId
+ * @return
+ */
+ @GetMapping("/storeUserInfo/{storeId}")
+ public ResponseObject userVoInfo1(@PathVariable Integer storeId){
+ return getSuccessResult(userService.queryUserByStoreIdAndUserId(storeId));
+ }
+
@GetMapping("/getByUniApp")
public ResponseObject getByUniApp(Integer chainStoreId){
LJUserVo user = userService.getByUniApp(chainStoreId);
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java
index a5d7865dc..b2b2301c4 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java
@@ -60,6 +60,13 @@ public interface LJUserService extends IService {
*/
public Map queryUserByStoreId(Integer storeId,Integer mobile);
+ /**
+ * 根据storeId获取连锁店id 根据连锁店id查询用户信息
+ * @param storeId
+ * @return
+ */
+ public LJUserVo queryUserByStoreIdAndUserId(Integer storeId);
+
/**
* 根据手机号和连锁店id查询会员信息
* @param mobile
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java
index 1ee593390..7e05bf5d6 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java
@@ -151,6 +151,13 @@ public class LJUserServiceImpl extends ServiceImpl impleme
return map;
}
+ @Override
+ public LJUserVo queryUserByStoreIdAndUserId(Integer storeId) {
+ AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
+ LJStore store = storeService.selectStoreByStoreId(storeId);
+ return baseMapper.queryUserByChainStoreId(nowAccountInfo.getId(),store.getChainStoreId());
+ }
+
@Override
public LJUserVo selectUserByMobileAndChantStoreId(String mobile) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue
index cb435fac1..40438ae0b 100644
--- a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue
+++ b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue
@@ -572,7 +572,7 @@
- 余额充值
+
¥{{member.cardBalance ? member.cardBalance : "--"}}
{{member.cardBalance ? member.cardBalance : "--"}}元
@@ -2062,7 +2062,7 @@
if (this.isMember){
if (this.balance >= (this.oilAmount - this.oilDiscount - this.fullReduction)){
this.oilActualPay = 0
- this.consumeAmount = this.oilAmount - this.oilDiscount - this.fullReduction
+ this.consumeAmount = (this.oilAmount*100 - this.oilDiscount*100 - this.fullReduction*100)/100
}else {
this.oilActualPay = (this.oilAmount -this.balance - this.oilDiscount - this.fullReduction).toFixed(2)
this.consumeAmount = this.balance
@@ -2241,6 +2241,7 @@
// 删除商品列表信息
delGoods(index){
this.goodsOrder.splice(index,1)
+ this.handleChange()
},
// 添加商品列表信息
changeGoods(val){
@@ -2250,11 +2251,6 @@
if (this.goodsOrder.length > 0) {
let amount = 0;
for (let i = 0; i < goods.length; i++) {
- if (_this.isMember) {
- amount += +(goods[i].memberPrice * goods[i].num).toFixed(2)
- } else {
- amount += +(goods[i].retailPrice * goods[i].num).toFixed(2)
- }
if (goods[i].id == val.id) {
if (val.stock 0) {
+ this.$modal.msgError("非油商品不可使用小程序码支付")
+ return;
+ }
+ }
this.authCode = ""
this.seekZero = 0;
this.isPay = false
- console.log(this.isPay)
this.dialogVisiblej = true
this.getStaff()
},
@@ -2568,6 +2586,10 @@
let _this = this;
if (this.payType=="APPLET_CODE"){
+ if (this.goodsOrder.length>0){
+ this.$modal.msgError("非油商品不可使用小程序码支付")
+ return;
+ }
scanAppletQrCode(_this.map).then( resp => {
if (resp.data.success=='success'){
this.loading = true;
@@ -2585,8 +2607,8 @@
}
addLJGoods(_this.map).then( response => {
+ _this.orderNo = response.data.orderNo;
if (response.data.oilOrder!=null){
- _this.orderNo = response.data.oilOrder.orderNo;
if (response.data.oilOrder.orderStatus == "paid"){
_this.isPaySuccess = true;
_this.seekZero = 0
@@ -2709,23 +2731,6 @@
_this.timer = setInterval(function (){
// "234520231228115544f073f4"
cashierOrderByOrderNo({orderNo:_this.orderNo}).then( response => {
- if (response.data!=null){
- if (response.data.orderStatus == "unpaid"){
- _this.isQuery = true;
- }
- if (response.data.orderStatus == "paid"){
- _this.isPaySuccess = true;
- _this.isQuery = false;
- _this.amount = 0
- }
- if (response.data.orderStatus == "payFail"){
- _this.isPaySuccess = false;
- _this.isQuery = false;
- }
- }
- _this.resetting1();
- })
- goodsOrder({orderNo:_this.orderNo}).then( response => {
if (response.data!=null){
if (response.data.status == "unpaid"){
_this.isQuery = true;
From a4c4e5fa0a13b8315d176c97dda9bf90e86ec10c 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: Fri, 12 Jan 2024 13:26:50 +0800
Subject: [PATCH 5/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
gasStation-uni/pages/index/index.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gasStation-uni/pages/index/index.vue b/gasStation-uni/pages/index/index.vue
index e8f166074..a751e1a2f 100644
--- a/gasStation-uni/pages/index/index.vue
+++ b/gasStation-uni/pages/index/index.vue
@@ -279,7 +279,7 @@
url: 'business/marketingActivity/activeNewlywedsRecords',
method: 'post',
data: {
-
+ storeId: this.storeId
}
}).then(res => {
console.log("11111" + res)
From 4ed6ba6e8c95f19f84a19fc0f008dfb38b18071b Mon Sep 17 00:00:00 2001
From: cun-nan <19819293608@163.com>
Date: Fri, 12 Jan 2024 13:55:40 +0800
Subject: [PATCH 6/6] bug
---
fuintAdmin/src/api/convenienceStore/goods.js | 18 +++--
.../src/views/convenienceStore/goodsFile.vue | 56 ++++++++-----
.../controller/CvsGoodsController.java | 9 +++
.../service/CvsGoodsService.java | 6 ++
.../service/impl/CvsGoodsServiceImpl.java | 8 ++
.../business/order/entity/CreditUnit.java | 8 ++
.../order/mapper/xml/HangBillMapper.xml | 5 +-
.../service/impl/CreditUnitServiceImpl.java | 14 ++++
.../service/impl/OilOrderServiceImpl.java | 29 ++++---
.../src/api/cashier/cashierorder.js | 2 +-
.../views/cashier/NewComponents/credit.vue | 79 ++++++++-----------
.../views/cashier/NewComponents/homeindex.vue | 3 +-
gasStation-uni/pagesMy/VIP/vip.vue | 2 +-
13 files changed, 153 insertions(+), 86 deletions(-)
diff --git a/fuintAdmin/src/api/convenienceStore/goods.js b/fuintAdmin/src/api/convenienceStore/goods.js
index 666ea2cc6..06679c043 100644
--- a/fuintAdmin/src/api/convenienceStore/goods.js
+++ b/fuintAdmin/src/api/convenienceStore/goods.js
@@ -20,11 +20,19 @@ export function selectTree(data) {
// 联级选择器 树形数据结构
export function cvsGoodsTree() {
- return request({
- url: '/business/cvsGoods/tree',
- method: 'get',
- })
- }
+ return request({
+ url: '/business/cvsGoods/tree',
+ method: 'get',
+ })
+}
+
+// 联级选择器 树形数据结构
+export function cvsGoodsAll() {
+ return request({
+ url: '/business/cvsGoods',
+ method: 'get',
+ })
+}
// 查询一级分类
export function list(data) {
diff --git a/fuintAdmin/src/views/convenienceStore/goodsFile.vue b/fuintAdmin/src/views/convenienceStore/goodsFile.vue
index 1cfae09ed..df3751b1f 100644
--- a/fuintAdmin/src/views/convenienceStore/goodsFile.vue
+++ b/fuintAdmin/src/views/convenienceStore/goodsFile.vue
@@ -11,14 +11,6 @@
:options="cvsGoodOptions"
:props="{ checkStrictly: true }"
clearable>
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -331,7 +327,7 @@