修改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.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<CardValueRecordMappe
private CardExchangeService cardExchangeService;
@Resource
private CardFavorableRecordService cardFavorableRecordService;
@Resource
private CardExchangeRecordService cardExchangeRecordService;
/**
* 储值卡充值新增
* @param cardValueRecordDTO
@ -138,16 +141,18 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
//筛选符合条件的优惠券并计算优惠金额
if (CollectionUtils.isNotEmpty(cardValueVouchers)) {
for (CardFavorable cardValueVoucher : cardValueVouchers) {
cardValueOrders.setCardFavorableId(cardValueVoucher.getId());
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
cardFavorableRecord.setCardFavorableId(cardValueVoucher.getId());
cardFavorableRecord.setStoreId(nowAccountInfo.getStoreId());
cardFavorableRecord.setMtUserId(nowAccountInfo.getId());
cardFavorableRecord.setName(nowAccountInfo.getRealName());
cardFavorableRecord.setMobile(ljUserVo.getMobile());
cardFavorableRecord.setStatus("0");
cardFavorableRecord.setExchangeFrom("充值送券");
cardFavorableRecordService.save(cardFavorableRecord);
if (ObjectUtils.isNotEmpty(cardValueVoucher)){
cardValueOrders.setCardFavorableId(cardValueVoucher.getId());
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
cardFavorableRecord.setCardFavorableId(cardValueVoucher.getId());
cardFavorableRecord.setStoreId(nowAccountInfo.getStoreId());
cardFavorableRecord.setMtUserId(nowAccountInfo.getId());
cardFavorableRecord.setName(nowAccountInfo.getRealName());
cardFavorableRecord.setMobile(ljUserVo.getMobile());
cardFavorableRecord.setStatus("0");
cardFavorableRecord.setExchangeFrom("充值送券");
cardFavorableRecordService.save(cardFavorableRecord);
}
/*
if (cardValue.getRechargeBalance() >= cardValueVoucher.getSatisfiedAmount()) {
cardFavorableValue += cardValueVoucher.getDiscountAmount();
@ -158,24 +163,27 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
List<CardExchange> 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<CardValueRecordMappe
//封装支付参数
receiveParameter.setOrderNo(orderNo);
receiveParameter.setType("3");
receiveParameter.setStoreId(nowAccountInfo.getStoreId());
receiveParameter.setStoreId(cardValueRecordDTO.getStoreId());
receiveParameter.setGoodsMoney(cardValueOrders.getPayAmount());
receiveParameter.setPayType(cardValueRecordDTO.getPayType());
receiveParameter.setUserId(nowAccountInfo.getId());
@ -613,7 +621,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
*/
@Transactional
public void rechargeFinallDeal(String orderNo){
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
//AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
UserBalance userBalance1 = new UserBalance();
CardValueRecord cardValueRecord = new CardValueRecord();
CardBalanceChange cardBalanceChange = new CardBalanceChange();
@ -652,7 +660,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
}else {
userBalance1.setMtUserId(cardValueOrders.getMtUserId());
userBalance1.setStoreId(cardValueOrders.getStoreId());
userBalance1.setChainStoreId(nowAccountInfo.getChainStoreId());
//userBalance1.setChainStoreId(nowAccountInfo.getChainStoreId());
//积分
if (ObjectUtils.isNotEmpty(cardValueOrders.getPoints())){
userBalance1.setPoints(cardValueOrders.getPoints());
@ -676,7 +684,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
}
//用户余额变化记录
cardBalanceChange.setUserId(cardValueOrders.getMtUserId());
cardBalanceChange.setChainStoreId(nowAccountInfo.getChainStoreId());
//cardBalanceChange.setChainStoreId(nowAccountInfo.getChainStoreId());
cardBalanceChange.setStoreId(cardValueOrders.getStoreId());
cardBalanceChange.setChangeType("1");
cardBalanceChange.setFromType("储值卡充值");
@ -709,7 +717,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
cardValueRecord.setPayStatus("paid");
cardValueRecord.setStoreId(cardValueOrders.getStoreId());
cardValueRecord.setPaymentNo(cardValueOrders.getOrderNo());
cardValueRecord.setChainStoreId(nowAccountInfo.getChainStoreId());
//cardValueRecord.setChainStoreId(nowAccountInfo.getChainStoreId());
save(cardValueRecord);
}

View File

@ -105,7 +105,9 @@ public class CardValueServiceImpl extends ServiceImpl<CardValueMapper, CardValue
if (ObjectUtils.isNotEmpty(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);
IPage page1 = page(page, queryWrapper);
List<CardValue> records = page1.getRecords();

View File

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

View File

@ -19,7 +19,7 @@
<view class="box-cz">
<view class="box-jg" :class="{ 'actbox' : actindex == index }" v-for="(item,index) in cardValueList"
: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
style="font-weight: bold;"></text>{{item.rechargeBalance}}</view>
<view class="min-size" :class="{ 'actsize' : actindex == index }">售价{{item.rechargeBalance}}
@ -75,8 +75,6 @@
</view>
<view class="min-size" :class="{ 'actsize' : actindex == index }">升数:{{item.incomeLitres}}L
</view>
</view>
</view>
<view class="box-hui">
@ -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)
}
})
},