This commit is contained in:
PQZ 2024-09-26 17:13:54 +08:00
commit 75815cf4b0
20 changed files with 554 additions and 136 deletions
fuintAdmin/src/views
EventMarketing/liJianMarketing
userGrade
fuintAdmin_zt/src/views/financialStatement/yunyingfenxi
fuintBackend/fuint-application/src/main/java/com/fuint/business
gasStation-uni
pages.json
pages/index
pagesHome/prize

View File

@ -9,21 +9,21 @@
</el-form-item>
<el-form-item label="活动时间" prop="activeTimeType">
<div class="d-s">
<div class="icon-type" v-for="(item,index) in activityTimeTypeList" :key="index"
:class="{ 'acvtive' : index === tindex1 }" @click="Typeindex1(index)">
<img src="@/assets/images/wx.png" style="width: 20px;height: 20px" v-if="index != tindex1">
<img src="@/assets/images/xz.png" style="width: 20px;height: 20px" v-if="index == tindex1">
{{ item }}
</div>
<el-radio-group v-model="ruleForm.activeTimeType">
<el-radio :label="'0'">永久有效</el-radio>
<el-radio :label="'1'">自定义</el-radio>
</el-radio-group>
<el-date-picker
v-if="ruleForm.activeTimeType=='1'"
v-model="ruleForm.activeStartTime"
style="width: 160px"
type="date"
value-format="yyyy-MM-dd"
placeholder="开始日期">
</el-date-picker>
<span style="margin: 0 5px"></span>
<span v-if="ruleForm.activeTimeType=='1'" style="margin: 0 5px"></span>
<el-date-picker
v-if="ruleForm.activeTimeType=='1'"
v-model="ruleForm.activeEndTime"
style="width: 160px"
type="date"
@ -35,23 +35,21 @@
<el-form-item label="优惠类型" prop="offerType">
<div class="d-s">
<div class="icon-type" v-for="(item,index) in preferentialTypeList" :key="index"
:class="{ 'acvtive' : index === tindex2 }" @click="Typeindex2(index)">
<img src="@/assets/images/wx.png" style="width: 20px;height: 20px" v-if="index != tindex2">
<img src="@/assets/images/xz.png" style="width: 20px;height: 20px" v-if="index == tindex2">
{{ item }}
</div>
<el-radio-group v-model="ruleForm.offerType" @input="changeOfferType()">
<el-radio :label="'0'" >立减优惠</el-radio>
<el-radio :label="'1'" >折扣优惠</el-radio>
</el-radio-group>
</div>
<span style="color: grey;font-size: 12px">例如:立减优惠满100立减2元;折扣优惠满200享受95折</span>
<span style="color: grey;font-size: 12px">例如:立减优惠满100立减2元;折扣优惠满200享受95折</span>
</el-form-item>
<el-form-item label="活动类型" prop="activeType">
<div class="d-s">
<div class="icon-type" v-for="(item,index) in activityTypeList" :key="index"
:class="{ 'acvtive' : index === tindex5 }" @click="Typeindex5(index)">
<img src="@/assets/images/wx.png" style="width: 20px;height: 20px" v-if="index != tindex5">
<img src="@/assets/images/xz.png" style="width: 20px;height: 20px" v-if="index == tindex5">
{{ item }}
</div>
<el-radio-group v-model="ruleForm.activeType">
<el-radio :label="'0'">固定优惠</el-radio>
<el-radio :label="'1'" v-if="ruleForm.offerType=='0'">随机满减</el-radio>
<el-radio :label="'2'" v-if="ruleForm.offerType=='0'">每满</el-radio>
</el-radio-group>
</div>
<div style="color: grey;font-size: 11px">
固定满减:订单满足规则时只优惠一次且金额固定:满100元立减5元订单金额是210元则优惠减5元
@ -96,27 +94,26 @@
</div>
<div style="width: 50%">
<el-form-item label="适用时间段" prop="timeType">
<div>
<div class="icon-type" v-for="(item,index) in weekMonthTypeList" :key="index"
:class="{ 'acvtive' : index === tindex3 }" @click="Typeindex3(index)">
<img src="@/assets/images/wx.png" style="width: 20px;height: 20px" v-if="index != tindex3">
<img src="@/assets/images/xz.png" style="width: 20px;height: 20px" v-if="index == tindex3">
{{ item }}
<el-checkbox-group v-model="weekDay" v-if="item=='每周'" style="margin-left: 20px"
:disabled="tindex3!=0">
<el-checkbox v-for="(item,index) in weekList" :key="index" :label="item"></el-checkbox>
</el-checkbox-group>
<el-select v-model="monthDay" placeholder="请选择每月固定日期" multiple v-if="item=='每月'"
:disabled="tindex3!=1"
style="margin-left: 20px">
<el-option
v-for="item in 31"
:key="item.value"
:label="item+'日'"
:value="item">
</el-option>
</el-select>
</div>
<div style="width: 100px;margin-top: 10px">
<el-radio-group v-model="ruleForm.timeType">
<div style="display: flex; width: 500px;margin-bottom: 15px;">
<el-radio :label="'1'">每周</el-radio>
<el-checkbox-group v-model="weekDay" style="margin-left: 20px" :disabled="ruleForm.timeType!='1'">
<el-checkbox v-for="(item,index) in weekList" :key="index" :label="item"></el-checkbox>
</el-checkbox-group>
</div>
<el-radio :label="'2'">每月
<el-select :disabled="ruleForm.timeType!='2'" v-model="monthDay" placeholder="请选择每月固定日期" multiple style="margin-left: 20px">
<el-option
v-for="item in 31"
:key="item+''"
:label="item+'日'"
:value="item+''">
</el-option>
</el-select>
</el-radio>
</el-radio-group>
</div>
<div style="margin-top: 20px">
<el-form-item label="时间段" prop="timeApplyStart" label-width="65px">
@ -139,13 +136,11 @@
<el-form-item label="适用油品油号" prop="applyOilType">
<div class="d-s">
<div class="icon-type" v-for="(item,index) in oilTypeList" :key="index"
:class="{ 'acvtive' : index === tindex4 }" @click="Typeindex4(index)">
<img src="@/assets/images/wx.png" style="width: 20px;height: 20px" v-if="index != tindex4">
<img src="@/assets/images/xz.png" style="width: 20px;height: 20px" v-if="index == tindex4">
{{ item }}
</div>
<el-select v-model="ruleForm.applyOil" multiple clearable placeholder="请选择油品油号(多选)">
<el-radio-group v-model="ruleForm.applyOilType">
<el-radio :label="'0'">不限</el-radio>
<el-radio :label="'1'">自定义</el-radio>
</el-radio-group>
<el-select v-if="ruleForm.applyOilType=='1'" v-model="ruleForm.applyOil" multiple clearable placeholder="请选择油品油号(多选)">
<el-option v-for="(item,index) in oilNumberList" :key="index"
:label="getOilNamess(oilNameList,item.oilName)" :value="item.oilName"></el-option>
</el-select>
@ -347,13 +342,13 @@ export default {
data() {
return {
ruleForm: {
activeTimeType: 0,
activeTimeType: '0',
paymentType: [],
activeManner: [],
offerType: 0,
activeType: 0,
timeType: 0,
applyOilType: 0,
offerType: '0',
activeType: '0',
timeType: '0',
applyOilType: '0',
},
userGradeList: [],
userLabelList: [],
@ -362,21 +357,21 @@ export default {
oilNumberList: [],
activityTimeTypeList: ["永久有效", "自定义"],
tindex1: 0,
tindex1: '0',
preferentialTypeList: ["立减优惠", "折扣优惠"],
tindex2: 0,
tindex2: '0',
weekMonthTypeList: ["每周", "每月"],
tindex3: 0,
tindex3: '0',
oilTypeList: ['不限', '自定义'],
tindex4: 0,
tindex4: '0',
activityTypeList: ['固定满减', '随机满减', '每满'],
tindex5: 0,
tindex5: '0',
weekList: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
weekDay: [],
monthDay: [],
orderList: [{
activeManner: 0,
activeManner: '0',
full: "",
sub: "",
randomFront: "",
@ -385,7 +380,7 @@ export default {
enjoyDiscount: "",
}],
refuelList: [{
activeManner: 1,
activeManner: '0',
full: "",
sub: "",
randomFront: "",
@ -395,6 +390,12 @@ export default {
}],
//
rules: {
timeType:[
{required: true, message: '适用时间段不能为空', trigger: 'blur'},
],
activeType:[
{required: true, message: '活动类型不能为空', trigger: 'blur'},
],
activeName: [
{required: true, message: '活动名称不能为空', trigger: 'blur'},
],
@ -438,6 +439,10 @@ export default {
this.getOilList()
},
methods: {
changeOfferType(){
this.ruleForm.activeType = '0'
console.log( this.ruleForm,446)
},
getOilList() {
getOilNameList().then(response => {
this.oilNameList = response.data;
@ -476,9 +481,9 @@ export default {
if (res.data) {
this.ruleForm = res.data
if (res.data.timeSlots) {
if (res.data.timeType == 0) {
if (res.data.timeType == 1) {
this.weekDay = this.ruleForm.timeSlots.split(",")
} else if (res.data.timeType == 1) {
} else if (res.data.timeType == 2) {
this.monthDay = this.ruleForm.timeSlots.split(",")
}
}
@ -491,13 +496,13 @@ export default {
if (res.data.refuelList) this.refuelList = this.ruleForm.refuelList
} else {
this.ruleForm = {
activeTimeType: 0,
activeTimeType: '0',
paymentType: [],
activeManner: [],
offerType: 0,
activeType: 0,
timeType: 0,
applyOilType: 0,
offerType: '0',
activeType: '0',
timeType: '0',
applyOilType: '0',
}
this.tindex1 = 0
this.tindex2 = 0
@ -714,9 +719,9 @@ export default {
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.ruleForm.timeType == 0) {
if (this.ruleForm.timeType == 1) {
this.ruleForm.timeSlots = this.weekDay.toString()
} else if (this.ruleForm.timeType == 1) {
} else if (this.ruleForm.timeType == 2) {
this.ruleForm.timeSlots = this.monthDay.toString()
}
if (this.ruleForm.levelId) this.ruleForm.levelId = this.ruleForm.levelId.toString()

View File

@ -725,9 +725,9 @@
<el-select :disabled="form2.suitTimeSlotType!='2'" v-model="monthDay" placeholder="请选择每月固定日期" multiple style="margin-left: 20px">
<el-option
v-for="item in 31"
:key="item.value"
:key="item+''"
:label="item+'日'"
:value="item">
:value="item+''">
</el-option>
</el-select>
</el-radio>
@ -763,9 +763,9 @@
<el-select :disabled="form2.noUseTimeType!='2'" v-model="monthDay1" placeholder="请选择每月固定日期" multiple style="margin-left: 20px">
<el-option
v-for="item in 31"
:key="item.value"
:key="item+''"
:label="item+'日'"
:value="item">
:value="item+''">
</el-option>
</el-select>
</el-radio>

View File

@ -25,17 +25,17 @@
<div class="heng-box" v-if="radio1 == '积分商城分析'"></div>
<div class="heng-box" style="background-color: #FFFFFF" v-else></div>
</div>
<div class="nbox" :class="pointerClass" @click="updateRedio('支付方式分析')">
<div class="fount-box" :style="{ color: radio1 === '支付方式分析' ? '#FF770F' : '#999999' }">支付方式分析</div>
<div class="heng-box" v-if="radio1 == '支付方式分析'"></div>
<div class="heng-box" style="background-color: #FFFFFF" v-else></div>
<!-- <div class="nbox" :class="pointerClass" @click="updateRedio('支付方式分析')">-->
<!-- <div class="fount-box" :style="{ color: radio1 === '支付方式分析' ? '#FF770F' : '#999999' }">支付方式分析</div>-->
<!-- <div class="heng-box" v-if="radio1 == '支付方式分析'"></div>-->
<!-- <div class="heng-box" style="background-color: #FFFFFF" v-else></div>-->
</div>
<div class="nbox" :class="pointerClass" @click="updateRedio('支付通道分析')">
<div class="fount-box" :style="{ color: radio1 === '支付通道分析' ? '#FF770F' : '#999999' }">支付通道分析</div>
<div class="heng-box" v-if="radio1 == '支付通道分析'"></div>
<div class="heng-box" style="background-color: #FFFFFF" v-else></div>
</div>
<!-- </div>-->
<!-- <div class="nbox" :class="pointerClass" @click="updateRedio('支付通道分析')">-->
<!-- <div class="fount-box" :style="{ color: radio1 === '支付通道分析' ? '#FF770F' : '#999999' }">支付通道分析</div>-->
<!-- <div class="heng-box" v-if="radio1 == '支付通道分析'"></div>-->
<!-- <div class="heng-box" style="background-color: #FFFFFF" v-else></div>-->
<!-- </div>-->
</div>
</el-card>

View File

@ -41,8 +41,8 @@
</el-form>
<div class="wrap-box">
<div class="k_" id="k_1">
<div class="size_">累计交易金额</div>
<div class="title_">{{ orderStatistics.paidInfo?(orderStatistics.paidInfo/10000).toFixed(4) : 0 }}</div>
<div class="size_">累计交易金额</div>
<div class="title_">{{ orderStatistics.paidInfo ||0}}</div>
</div>
<div class="k_" id="k_2">
<div class="size_">累计交易笔数</div>
@ -65,9 +65,9 @@
style="width: 100%">
<el-table-column type="index" width="50" align="center" label="序号"/>
<el-table-column prop="storeName" label="机构名称" width="150" align="center"></el-table-column>
<el-table-column prop="paidInfo" label="累计交易金额 (元)" width="150" align="center">
<el-table-column prop="paidInfo" label="累计交易金额 (元)" width="150" align="center">
<template>
{{this.orderStatistics.paidInfo?(this.orderStatistics.paidInfo/10000).toFixed(6) : 0 }}
{{this.orderStatistics.paidInfo}}
</template>
</el-table-column>
<el-table-column prop="count" label="累计交易笔数" width="150" align="center"></el-table-column>

View File

@ -1,4 +1,4 @@
<!-- 收银台订单-->
<!-- 油品分析 -->
<template>
<div style="padding-top: 20px; padding-right: 20px; background: #f6f8f9;padding-bottom: 15px">
<div class="card-change2-1" shadow="never" >
@ -43,28 +43,28 @@
</el-form>
<div class="wrap-box">
<div class="k_" id="k_1">
<div class="size_">累计交易金额</div>
<div class="title_">{{orderStatistics.amount?(orderStatistics.amount/10000).toFixed(4) : '0'}}</div>
<div class="size_">累计交易金额</div>
<div class="title_">{{orderStatistics.amount}}</div>
</div>
<div class="k_" id="k_2">
<div class="size_">累计交易升数</div>
<div class="title_">{{orderStatistics.num || 0}}</div>
</div>
<div class="k_" id="k_3">
<div class="size_">92#汽油交易金额</div>
<div class="title_">{{orderStatistics.amount92?(orderStatistics.amount92/10000).toFixed(4) : '0'}}</div>
<div class="size_">92#汽油交易金额</div>
<div class="title_">{{orderStatistics.amount92}}</div>
</div>
<div class="k_" id="k_4">
<div class="size_">95#汽油交易金额</div>
<div class="title_">{{orderStatistics.amount95?(orderStatistics.amount95/10000).toFixed(4) : '0'}}</div>
<div class="size_">95#汽油交易金额</div>
<div class="title_">{{orderStatistics.amount95}}</div>
</div>
<div class="k_" id="k_5">
<div class="size_">98#汽油交易金额</div>
<div class="title_">{{orderStatistics.amount98?(orderStatistics.amount98/10000).toFixed(4) : '0'}}</div>
<div class="size_">98#汽油交易金额</div>
<div class="title_">{{orderStatistics.amount98}}</div>
</div>
<div class="k_" id="k_5">
<div class="size_">0#柴油交易金额</div>
<div class="title_">{{orderStatistics.amount0?(orderStatistics.amount0/10000).toFixed(4) : '0'}}</div>
<div class="size_">0#柴油交易金额</div>
<div class="title_">{{orderStatistics.amount0}}</div>
</div>
</div>
</div>
@ -78,40 +78,40 @@
style="width: 100%">
<el-table-column type="index" width="50" align="center" label="序号"/>
<el-table-column align="center" prop="storeName" label="机构名称"></el-table-column>
<el-table-column align="center" prop="payAmount" label="累计交易金额(元)"></el-table-column>
<el-table-column align="center" prop="payAmount" label="累计交易金额(元)"></el-table-column>
<el-table-column align="center" prop="sum" label="累计交易笔数"></el-table-column>
<el-table-column align="center" prop="oilNum" label="累计交易升数"></el-table-column>
<el-table-column align="center" label="92#汽油">
<el-table-column align="center" prop="amount92" label="交易金额(元)">
<el-table-column align="center" prop="amount92" label="交易金额(元)">
<template slot-scope="scope">
{{(scope.row.amount92/10000).toFixed(6)}}
{{scope.row.amount92}}
</template>
</el-table-column>
<el-table-column align="center" prop="count92" label="交易笔数"></el-table-column>
<el-table-column align="center" prop="num92" label="交易升数"></el-table-column>
</el-table-column>
<el-table-column align="center" label="95#汽油">
<el-table-column align="center" prop="amount95" label="交易金额(元)">
<el-table-column align="center" prop="amount95" label="交易金额(元)">
<template slot-scope="scope">
{{(scope.row.amount95/10000).toFixed(6)}}
{{scope.row.amount95}}
</template>
</el-table-column>
<el-table-column align="center" prop="count95" label="交易笔数"></el-table-column>
<el-table-column prop="num95" label="交易升数"></el-table-column>
</el-table-column>
<el-table-column align="center" label="98#汽油">
<el-table-column align="center" prop="amount98" label="交易金额(元)">
<el-table-column align="center" prop="amount98" label="交易金额(元)">
<template slot-scope="scope">
{{(scope.row.amount98/10000).toFixed(6)}}
{{scope.row.amount98}}
</template>
</el-table-column>
<el-table-column align="center" prop="count98" label="交易笔数" ></el-table-column>
<el-table-column align="center" prop="num98" label="交易升数" ></el-table-column>
</el-table-column>
<el-table-column align="center" label="0#柴油">
<el-table-column align="center" prop="amount0" label="交易金额(元)" >
<el-table-column align="center" prop="amount0" label="交易金额(元)" >
<template slot-scope="scope">
{{(scope.row.amount0/10000).toFixed(6)}}
{{scope.row.amount0}}
</template>
</el-table-column>
<el-table-column align="center" prop="count0" label="交易笔数" ></el-table-column>
@ -279,6 +279,16 @@ import {parseTime} from "@/utils/fuint";
}
getFenXiOilOrderDataApi(this.addDateRange(this.queryParams, this.value2)).then(res=>{
this.orderStatistics = res.data
if (res.data == null){
this.orderStatistics = {
amount:'0',
num:'0',
amount92:'0',
amount95:'0',
amount98:'0',
amount0:'0',
}
}
console.log("res.data1111",res.data)
})
},

View File

@ -42,20 +42,20 @@
</el-form>
<div class="wrap-box">
<div class="k_" id="k_1">
<div class="size_">累计交易金额</div>
<div class="title_">{{orderStatistics.payAmount?(orderStatistics.payAmount/10000).toFixed(4) : 0}}</div>
<div class="size_">累计交易金额</div>
<div class="title_">{{orderStatistics.payAmount || 0}}</div>
</div>
<div class="k_" id="k_2">
<div class="size_">累计交易笔数</div>
<div class="title_">{{orderStatistics.count/10000 || 0}}</div>
<div class="title_">{{orderStatistics.count || 0}}</div>
</div>
<div class="k_" id="k_3">
<div class="size_">累计销售商品数量</div>
<div class="title_">{{orderStatistics.goodsNum/10000 || 0}}</div>
<div class="title_">{{orderStatistics.goodsNum || 0}}</div>
</div>
<div class="k_" id="k_4">
<div class="size_">热销品类数量</div>
<div class="title_">{{orderStatistics.cvg/10000 || 0}}</div>
<div class="title_">{{orderStatistics.cvg || 0}}</div>
</div>
</div>
</div>
@ -66,9 +66,9 @@
style="width: 100%">
<el-table-column type="index" width="50" align="center" label="序号"/>
<el-table-column prop="storeName" label="机构名称" width="150" align="center"></el-table-column>
<el-table-column prop="payAmounts" label="累计交易金额 (元)" align="center">
<el-table-column prop="payAmounts" label="累计交易金额 (元)" align="center">
<template slot-scope="scope">
{{(scope.row.payAmounts/10000).toFixed(6)}}
{{scope.row.payAmounts}}
</template>
</el-table-column>
<el-table-column prop="counts" label="累计交易笔数" align="center"></el-table-column>
@ -76,9 +76,9 @@
<el-table-column label="商品信息" align="center">
<el-table-column prop="cvgNum" label="品类数量" width="100" align="center"></el-table-column>
<el-table-column prop="goodsNum" label="商品数量" width="100" align="center"></el-table-column>
<el-table-column prop="payAmounts" label="累计交易金额 (元)" width="150" align="center">
<el-table-column prop="payAmounts" label="累计交易金额 (元)" width="150" align="center">
<template slot-scope="scope">
{{(scope.row.payAmounts/10000).toFixed(6)}}
{{scope.row.payAmounts}}
</template>
</el-table-column>
@ -254,6 +254,14 @@ import {parseTime} from "@/utils/fuint";
}
getFenXiStoreDataApi(this.addDateRange(this.queryParams, this.value2)).then(res=>{
this.orderStatistics = res.data
if (res.data == null){
this.orderStatistics = {
count:'0',
cvg:'0',
goodsNum:'0',
payAmount:'0',
}
}
console.log("res.data1111",res.data)
})
},

View File

@ -96,6 +96,16 @@ public class IntegralSettings extends BaseEntity {
*/
private Integer chainStoreId;
/**
* 适用规则 0-无限制 1-有限制
*/
private Integer signApplicableRules;
/**
* 签到周期 0-一周 1-两周 2-一个月 只有适用规则为1时有值
*/
private Integer signCycle;
}

View File

@ -45,8 +45,10 @@ public class ActiveSubPrice extends Model<ActiveSubPrice> {
/** 活动时间类型0永久有效1自定义 */
private String activeTimeType ;
/** 生效起始时间 */
@JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
private Date activeStartTime ;
/** 生效截止时间 */
@JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
private Date activeEndTime ;
/** 优惠类型0立减优惠|1活动优惠 */
private String offerType ;
@ -87,4 +89,4 @@ public class ActiveSubPrice extends Model<ActiveSubPrice> {
/**加油升数列表*/
@TableField(exist = false)
private List<ActiveSubPriceRule> refuelList;
}
}

View File

@ -76,15 +76,9 @@ public class ActiveSubPriceServiceImpl extends ServiceImpl<ActiveSubPriceMapper,
**/
@Override
public boolean saveActiveSubPrice(boolean isAdd, ActiveSubPriceSaveVO saveVO) {
// if (isAdd){
// ActiveSubPrice activeSubPrice = this.selectByStoreId();
// if (ObjectUtil.isNotEmpty(activeSubPrice)){
// return false;
// }
// }
ActiveSubPrice activeSubPrice = new ActiveSubPrice();
BeanUtils.copyProperties(saveVO, activeSubPrice);
// 插入店铺id信息
//插入店铺id信息
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
activeSubPrice.setChainStorId(nowAccountInfo.getChainStoreId());
activeSubPrice.setStoreId(nowAccountInfo.getStoreId());

View File

@ -21,5 +21,13 @@ public interface CardCouponMapper extends BaseMapper<CardCoupon> {
IPage<CardCoupon> pageVo(Page page, @Param("cardCoupon") CardCoupon cardCoupon);
IPage<CardCouponUniVo> selectAllByPageAndStoreId(Page page, @Param("cardCoupon")CardCoupon cardCoupon);
IPage<CardCouponUniVo> selectAllByPageAndIds(Page page,@Param("ids") List<Integer> ids);
/**
* 根据店铺id查询优惠券今日领取数量
* @param cardCouponUniVos
* @return
*/
List<CardCouponUniVo> selectByStoreIdCount(CardCouponUniVo cardCouponUniVos);
}

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser;
import com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponUniVo;
import com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponUserVo;
import com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponVO;
import org.apache.ibatis.annotations.Mapper;
@ -11,6 +12,7 @@ import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 用户优惠卷表2024(CardCouponUser)表数据库访问层
@ -38,5 +40,7 @@ public interface CardCouponUserMapper extends BaseMapper<CardCouponUser> {
* @return
*/
IPage<CardCouponUserVo> queryPage(Page page,@Param("entity") CardCouponUserVo cardCouponUserVo);
List<CardCouponUniVo> selectCouponCount(@Param("storeId") Integer storeId,@Param("userId") Integer userId);
}

View File

@ -31,7 +31,7 @@
resultType="com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponUniVo">
SELECT
cc.*,
mt.NAME AS typeName,
mt.NAME AS storeName,
CASE
cc.type
WHEN 1 THEN
@ -44,7 +44,7 @@
'油品立减券'
WHEN 5 THEN
'单品代金券'
END AS statusName
END AS typeName
FROM
card_coupon cc
LEFT JOIN mt_store mt ON mt.id = cc.store_id
@ -66,5 +66,46 @@
</if>
</where>
</select>
<select id="selectByStoreIdCount"
resultType="com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponUniVo">
select cc.id id, count(cu.id) count
from card_coupon cc
left join card_coupon_user as cu on cc.id = cu.card_coupon_id
<where>
cc.store_id = #{storeId}
<if test="startTime!=null and startTime!=''">
and cu.create_time between #{startTime} and #{endTime}
</if>
</where>
group by cc.id
</select>
<select id="selectAllByPageAndIds"
resultType="com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponUniVo">
SELECT
cc.*,
mt.NAME AS storeName,
CASE
cc.type
WHEN 1 THEN
'代金券'
WHEN 2 THEN
'兑换券'
WHEN 3 THEN
'折扣券'
WHEN 4 THEN
'油品立减券'
WHEN 5 THEN
'单品代金券'
END AS typeName
FROM
card_coupon cc
LEFT JOIN mt_store mt ON mt.id = cc.store_id
<where>
cc.id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</where>
</select>
</mapper>

View File

@ -29,4 +29,12 @@
</if>
</where>
</select>
<select id="selectCouponCount" resultType="com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponUniVo">
SELECT
card_coupon_id id,
count(1) count
FROM card_coupon_user
WHERE store_id = #{storeId} AND mt_user_id = #{userId}
group by card_coupon_id
</select>
</mapper>

View File

@ -1,6 +1,9 @@
package com.fuint.business.marketingActivity.cardCoupon.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -8,6 +11,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCoupon;
import com.fuint.business.marketingActivity.cardCoupon.mapper.CardCouponMapper;
import com.fuint.business.marketingActivity.cardCoupon.mapper.CardCouponUserMapper;
import com.fuint.business.marketingActivity.cardCoupon.service.CardCouponService;
import com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponUniVo;
import com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponVO;
@ -20,6 +24,8 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 油站优惠卷表2024(CardCoupon)表服务实现类
@ -32,6 +38,9 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
@Autowired
private MtStoreMapper mtStoreMapper;
@Autowired
private CardCouponUserMapper cardCouponUserMapper;
@Override
public IPage<CardCoupon> pageVo(Page page, CardCoupon cardCoupon) {
return baseMapper.pageVo( page, cardCoupon);
@ -49,24 +58,64 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
@Override
public IPage selectAllByPageAndStoreId(Page page, CardCoupon cardCoupon) {
//获取今天开始与结束时间
DateTime now = DateUtil.date();
DateTime startTime = DateUtil.beginOfDay(now);
DateTime endTime = DateUtil.endOfDay(now);
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
//首先查询该店铺所有的优惠券
cardCoupon.setPutType("2");
cardCoupon.setStatus("1");
IPage<CardCouponUniVo> cardCouponUniVos = baseMapper.selectAllByPageAndStoreId(page, cardCoupon);
List<CardCouponUniVo> cardCouponVos = new ArrayList<>();
//用户拥有的优惠券以及数量
List<CardCouponUniVo> list= cardCouponUserMapper.selectCouponCount(cardCoupon.getStoreId(), nowAccountInfo.getId());
Map<Integer, Integer> map = list.stream().collect(Collectors.toMap(CardCouponUniVo::getId, CardCouponUniVo::getCount));
CardCouponUniVo cardCouponUniVo1 = new CardCouponUniVo();
cardCouponUniVo1.setStoreId(cardCoupon.getStoreId());
cardCouponUniVo1.setStartTime(startTime.toString());
cardCouponUniVo1.setEndTime(endTime.toString());
//根据店铺id查询优惠券今日领取数量
List<CardCouponUniVo> cardCouponUniVos1 = baseMapper.selectByStoreIdCount(cardCouponUniVo1);
Map<Integer, Integer> cardCouponMap = cardCouponUniVos1.stream().collect(Collectors.toMap(CardCouponUniVo::getId, CardCouponUniVo::getCount));
//存放最终可领取的优惠券id集合
List<Integer> ids = new ArrayList<>();
//循环店铺优惠券
for (CardCouponUniVo coupon : cardCouponUniVos.getRecords()) {
//查询该优惠券是否已到达限制数量
if (coupon.getTfGetNum() < coupon.getTfTotal()){
CardCouponUniVo cardCouponUniVo = BeanUtil.copyProperties(coupon, CardCouponUniVo.class);
//计算领取的比例
double scale = (coupon.getTfGetNum() * 1.0 / coupon.getTfTotal()) * 100;
cardCouponUniVo.setScale(scale + "%");
if ((coupon.getTfGetNum() < coupon.getTfTotal())) {
Integer count = 0;
if (ObjectUtil.isNotEmpty(cardCouponMap.get(coupon.getId()))){
count = cardCouponMap.get(coupon.getId());
}
if (count < coupon.getDayGetLimit()) {
Integer getNumLimit = coupon.getGetNumLimit();
Integer userCount = 0;
if (ObjectUtil.isNotEmpty(map.get(coupon.getId()))){
userCount = map.get(coupon.getId());
}
if (userCount < getNumLimit) {
//查询当前用户所拥有的优惠券数量
ids.add(coupon.getId());
}
}
}
}
return cardCouponUniVos;
IPage<CardCouponUniVo> cardCouponUniVoIPage = new Page<>(page.getCurrent(), page.getSize());
if (CollUtil.isNotEmpty(ids)) {
cardCouponUniVoIPage = baseMapper.selectAllByPageAndIds(page, ids);
cardCouponUniVoIPage.getRecords().stream().forEach(coupon -> extracted(coupon));
}
return cardCouponUniVoIPage;
}
private static void extracted(CardCouponUniVo coupon) {
//计算领取的比例
double scale = (coupon.getTfGetNum() * 1.0 / coupon.getTfTotal()) * 100;
coupon.setScale(scale + "%");
}
}

View File

@ -1,5 +1,7 @@
package com.fuint.business.marketingActivity.cardCoupon.vo;
import cn.hutool.core.date.DateTime;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCoupon;
import lombok.Data;
@ -11,4 +13,12 @@ public class CardCouponUniVo extends CardCoupon {
private String scale;
//兑换券类型
private String typeName;
private Integer count;
@JsonIgnore
private String startTime;
@JsonIgnore
private String endTime;
}

View File

@ -142,6 +142,14 @@ public class LJOrderServiceImpl extends ServiceImpl<LJOrderMapper, LJOrder> impl
@Override
public Map<String, Object> selectOrderFenxiDataByZtDz(LJOrderVo order){
if (ObjectUtil.isEmpty(order.getDeptId())) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
order.setDeptId(nowAccountInfo.getDeptId());
}
List<Long> strings = sysDeptMapper.selectChildByDeptIdR(order.getDeptId());
List<Long> longs = mtStoreMapper.queryStoresByDeptIdsR(strings);
order.setStoreIds(longs);
Map<String, Object> stringObjectMap = baseMapper.selectOrderFenxiDataByZtDz(order);
Map<String, Object> stringObjectMap2 = baseMapper.selectOrderFenxiDataByZtDz2(order);
stringObjectMap.put("cvg",stringObjectMap2.get("cvg"));

View File

@ -203,6 +203,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
}
return oilOrderIPage;
}
// 查询油品分析 列表
@Override
public IPage<OilOrderVo> selectOilOrderFenXiListByZtDz(Page page, OilOrderVo order) {
if (ObjectUtil.isEmpty(order.getDeptId())) {
@ -238,9 +239,18 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
}
return oilOrderIPage;
}
// 查询油品分析 累计
public Map<String,String> selectOilOrderFenXiDataByZtDz(OilOrderVo order){
return baseMapper.selectOilOrderFenXiDataByZtDz(order);
if (ObjectUtil.isEmpty(order.getDeptId())) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
order.setDeptId(nowAccountInfo.getDeptId());
}
List<Long> strings = sysDeptMapper.selectChildByDeptIdR(order.getDeptId());
List<Long> longs = mtStoreMapper.queryStoresByDeptIdsR(strings);
order.setStoreIds(longs);
Map<String, String> stringStringMap = baseMapper.selectOilOrderFenXiDataByZtDz(order);
return stringStringMap;
}
public void export(HttpServletResponse response, OilOrder order) {

View File

@ -210,6 +210,13 @@
"style": {
"navigationBarTitleText": "会员注册"
}
},
{
"path": "prize/index",
"style": {
"navigationBarTitleText": "我的奖品"
}
}
]

View File

@ -1003,6 +1003,7 @@
box-sizing: border-box;
padding: 15px;
margin: 15px auto;
}
.station-title {
@ -1225,4 +1226,4 @@
justify-content: center;
color: #fff;
}
</style>
</style>

View File

@ -0,0 +1,243 @@
<template>
<view class="content">
<view class="container">
<view class="top_show">
<view class="wx_" v-if="show == false" @click="show =! show"></view>
<view class="x_" v-else @click="show =! show">
<u-icon name="checkbox-mark" color="#fff" size="14"></u-icon>
</view>
<view style="font-size: 14px;">仅查看已中奖的记录</view>
</view>
<view class="box_" v-for="(item,index) in 3" :key="index">
<view class="title_">抽奖</view>
<view class="box_bs">
<image src="../../static/logo.png" style="width: 80px; height: 80px; "></image>
<view class="r_box">
<view class="">
<view class="b_title">获得 <text style="color:#E02020 ;">抽纸</text> 1</view>
<view style="margin: 5px 0px;">抽纸1份</view>
<view class="">2024-08-02 12:02:24</view>
</view>
<view class="anniu">待核销</view>
</view>
</view>
</view>
<u-popup :show="showl" :round="10" mode="bottom" @close="close" @open="open">
<view class="">
<view class="pop-top">
<view style="width: 20px;"></view>
<view class="">立即使用</view>
<view class=""><u-icon name="close"></u-icon></view>
</view>
<view class="popup-box">
<view class="">
<view class="">请向商家出示此码使用</view>
<view style="display: flex;align-items: center;justify-content: center; margin: 10px auto;">
<w-qrcode :options="options"></w-qrcode>
</view>
<view class="">核销码6688172293684182</view>
</view>
</view>
</view>
</u-popup>
</view>
</view>
</template>
<script>
import request from '../../utils/request';
export default {
data() {
return {
title: '',
show: false,
List: [],
pageNo: 1,
pageSize: 10,
totalPage: '',
showl: true,
options: {
code: 'https://oilapi.youkerr.com/oily?storeId=' + uni.getStorageSync('storeId') + '&userId=' + uni
.getStorageSync('userId') + '&type=yaoqingyouli',
// code: 'https://www.tuofeng.cc/oily?storeId=' + uni.getStorageSync('storeId') + ' &userId=' + uni
// .getStorageSync('userId'), //
size: 400, // 460460rpx
},
}
},
onLoad() {
},
onPullDownRefresh() {
//
this.resetting() //
this.getList() //
uni.stopPullDownRefresh()
},
onReachBottom() {
//
if (this.pageNo >= this.totalPage) {
uni.showToast({
title: '没有下一页数据',
icon: 'none'
})
} else {
this.pageNo++
this.getList()
}
},
components: {
},
methods: {
//
resetting() {
this.pageNo = 1
this.pageSize = 10
this.totalPage = ''
this.List = []
},
//
async getList() {
uni.showLoading({
title: '加载中'
});
let res = await request({
url: '网络请求',
method: 'get',
data: {
pageNo: this.pageNo,
pageSize: this.pageSize,
}
})
if (res.code == 200) {
uni.hideLoading(); //
if (this.pageNo != 1) {
this.List = this.ruleList.concat(res.result.records)
} else {
this.List = res.result.records
}
this.totalPage = res.result.pages
}
},
goback() {
uni.navigateBack()
}
}
}
</script>
<style scoped lang="scss">
.content {
background: #f4f5f6;
}
.container {
width: 100%;
height: 100vh;
box-sizing: border-box;
background: #f4f5f6;
}
.box_ {
width: 95%;
background: #fff;
border-radius: 4px;
box-sizing: border-box;
padding: 10px;
margin: 15px auto;
}
.box_bs {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 12px;
}
.r_box {
width: 70%;
display: flex;
align-items: center;
justify-content: space-between;
}
.anniu {
border-radius: 13px;
border: 1px solid #FA6400;
width: 60px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
color: #FA6400;
font-size: 14px;
}
.title_ {
font-size: 16px;
color: #333333;
margin-bottom: 15px;
}
.top_show {
width: 100%;
background: #fff;
box-sizing: border-box;
padding: 10px 20px;
display: flex;
align-items: center;
}
.b_title {
font-size: 14px;
}
.wx_ {
width: 14px;
height: 14px;
border-radius: 50%;
border: 1px solid #eee;
margin-right: 5px;
}
.x_ {
width: 14px;
height: 14px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
border: 1px solid #FA6400;
background: #FA6400;
margin-right: 5px;
}
.popup-box {
background: #fff;
box-sizing: border-box;
padding: 10px;
background: #ffffff;
margin: 15px auto;
box-sizing: border-box;
padding: 10px;
text-align: center;
}
.pop-top {
width: 100%;
box-sizing: border-box;
padding: 10px;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #eee;
}
</style>