Merge remote-tracking branch 'origin/master'

This commit is contained in:
齐天大圣 2024-02-23 17:37:34 +08:00
commit 922cfcb017
35 changed files with 685 additions and 205 deletions

View File

@ -13,8 +13,8 @@ export function listQRCode(query) {
export function QRCodeByStoreId(query) {
return request({
url: '/business/storeInformation/qrCode/createStoreQrCode',
method: 'get',
params: query
method: 'post',
data: query
})
}

View File

@ -54,4 +54,12 @@ export function getCardFavorableList(query) {
params: query
})
}
// 成长值记录
// 卡券列表
export function getCardFavorableLists(query) {
return request({
url: 'business/marketingActivity/cardFavorable/PC',
method: 'get',
params: query
})
}
// 成长值记录

View File

@ -53,21 +53,21 @@
<el-option label="无储值余额" value="noHaveBalance"/>
</el-select>
</el-form-item>
<el-form-item label="" prop="status">
<el-select
v-model="queryParams.official"
placeholder="全部"
clearable
style="width: 240px"
>
<el-option
v-for="dict in dict.type.official"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="" prop="status">-->
<!-- <el-select-->
<!-- v-model="queryParams.official"-->
<!-- placeholder="全部"-->
<!-- clearable-->
<!-- style="width: 240px"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.official"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="注册时间">
<el-date-picker
v-model="dateRange"
@ -75,7 +75,7 @@
size="medium"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
@ -202,11 +202,7 @@
<div>{{ scope.row.consumeNum ? scope.row.consumeNum : '0' }}</div>
</template>
</el-table-column>
<el-table-column label="注册时间" align="center" width="160" prop="balCreateTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.balCreateTime) }}</span>
</template>
</el-table-column>
<el-table-column label="注册时间" align="center" width="160" prop="balCreateTime"/>
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.zhzt" :value="scope.row.status"/>
@ -359,16 +355,16 @@
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<el-row>
<el-col :span="24">
<el-form-item label="是否关注公众号">
<el-radio-group v-model="form.official">
<el-radio label="ygz" value="ygz">已关注</el-radio>
<el-radio label="wgz" value="wgz">未关注</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<!-- <el-row>-->
<!-- <el-col :span="24">-->
<!-- <el-form-item label="是否关注公众号">-->
<!-- <el-radio-group v-model="form.official">-->
<!-- <el-radio label="ygz" value="ygz">已关注</el-radio>-->
<!-- <el-radio label="wgz" value="wgz">未关注</el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<el-row>
<el-col :span="24">
<el-form-item label="会员状态" prop="status">

View File

@ -201,7 +201,7 @@
disabled>
<template slot="append"></template>
</el-input>
<span class="bom">赠送金额 仅自定义金额模式下可手动输入赠送活动充值赠送金额不可手动更改</span>
<span class="bom">赠送金额 自定义金额模式下将按照距离自定义金额最近的充值活动信息进行赠送</span>
</div>
</div>
@ -214,29 +214,29 @@
<template slot="append">积分</template>
</el-input>
<span
class="bom">赠送积分 仅自定义金额模式下可手动输入,活动充值赠送积分不可手动更改[需开启积分活动有效]</span>
class="bom">赠送积分 自定义金额模式下将按照距离自定义金额最近的充值活动信息进行赠送</span>
</div>
</div>
<div class="jine">
<div class="zeng" style="width: 100px;">赠成长值</div>
<div class="zeng">赠成长值</div>
<div>
<el-input placeholder="0"
v-model="cardValueForm.growthValue"
disabled>
<template slot="append">成长值</template>
</el-input>
<!-- <span class="bom">赠送加油金金额 仅自定义金额模式下可手动输入赠送活动充值赠送金额不可手动更改</span> -->
<span class="bom">赠送成长值 自定义金额模式下将按照距离自定义金额最近的充值活动信息进行赠送</span>
</div>
</div>
<div class="jine">
<div class="zeng">提成员工</div>
<div class="zeng" style="width: 30%">提成员工</div>
<div>
<el-input :readonly="true" placeholder="请选择提成员工" v-model="cardValueForm.realName">
<el-button slot="append" @click="chooseStaff">选择员工</el-button>
</el-input>
<span class="bom">仅系统储值档次支持提成员工选择自定义充值金额匹配低一档次</span>
<!-- <span class="bom">仅系统储值档次支持提成员工选择自定义充值金额匹配低一档次</span>-->
</div>
</div>
</div>
@ -318,7 +318,7 @@
<template slot="append">积分</template>
</el-input>
<span
class="bom">升数卡充值不支持自定义积分,选择对应充值活动获得对应积分[需开启积分活动有效]</span>
class="bom">升数卡充值不支持自定义积分,选择对应充值活动获得对应积分</span>
</div>
</div>
<div style="display:flex;margin-left: 20px">

View File

@ -8,40 +8,48 @@
</el-radio-group>
<div>
<el-table ref="tables" v-loading="loading" :data="list">
<el-table-column align="center" prop="storeName" label="所属油站"/>
<el-table-column align="center" prop="cardFavorableName" label="优惠券名称"/>
<el-table-column align="center" prop="type" label="卡券类型">
<el-table-column align="center" prop="storeName" label="所属油站">
<template slot-scope="scope">
<el-tag v-if="scope.row.type == 0">油品券</el-tag>
<el-tag v-if="scope.row.type == 1" type="success">商品券</el-tag>
<el-tag v-if="scope.row.type == 2" type="warning">通用券</el-tag>
<span>{{store.name}}</span>
</template>
</el-table-column>
<el-table-column align="center" prop="fullDeduction" label="满减金额"/>
<el-table-column align="center" prop="discountAmount" label="券面额"/>
<el-table-column align="center" prop="oilType" label="适用油品">
<el-table-column align="center" prop="couponName" label="优惠券名称"/>
<el-table-column align="center" prop="couponType" label="卡券类型">
<!-- <template slot-scope="scope">-->
<!-- <el-tag v-if="scope.row.type == 0">油品券</el-tag>-->
<!-- <el-tag v-if="scope.row.type == 1" type="success">商品券</el-tag>-->
<!-- <el-tag v-if="scope.row.type == 2" type="warning">通用券</el-tag>-->
<!-- </template>-->
</el-table-column>
<el-table-column align="center" prop="couponAmount" label="优惠金额/参与次数">
<template slot-scope="scope">
<span>{{ getOilNames(oilNameList,scope.row.oilType) }}</span>
<span>{{scope.row.couponAmount || 0}}</span>
</template>
</el-table-column>
<el-table-column align="center" prop="status" label="状态">
<el-table-column align="center" prop="couponContent" label="券面额/使用说明"/>
<!-- <el-table-column align="center" prop="oilType" label="适用油品">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ getOilNames(oilNameList,scope.row.oilType) }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column align="center" prop="useStatus" label="状态">
<template slot-scope="scope">
<el-tag v-if="scope.row.status == 0">未使用</el-tag>
<el-tag v-if="scope.row.status == 1" type="success">已使用</el-tag>
<el-tag v-if="scope.row.status == 2" type="warning">已过期</el-tag>
<el-tag v-if="scope.row.useStatus == 0">未使用</el-tag>
<el-tag v-if="scope.row.useStatus == 1" type="success">已使用</el-tag>
<el-tag v-if="scope.row.useStatus == 2" type="warning">已过期</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="卡券可用规则">
<el-table-column align="center" prop="name" label="有效期">
<!-- <el-table-column align="center" label="卡券可用规则">-->
<el-table-column align="center" prop="name" label="到期时间">
<template slot-scope="scope">
{{ scope.row.startTime }}{{ scope.row.endTime }}
{{ scope.row.endTime }}
</template>
</el-table-column>
<el-table-column align="center" prop="availablePeriod" label="周期与时段"/>
</el-table-column>
<el-table-column align="center" prop="createTime" label="领取时间"/>
<el-table-column align="center" prop="exchangeFrom" label="描述"/>
<!-- <el-table-column align="center" prop="availablePeriod" label="周期与时段"/>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" prop="createTime" label="领取时间"/>-->
<!-- <el-table-column align="center" prop="exchangeFrom" label="描述"/>-->
</el-table>
<pagination
@ -55,8 +63,9 @@
</template>
<script>
import { getCardFavorableList } from "@/api/userInfoOrder.js";
import {getCardFavorableList, getCardFavorableLists} from "@/api/userInfoOrder.js";
import {oilNumbers} from "@/api/oilConfig/oilGuns";
import {ljStoreInfo} from "@/api/staff/store";
export default {
props:["pUserId"],
@ -68,11 +77,12 @@ export default {
list:[],
total:0,
queryParams:{
status: 0,
useStatus: 0,
page:1,
pageSize:10,
},
oilNameList:[],
store:{},
}
},
created() {
@ -111,25 +121,30 @@ export default {
getList(){
this.loading = true
this.queryParams.mtUserId = this.userId
getCardFavorableList(this.queryParams).then(res=>{
this.queryParams.id = this.userId
getCardFavorableLists(this.queryParams).then(res=>{
if (res.code == 200) {
this.list = res.data.records
this.total = res.data.total
this.loading = false
this.getStore()
}
})
},
getStore(){
ljStoreInfo().then(res => {
this.store = res.data
})
},
changeStatus() {
if (this.cardList == 'notUse') {
this.queryParams.status = 0
this.queryParams.useStatus = 0
} else if (this.cardList == 'used') {
this.queryParams.status = 1
this.queryParams.useStatus = 1
} else if (this.cardList == 'expired') {
this.queryParams.status = 2
this.queryParams.useStatus = 2
} else {
this.queryParams.status = ''
this.queryParams.useStatus = ''
}
this.getList()
}

View File

@ -149,7 +149,7 @@
<el-table-column type="index" width="50" align="center" label="序号"/>
<el-table-column prop="name" label="会员名称" align="center"> </el-table-column>
<el-table-column prop="mobile" label="会员手机号" align="center"> </el-table-column>
<el-table-column prop="bidBalance" label="储值卡面值" align="center"> </el-table-column>
<el-table-column prop="bidBalance" label="到账金额" align="center"> </el-table-column>
<el-table-column prop="rechargeBalance" label="储值卡实售金额" align="center"> </el-table-column>
<el-table-column prop="giftBalance" label="储值卡赠送金额" align="center"></el-table-column>
<el-table-column prop="paymentType" label="支付方式" align="center">
@ -351,13 +351,23 @@ export default {
return name;
},
exportExcelVip() {
exportExcelVipApi(this.queryParams).then(res=>{
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
exportExcelVipApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
this.$download.saveAs(blob,'会员充值订单统计.xLsx')
})
},
getOrderStatistics () {
orderStatisticsApi().then(res=>{
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
orderStatisticsApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
this.orderStatistics = res.data
})

View File

@ -222,6 +222,7 @@
<el-select v-model="form.notice">
<el-option
v-for="dict in dict.type.notice"
v-if="dict.value!='zdyx'"
:key="dict.value"
:label="dict.label"
:value="dict.value"

View File

@ -34,7 +34,9 @@
<div slot="header" class="clearfix">
<span>油站二维码</span>
</div>
<img id="collection" class="qrcode" :src="collectionImg" /><br/>
<el-button style="margin-left: 200px" type="text" v-if="type==0" @click="getQRCodeInfoByStoreId(1)">切换样式</el-button><br/>
<el-button style="margin-left: 200px" type="text" v-if="type==1" @click="getQRCodeInfoByStoreId(0)">切换样式</el-button><br/>
<img id="collection" class="qrcode" :src="baseUrl + collectionImg" /><br/>
<el-button class="but" type="primary"
icon="el-icon-download"
@click="handleDownloadqrCode('collection')">
@ -58,7 +60,7 @@
<script>
import QRCode from 'qrcode'
import html2canvas from "html2canvas";
import {listQRCode} from "@/api/staff/qrcode";
import {listQRCode, QRCodeByStoreId} from "@/api/staff/qrcode";
import {ljStoreInfo, updateStore} from "@/api/staff/store";
import mapComponment from "@/components/map/mapComponent.vue";
import imgUpload from "@/components/ImageUpload/index.vue"
@ -114,10 +116,13 @@ export default {
//
options: [],
welfare:[],
type:0,
baseUrl:process.env.VUE_APP_BASE_API,
}
},
created() {
this.getQRCodeInfo();
// this.getQRCodeInfo();
this.getQRCodeInfoByStoreId(0);
this.getStore();
this.getForm()
},
@ -162,6 +167,7 @@ export default {
}
this.$refs.mapRef.initAMap();
this.flag = true;
})
},
@ -187,10 +193,10 @@ export default {
})
},
//
getQRCodeInfoByStoreId(){
listQRCode().then(response => {
this.qrcode = response.data.records;
this.getQRcode();
getQRCodeInfoByStoreId(type){
this.type = type
QRCodeByStoreId({type:type}).then(response => {
this.collectionImg = response.data;
})
},
// url
@ -252,12 +258,12 @@ export default {
margin: 15px auto;
}
.qrcode{
width: 180px;
height: 180px;
width: 300px;
margin-top: 15px;
}
.but{
margin-top: 15px;
margin-top: 20px;
margin-left: 50px;
width: 180px;
}
.copy{

View File

@ -219,7 +219,7 @@
</el-card>
<!-- 添加或修改对话框 -->
<el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="60%" append-to-body>
<el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="50%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="24">
@ -311,11 +311,11 @@
</el-row>
</div>
<!-- 选择优惠券-->
<div class="xh-box" v-if="form.activeGift && form.activeGift.indexOf('1')>-1 " >
<div class="xh-box" v-if="form.ifRechargeCoupon == '1' && form.activeGift && form.activeGift.indexOf('1')>-1 " >
<div class="box-bt"> <div >赠送卡券</div> <el-button type="primary" icon="el-icon-plus" @click="getlistFavorable()" >新增</el-button> </div>
<div style="margin: 10px 0px">
<el-table
:data="form.tableDatas"
:data="tableDatas1"
border
style="width: 100%">
<el-table-column
@ -376,7 +376,7 @@
</div>
</div>
<!-- 选择兑换券-->
<div class="xh-box" v-if="form.activeGift && form.activeGift.indexOf('2')>-1 " >
<div class="xh-box" v-if="form.ifRechargeCoupon == '1' && form.activeGift && form.activeGift.indexOf('2')>-1 " >
<div class="box-bt"> <div >选择兑换券</div> <el-button type="primary" icon="el-icon-plus" @click="getlistExchange()" >新增</el-button> </div>
<div style="margin: 10px 0px">
@ -757,6 +757,7 @@ export default {
data() {
return {
tableDatas:[],//
tableDatas1:[],//
tableDatadh:[],//
//
youhuiquan:{
@ -844,7 +845,8 @@ export default {
form: { id: '', grade: "", name: '',gasoline:1,dieselOil:1,naturalGas:1,preferential:'自定义优惠',
gasolineDiscount:'无优惠',dieselDiscount:'无优惠',naturalGasDiscount:'无优惠',promotionGroup:'',
// catchCondition: '', userPrivilege: '', catchType: '', catchValue: '', validDay: '',discount: '', speedPoint: '',
status: 'qy',tableDatas:[] },
status: 'qy',
tableDatas:[], },
//
queryParams: {
page: 1,
@ -940,10 +942,7 @@ export default {
this.pddhidlist.push(row.id)
console.log(row)
let data ={
activeGift: 2, // 01 2. 3 4.
goodsIds: "", //id
goodsName:"" , //
goodsTotal: "", //
activeGift: 2, //1 2
vouchersId:row.id, //id
giftCardName:row.name, //
giftCardType: row.type, //
@ -970,10 +969,7 @@ export default {
this.pdidlist.push(row.id)
let data ={
activeGift: 1, // 01 2. 3 4.
goodsIds: "", //id
goodsName:"" , //
goodsTotal: "", //
activeGift: 1, //1 2
vouchersId:row.id, //id
giftCardName:row.name, //
giftCardType: row.type, //
@ -986,23 +982,23 @@ export default {
giftCardTotal: 1//
}
// this.form.tableDatas.push(data)
this.tableDatas1.push(data)
this.$message.success("新增成功")
},
//
deletedata(row){
if(this.form.tableDatas&&this.form.tableDatas.length>0){
if(this.tableDatas1&&this.tableDatas1.length>0){
let delIdx=-1;
for ( let item of this.form.tableDatas) {
for ( let item of this.tableDatas1) {
delIdx++;
if (item.id===row.id){
break
}
}
this.pdidlist.splice(delIdx,1);
this.form.tableDatas.splice(delIdx,1);
this.tableDatas1.splice(delIdx,1);
}
@ -1224,6 +1220,11 @@ export default {
this.form.dieselRule = JSON.stringify(this.dieselPreferential)
this.form.naturalGasRule = JSON.stringify(this.naturalGasPreferential)
this.form.activeGift = this.form.activeGift.toString()
if (this.form.ifRechargeCoupon == 1){
this.form.mtUserGradeChildList = this.tableDatas.concat(this.tableDatas1);
}else {
this.form.mtUserGradeChildList = []
}
if (this.form.id) {
updateUserGrade(this.form).then(response => {
if (response.data==1) {
@ -1265,6 +1266,8 @@ export default {
let _this = this;
this.reset();
const id = row.id || this.ids;
this.tableDatas1 = []
this.tableDatas = []
getUserGrade(id).then(response => {
_this.form = response.data;
this.gasolinePreferential = JSON.parse(this.form.gasolineRule)
@ -1275,6 +1278,16 @@ export default {
}else {
_this.form.activeGift = []
}
if (response.data.mtUserGradeChildList.length>0){
response.data.mtUserGradeChildList.forEach(item => {
if (item.activeGift == '1'){
this.tableDatas1.push(item)
}
if (item.activeGift == '2'){
this.tableDatas.push(item)
}
})
}
this.open = true;
this.title = "编辑会员等级";
});
@ -1304,4 +1317,11 @@ export default {
.card{
margin-top: 15px;
}
.box-bt{
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 18px;
}
</style>

View File

@ -134,5 +134,20 @@ public class CardFavorableController extends BaseController {
Page page = new Page(pageNo, pageSize);
return getSuccessResult(this.cardFavorableService.selectAllByCondition(page,cardFavorableDTOS));
}
/**
*查询我的卡券接口(小程序端)
* @param pageNo
* @param pageSize
* @param cardFavorableDTOS
* @return
*/
@GetMapping("PC")
public ResponseObject selectAllByConditionPC(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
@Param("cardFuelDiesel") CardFavorableDTOS cardFavorableDTOS) {
Page page = new Page(pageNo, pageSize);
return getSuccessResult(this.cardFavorableService.selectAllByConditionPC(page,cardFavorableDTOS));
}
}

View File

@ -91,51 +91,64 @@
card_favorables.couponContent,
card_favorables.cardRecordId,
card_favorables.endTime,
card_favorables.useStatus,
card_favorables.exclusiveFunction
from
(SELECT
'优惠券' AS couponType,
cf.NAME couponName ,cf.id id,cf.discount_amount couponAmount,cf.satisfied_amount couponContent,cfr.id cardRecordId, cfr.end_time endTime, cf.exclusive_function exclusiveFunction
cf.NAME couponName ,cf.id id,cf.discount_amount couponAmount,cf.satisfied_amount couponContent,
cfr.id cardRecordId, cfr.end_time endTime, cf.exclusive_function exclusiveFunction,cfr.status useStatus
FROM
card_favorable cf
LEFT JOIN card_favorable_record cfr ON cf.id = cfr.card_favorable_id
WHERE
cfr.mt_user_id = #{cardFavorableDTOS.id}
and cfr.status = #{cardFavorableDTOS.useStatus}
<if test="cardFavorableDTOS.useStatus!=null and cardFavorableDTOS.useStatus != ''">
and cfr.status = #{cardFavorableDTOS.useStatus}
</if>
and cfr.store_id = #{cardFavorableDTOS.storeId}
and cf.type != 1 UNION ALL
SELECT
'兑换券' AS couponType,
ce.NAME couponName, ce.id id, ce.count couponAmount, ce.use_instructions couponContent,cer.id cardRecordId, cer.out_time endTime, ce.qr_code_link exclusiveFunction
ce.NAME couponName, ce.id id, ce.count couponAmount, ce.use_instructions couponContent,cer.id cardRecordId,
cer.out_time endTime, ce.qr_code_link exclusiveFunction,cer.status useStatus
FROM
card_exchange_record cer
LEFT JOIN card_exchange ce ON cer.card_exchange_id = ce.id
WHERE
cer.mt_user_id = #{cardFavorableDTOS.id}
and ce.type = 0
<if test="cardFavorableDTOS.useStatus!=null and cardFavorableDTOS.useStatus != ''">
and cer.status = #{cardFavorableDTOS.useStatus}
</if>
and cer.store_id = #{cardFavorableDTOS.storeId} UNION ALL
SELECT
'洗车券' AS couponType,
ce.NAME couponName, ce.id id, ce.count couponAmount, ce.use_instructions couponContent,cer.id cardRecordId, cer.out_time endTime, ce.qr_code_link exclusiveFunction
ce.NAME couponName, ce.id id, ce.count couponAmount, ce.use_instructions couponContent,
cer.id cardRecordId, cer.out_time endTime, ce.qr_code_link exclusiveFunction,cer.status useStatus
FROM
card_exchange_record cer
LEFT JOIN card_exchange ce ON cer.card_exchange_id = ce.id
WHERE
cer.mt_user_id = #{cardFavorableDTOS.id}
and ce.type = 1
<if test="cardFavorableDTOS.useStatus!=null and cardFavorableDTOS.useStatus != ''">
and cer.status = #{cardFavorableDTOS.useStatus}
</if>
and cer.store_id = #{cardFavorableDTOS.storeId} UNION ALL
SELECT
'洗车卡' AS couponType,
ce.NAME couponName, ce.id id, ce.count couponAmount, ce.use_instructions couponContent,cer.id cardRecordId, cer.out_time endTime, ce.qr_code_link exclusiveFunction
ce.NAME couponName, ce.id id, ce.count couponAmount, ce.use_instructions couponContent,cer.id cardRecordId,
cer.out_time endTime, ce.qr_code_link exclusiveFunction,cer.status useStatus
FROM
card_exchange_record cer
LEFT JOIN card_exchange ce ON cer.card_exchange_id = ce.id
WHERE
cer.mt_user_id = #{cardFavorableDTOS.id}
and ce.type = 2
<if test="cardFavorableDTOS.useStatus!=null and cardFavorableDTOS.useStatus != ''">
and cer.status = #{cardFavorableDTOS.useStatus}
</if>
and cer.store_id = #{cardFavorableDTOS.storeId}) AS card_favorables
<where>
<if test="cardFavorableDTOS.couponType != null">

View File

@ -62,5 +62,13 @@ public interface CardFavorableService extends IService<CardFavorable> {
* @return
*/
IPage selectAllByCondition(Page page, CardFavorableDTOS cardFavorableDTOS);
/**
* 查询优惠券接口(PC)
* @param page
* @param cardFavorableDTOS
* @return
*/
IPage selectAllByConditionPC(Page page, CardFavorableDTOS cardFavorableDTOS);
}

View File

@ -233,5 +233,26 @@ public class CardFavorableServiceImpl extends ServiceImpl<CardFavorableMapper, C
//couponVOS.setRecords(collect);
return couponVOS;
}
@Override
public IPage selectAllByConditionPC(Page page, CardFavorableDTOS cardFavorableDTOS) {
//获取登录用户id
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
cardFavorableDTOS.setStoreId(nowAccountInfo.getStoreId());
IPage<CouponVO> couponVOS = cardFavorableRecordMapper.selectAllByCondition(page,cardFavorableDTOS);
List<CouponVO> records = couponVOS.getRecords();
//有效期
List<CouponVO> collect = records.stream().filter(s -> s.getEndTime().getTime() < System.currentTimeMillis()).collect(Collectors.toList());
if (ObjectUtils.isNotEmpty(collect)){
for (CouponVO couponVO : collect) {
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
cardFavorableRecord.setId(couponVO.getCardRecordId());
cardFavorableRecord.setStatus("2");
cardFavorableRecordMapper.updateById(cardFavorableRecord);
}
}
//couponVOS.setRecords(collect);
return couponVOS;
}
}

View File

@ -262,7 +262,24 @@
COUNT(CASE WHEN payment_type = 'ALIPAY' THEN 0 END) AS alipay, -- 支付宝
COUNT(CASE WHEN payment_type = 'CASH' THEN 0 END) AS cash -- 现金
from card_value_record
where store_id = #{cardValueRecord.storeId}
<where>
store_id = #{cardValueRecord.storeId}
<if test="cardValueRecord.mtStaffId != null and cardValueRecord.mtStaffId != ''">
and mt_staff_id = #{cardValueRecord.mtStaffId}
</if>
<if test="cardValueRecord.paymentType != null and cardValueRecord.paymentType != ''">
and payment_type = #{cardValueRecord.paymentType}
</if>
<if test="cardValueRecord.mobile != null and cardValueRecord.mobile != ''">
and mobile like concat('%', #{cardValueRecord.mobile}, '%')
</if>
<if test="cardValueRecord.params.beginTime != null and cardValueRecord.params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(create_time,'%y%m%d') &gt;= date_format(#{cardValueRecord.params.beginTime},'%y%m%d')
</if>
<if test="cardValueRecord.params.endTime != null and cardValueRecord.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(create_time,'%y%m%d') &lt;= date_format(#{cardValueRecord.params.endTime},'%y%m%d')
</if>
</where>
</select>
<select id="selectCardValueRecordList"
resultType="com.fuint.business.marketingActivity.cardValue.entity.CardValueRecord">

View File

@ -7,8 +7,10 @@ import com.fuint.api.fuyou.entity.ReturnParameter;
import com.fuint.business.integral.entity.IntegralDetail;
import com.fuint.business.marketingActivity.cardValue.dto.CardValueRecordDTO;
import com.fuint.business.marketingActivity.cardValue.entity.CardValueRecord;
import com.fuint.business.member.entity.LJStaff;
import com.fuint.business.order.entity.CashierOrder;
import com.fuint.business.petrolStationManagement.entity.OilGun;
import com.fuint.business.userManager.vo.LJUserVo;
import io.lettuce.core.dynamic.annotation.Param;
import javax.servlet.http.HttpServletResponse;
@ -60,6 +62,12 @@ public interface CardValueRecordService extends IService<CardValueRecord> {
void export(HttpServletResponse response, CardValueRecord cardValueRecord);
void rechargeFinallDeal(String orderNo);
/**
* 会员等级优惠送券
* @param userId
*/
void giveCoupon(Integer userId, Integer storeId, LJUserVo ljUserVos, LJStaff ljStaff);
/**
* 根据用户id查询当前的储值卡信息
* @return

View File

@ -27,6 +27,7 @@ import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable;
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService;
import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableVO;
import com.fuint.business.marketingActivity.cardValue.dto.CardValueRecordDTO;
import com.fuint.business.marketingActivity.cardValue.entity.CardValueChild;
import com.fuint.business.marketingActivity.cardValue.mapper.CardValueChildMapper;
@ -50,8 +51,10 @@ import com.fuint.business.order.service.CardBalanceChangeService;
import com.fuint.business.order.service.GrowthValueChangeService;
import com.fuint.business.storeInformation.entity.LJStore;
import com.fuint.business.storeInformation.service.ILJStoreService;
import com.fuint.business.userManager.entity.MtUserGradeChild;
import com.fuint.business.userManager.entity.UserBalance;
import com.fuint.business.userManager.mapper.LJUserMapper;
import com.fuint.business.userManager.service.MtUserGradeChildService;
import com.fuint.business.userManager.service.UserBalanceService;
import com.fuint.business.userManager.vo.LJUserVo;
import com.fuint.common.dto.AccountInfo;
@ -126,6 +129,9 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
private ILJStoreService storeService;
@Resource
private CommissionRecordMapper commissionRecordMapper;
@Resource
private MtUserGradeChildService userGradeChildService;
/**
* 储值卡充值新增
* @param cardValueRecordDTO
@ -545,6 +551,11 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
}
//会员等级充值送券
giveCoupon(cardValueRecord.getMtUserId(),cardValueRecord.getStoreId(),ljUserVos,ljStaff);
// 修改订单的处理状态 (避免二次执行)
CardValueRecord updateCardValueRecord = new CardValueRecord();
updateCardValueRecord.setId(id);
@ -900,6 +911,11 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
}
}
}
//会员等级充值送券
giveCoupon(cardValueOrders.getMtUserId(),cardValueOrders.getStoreId(),ljUserVo,ljStaff);
//生成充值记录
cardValueRecord.setMtUserId(cardValueOrders.getMtUserId());
cardValueRecord.setName(cardValueOrders.getName());
@ -929,6 +945,47 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
save(cardValueRecord);
}
@Override
public void giveCoupon(Integer userId,Integer storeId,LJUserVo ljUserVos,LJStaff ljStaff) {
List<MtUserGradeChild> mtUserGradeChildren = userGradeChildService.selectListByUserId(userId,storeId);
if (CollectionUtils.isNotEmpty(mtUserGradeChildren)) {
for (MtUserGradeChild mtUserGradeChild : mtUserGradeChildren) {
if ("1".equals(mtUserGradeChild.getActiveGift())){
//优惠券
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
cardFavorableRecord.setCardFavorableId(mtUserGradeChild.getVouchersId());
cardFavorableRecord.setStoreId(storeId);
cardFavorableRecord.setMtUserId(userId);
cardFavorableRecord.setName(ljUserVos.getName());
cardFavorableRecord.setMobile(ljUserVos.getMobile());
cardFavorableRecord.setStatus("0");
cardFavorableRecord.setExchangeFrom("储值卡赠送");
cardFavorableRecordService.addCardFavorableRecord(cardFavorableRecord);
}else if("2".equals(mtUserGradeChild.getActiveGift())) {
//兑换券
CardExchangeRecord cardExchangeRecord = new CardExchangeRecord();
cardExchangeRecord.setCardExchangeId(mtUserGradeChild.getVouchersId());
cardExchangeRecord.setStoreId(storeId);
cardExchangeRecord.setMtUserId(userId);
cardExchangeRecord.setName(ljUserVos.getName());
cardExchangeRecord.setMobile(ljUserVos.getMobile());
cardExchangeRecord.setPhoto(ljUserVos.getAvatar());
if (ObjectUtil.isNotEmpty(ljStaff)) {
cardExchangeRecord.setMtStaffId(ljStaff.getId());
cardExchangeRecord.setRealName(ljStaff.getRealName());
cardExchangeRecord.setStaffMobile(ljStaff.getMobile());
}
cardExchangeRecord.setStatus("0");
cardExchangeRecord.setExchangeFrom("储值卡赠送");
cardExchangeRecordService.addCardExchangeRecord(cardExchangeRecord);
}
}
}
}
@Override
public CardValueRecord selectCardValueRecordByUserId(Integer storeId,Integer userId) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();

View File

@ -90,6 +90,7 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
queryWrapper.eq("status","qy");
queryWrapper.eq("role_id","15");
queryWrapper.eq("if_delete","0");
queryWrapper.eq("is_refuel","xs");
List list = baseMapper.selectList(queryWrapper);
return list;
}
@ -101,6 +102,7 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
queryWrapper.eq("status","qy");
queryWrapper.eq("role_id","15");
queryWrapper.eq("if_delete","0");
queryWrapper.eq("is_refuel","xs");
List list = baseMapper.selectList(queryWrapper);
return list;
}

View File

@ -65,7 +65,7 @@ public class QrCodeUtils {
//使用工具类生成二维码
Image image = createQrCode(logoStream, url, 360, 360);
//将小图片绘到大图片上,500,300 .表示你的小图片在大图片上的位置
g.drawImage(image, 260, 320, null);
g.drawImage(image, (bufImg.getWidth()-360)/2, 320, null);
// 设置字体样式字体大小
g.setFont(new Font("TimesRoman", Font.BOLD, 40));
//设置颜色

View File

@ -38,8 +38,7 @@ public class QRCodeController extends BaseController {
@PostMapping("/createStoreQrCode")
public ResponseObject createStoreQrCode(HttpServletRequest request, @RequestBody Map<String,String> map) throws Exception {
String type = map.get("type");
Integer storeId = Integer.valueOf(map.get("storeId"));
return getSuccessResult(iqrCodeService.createStoreQrCode(type,storeId,request));
return getSuccessResult(iqrCodeService.createStoreQrCode(type,request));
}
/**

View File

@ -21,7 +21,7 @@ public interface IQRCodeService extends IService<QRCode> {
*/
public IPage<QRCode> selectQRCodeList(Page page, QRCode qrCode);
String createStoreQrCode(String type,Integer storeId, HttpServletRequest request) throws Exception;
String createStoreQrCode(String type, HttpServletRequest request) throws Exception;
/**
* 根据店铺id查询二维码信息

View File

@ -52,7 +52,9 @@ public class QRCodeServiceImpl extends ServiceImpl<QRCodeMapper, QRCode> impleme
private BackendFileController backendFileController;
@Override
public String createStoreQrCode(String type, Integer storeId, HttpServletRequest request) throws Exception {
public String createStoreQrCode(String type, HttpServletRequest request) throws Exception {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
QRCode qrCode = selectQRCodeByStoreId(storeId);
// 根据id查询员工信息和店铺信息
LJStore store = storeService.selectStoreByStoreId(storeId);
@ -61,7 +63,7 @@ public class QRCodeServiceImpl extends ServiceImpl<QRCodeMapper, QRCode> impleme
if (type.equals("0")){
backgroundImage = "static/qrCodeImg/laigeyouhui_bg.jpg";
}else {
backgroundImage = "static/qrCodeImg/laigeyouhui_bg1.jpg";
backgroundImage = "static/qrCodeImg/laigeyouhui_bg1.png";
}
String logoImage = "static/qrCodeImg/logo.png";

View File

@ -0,0 +1,27 @@
package com.fuint.business.userManager.controller;
import com.fuint.business.userManager.service.MtUserGradeChildService;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/business/userManager/userGradeChild")
public class MtUserGradeChildController extends BaseController {
@Autowired
private MtUserGradeChildService userGradeChildService;
/**
* 根据会员id查询子表列表信息
* @param userId
* @return
*/
// @GetMapping("/{userId}")
// public ResponseObject getUserGradeChildList(@PathVariable Integer userId){
// return getSuccessResult(userGradeChildService.selectListByUserId(userId));
// }
}

View File

@ -99,4 +99,7 @@ public class LJUserGrade extends BaseEntity implements Serializable {
@TableField(exist = false)
private List<JSONObject> naturalGasRuleList;
@TableField(exist = false)
private List<MtUserGradeChild> MtUserGradeChildList;
}

View File

@ -0,0 +1,83 @@
package com.fuint.business.userManager.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fuint.framework.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.io.Serializable;
/**
* 会员等级充值送券信息的子表(MtUserGradeChild)实体类
*
* @author makejava
* @since 2024-02-22 09:58:35
*/
@Data
@TableName("mt_user_grade_child")
@ApiModel(value = "MtUserGradeChild对象", description = "会员等级充值送券信息的子表")
public class MtUserGradeChild extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("自增ID")
@TableId(value = "ID", type = IdType.AUTO)
/**
* 主键
*/
private Integer id;
/**
* 会员等级id
*/
private Integer userGradeId;
/**
* 充值赠送类型1赠送优惠券 2赠送兑换券
*/
private String activeGift;
/**
* 券id
*/
private Integer vouchersId;
/**
* 赠送卡券名称
*/
private String giftCardName;
/**
* 券类型
*/
private String giftCardType;
/**
* 券详情
*/
private String giftCardDetail;
/**
* 券有效期
*/
private Integer giftCardTime;
/**
* 券数量
*/
private Integer giftCardTotal;
/**
* 有效期0
*/
private Integer validityZero;
/**
* 有效期1
*/
private Integer validityOne;
/**
* 有效期2
*/
private Integer validityTwo;
/**
* 生效日期类型 0 12
*/
private String timeType;
}

View File

@ -0,0 +1,7 @@
package com.fuint.business.userManager.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fuint.business.userManager.entity.MtUserGradeChild;
public interface MtUserGradeChildMapper extends BaseMapper<MtUserGradeChild> {
}

View File

@ -156,10 +156,10 @@
and mub.card_balance != 0
</if>
<if test="user.params.beginTime != null and user.params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(mu.create_time,'%y%m%d') &gt;= date_format(#{user.params.beginTime},'%y%m%d')
and date_format(mub.create_time,'%y%m%d') &gt;= date_format(#{user.params.beginTime},'%y%m%d')
</if>
<if test="user.params.endTime != null and user.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(mu.create_time,'%y%m%d') &lt;= date_format(#{user.params.endTime},'%y%m%d')
and date_format(mub.create_time,'%y%m%d') &lt;= date_format(#{user.params.endTime},'%y%m%d')
</if>
</where>
</select>
@ -168,7 +168,7 @@
<select id="selectSumByStore" resultType="java.lang.Double" parameterType="int">
select sum(${sumValue}) from
(select mu.*,mub.grade_id,mub.card_balance,mub.points,mub.consume_num,mub.growth_value,mub.refuel_money,
mub.second_card,mub.fixing_level,mub.chain_store_id
mub.second_card,mub.fixing_level,mub.chain_store_id,mub.create_time balCreateTime
FROM mt_user mu
LEFT JOIN mt_user_balance mub ON mu.id = mub.mt_user_id) t
<where>
@ -200,10 +200,10 @@
and t.card_balance != 0
</if>
<if test="user.params.beginTime != null and user.params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(t.create_time,'%y%m%d') &gt;= date_format(#{user.params.beginTime},'%y%m%d')
and date_format(t.balCreateTime,'%y%m%d') &gt;= date_format(#{user.params.beginTime},'%y%m%d')
</if>
<if test="user.params.endTime != null and user.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(t.create_time,'%y%m%d') &lt;= date_format(#{user.params.endTime},'%y%m%d')
and date_format(t.balCreateTime,'%y%m%d') &lt;= date_format(#{user.params.endTime},'%y%m%d')
</if>
</where>
</select>

View File

@ -0,0 +1,35 @@
package com.fuint.business.userManager.service;
import com.fuint.business.userManager.entity.MtUserGradeChild;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Transactional
public interface MtUserGradeChildService {
/**
* 根据会员等级id查询子表信息
* @param gradeId
* @return
*/
List<MtUserGradeChild> selectListByGradeId(Integer gradeId);
/**
* 根据会员id查询子表信息
* @param userId
* @return
*/
List<MtUserGradeChild> selectListByUserId(Integer userId,Integer storeId);
/**
* 根据会员等级id删除子表信息
* @param gradeId
*/
void deleteMtUserGradeChildByGradeId(Integer gradeId);
/**
* 添加子表信息
* @param mtUserGradeChild
*/
void insertMtUserGradeChild(MtUserGradeChild mtUserGradeChild);
}

View File

@ -1,5 +1,6 @@
package com.fuint.business.userManager.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
@ -10,15 +11,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.storeInformation.entity.LJStore;
import com.fuint.business.storeInformation.service.ILJStoreService;
import com.fuint.business.userManager.entity.CertifiedMember;
import com.fuint.business.userManager.entity.ChainStoreConfig;
import com.fuint.business.userManager.entity.FixingLevel;
import com.fuint.business.userManager.entity.LJUserGrade;
import com.fuint.business.userManager.entity.*;
import com.fuint.business.userManager.mapper.LJUserGradeMapper;
import com.fuint.business.userManager.service.CertifiedMemberService;
import com.fuint.business.userManager.service.ChainStoreConfigService;
import com.fuint.business.userManager.service.FixingLevelService;
import com.fuint.business.userManager.service.LJUserGradeService;
import com.fuint.business.userManager.service.*;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.StringUtils;
import com.fuint.common.util.TokenUtil;
@ -36,6 +31,8 @@ import java.util.Map;
public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUserGrade> implements LJUserGradeService {
@Autowired
private ILJStoreService storeService;
@Autowired
private MtUserGradeChildService userGradeChildService;
@Override
public IPage<LJUserGrade> selectUserGradeList(Page page, LJUserGrade userGrade) {
@ -54,6 +51,8 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
if (StringUtils.isNotEmpty(record.getNaturalGasRule())){
record.setNaturalGasRuleList(JSONArray.parseArray(record.getNaturalGasRule(), JSONObject.class));
}
List<MtUserGradeChild> mtUserGradeChildren = userGradeChildService.selectListByGradeId(record.getId());
record.setMtUserGradeChildList(mtUserGradeChildren);
}
return ljUserGradeIPage;
}
@ -86,7 +85,10 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
@Override
public LJUserGrade selectUserGradeById(int id) {
return baseMapper.selectById(id);
LJUserGrade ljUserGrade = baseMapper.selectById(id);
List<MtUserGradeChild> mtUserGradeChildren = userGradeChildService.selectListByGradeId(ljUserGrade.getId());
ljUserGrade.setMtUserGradeChildList(mtUserGradeChildren);
return ljUserGrade;
}
@Override
@ -266,6 +268,17 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
if (flag) {
return row;
}
List<MtUserGradeChild> mtUserGradeChildList = userGrade.getMtUserGradeChildList();
// 更新子表数据
userGradeChildService.deleteMtUserGradeChildByGradeId(userGrade.getId());
if (CollectionUtil.isNotEmpty(mtUserGradeChildList)){
for (MtUserGradeChild mtUserGradeChild : mtUserGradeChildList) {
mtUserGradeChild.setUserGradeId(userGrade.getId());
userGradeChildService.insertMtUserGradeChild(mtUserGradeChild);
}
}
row = baseMapper.updateById(userGrade);
return row;
}

View File

@ -0,0 +1,49 @@
package com.fuint.business.userManager.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.userManager.entity.MtUserGradeChild;
import com.fuint.business.userManager.mapper.MtUserGradeChildMapper;
import com.fuint.business.userManager.service.LJUserService;
import com.fuint.business.userManager.service.MtUserGradeChildService;
import com.fuint.business.userManager.vo.LJUserVo;
import com.fuint.common.util.TokenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class MtUserGradeChildServiceImpl extends ServiceImpl<MtUserGradeChildMapper,MtUserGradeChild> implements MtUserGradeChildService {
@Autowired
@Lazy
private LJUserService userService;
@Override
public List<MtUserGradeChild> selectListByGradeId(Integer gradeId) {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("user_grade_id",gradeId);
return baseMapper.selectList(queryWrapper);
}
@Override
public List<MtUserGradeChild> selectListByUserId(Integer userId,Integer storeId) {
LJUserVo userVo = userService.queryUserById(userId, storeId);
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("user_grade_id",userVo.getGradeId());
return baseMapper.selectList(queryWrapper);
}
@Override
public void deleteMtUserGradeChildByGradeId(Integer gradeId) {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("user_grade_id",gradeId);
baseMapper.delete(queryWrapper);
}
@Override
public void insertMtUserGradeChild(MtUserGradeChild mtUserGradeChild) {
baseMapper.insert(mtUserGradeChild);
}
}

View File

@ -54,4 +54,12 @@ export function getCardFavorableList(query) {
params: query
})
}
// 卡券列表
export function getCardFavorableLists(query) {
return request({
url: 'business/marketingActivity/cardFavorable/PC',
method: 'get',
params: query
})
}
// 成长值记录

View File

@ -186,8 +186,8 @@
<div class="bule">{{ seekZero.toFixed(2) }}</div>
</div>
<div class="th-box">
<div @click="dialogVisible = true">加油员</div>
<div style="cursor: pointer;color: crimson" @click="dialogVisible = true" >{{ staff.realName }}</div>
<div @click="getStaffList">加油员</div>
<div style="cursor: pointer;color: crimson" @click="getStaffList" >{{ staff.realName }}</div>
</div>
</div>
</div>
@ -590,11 +590,7 @@
<el-tabs v-model="activeRecharge" type="card" @tab-click="handleClick">
<el-tab-pane label="储值卡" name="balance">
<div style="font-size: 14px">
<el-row>
<el-col :span="1.5">
<div style="font-size: 14px;height: 50px;line-height: 50px">充值金额</div>
</el-col>
<el-col :span="22">
<div v-if="cardValueList.length>0"
style="display: flex;margin: 13px 5px;box-sizing: border-box;flex-wrap: wrap; ">
<div class="mon"
@ -602,7 +598,7 @@
:class="activeKey === index ? 'select2' : ''"
@click="rechargeCard(index)">
<div class="top1"><span class="amount1">{{ item.rechargeBalance }}</span></div>
<div>赠送<span class="amount">{{ item.giftBalance }}</span></div>
<div>赠送<span style="color: #00afff">{{ item.giftBalance }}</span></div>
</div>
</div>
@ -619,11 +615,9 @@
<template slot="append"></template>
</el-input>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div style="display: flex;justify-content: space-between;margin: 20px 0;height: 200px">
<!-- <el-row>-->
<!-- <el-col :span="24">-->
<div style="display: flex;justify-content: space-between;margin: 20px 0;">
<div class="jine">
<div class="zeng">赠送金额</div>
<div>
@ -632,7 +626,7 @@
disabled>
<template slot="append"></template>
</el-input>
<span class="bom">赠送金额 仅自定义金额模式下可手动输入赠送活动充值赠送金额不可手动更改</span>
<span class="bom">赠送金额 自定义金额模式下将按照距离自定义金额最近的充值活动信息进行赠送</span>
</div>
</div>
@ -645,34 +639,34 @@
<template slot="append">积分</template>
</el-input>
<span
class="bom">赠送积分 仅自定义金额模式下可手动输入,活动充值赠送积分不可手动更改[需开启积分活动有效]</span>
class="bom">赠送积分 自定义金额模式下将按照距离自定义金额最近的充值活动信息进行赠送</span>
</div>
</div>
<div class="jine">
<div class="zeng" style="width: 100px;">赠成长值</div>
<div class="zeng">赠成长值</div>
<div>
<el-input placeholder="0"
v-model="cardValueForm.growthValue"
disabled>
<template slot="append">成长值</template>
</el-input>
<!-- <span class="bom">赠送加油金金额 仅自定义金额模式下可手动输入赠送活动充值赠送金额不可手动更改</span> -->
<span class="bom">赠送成长值 自定义金额模式下将按照距离自定义金额最近的充值活动信息进行赠送</span>
</div>
</div>
<div class="jine">
<div class="zeng">提成员工</div>
<div class="zeng" style="width: 30%">提成员工</div>
<div>
<el-input :readonly="true" placeholder="请选择提成员工" v-model="cardValueForm.realName">
<el-button slot="append" @click="openStaff = true">选择员工</el-button>
</el-input>
<span class="bom">仅系统储值档次支持提成员工选择自定义充值金额匹配低一档次</span>
<!-- <span class="bom">仅系统储值档次支持提成员工选择自定义充值金额匹配低一档次</span>-->
</div>
</div>
</div>
</el-col>
</el-row>
<!-- </el-col>-->
<!-- </el-row>-->
<el-row>
<el-col :span="24">
<div style="display: flex;margin-top: 20px">
@ -733,15 +727,15 @@
:class="activeKey === index ? 'select2' : ''"
@click="recharge(index)">
<div class="top1"><span class="amount1">{{ item.incomeLitres }}</span>L</div>
<div>售价<span class="amount">{{ item.rechargeBalance }}</span></div>
<div>锁价<span class="amount">{{ item.lockupPrice }}</span>/</div>
<div style="font-size: 14px">售价<span style="color: #00afff;">{{ item.rechargeBalance }}</span></div>
<div style="font-size: 14px">锁价<span style="color: #00afff;">{{ item.lockupPrice }}</span>/</div>
</div>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div style="display: flex;margin: 20px 0">
<!-- <el-row>-->
<!-- <el-col :span="24">-->
<div style="display: flex;margin-top: 60px">
<div class="jine">
<div class="zeng">赠送积分</div>
<div>
@ -749,7 +743,7 @@
<template slot="append">积分</template>
</el-input>
<span
class="bom">升数卡充值不支持自定义积分,选择对应充值活动获得对应积分[需开启积分活动有效]</span>
class="bom">升数卡充值不支持自定义积分,选择对应充值活动获得对应积分</span>
</div>
</div>
<div style="display:flex;margin-left: 20px">
@ -761,8 +755,8 @@
</div>
</div>
</div>
</el-col>
</el-row>
<!-- </el-col>-->
<!-- </el-row>-->
<el-row>
<el-col :span="24">
<div style="display: flex">
@ -1122,6 +1116,10 @@
<div v-if="isMember == false">{{ item.retailPrice }}</div>
<div v-else>{{ item.memberPrice }}</div>
</div>
<div class="input-box" v-if="rechargeBalCard">
<div>充值金额</div>
<div>{{ rechargeBalCard.amount ? rechargeBalCard.amount : rechargeBalCard.rechargeBalance }}</div>
</div>
<div class="input-box">
<div>支付方式</div>
<div v-if="payType == 'CASH'">现金</div>
@ -1131,8 +1129,25 @@
<div v-else-if="payType == 'credit'">挂账</div>
<div v-else>小程序码</div>
</div>
<div class="input-box">
<div>合计</div>
<div class="input-box" v-if="rechargeBalCard">
<div>赠送金额</div>
<div>{{ rechargeBalCard.giftBalance }}</div>
</div>
<div class="input-box" v-if="rechargeBalCard">
<div>到账金额</div>
<div>{{ rechargeBalCard.amount ? rechargeBalCard.giftBalance + rechargeBalCard.amount : rechargeBalCard.giftBalance + rechargeBalCard.rechargeBalance }}</div>
</div>
<div class="input-box" v-if="rechargeBalCard">
<div>实付款</div>
<div>{{ rechargeBalCard.amount ? rechargeBalCard.amount : rechargeBalCard.rechargeBalance }}</div>
</div>
<div class="input-box1">
<div v-if="payType == 'credit'">挂账单位</div>
<div>{{ form1.unitName }}</div>
</div>
<div class="input-box" v-if="!rechargeBalCard && rechargeOilCard">
<div v-if="payType != 'credit'">合计</div>
<div v-else>挂账金额</div>
<div>{{ (oilAmount+(+goodsAmount)).toFixed(2) }}</div>
</div>
<div class="input-box" v-if="(oilDiscount + goodsDiscount + fullReduction + couponAmount)>0">
@ -1147,7 +1162,7 @@
<div>囤油卡付款</div>
<div>{{ consumeRefuelMoney.toFixed(2) }}</div>
</div>
<div class="input-box">
<div class="input-box" v-if="!rechargeBalCard && rechargeOilCard">
<div>实付款</div>
<div v-if="payType == 'credit'">0.00</div>
<div v-else>{{ ((+oilActualPay)+(+goodsActualPay)).toFixed(2) }}</div>
@ -1194,6 +1209,8 @@
components: {SelectStaff},
data(){
return{
rechargeBalCard:{},
rechargeOilCard:{},
openStaff:false,
cardFuelDieselForm: {
mtStaffId: '',
@ -1548,7 +1565,7 @@
this.getPayList();
this.getOilName();
this.getGoods();
this.getStaffList();
// this.getStaffList();
this.getStaff();
this.getList();
this.getCouponList();
@ -1821,6 +1838,8 @@
//
this_.isPaySuccess = true;
this_.isQuery = false;
// this_.rechargeBalCard = response.data
// this_.printLocally()
this_.getMemberAfter();
}else if (payStatus === "payFail") {
this_.isPaySuccess = false;
@ -1895,6 +1914,8 @@
if (response.data.payStatus == "paid") {
this_.isPaySuccess = true;
this_.isQuery = false;
this_.rechargeOilCard = response.data
this_.printLocally()
this_.getMemberAfter();
}
if (response.data.payStatus == "payFail") {
@ -2110,6 +2131,11 @@
font-size: 14px;
margin: 5px 0px;
}
.input-box1{
width: 100%;
font-size: 14px;
margin: 5px 0px;
}
.box-ge{
border-bottom: 1px solid #000000 ;
box-sizing: border-box;
@ -2254,8 +2280,8 @@
}else {
this.$modal.msgSuccess("挂账记录添加成功");
this.dialogVisibleCredit = false;
this.form1.unitName = ""
this.printLocally()
this.form1.unitName = ""
this.resetMember();
this.resetting();
this.empty();
@ -3265,6 +3291,7 @@
//
getStaffList(){
queryStaffList({storeId:""}).then( response => {
this.dialogVisible = true
this.staffList = response.data
})
},

View File

@ -320,9 +320,13 @@
<div>优惠合计</div>
<div>{{ oilOrder.discountAmount }}</div>
</div>
<div class="input-box" v-if="oilOrder.userId && oilOrder.orderStatus=='paid' &&(oilOrder.orderAmount - oilOrder.discountAmount - oilOrder.payAmount)>0">
<div>储值卡或囤油卡付款</div>
<div>{{ (oilOrder.orderAmount - oilOrder.discountAmount - oilOrder.payAmount).toFixed(2) }}</div>
<div class="input-box" v-if="oilOrder.balanceAmount>0">
<div>储值卡付款金额</div>
<div>{{ oilOrder.balanceAmount }}</div>
</div>
<div class="input-box" v-if="oilOrder.oilCardAmount>0">
<div>囤油卡付款升数</div>
<div>{{ oilOrder.oilCardAmount }}</div>
</div>
<div class="input-box">
<div>实付款</div>

View File

@ -149,7 +149,7 @@
<el-table-column type="index" width="50" align="center" label="序号"/>
<el-table-column prop="name" label="会员名称" align="center"> </el-table-column>
<el-table-column prop="mobile" label="会员手机号" align="center"> </el-table-column>
<el-table-column prop="bidBalance" label="储值卡面值" align="center"> </el-table-column>
<el-table-column prop="bidBalance" label="到账金额" align="center"> </el-table-column>
<el-table-column prop="amount" label="自定义充值金额" align="center"> </el-table-column>
<el-table-column prop="rechargeBalance" label="储值卡实售金额" align="center"> </el-table-column>
<el-table-column prop="giftBalance" label="储值卡赠送金额" align="center"></el-table-column>
@ -356,13 +356,23 @@ export default {
return name;
},
exportExcelVip() {
exportExcelVipApi(this.queryParams).then(res=>{
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
exportExcelVipApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
this.$download.saveAs(blob,'会员充值订单统计.xLsx')
})
},
getOrderStatistics () {
orderStatisticsApi().then(res=>{
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
orderStatisticsApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
this.orderStatistics = res.data
})

View File

@ -202,7 +202,7 @@
disabled>
<template slot="append"></template>
</el-input>
<span class="bom">赠送金额 仅自定义金额模式下可手动输入赠送活动充值赠送金额不可手动更改</span>
<span class="bom">赠送金额 自定义金额模式下将按照距离自定义金额最近的充值活动信息进行赠送</span>
</div>
</div>
@ -215,29 +215,29 @@
<template slot="append">积分</template>
</el-input>
<span
class="bom">赠送积分 仅自定义金额模式下可手动输入,活动充值赠送积分不可手动更改[需开启积分活动有效]</span>
class="bom">赠送积分 自定义金额模式下将按照距离自定义金额最近的充值活动信息进行赠送</span>
</div>
</div>
<div class="jine">
<div class="zeng" style="width: 100px;">赠成长值</div>
<div class="zeng">赠成长值</div>
<div>
<el-input placeholder="0"
v-model="cardValueForm.growthValue"
disabled>
<template slot="append">成长值</template>
</el-input>
<!-- <span class="bom">赠送加油金金额 仅自定义金额模式下可手动输入赠送活动充值赠送金额不可手动更改</span> -->
<span class="bom">赠送成长值 自定义金额模式下将按照距离自定义金额最近的充值活动信息进行赠送</span>
</div>
</div>
<div class="jine">
<div class="zeng">提成员工</div>
<div class="zeng" style="width: 30%">提成员工</div>
<div>
<el-input :readonly="true" placeholder="请选择提成员工" v-model="cardValueForm.realName">
<el-button slot="append" @click="chooseStaff">选择员工</el-button>
</el-input>
<span class="bom">仅系统储值档次支持提成员工选择自定义充值金额匹配低一档次</span>
<!-- <span class="bom">仅系统储值档次支持提成员工选择自定义充值金额匹配低一档次</span>-->
</div>
</div>
</div>
@ -319,7 +319,7 @@
<template slot="append">积分</template>
</el-input>
<span
class="bom">升数卡充值不支持自定义积分,选择对应充值活动获得对应积分[需开启积分活动有效]</span>
class="bom">升数卡充值不支持自定义积分,选择对应充值活动获得对应积分</span>
</div>
</div>
<div style="display:flex;margin-left: 20px">

View File

@ -8,40 +8,48 @@
</el-radio-group>
<div>
<el-table ref="tables" v-loading="loading" :data="list">
<el-table-column align="center" prop="storeName" label="所属油站"/>
<el-table-column align="center" prop="cardFavorableName" label="优惠券名称"/>
<el-table-column align="center" prop="type" label="卡券类型">
<el-table-column align="center" prop="storeName" label="所属油站">
<template slot-scope="scope">
<el-tag v-if="scope.row.type == 0">油品券</el-tag>
<el-tag v-if="scope.row.type == 1" type="success">商品券</el-tag>
<el-tag v-if="scope.row.type == 2" type="warning">通用券</el-tag>
<span>{{store.name}}</span>
</template>
</el-table-column>
<el-table-column align="center" prop="fullDeduction" label="满减金额"/>
<el-table-column align="center" prop="discountAmount" label="券面额"/>
<el-table-column align="center" prop="oilType" label="适用油品">
<el-table-column align="center" prop="couponName" label="优惠券名称"/>
<el-table-column align="center" prop="couponType" label="卡券类型">
<!-- <template slot-scope="scope">-->
<!-- <el-tag v-if="scope.row.type == 0">油品券</el-tag>-->
<!-- <el-tag v-if="scope.row.type == 1" type="success">商品券</el-tag>-->
<!-- <el-tag v-if="scope.row.type == 2" type="warning">通用券</el-tag>-->
<!-- </template>-->
</el-table-column>
<el-table-column align="center" prop="couponAmount" label="优惠金额/参与次数">
<template slot-scope="scope">
<span>{{ getOilNames(oilNameList,scope.row.oilType) }}</span>
<span>{{scope.row.couponAmount || 0}}</span>
</template>
</el-table-column>
<el-table-column align="center" prop="status" label="状态">
<el-table-column align="center" prop="couponContent" label="券面额/使用说明"/>
<!-- <el-table-column align="center" prop="oilType" label="适用油品">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ getOilNames(oilNameList,scope.row.oilType) }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column align="center" prop="useStatus" label="状态">
<template slot-scope="scope">
<el-tag v-if="scope.row.status == 0">未使用</el-tag>
<el-tag v-if="scope.row.status == 1" type="success">已使用</el-tag>
<el-tag v-if="scope.row.status == 2" type="warning">已过期</el-tag>
<el-tag v-if="scope.row.useStatus == 0">未使用</el-tag>
<el-tag v-if="scope.row.useStatus == 1" type="success">已使用</el-tag>
<el-tag v-if="scope.row.useStatus == 2" type="warning">已过期</el-tag>
</template>
</el-table-column>
<!-- <el-table-column align="center" label="卡券可用规则">-->
<el-table-column align="center" prop="name" label="到期时间">
<template slot-scope="scope">
{{ scope.row.endTime }}
</template>
</el-table-column>
<el-table-column align="center" label="卡券可用规则">
<el-table-column align="center" prop="name" label="有效期">
<template slot-scope="scope">
{{ scope.row.startTime }}{{ scope.row.endTime }}
</template>
</el-table-column>
<el-table-column align="center" prop="availablePeriod" label="周期与时段"/>
</el-table-column>
<el-table-column align="center" prop="createTime" label="领取时间"/>
<el-table-column align="center" prop="exchangeFrom" label="描述"/>
<!-- <el-table-column align="center" prop="availablePeriod" label="周期与时段"/>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" prop="createTime" label="领取时间"/>-->
<!-- <el-table-column align="center" prop="exchangeFrom" label="描述"/>-->
</el-table>
<pagination
@ -55,8 +63,9 @@
</template>
<script>
import { getCardFavorableList } from "@/api/cashier/userInfoOrder";
import {getCardFavorableList, getCardFavorableLists} from "@/api/cashier/userInfoOrder";
import {oilNumbers} from "@/api/cashier/oilnumber";
import {ljStoreInfo} from "@/api/staff/store";
export default {
props:["pUserId"],
@ -72,7 +81,8 @@ export default {
page:1,
pageSize:10,
},
oilNameList:[]
oilNameList:[],
store:{},
}
},
created() {
@ -115,27 +125,33 @@ export default {
getList(){
this.loading = true
this.queryParams.mtUserId = this.userId
getCardFavorableList(this.queryParams).then(res=>{
this.queryParams.id = this.userId
getCardFavorableLists(this.queryParams).then(res=>{
if (res.code == 200) {
this.list = res.data.records
this.total = res.data.total
this.loading = false
this.getStore()
}
})
},
getStore(){
ljStoreInfo().then(res => {
this.store = res.data
})
},
changeStatus() {
if (this.cardList == 'notUse') {
this.queryParams.status = 0
this.queryParams.useStatus = 0
} else if (this.cardList == 'used') {
this.queryParams.status = 1
this.queryParams.useStatus = 1
} else if (this.cardList == 'expired') {
this.queryParams.status = 2
this.queryParams.useStatus = 2
} else {
this.queryParams.status = ''
this.queryParams.useStatus = ''
}
this.getList()
}