优惠统计

This commit is contained in:
齐天大圣 2024-05-21 09:50:27 +08:00
parent 9e2a581288
commit 226cab681e
2 changed files with 91 additions and 68 deletions

View File

@ -9,13 +9,13 @@ import com.fuint.business.marketingActivity.favorableRecords.entity.FavorableRec
import com.fuint.business.marketingActivity.favorableRecords.service.FavorableRecordsService; import com.fuint.business.marketingActivity.favorableRecords.service.FavorableRecordsService;
import com.fuint.common.dto.AccountInfo; import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil; import com.fuint.common.util.TokenUtil;
import com.sun.org.apache.bcel.internal.generic.NEW;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* 优惠记录表(FavorableRecords)表服务实现类 * 优惠记录表(FavorableRecords)表服务实现类
@ -55,17 +55,18 @@ public class FavorableRecordsServiceImpl extends ServiceImpl<FavorableRecordsMap
Long deptId = nowAccountInfo.getDeptId(); Long deptId = nowAccountInfo.getDeptId();
LambdaQueryWrapper<FavorableRecords> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<FavorableRecords> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(FavorableRecords::getStoreId, nowAccountInfo.getStoreId()); queryWrapper.eq(FavorableRecords::getStoreId, nowAccountInfo.getStoreId());
queryWrapper.eq(FavorableRecords::getChainStoreId, nowAccountInfo.getChainStoreId()); List<FavorableRecords> list = list(queryWrapper);
if (ObjectUtils.isNotEmpty(favorableRecords.getFavFrom())){ //优惠次数
queryWrapper.eq(FavorableRecords::getFavFrom, favorableRecords.getFavFrom()); objectObjectHashMap.put("count", list.size());
}
if (ObjectUtils.isNotEmpty(favorableRecords.getFavType())){ double allTotalCount = 0.0;
queryWrapper.eq(FavorableRecords::getFavType, favorableRecords.getFavType());
} for (FavorableRecords records : list) {
if (ObjectUtils.isNotEmpty(favorableRecords.getFavConsumptionType())){ allTotalCount += records.getFavMoney();
queryWrapper.eq(FavorableRecords::getFavConsumptionType, favorableRecords.getFavConsumptionType());
} }
objectObjectHashMap.put("allMoney",allTotalCount);
return objectObjectHashMap; return objectObjectHashMap;
} }
} }

View File

@ -18,8 +18,8 @@
</view> </view>
<!-- 储值充值 --> <!-- 储值充值 -->
<view class="boxback" v-if="actinput == 0"> <view class="boxback" v-if="actinput == 0">
<swiper class="swiper" style="width: 100%;height: 70px;" circular <swiper class="swiper" style="width: 100%;height: 70px;" circular :autoplay="autoplay"
:autoplay="autoplay" :interval="interval" :vertical="true" :duration="duration"> :interval="interval" :vertical="true" :duration="duration">
<swiper-item class="conttainer-box" v-for="(item,index) in actList" :key="index"> <swiper-item class="conttainer-box" v-for="(item,index) in actList" :key="index">
<view class="box_s"> <view class="box_s">
{{item.discountActiveDescribe || ''}} {{item.discountActiveDescribe || ''}}
@ -89,8 +89,8 @@
</view> </view>
<!-- 囤油充值 --> <!-- 囤油充值 -->
<view class="boxback" v-if="actinput == 1"> <view class="boxback" v-if="actinput == 1">
<swiper class="swiper" style="width: 100%;height: 70px;" circular <swiper class="swiper" style="width: 100%;height: 70px;" circular :autoplay="autoplay"
:autoplay="autoplay" :interval="interval" :vertical="true" :duration="duration"> :interval="interval" :vertical="true" :duration="duration">
<swiper-item class="conttainer-box" v-for="(item,index) in cardList" :key="index"> <swiper-item class="conttainer-box" v-for="(item,index) in cardList" :key="index">
<view class="box_s"> <view class="box_s">
{{item.discountActiveDescribe || ''}} {{item.discountActiveDescribe || ''}}
@ -98,17 +98,33 @@
</swiper-item> </swiper-item>
</swiper> </swiper>
<view class="box-cz" style="margin-top: 20px;"> <view class="box-cz" style="margin-top: 20px;">
<view :class="{ 'actbox' : actindex == index }" v-for="(item,index) in cardFuleList" <view :class="{ 'actbox' : actindex == index }" v-for="(item,index) in cardFuleList" style="display: flex;justify-content: space-around;width: 98%;border-radius: 8px;border: 1px solid #e2e2e2;
style="display: flex;justify-content: space-around;width: 98%;border-radius: 8px;border: 1px solid #e2e2e2; box-sizing: border-box;padding: 10px;margin: 5px;height: 60px;line-height: 18px;" :key="index"
box-sizing: border-box;padding: 10px;margin: 5px;height: 60px;line-height: 18px;" @click="fuleindex(index,item.rechargeBalance,item.points,item.id)">
:key="index" @click="fuleindex(index,item.rechargeBalance,item.points,item.id)"> <view style="font-size: 16px;font-weight: bold;line-height: 40px;"
<view style="font-size: 16px;font-weight: bold;line-height: 40px;" :class="{ 'actsize' : actindex == index }">{{item.oilType}}</view> :class="{ 'actsize' : actindex == index }">{{item.oilType}}</view>
<!-- <view style="font-size: 12px;font-weight: bold;margin: 0 5px;" :class="{ 'actsize' : actindex == index }">:</view> --> <!-- <view style="font-size: 12px;font-weight: bold;margin: 0 5px;" :class="{ 'actsize' : actindex == index }">:</view> -->
<view class="min-size1" :class="{ 'actsize' : actindex == index }"><view>国标油价</view><view>{{item.gbPrice}}/L</view></view> <view class="min-size1" :class="{ 'actsize' : actindex == index }">
<view class="min-size1" :class="{ 'actsize' : actindex == index }"><view>本站油价</view><view>{{item.oilPrice}}/L</view></view> <view>国标油价</view>
<view class="min-size1" :class="{ 'actsize' : actindex == index }"><view>锁价</view><view>{{item.lockupPrice}}/L</view></view> <view>{{item.gbPrice}}/L</view>
<view class="min-size1" :class="{ 'actsize' : actindex == index }"><view>总升数</view><view>{{item.incomeLitres || 0}}L</view></view> </view>
<view class="min-size1" style="color: red;" :class="{ 'actsize' : actindex == index }"><view>总价</view><view>{{item.rechargeBalance}}</view></view> <view class="min-size1" :class="{ 'actsize' : actindex == index }">
<view>本站油价</view>
<view>{{item.oilPrice}}/L</view>
</view>
<view class="min-size1" :class="{ 'actsize' : actindex == index }">
<view>锁价活动价</view>
<view>{{item.lockPrice}}/L</view>
</view>
<view class="min-size1" :class="{ 'actsize' : actindex == index }">
<view>锁价满足金额</view>
<view>{{item.rechargeBalance}}</view>
</view>
<!-- <view class="min-size1" :class="{ 'actsize' : actindex == index }"><view>总升数</view><view>{{item.incomeLitres || 0}}L</view></view> -->
<!-- <view class="min-size1" style="color: red;" :class="{ 'actsize' : actindex == index }">
<view>总价</view>
<view>{{item.rechargeBalance}}</view>
</view> -->
</view> </view>
</view> </view>
<view class="box-hui"> <view class="box-hui">
@ -287,7 +303,8 @@
this.cardValueList.forEach((item, index) => { this.cardValueList.forEach((item, index) => {
console.log(this.balance >= item.rechargeBalance, 111); console.log(this.balance >= item.rechargeBalance, 111);
if (this.balance >= item.rechargeBalance) { if (this.balance >= item.rechargeBalance) {
this.xzindex(index,this.balance,item.fringeBenefit,item.giftBalance,item.points,item.growthValue,item.count,item.id); this.xzindex(index, this.balance, item.fringeBenefit, item.giftBalance, item.points,
item.growthValue, item.count, item.id);
} }
}) })
if (this.balance < this.cardValueList[0].rechargeBalance) { if (this.balance < this.cardValueList[0].rechargeBalance) {
@ -298,7 +315,8 @@
}, },
activen() { activen() {
request({ request({
url: 'business/marketingActivity/cardValue/appletList?storeId='+uni.getStorageSync("storeId")+"&&activeStatus=1", url: 'business/marketingActivity/cardValue/appletList?storeId=' + uni.getStorageSync(
"storeId") + "&&activeStatus=1",
method: 'get', method: 'get',
}).then(res => { }).then(res => {
@ -606,7 +624,9 @@
if (index == 0) { if (index == 0) {
// this.getValueCars(); // this.getValueCars();
if (this.cardValueList.length > 0) if (this.cardValueList.length > 0)
this.xzindex(0,this.cardValueList[0].rechargeBalance,this.cardValueList[0].fringeBenefit,this.cardValueList[0].giftBalance,this.cardValueList[0].points,this.cardValueList[0].growthValue,this.cardValueList[0].count,this.cardValueList[0].id) this.xzindex(0, this.cardValueList[0].rechargeBalance, this.cardValueList[0].fringeBenefit, this
.cardValueList[0].giftBalance, this.cardValueList[0].points, this.cardValueList[0].growthValue,
this.cardValueList[0].count, this.cardValueList[0].id)
} }
if (index == 1) { if (index == 1) {
// this.getFuelCars(); // this.getFuelCars();
@ -666,7 +686,8 @@
// //
getFuelCarList() { getFuelCarList() {
request({ request({
url: 'business/marketingActivity/cardFuelDiesel/appletList?storeId='+uni.getStorageSync("storeId"), url: 'business/marketingActivity/cardFuelDiesel/appletList?storeId=' + uni.getStorageSync(
"storeId"),
method: 'get', method: 'get',
}).then(res => { }).then(res => {
if (res.code == 200) { if (res.code == 200) {
@ -872,6 +893,7 @@
//color: #e2e2e2; //color: #e2e2e2;
text-align: center; text-align: center;
} }
.min-size1 { .min-size1 {
font-size: 12px; font-size: 12px;
//color: #e2e2e2; //color: #e2e2e2;