修改bug

This commit is contained in:
齐天大圣 2024-01-03 10:54:36 +08:00
parent a9b86ff520
commit a897807c16
4 changed files with 81 additions and 50 deletions

View File

@ -19,6 +19,7 @@ import com.fuint.business.integral.entity.IntegralDetail;
import com.fuint.business.integral.service.IntegralDetailService; import com.fuint.business.integral.service.IntegralDetailService;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchange; import com.fuint.business.marketingActivity.cardExchange.entity.CardExchange;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord; 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.cardExchange.service.CardExchangeService;
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable; import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable;
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord; import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
@ -102,6 +103,8 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
private CardExchangeService cardExchangeService; private CardExchangeService cardExchangeService;
@Resource @Resource
private CardFavorableRecordService cardFavorableRecordService; private CardFavorableRecordService cardFavorableRecordService;
@Resource
private CardExchangeRecordService cardExchangeRecordService;
/** /**
* 储值卡充值新增 * 储值卡充值新增
* @param cardValueRecordDTO * @param cardValueRecordDTO
@ -138,16 +141,18 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
//筛选符合条件的优惠券并计算优惠金额 //筛选符合条件的优惠券并计算优惠金额
if (CollectionUtils.isNotEmpty(cardValueVouchers)) { if (CollectionUtils.isNotEmpty(cardValueVouchers)) {
for (CardFavorable cardValueVoucher : cardValueVouchers) { for (CardFavorable cardValueVoucher : cardValueVouchers) {
cardValueOrders.setCardFavorableId(cardValueVoucher.getId()); if (ObjectUtils.isNotEmpty(cardValueVoucher)){
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord(); cardValueOrders.setCardFavorableId(cardValueVoucher.getId());
cardFavorableRecord.setCardFavorableId(cardValueVoucher.getId()); CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
cardFavorableRecord.setStoreId(nowAccountInfo.getStoreId()); cardFavorableRecord.setCardFavorableId(cardValueVoucher.getId());
cardFavorableRecord.setMtUserId(nowAccountInfo.getId()); cardFavorableRecord.setStoreId(nowAccountInfo.getStoreId());
cardFavorableRecord.setName(nowAccountInfo.getRealName()); cardFavorableRecord.setMtUserId(nowAccountInfo.getId());
cardFavorableRecord.setMobile(ljUserVo.getMobile()); cardFavorableRecord.setName(nowAccountInfo.getRealName());
cardFavorableRecord.setStatus("0"); cardFavorableRecord.setMobile(ljUserVo.getMobile());
cardFavorableRecord.setExchangeFrom("充值送券"); cardFavorableRecord.setStatus("0");
cardFavorableRecordService.save(cardFavorableRecord); cardFavorableRecord.setExchangeFrom("充值送券");
cardFavorableRecordService.save(cardFavorableRecord);
}
/* /*
if (cardValue.getRechargeBalance() >= cardValueVoucher.getSatisfiedAmount()) { if (cardValue.getRechargeBalance() >= cardValueVoucher.getSatisfiedAmount()) {
cardFavorableValue += cardValueVoucher.getDiscountAmount(); cardFavorableValue += cardValueVoucher.getDiscountAmount();
@ -158,24 +163,27 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
List<CardExchange> cardExchangeVouchers = getCardExchangeVouchers(cardValue); List<CardExchange> cardExchangeVouchers = getCardExchangeVouchers(cardValue);
if (CollectionUtils.isNotEmpty(cardExchangeVouchers)){ if (CollectionUtils.isNotEmpty(cardExchangeVouchers)){
for (CardExchange cardExchangeVoucher : cardExchangeVouchers) { for (CardExchange cardExchangeVoucher : cardExchangeVouchers) {
CardExchangeRecord cardExchangeRecord = new CardExchangeRecord(); if (ObjectUtils.isNotEmpty(cardExchangeVoucher)){
cardValueOrders.setCardExchangeId(cardExchangeVoucher.getId()); CardExchangeRecord cardExchangeRecord = new CardExchangeRecord();
cardExchangeRecord.setCardExchangeId(cardExchangeVoucher.getId()); cardValueOrders.setCardExchangeId(cardExchangeVoucher.getId());
cardExchangeRecord.setStoreId(ljUserVo.getStoreId()); cardExchangeRecord.setCardExchangeId(cardExchangeVoucher.getId());
cardExchangeRecord.setMtUserId(ljUserVo.getId()); cardExchangeRecord.setStoreId(ljUserVo.getStoreId());
cardExchangeRecord.setName(ljUserVo.getName()); cardExchangeRecord.setMtUserId(ljUserVo.getId());
cardExchangeRecord.setMobile(ljUserVo.getMobile()); cardExchangeRecord.setName(ljUserVo.getName());
cardExchangeRecord.setPhoto(ljUserVo.getAvatar()); cardExchangeRecord.setMobile(ljUserVo.getMobile());
cardExchangeRecord.setMtStaffId(ljStaff.getId()); cardExchangeRecord.setPhoto(ljUserVo.getAvatar());
cardExchangeRecord.setRealName(ljStaff.getRealName()); cardExchangeRecord.setMtStaffId(ljStaff.getId());
cardExchangeRecord.setStaffMobile(ljStaff.getMobile()); cardExchangeRecord.setRealName(ljStaff.getRealName());
cardExchangeRecord.setExchangeName(cardExchangeVoucher.getName()); cardExchangeRecord.setStaffMobile(ljStaff.getMobile());
cardExchangeRecord.setExchangeFrom("充值送券"); cardExchangeRecord.setExchangeName(cardExchangeVoucher.getName());
cardExchangeRecord.setGiftName(cardExchangeVoucher.getGiftName()); cardExchangeRecord.setExchangeFrom("充值送券");
cardExchangeRecord.setDescription(cardExchangeVoucher.getUseInstructions()); cardExchangeRecord.setGiftName(cardExchangeVoucher.getGiftName());
cardExchangeRecord.setStatus("0"); cardExchangeRecord.setDescription(cardExchangeVoucher.getUseInstructions());
cardExchangeRecord.setStartTime(cardExchangeVoucher.getCreateTime()); cardExchangeRecord.setStatus("0");
cardExchangeRecord.setEndTime(cardExchangeVoucher.getOutTime()); cardExchangeRecord.setStartTime(cardExchangeVoucher.getCreateTime());
cardExchangeRecord.setEndTime(cardExchangeVoucher.getOutTime());
cardExchangeRecordService.save(cardExchangeRecord);
}
} }
} }
//订单号 //订单号
@ -228,7 +236,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
//封装支付参数 //封装支付参数
receiveParameter.setOrderNo(orderNo); receiveParameter.setOrderNo(orderNo);
receiveParameter.setType("3"); receiveParameter.setType("3");
receiveParameter.setStoreId(nowAccountInfo.getStoreId()); receiveParameter.setStoreId(cardValueRecordDTO.getStoreId());
receiveParameter.setGoodsMoney(cardValueOrders.getPayAmount()); receiveParameter.setGoodsMoney(cardValueOrders.getPayAmount());
receiveParameter.setPayType(cardValueRecordDTO.getPayType()); receiveParameter.setPayType(cardValueRecordDTO.getPayType());
receiveParameter.setUserId(nowAccountInfo.getId()); receiveParameter.setUserId(nowAccountInfo.getId());
@ -613,7 +621,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
*/ */
@Transactional @Transactional
public void rechargeFinallDeal(String orderNo){ public void rechargeFinallDeal(String orderNo){
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); //AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
UserBalance userBalance1 = new UserBalance(); UserBalance userBalance1 = new UserBalance();
CardValueRecord cardValueRecord = new CardValueRecord(); CardValueRecord cardValueRecord = new CardValueRecord();
CardBalanceChange cardBalanceChange = new CardBalanceChange(); CardBalanceChange cardBalanceChange = new CardBalanceChange();
@ -652,7 +660,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
}else { }else {
userBalance1.setMtUserId(cardValueOrders.getMtUserId()); userBalance1.setMtUserId(cardValueOrders.getMtUserId());
userBalance1.setStoreId(cardValueOrders.getStoreId()); userBalance1.setStoreId(cardValueOrders.getStoreId());
userBalance1.setChainStoreId(nowAccountInfo.getChainStoreId()); //userBalance1.setChainStoreId(nowAccountInfo.getChainStoreId());
//积分 //积分
if (ObjectUtils.isNotEmpty(cardValueOrders.getPoints())){ if (ObjectUtils.isNotEmpty(cardValueOrders.getPoints())){
userBalance1.setPoints(cardValueOrders.getPoints()); userBalance1.setPoints(cardValueOrders.getPoints());
@ -676,7 +684,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
} }
//用户余额变化记录 //用户余额变化记录
cardBalanceChange.setUserId(cardValueOrders.getMtUserId()); cardBalanceChange.setUserId(cardValueOrders.getMtUserId());
cardBalanceChange.setChainStoreId(nowAccountInfo.getChainStoreId()); //cardBalanceChange.setChainStoreId(nowAccountInfo.getChainStoreId());
cardBalanceChange.setStoreId(cardValueOrders.getStoreId()); cardBalanceChange.setStoreId(cardValueOrders.getStoreId());
cardBalanceChange.setChangeType("1"); cardBalanceChange.setChangeType("1");
cardBalanceChange.setFromType("储值卡充值"); cardBalanceChange.setFromType("储值卡充值");
@ -709,7 +717,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
cardValueRecord.setPayStatus("paid"); cardValueRecord.setPayStatus("paid");
cardValueRecord.setStoreId(cardValueOrders.getStoreId()); cardValueRecord.setStoreId(cardValueOrders.getStoreId());
cardValueRecord.setPaymentNo(cardValueOrders.getOrderNo()); cardValueRecord.setPaymentNo(cardValueOrders.getOrderNo());
cardValueRecord.setChainStoreId(nowAccountInfo.getChainStoreId()); //cardValueRecord.setChainStoreId(nowAccountInfo.getChainStoreId());
save(cardValueRecord); save(cardValueRecord);
} }

View File

@ -105,7 +105,9 @@ public class CardValueServiceImpl extends ServiceImpl<CardValueMapper, CardValue
if (ObjectUtils.isNotEmpty(cardValue.getActiveStatus())){ if (ObjectUtils.isNotEmpty(cardValue.getActiveStatus())){
queryWrapper.eq(CardValue::getActiveStatus,cardValue.getActiveStatus()); queryWrapper.eq(CardValue::getActiveStatus,cardValue.getActiveStatus());
} }
queryWrapper.eq(CardValue::getStoreId, TokenUtil.getNowAccountInfo().getStoreId()); if (ObjectUtils.isNotEmpty(cardValue.getStoreId())){
queryWrapper.eq(CardValue::getStoreId,cardValue.getStoreId());
}
queryWrapper.orderByDesc(CardValue::getCreateTime); queryWrapper.orderByDesc(CardValue::getCreateTime);
IPage page1 = page(page, queryWrapper); IPage page1 = page(page, queryWrapper);
List<CardValue> records = page1.getRecords(); List<CardValue> records = page1.getRecords();

View File

@ -75,10 +75,10 @@
<!-- 礼品卡 --> <!-- 礼品卡 -->
<view class="xyihang"> <view class="xyihang">
<view class="title-hei">礼品卡</view> <view class="title-hei">礼品卡</view>
<view class=""> <!-- <view class="">
<text>下一张</text> <text>下一张</text>
<uni-icons type="refreshempty" color="#2979ff" size="20"></uni-icons> <uni-icons type="refreshempty" color="#2979ff" size="20"></uni-icons>
</view> </view> -->
</view> </view>
<view class="card-lp"> <view class="card-lp">
<view class="card-top"> <view class="card-top">
@ -91,7 +91,7 @@
<view style="width: 100%;display: flex;align-items: center;justify-content: space-between; "> <view style="width: 100%;display: flex;align-items: center;justify-content: space-between; ">
<view class="bai-box"> <view class="bai-box">
<view class="title-card">礼品卡</view> <view class="title-card">礼品卡</view>
<view class="">卡号:**** **** **** ****</view> <view class="">卡号: **** **** **** ****</view>
<view style="lins"> 卡密: **** **** **** **** </view> <view style="lins"> 卡密: **** **** **** **** </view>
</view> </view>
<view class=""> <view class="">

View File

@ -19,7 +19,7 @@
<view class="box-cz"> <view class="box-cz">
<view class="box-jg" :class="{ 'actbox' : actindex == index }" v-for="(item,index) in cardValueList" <view class="box-jg" :class="{ 'actbox' : actindex == index }" v-for="(item,index) in cardValueList"
:key="index" :key="index"
@click="xzindex(index,item.rechargeBalance,item.fringeBenefit,item.giftBalance,item.points,item.growthValue,item.count)"> @click="xzindex(index,item.rechargeBalance,item.fringeBenefit,item.giftBalance,item.points,item.growthValue,item.count,item.id)">
<view class="s-title" :class="{ 'actsize' : actindex == index }"> <text <view class="s-title" :class="{ 'actsize' : actindex == index }"> <text
style="font-weight: bold;"></text>{{item.rechargeBalance}}</view> style="font-weight: bold;"></text>{{item.rechargeBalance}}</view>
<view class="min-size" :class="{ 'actsize' : actindex == index }">售价{{item.rechargeBalance}} <view class="min-size" :class="{ 'actsize' : actindex == index }">售价{{item.rechargeBalance}}
@ -75,8 +75,6 @@
</view> </view>
<view class="min-size" :class="{ 'actsize' : actindex == index }">升数:{{item.incomeLitres}}L <view class="min-size" :class="{ 'actsize' : actindex == index }">升数:{{item.incomeLitres}}L
</view> </view>
</view> </view>
</view> </view>
<view class="box-hui"> <view class="box-hui">
@ -151,6 +149,9 @@
export default { export default {
data() { data() {
return { return {
storeId: '',
staffId: '',
carValueId: '',
shows: false, shows: false,
money: '', money: '',
message: '', message: '',
@ -160,7 +161,7 @@
actindex: 0, actindex: 0,
actInput: 0, actInput: 0,
index: 0, index: 0,
text: "", text: '',
fringeBenefit: "", fringeBenefit: "",
giftBalance: "", giftBalance: "",
rechargeBalance: "", rechargeBalance: "",
@ -195,6 +196,7 @@
}, },
onLoad(option) { onLoad(option) {
this.storeId = uni.getStorageSync("storeId")
this.actinput = option.id this.actinput = option.id
if (option.id == 0) { if (option.id == 0) {
this.getValueCars(); this.getValueCars();
@ -204,22 +206,36 @@
this.getFuelCars(); this.getFuelCars();
} }
},
onShow() {
this.getValueCars();
this.getStaffList() this.getStaffList()
}, },
methods: { methods: {
// //
addValueCarRecords() { addValueCarRecords() {
if (this.staffId == '') {
uni.showToast({
title: "员工为必填项",
icon: Error
})
return
}
if (this.carValueId == '') {
uni.showToast({
title: "储值卡为必填项",
icon: Error
})
return
}
request({ request({
url: 'business/marketingActivity/cardValueRecord', url: 'business/marketingActivity/cardValueRecord',
method: 'post', method: 'post',
data: { data: {
payType: 'WECHAT', payType: 'WECHAT',
mtStaffId: '4', mtStaffId: this.staffId,
id: 68 id: this.carValueId,
storeId: this.storeId
}, },
}).then(res => { }).then(res => {
if (res.code === 200) { if (res.code === 200) {
@ -267,13 +283,16 @@
}, },
confirm(e) { confirm(e) {
console.log(e); console.log(e);
this.staffId = e.value[0].id
this.show = false this.show = false
}, },
cancel() { cancel() {
this.show = false 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.shuomingList = []
this.carValueId = id
console.log(this.shuomingList); console.log(this.shuomingList);
if (text) { if (text) {
this.text = text this.text = text
@ -324,16 +343,18 @@
url: 'business/marketingActivity/cardValue/appletL', url: 'business/marketingActivity/cardValue/appletL',
method: 'get', method: 'get',
data: { data: {
activeStatus: '1' activeStatus: '1',
storeId: this.storeId,
}, },
}).then(res => { }).then(res => {
this.cardValueList = [] this.cardValueList = []
if (res.code == 200) { if (res.code == 200) {
this.cardValueList = res.data.records this.cardValueList = res.data.records
console.log(res.data.records);
this.xzindex(0, res.data.records[0].rechargeBalance, res.data.records[0].fringeBenefit, 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] res.data.records[0].giftBalance, res.data.records[0].points, res.data.records[0]
.growthValue, res.data.records[0] .growthValue, res.data.records[0]
.count) .count, res.data.records[0].id)
} }
}) })
}, },