会员管理
This commit is contained in:
parent
ee68993784
commit
26cd3cdf7c
@ -1,7 +1,7 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询会员详细
|
||||
export function getChainStoreConfig(id) {
|
||||
export function getChainStoreConfig() {
|
||||
return request({
|
||||
url: '/business/userManager/chainStoreConfig',
|
||||
method: 'get'
|
||||
|
9
fuintAdmin/src/api/staff/user/sysconfig.js
Normal file
9
fuintAdmin/src/api/staff/user/sysconfig.js
Normal file
@ -0,0 +1,9 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询会员详细
|
||||
export function getSysConfig(key) {
|
||||
return request({
|
||||
url: '/sysConfig/getByKey/' + key,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
@ -9,6 +9,14 @@ export function listUser(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 查询会员列表
|
||||
export function listStatistic() {
|
||||
return request({
|
||||
url: '/business/userManager/user/statistic',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
// 查询会员详细
|
||||
export function getUser(id) {
|
||||
return request({
|
||||
|
@ -91,6 +91,76 @@
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<div>统计</div>
|
||||
<template>
|
||||
<div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="4">
|
||||
<div class="sta">
|
||||
<el-statistic
|
||||
group-separator=","
|
||||
:precision="2"
|
||||
:value="total"
|
||||
title="会员总数"
|
||||
></el-statistic>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<div class="sta">
|
||||
<el-statistic
|
||||
group-separator=","
|
||||
:precision="2"
|
||||
:value="addNum"
|
||||
title="今日新增/昨日新增"
|
||||
></el-statistic>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<div class="sta">
|
||||
<el-statistic
|
||||
group-separator=","
|
||||
:precision="2"
|
||||
:value="balance"
|
||||
title="储值总余额"
|
||||
></el-statistic>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<div class="sta">
|
||||
<el-statistic
|
||||
group-separator=","
|
||||
:precision="2"
|
||||
:value="literCard"
|
||||
title="升数卡总余额"
|
||||
></el-statistic>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<div class="sta">
|
||||
<el-statistic
|
||||
group-separator=","
|
||||
:precision="2"
|
||||
:value="point"
|
||||
title="积分总余额"
|
||||
></el-statistic>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<div class="sta">
|
||||
<el-statistic
|
||||
group-separator=","
|
||||
:precision="2"
|
||||
:value="refuelMoney"
|
||||
title="加油金余额"
|
||||
></el-statistic>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
</el-card>
|
||||
|
||||
<el-card style="margin-top: 20px">
|
||||
<el-table ref="tables" v-loading="loading" :data="list" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
|
||||
<el-table-column label="会员ID" prop="id" align="center" width="60"/>
|
||||
@ -101,7 +171,15 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="会员号" align="center" prop="userNo" width="150"/>
|
||||
<el-table-column label="名称" align="center" prop="name" />
|
||||
<el-table-column label="名称" align="center" prop="name" >
|
||||
<template slot-scope="scope">
|
||||
<!-- <router-link :to="'/system/dict/data/' + scope.row.dictId" class="link-type">-->
|
||||
<!-- <span>{{ scope.row.dictType }}</span>-->
|
||||
<!-- </router-link>-->
|
||||
|
||||
<span style="color: #409EFF;cursor: pointer " @click="goDedi(scope.row.id)">{{ scope.row.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="手机号" align="center" prop="mobile" width="110">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.mobile ? scope.row.mobile : '-' }}</span>
|
||||
@ -346,13 +424,23 @@
|
||||
import { getMemberList, updateMemberStatus, getMemberInfo, saveMember, deleteMember } from "@/api/member";
|
||||
import balanceRecharge from "./balanceRecharge";
|
||||
import pointRecharge from "./pointRecharge";
|
||||
import {listUser} from "@/api/staff/user/user";
|
||||
import {listStatistic, listUser} from "@/api/staff/user/user";
|
||||
export default {
|
||||
name: "MemberIndex",
|
||||
components: { balanceRecharge, pointRecharge },
|
||||
dicts: ['official'],
|
||||
data() {
|
||||
return {
|
||||
// 余额
|
||||
balance:'',
|
||||
// 积分
|
||||
point:'',
|
||||
// 升数卡
|
||||
literCard:'',
|
||||
// 加油金
|
||||
refuelMoney:'',
|
||||
// 今日新增
|
||||
addNum:'',
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 标题
|
||||
@ -410,8 +498,19 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getStatistic();
|
||||
},
|
||||
methods: {
|
||||
// 跳转详情页
|
||||
goDedi(id){
|
||||
console.log('id:',id)
|
||||
this.$router.push({
|
||||
path:"/member/userInfo",
|
||||
// query:{
|
||||
// id:id
|
||||
// }
|
||||
})
|
||||
},
|
||||
// 查询列表
|
||||
getList() {
|
||||
this.loading = true;
|
||||
@ -432,6 +531,15 @@ export default {
|
||||
// }
|
||||
// );
|
||||
},
|
||||
getStatistic(){
|
||||
listStatistic().then( response => {
|
||||
this.addNum = response.data.addNum;
|
||||
this.balance = response.data.balance;
|
||||
this.point = response.data.point;
|
||||
this.literCard = response.data.literCard;
|
||||
this.refuelMoney = response.data.refuelMoney;
|
||||
});
|
||||
},
|
||||
// 搜索按钮操作
|
||||
handleQuery() {
|
||||
this.queryParams.page = 1;
|
||||
@ -563,4 +671,10 @@ export default {
|
||||
height: 100vh;
|
||||
background: #f6f8f9;
|
||||
}
|
||||
.sta{
|
||||
height: 100px;
|
||||
margin-top: 10px;
|
||||
background: #f6f8f9;
|
||||
padding-top: 30px;
|
||||
}
|
||||
</style>
|
||||
|
15
fuintAdmin/src/views/member/userInfo.vue
Normal file
15
fuintAdmin/src/views/member/userInfo.vue
Normal file
@ -0,0 +1,15 @@
|
||||
<template>
|
||||
<div>
|
||||
会员详情页
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
@ -690,6 +690,7 @@ export default {
|
||||
listStaff(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
this.list = response.data.records;
|
||||
this.total = response.data.total;
|
||||
console.log(response)
|
||||
// response.data.records.forEach(item=>{
|
||||
// this.categoryOptions.push(item.category)
|
||||
// })
|
||||
|
@ -7,23 +7,15 @@
|
||||
<div>
|
||||
<div style="display: flex;justify-content: space-between">
|
||||
<span style="color: grey;">会员等级规则说明</span>
|
||||
<el-button type="success" round>开启等级功能</el-button>
|
||||
<el-button v-show="level1" @click="editLevel1" type="primary" round>开启等级功能</el-button>
|
||||
<el-button v-show="level2" @click="editLevel2" type="danger" round>关闭等级功能</el-button>
|
||||
</div>
|
||||
<el-alert
|
||||
type="warning"
|
||||
style="margin-top: 15px"
|
||||
:closable="false">
|
||||
<p>
|
||||
1、用户每次消费后根据“成长值计算方式”中的规则获得相应的成长值,并根据“会员等级配置”的规则自动更新用户的会员等级
|
||||
</p>
|
||||
<p>
|
||||
2、会员等级区分汽油、柴油、天然气;会员加油或加气将按照对应的等级进行优惠
|
||||
</p>
|
||||
<p>
|
||||
3、当成长值累计达到下一个等级时,实时升级,升级后的等级规则将生效
|
||||
</p>
|
||||
<p>
|
||||
4、开启会员等级功能、系统将按照规则及成长值进行处理、如关闭等级功能、用户等级将失效,将无法享受对应优惠规则、成长值将暂停增加或减少、但不影响会员已有成长值
|
||||
<p v-for="(item,index) in memberLevelRule" :id="index">
|
||||
{{item}}
|
||||
</p>
|
||||
</el-alert>
|
||||
</div>
|
||||
@ -40,78 +32,33 @@
|
||||
type="warning"
|
||||
style="margin-top: 15px"
|
||||
:closable="false">
|
||||
<p>
|
||||
清算说明
|
||||
</p>
|
||||
<p>
|
||||
1、油站可根据自身运营情况选择并设置会员等级的清算规则、保存后实时生效、不影响会员已有成长值(规则不影响会员的成长值增减)
|
||||
</p>
|
||||
<p>
|
||||
2、按月清算: 以月为周期动态调整会员成长值等级清算,如本月所属会员等级则按照上月成长值计算、本月所得成长值下月有效
|
||||
</p>
|
||||
<p>
|
||||
3、不清算: 按照成长值累计只升不降、且用户等级按照用户获得的成长值实时计算所属会员等级
|
||||
<p v-for="(item,index) in levelClearRule" :key="index">
|
||||
{{item}}
|
||||
</p>
|
||||
</el-alert>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<span style="color: grey;">成长值计算方式</span>
|
||||
<div style="display: flex;justify-content: space-between">
|
||||
<div style="margin-top: 10px;display: flex;width: 30%">
|
||||
<el-input
|
||||
placeholder="汽油成长值比例,每消费1元积"
|
||||
:disabled="true" style="width: 800px">
|
||||
</el-input>
|
||||
<el-input
|
||||
placeholder="1"
|
||||
:disabled="true">
|
||||
</el-input>
|
||||
<el-input
|
||||
placeholder="成长值"
|
||||
:disabled="true">
|
||||
</el-input>
|
||||
</div>
|
||||
<div style="margin-top: 10px;display: flex;width: 30%">
|
||||
<el-input
|
||||
placeholder="柴油成长值比例,每消费1元积"
|
||||
:disabled="true" style="width: 800px">
|
||||
</el-input>
|
||||
<el-input
|
||||
placeholder="1"
|
||||
:disabled="true">
|
||||
</el-input>
|
||||
<el-input
|
||||
placeholder="成长值"
|
||||
:disabled="true">
|
||||
</el-input>
|
||||
</div>
|
||||
<div style="margin-top: 10px;display: flex;width: 30%">
|
||||
<el-input
|
||||
placeholder="天然气成长值比例,每消费1元积"
|
||||
:disabled="true" style="width: 800px">
|
||||
</el-input>
|
||||
<el-input
|
||||
placeholder="1"
|
||||
:disabled="true">
|
||||
</el-input>
|
||||
<el-input
|
||||
placeholder="成长值"
|
||||
:disabled="true">
|
||||
</el-input>
|
||||
</div>
|
||||
<el-input v-model="gasGrowthValue" disabled placeholder="1" style="margin: 10px 10px">
|
||||
<template slot="prepend">汽油成长值比例,每消费1元积</template>
|
||||
<template slot="append">成长值</template>
|
||||
</el-input>
|
||||
<el-input v-model="dieselGrowthValue" disabled placeholder="1" style="margin: 10px 10px">
|
||||
<template slot="prepend">柴油成长值比例,每消费1元积</template>
|
||||
<template slot="append">成长值</template>
|
||||
</el-input>
|
||||
<el-input v-model="naturalGrowthValue" disabled placeholder="1" style="margin: 10px 10px">
|
||||
<template slot="prepend">天然气成长值比例,每消费1元积</template>
|
||||
<template slot="append">成长值</template>
|
||||
</el-input>
|
||||
</div>
|
||||
<el-alert
|
||||
type="warning"
|
||||
style="margin-top: 15px"
|
||||
:closable="false">
|
||||
<p>
|
||||
1、支付成功订单增加成长值,退款成功订单扣减成长值
|
||||
</p>
|
||||
<p>
|
||||
2、成长值按照加油或加气订单消费金额计算(非实付金额)、商品订单不包含在内
|
||||
</p>
|
||||
<p>
|
||||
3、汽油、柴油、天然气成长值默认为1:1进行计算,如加油金额消费99.6元,将累计99个成长值(不足1元的部分直接舍掉),成长值比例暂不支持更改
|
||||
<p v-for="(item,index) in growthValueRule" :id="index">
|
||||
{{item}}
|
||||
</p>
|
||||
</el-alert>
|
||||
</div>
|
||||
@ -163,6 +110,16 @@
|
||||
<!-- </el-card>-->
|
||||
|
||||
<el-card class="card">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="handleAdd"
|
||||
>新增会员等级</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
<el-table ref="tables" v-loading="loading" :data="list" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
|
||||
<el-table-column label="等级" prop="grade" width="55"/>
|
||||
<el-table-column label="等级名称" align="center" prop="name" />
|
||||
@ -200,20 +157,65 @@
|
||||
<dict-tag :options="dict.type.yhlx" :value="scope.row.preferential"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="特权信息" align="center">
|
||||
<el-table-column label="特权信息" >
|
||||
<template slot-scope="scope">
|
||||
<div v-show="scope.row.preferential=='自定义优惠'">
|
||||
<p>
|
||||
汽油:
|
||||
<span style="margin-left: 10px">{{ scope.row.gasolineDiscount }}</span>
|
||||
<span v-if="scope.row.gasolineRule!=null && scope.row.gasolineRule!=''"
|
||||
style="color: grey;font-size: 12px">
|
||||
<div style="margin-left: 10px"
|
||||
v-if="scope.row.gasolineDiscount=='满减优惠'"
|
||||
v-for="(item,index) in scope.row.gasolineRuleList"
|
||||
:key="index">
|
||||
消费满{{item.gasolineRule1}}元,立减{{item.gasolineRule2}}元
|
||||
</div>
|
||||
<div style="margin-left: 10px"
|
||||
v-if="scope.row.gasolineDiscount=='每升优惠'"
|
||||
v-for="(item,index) in scope.row.gasolineRuleList"
|
||||
:key="index">
|
||||
消费满{{item.gasolineRule1}}元,每升优惠{{item.gasolineRule3}}元
|
||||
</div>
|
||||
</span>
|
||||
</p>
|
||||
<p>
|
||||
柴油:
|
||||
<span style="margin-left: 10px">{{ scope.row.dieselDiscount }}</span>
|
||||
<span v-if="scope.row.dieselRule!=null && scope.row.dieselRule!=''"
|
||||
style="margin-left: 10px;color: grey;font-size: 12px">
|
||||
<div style="margin-left: 10px"
|
||||
v-if="scope.row.dieselDiscount=='满减优惠'"
|
||||
v-for="(item,index) in scope.row.dieselRuleList"
|
||||
:key="index">
|
||||
消费满{{item.dieselRule1}}元,立减{{item.dieselRule2}}元
|
||||
</div>
|
||||
<div style="margin-left: 10px"
|
||||
v-if="scope.row.dieselDiscount=='每升优惠'"
|
||||
v-for="(item,index) in scope.row.dieselRuleList"
|
||||
:key="index">
|
||||
消费满{{item.dieselRule1}}元,每升优惠{{item.dieselRule3}}元
|
||||
</div>
|
||||
</span>
|
||||
</p>
|
||||
<p>
|
||||
天然气:
|
||||
<span style="margin-left: 10px">{{ scope.row.naturalGasDiscount }}</span>
|
||||
<span v-if="scope.row.naturalGasRule!=null && scope.row.naturalGasRule!=''"
|
||||
style="margin-left: 10px;color: grey;font-size: 12px">
|
||||
<div style="margin-left: 10px"
|
||||
v-if="scope.row.naturalGasDiscount=='满减优惠'"
|
||||
v-for="(item,index) in scope.row.naturalGasRuleList"
|
||||
:key="index">
|
||||
消费满{{item.naturalGas1}}元,立减{{item.naturalGas2}}元
|
||||
</div>
|
||||
<div style="margin-left: 10px"
|
||||
v-if="scope.row.naturalGasDiscount=='每单位优惠'"
|
||||
v-for="(item,index) in scope.row.naturalGasRuleList"
|
||||
:key="index">
|
||||
消费满{{item.naturalGas1}}元,每单位优惠{{item.naturalGas3}}元
|
||||
</div>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
<div v-show="scope.row.preferential=='优惠活动组'">
|
||||
@ -224,12 +226,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
active-value="A"
|
||||
inactive-value="N"
|
||||
@change="handleStatusChange(scope.row)"
|
||||
></el-switch>
|
||||
<dict-tag :options="dict.type.zhzt" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
@ -262,7 +259,7 @@
|
||||
</el-card>
|
||||
|
||||
<!-- 添加或修改对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" class="common-dialog" width="700px" 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">
|
||||
@ -280,69 +277,231 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="升级条件描述" prop="catchCondition">
|
||||
<el-input v-model="form.catchCondition" placeholder="请输入升级条件描述" maxlength="200" />
|
||||
<el-form-item label="所需成长值">
|
||||
<el-input v-model="form.gasoline" placeholder="1" style="width: 240px">
|
||||
<template slot="prepend">汽油</template>
|
||||
<template slot="append">成长值</template>
|
||||
</el-input>
|
||||
<el-input v-model="form.dieselOil" placeholder="1" style="width: 240px">
|
||||
<template slot="prepend">柴油</template>
|
||||
<template slot="append">成长值</template>
|
||||
</el-input>
|
||||
<el-input v-model="form.naturalGas" placeholder="1" style="width: 240px">
|
||||
<template slot="prepend">天然气</template>
|
||||
<template slot="append">成长值</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="升级权益描述" prop="userPrivilege">
|
||||
<el-input v-model="form.userPrivilege" type="textarea" placeholder="请输入升级权益描述"></el-input>
|
||||
</el-form-item>
|
||||
<div style="font-size: 16px">
|
||||
等级特权
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="升级方式" prop="catchType">
|
||||
<el-select
|
||||
v-model="form.catchType"
|
||||
clearable
|
||||
placeholder="升级方式"
|
||||
>
|
||||
<el-option v-for="catchType in catchTypeList" :key="catchType.key" :label="catchType.name" :value="catchType.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="升级条件值" prop="catchValue">
|
||||
<el-input v-model="form.catchValue" placeholder="请输入升级条件值,单位可能是元、次"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="有效天数" prop="validDay">
|
||||
<el-input v-model="form.validDay" placeholder="请输入有效天数,如30,0表示永久有效"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="支付折扣" prop="discount">
|
||||
<el-input v-model="form.discount" placeholder="请输入支付折扣,数字,如:8.8"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="积分加速" prop="speedPoint">
|
||||
<el-input v-model="form.speedPoint" placeholder="请输入积分加速,积分加速倍数,数字"></el-input>
|
||||
<el-form-item label="优惠类型">
|
||||
<el-radio-group v-model="form.preferential">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.yhlx"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"></el-radio>
|
||||
</el-radio-group>
|
||||
<div>
|
||||
<div style="color: grey;font-size: 12px;height: 18px">
|
||||
自定义优惠:当前页面自定义简单的油品优惠
|
||||
</div>
|
||||
<div style="color: grey;font-size: 12px;height: 18px">
|
||||
优惠活动组:使用优惠组设置来配置当前等级用户的优惠信息,支持周期性
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<div v-if="form.preferential=='自定义优惠'">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="汽油优惠">
|
||||
<el-radio-group v-model="form.gasolineDiscount">
|
||||
<el-radio label="无优惠">无优惠</el-radio>
|
||||
<el-radio label="满减优惠">满减优惠</el-radio>
|
||||
<el-radio label="每升优惠">每升优惠</el-radio>
|
||||
</el-radio-group>
|
||||
<div v-if="form.gasolineDiscount != '无优惠'">
|
||||
<div v-for="(item,idx) in gasolinePreferential" style="display: flex">
|
||||
<el-input v-model="item.gasolineRule1" placeholder="1" style="width: 260px;">
|
||||
<template slot="prepend">消费满</template>
|
||||
<template slot="append">元,</template>
|
||||
</el-input>
|
||||
<el-input v-model="item.gasolineRule2" placeholder="1" style="width: 260px;" v-if="form.gasolineDiscount == '满减优惠'">
|
||||
<template slot="prepend">立减</template>
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
<el-input v-model="item.gasolineRule3" placeholder="1" style="width: 260px;" v-if="form.gasolineDiscount == '每升优惠'">
|
||||
<template slot="prepend">每升优惠</template>
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
<el-button v-if="idx==0" type="primary" @click="addGasOline()" icon="el-icon-plus" style="margin-left: 20px"></el-button>
|
||||
<el-button v-else type="danger" @click="subGasOline(idx)" icon="el-icon-close" style="margin-left: 20px"></el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="柴油优惠">
|
||||
<el-radio-group v-model="form.dieselDiscount">
|
||||
<el-radio label="无优惠">无优惠</el-radio>
|
||||
<el-radio label="满减优惠">满减优惠</el-radio>
|
||||
<el-radio label="每升优惠">每升优惠</el-radio>
|
||||
</el-radio-group>
|
||||
<div v-if="form.dieselDiscount != '无优惠'">
|
||||
<div v-for="(item,idx) in dieselPreferential" style="display: flex">
|
||||
<el-input v-model="item.dieselRule1" placeholder="1" style="width: 260px;">
|
||||
<template slot="prepend">消费满</template>
|
||||
<template slot="append">元,</template>
|
||||
</el-input>
|
||||
<el-input v-model="item.dieselRule2" placeholder="1" style="width: 260px;" v-if="form.dieselDiscount == '满减优惠'">
|
||||
<template slot="prepend">立减</template>
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
<el-input v-model="item.dieselRule3" placeholder="1" style="width: 260px;" v-if="form.dieselDiscount == '每升优惠'">
|
||||
<template slot="prepend">每升优惠</template>
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
<el-button v-if="idx==0" type="primary" @click="addDiesel()" icon="el-icon-plus" style="margin-left: 20px"></el-button>
|
||||
<el-button v-else type="danger" @click="subDiesel(idx)" icon="el-icon-close" style="margin-left: 20px"></el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="天然气优惠">
|
||||
<el-radio-group v-model="form.naturalGasDiscount">
|
||||
<el-radio label="无优惠">无优惠</el-radio>
|
||||
<el-radio label="满减优惠">满减优惠</el-radio>
|
||||
<el-radio label="每单位优惠">每单位优惠</el-radio>
|
||||
</el-radio-group>
|
||||
<div v-if="form.naturalGasDiscount != '无优惠'">
|
||||
<div v-for="(item,idx) in naturalGasPreferential" style="display: flex">
|
||||
<el-input v-model="item.naturalGas1" placeholder="1" style="width: 260px;">
|
||||
<template slot="prepend">消费满</template>
|
||||
<template slot="append">元,</template>
|
||||
</el-input>
|
||||
<el-input v-model="item.naturalGas2" placeholder="1" style="width: 260px;" v-if="form.naturalGasDiscount == '满减优惠'">
|
||||
<template slot="prepend">立减</template>
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
<el-input v-model="item.naturalGas3" placeholder="1" style="width: 260px;" v-if="form.naturalGasDiscount == '每单位优惠'">
|
||||
<template slot="prepend">每单位优惠</template>
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
<el-button v-if="idx==0" type="primary" @click="addNaturalGas()" icon="el-icon-plus" style="margin-left: 20px"></el-button>
|
||||
<el-button v-else type="danger" @click="subNaturalGas(idx)" icon="el-icon-close" style="margin-left: 20px"></el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="关联优惠组">
|
||||
<el-select v-model="form.promotionGroup">
|
||||
<el-option
|
||||
v-for="dict in dict.type.yhhdz"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
<div>
|
||||
<div style="color: grey;font-size: 12px;height: 18px">
|
||||
关联组后当前等级的用户优惠将按照优惠组的规则享受满减优惠
|
||||
</div>
|
||||
<div style="color: grey;font-size: 12px;height: 18px">
|
||||
优惠活动组请前往活动营销-特惠活动-优惠活动组进行配置
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="状态">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio key="A" label="A" value="A">启用</el-radio>
|
||||
<el-radio key="N" label="N" value="N">禁用</el-radio>
|
||||
<el-radio label="qy">启用</el-radio>
|
||||
<el-radio label="jy">禁用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- <el-row>-->
|
||||
<!-- <el-col :span="24">-->
|
||||
<!-- <el-form-item label="升级条件描述" prop="catchCondition">-->
|
||||
<!-- <el-input v-model="form.catchCondition" placeholder="请输入升级条件描述" maxlength="200" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-row>-->
|
||||
<!-- <el-row>-->
|
||||
<!-- <el-col :span="24">-->
|
||||
<!-- <el-form-item label="升级权益描述" prop="userPrivilege">-->
|
||||
<!-- <el-input v-model="form.userPrivilege" type="textarea" placeholder="请输入升级权益描述"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-row>-->
|
||||
<!-- <el-row>-->
|
||||
<!-- <el-col :span="24">-->
|
||||
<!-- <el-form-item label="升级方式" prop="catchType">-->
|
||||
<!-- <el-select-->
|
||||
<!-- v-model="form.catchType"-->
|
||||
<!-- clearable-->
|
||||
<!-- placeholder="升级方式"-->
|
||||
<!-- >-->
|
||||
<!-- <el-option v-for="catchType in catchTypeList" :key="catchType.key" :label="catchType.name" :value="catchType.value"/>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-row>-->
|
||||
<!-- <el-row>-->
|
||||
<!-- <el-col :span="24">-->
|
||||
<!-- <el-form-item label="升级条件值" prop="catchValue">-->
|
||||
<!-- <el-input v-model="form.catchValue" placeholder="请输入升级条件值,单位可能是元、次"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-row>-->
|
||||
<!-- <el-row>-->
|
||||
<!-- <el-col :span="24">-->
|
||||
<!-- <el-form-item label="有效天数" prop="validDay">-->
|
||||
<!-- <el-input v-model="form.validDay" placeholder="请输入有效天数,如30,0表示永久有效"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-row>-->
|
||||
<!-- <el-row>-->
|
||||
<!-- <el-col :span="24">-->
|
||||
<!-- <el-form-item label="支付折扣" prop="discount">-->
|
||||
<!-- <el-input v-model="form.discount" placeholder="请输入支付折扣,数字,如:8.8"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-row>-->
|
||||
<!-- <el-row>-->
|
||||
<!-- <el-col :span="24">-->
|
||||
<!-- <el-form-item label="积分加速" prop="speedPoint">-->
|
||||
<!-- <el-input v-model="form.speedPoint" placeholder="请输入积分加速,积分加速倍数,数字"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-row>-->
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
@ -354,13 +513,50 @@
|
||||
|
||||
<script>
|
||||
import { getUserGradeList, updateUserGradeStatus, getUserGradeInfo, saveUserGrade, deleteUserGrade } from "@/api/userGrade";
|
||||
import {listUserGrade} from "@/api/staff/user/usergrade";
|
||||
import {addUserGrade, delUserGrade, getUserGrade, listUserGrade, updateUserGrade} from "@/api/staff/user/usergrade";
|
||||
import {getChainStoreConfig, updateChainStoreConfig} from "@/api/staff/user/chainstoreconfig";
|
||||
import {getSysConfig} from "@/api/staff/user/sysconfig";
|
||||
export default {
|
||||
name: "UserGradeIndex",
|
||||
dicts: ['yhlx'],
|
||||
dicts: ['yhlx','zhzt','yhhdz'],
|
||||
data() {
|
||||
return {
|
||||
level1:true,
|
||||
level2:false,
|
||||
// 优惠值
|
||||
gasolinePreferential:[
|
||||
{
|
||||
gasolineRule1:1,
|
||||
gasolineRule2:1,
|
||||
gasolineRule3:1,
|
||||
}
|
||||
],
|
||||
dieselPreferential:[
|
||||
{
|
||||
dieselRule1:1,
|
||||
dieselRule2:1,
|
||||
dieselRule3:1,
|
||||
}
|
||||
],
|
||||
naturalGasPreferential:[
|
||||
{
|
||||
naturalGas1:1,
|
||||
naturalGas2:1,
|
||||
naturalGas3:1,
|
||||
}
|
||||
],
|
||||
// 会员等级规则说明
|
||||
memberLevelRule:[],
|
||||
// 等级清算规则
|
||||
levelClearRule:[],
|
||||
// 成长值计算规则
|
||||
growthValueRule:[],
|
||||
// 汽油成长值
|
||||
gasGrowthValue:'',
|
||||
// 柴油成长值
|
||||
dieselGrowthValue:'',
|
||||
// 天然气成长值
|
||||
naturalGrowthValue:'',
|
||||
clear:'',
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
@ -383,7 +579,10 @@ export default {
|
||||
// 默认排序
|
||||
defaultSort: {prop: 'createTime', order: 'descending'},
|
||||
// 表单参数
|
||||
form: { id: '', grade: 0, name: '', catchCondition: '', userPrivilege: '', catchType: '', catchValue: '', validDay: '', discount: '', speedPoint: '', status: "A" },
|
||||
form: { id: '', grade: 0, name: '',gasoline:'',dieselOil:'',naturalGas:'',preferential:'自定义优惠',
|
||||
gasolineDiscount:'无优惠',dieselDiscount:'无优惠',naturalGasDiscount:'无优惠',promotionGroup:'',
|
||||
// catchCondition: '', userPrivilege: '', catchType: '', catchValue: '', validDay: '',discount: '', speedPoint: '',
|
||||
status: 'qy' },
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
page: 1,
|
||||
@ -423,18 +622,83 @@ export default {
|
||||
created() {
|
||||
this.getList();
|
||||
this.getClearConfig();
|
||||
this.getRule();
|
||||
},
|
||||
methods: {
|
||||
editLevel1(){
|
||||
this.level1 = false;
|
||||
this.level2 = true;
|
||||
this.$modal.msgSuccess("等级状态更新成功");
|
||||
},
|
||||
editLevel2(){
|
||||
this.level1 = true;
|
||||
this.level2 = false;
|
||||
this.$modal.msgSuccess("等级状态更新成功");
|
||||
},
|
||||
addGasOline(){
|
||||
let temp= {
|
||||
gasolineRule1:1,
|
||||
gasolineRule2:1,
|
||||
gasolineRule3:1,
|
||||
}
|
||||
this.gasolinePreferential.push(temp);
|
||||
},
|
||||
subGasOline(idx){
|
||||
this.gasolinePreferential.splice(idx-1,1);
|
||||
},
|
||||
addDiesel(){
|
||||
let temp= {
|
||||
dieselRule1:1,
|
||||
dieselRule2:1,
|
||||
dieselRule3:1,
|
||||
}
|
||||
this.dieselPreferential.push(temp);
|
||||
},
|
||||
subDiesel(idx){
|
||||
this.dieselPreferential.splice(idx-1,1);
|
||||
},
|
||||
addNaturalGas(){
|
||||
let temp= {
|
||||
naturalGas1:1,
|
||||
naturalGas2:1,
|
||||
naturalGas3:1,
|
||||
}
|
||||
this.naturalGasPreferential.push(temp);
|
||||
},
|
||||
subNaturalGas(idx){
|
||||
this.naturalGasPreferential.splice(idx-1,1);
|
||||
},
|
||||
// 获取规则信息
|
||||
getRule(){
|
||||
getSysConfig('member_level_rule').then(response => {
|
||||
this.memberLevelRule = response.data.split(";")
|
||||
});
|
||||
getSysConfig('level_clear_rule').then(response => {
|
||||
this.levelClearRule = response.data.split(";")
|
||||
});
|
||||
getSysConfig('growth_value_rule').then(response => {
|
||||
this.growthValueRule = response.data.split(";")
|
||||
});
|
||||
getSysConfig('gas_growth_value').then(response => {
|
||||
this.gasGrowthValue = response.data
|
||||
});
|
||||
getSysConfig('diesel_growth_value').then(response => {
|
||||
this.dieselGrowthValue = response.data
|
||||
});
|
||||
getSysConfig('natural_growth_value').then(response => {
|
||||
this.naturalGrowthValue = response.data
|
||||
});
|
||||
},
|
||||
// 查询连锁店配置信息
|
||||
getClearConfig(){
|
||||
getChainStoreConfig().then(response => {
|
||||
this.clear = response.data.levelClearRule;
|
||||
})
|
||||
},
|
||||
// 修改清算规则
|
||||
updateClearConfig(){
|
||||
updateChainStoreConfig({'levelClearRule':this.clear}).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
console.log(response)
|
||||
});
|
||||
this.getClearConfig();
|
||||
},
|
||||
@ -496,18 +760,32 @@ export default {
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: "",
|
||||
grade: "",
|
||||
name: "",
|
||||
status: "A",
|
||||
catchType: "",
|
||||
catchValue: "",
|
||||
validDay: "",
|
||||
discount: "",
|
||||
speedPoint: "",
|
||||
catchCondition: "",
|
||||
userPrivilege: ""
|
||||
id: '', grade: 0, name: '',gasoline:'',dieselOil:'',naturalGas:'',preferential:'自定义优惠',
|
||||
gasolineDiscount:'无优惠',dieselDiscount:'无优惠',naturalGasDiscount:'无优惠',promotionGroup:'',
|
||||
// catchCondition: '', userPrivilege: '', catchType: '', catchValue: '', validDay: '',discount: '', speedPoint: '',
|
||||
status: 'qy'
|
||||
};
|
||||
this.gasolinePreferential=[
|
||||
{
|
||||
gasolineRule1:1,
|
||||
gasolineRule2:1,
|
||||
gasolineRule3:1,
|
||||
}
|
||||
],
|
||||
this.dieselPreferential=[
|
||||
{
|
||||
dieselRule1:1,
|
||||
dieselRule2:1,
|
||||
dieselRule3:1,
|
||||
}
|
||||
],
|
||||
this.naturalGasPreferential=[
|
||||
{
|
||||
naturalGas1:1,
|
||||
naturalGas2:1,
|
||||
naturalGas3:1,
|
||||
}
|
||||
],
|
||||
this.resetForm("form");
|
||||
},
|
||||
// 取消按钮
|
||||
@ -519,40 +797,64 @@ export default {
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.form.gasolineRule = JSON.stringify(this.gasolinePreferential)
|
||||
this.form.dieselRule = JSON.stringify(this.dieselPreferential)
|
||||
this.form.naturalGasRule = JSON.stringify(this.naturalGasPreferential)
|
||||
if (this.form.id) {
|
||||
saveUserGrade(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
updateUserGrade(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
// saveUserGrade(this.form).then(response => {
|
||||
// this.$modal.msgSuccess("修改成功");
|
||||
// this.open = false;
|
||||
// this.getList();
|
||||
// });
|
||||
} else {
|
||||
saveUserGrade(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
addUserGrade(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
// saveUserGrade(this.form).then(response => {
|
||||
// this.$modal.msgSuccess("新增成功");
|
||||
// this.open = false;
|
||||
// this.getList();
|
||||
// });
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 修改按钮操作
|
||||
handleUpdate(row) {
|
||||
let _this = this;
|
||||
this.reset();
|
||||
const id = row.id || this.ids;
|
||||
getUserGradeInfo(id).then(response => {
|
||||
this.form = response.data.userGradeInfo;
|
||||
getUserGrade(id).then(response => {
|
||||
_this.form = response.data;
|
||||
this.gasolinePreferential = JSON.parse(this.form.gasolineRule)
|
||||
this.dieselPreferential = JSON.parse(this.form.dieselRule)
|
||||
this.naturalGasPreferential = JSON.parse(this.form.naturalGasRule)
|
||||
this.open = true;
|
||||
this.title = "编辑会员等级";
|
||||
});
|
||||
|
||||
// getUserGradeInfo(id).then(response => {
|
||||
// this.form = response.data.userGradeInfo;
|
||||
// this.open = true;
|
||||
// this.title = "编辑会员等级";
|
||||
// });
|
||||
},
|
||||
// 删除按钮操作
|
||||
handleDelete(row) {
|
||||
const name = row.name
|
||||
this.$modal.confirm('是否确认删除"' + name + '"的数据项?').then(function() {
|
||||
return deleteUserGrade(row.id);
|
||||
// return deleteUserGrade(row.id);
|
||||
return delUserGrade(row.id);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
this.getList();
|
||||
}).catch(() => {});
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 会员信息 controller层
|
||||
*/
|
||||
@ -35,6 +37,16 @@ public class LJUserController extends BaseController {
|
||||
return getSuccessResult(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员统计信息
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/statistic")
|
||||
public ResponseObject getStatistic(){
|
||||
Map<String, Object> map = userService.selectStatistic();
|
||||
return getSuccessResult(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询会员信息
|
||||
* @param id
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.fuint.business.userManager.entity;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fuint.framework.entity.BaseEntity;
|
||||
@ -11,6 +13,7 @@ import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员等级表
|
||||
@ -78,12 +81,30 @@ public class LJUserGrade extends BaseEntity implements Serializable {
|
||||
@ApiModelProperty("汽油优惠,无优惠,满减优惠,每升优惠")
|
||||
private String gasolineDiscount;
|
||||
|
||||
@ApiModelProperty("汽油优惠规则")
|
||||
private String gasolineRule;
|
||||
|
||||
@ApiModelProperty("柴油优惠,无优惠,满减优惠,每升优惠")
|
||||
private String dieselDiscount;
|
||||
|
||||
@ApiModelProperty("柴油优惠规则")
|
||||
private String dieselRule;
|
||||
|
||||
@ApiModelProperty("天然气优惠,无优惠,满减优惠,每单位优惠")
|
||||
private String naturalGasDiscount;
|
||||
|
||||
@ApiModelProperty("天然气优惠规则")
|
||||
private String naturalGasRule;
|
||||
|
||||
@ApiModelProperty("优惠活动组")
|
||||
private String promotionGroup;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<JSONObject> gasolineRuleList;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<JSONObject> dieselRuleList;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<JSONObject> naturalGasRuleList;
|
||||
}
|
||||
|
@ -17,4 +17,6 @@ public interface LJUserMapper extends BaseMapper<LJUser> {
|
||||
* @return
|
||||
*/
|
||||
public IPage<LJUser> selectUserList(Page page, @Param("user") LJUser user);
|
||||
|
||||
public Double selectSumByStore(@Param("storeId") int storeId,@Param("sumValue") String sumValue);
|
||||
}
|
||||
|
@ -26,12 +26,16 @@
|
||||
<result property="dieselDiscount" column="diesel_discount" />
|
||||
<result property="naturalGasDiscount" column="natural_gas_discount" />
|
||||
<result property="promotionGroup" column="promotion_group" />
|
||||
<result property="gasolineRule" column="gasoline_rule" />
|
||||
<result property="dieselRule" column="diesel_rule" />
|
||||
<result property="naturalGasRule" column="natural_gas_rule" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectUserGrade">
|
||||
select id, merchant_id, grade, name, catch_condition, catch_type, catch_value, user_privilege, valid_day, discount,
|
||||
speed_point, status, create_time, update_time, create_by, update_by, gasoline, diesel_oil, natural_gas,
|
||||
preferential, gasoline_discount, diesel_discount, natural_gas_discount,promotion_group from mt_user_grade
|
||||
preferential, gasoline_discount, diesel_discount, natural_gas_discount,promotion_group,gasoline_rule,
|
||||
diesel_rule, natural_gas_rule from mt_user_grade
|
||||
</sql>
|
||||
|
||||
<select id="selectUserGradeList" resultMap="UserGradeResult">
|
||||
|
@ -60,4 +60,7 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectSumByStore" resultType="java.lang.Double" parameterType="int">
|
||||
select sum(${sumValue}) from mt_user where store_id = #{storeId};
|
||||
</select>
|
||||
</mapper>
|
@ -4,39 +4,47 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.userManager.entity.LJUser;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 会员信息 业务层
|
||||
*/
|
||||
public interface LJUserService {
|
||||
/**
|
||||
* 根据条件分页查询员工信息
|
||||
* 根据条件分页查询会员信息
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
public IPage<LJUser> selectUserList(Page page, LJUser user);
|
||||
|
||||
/**
|
||||
* 根据id查询员工信息
|
||||
* 查询会员统计信息
|
||||
* @return
|
||||
*/
|
||||
public Map<String ,Object> selectStatistic();
|
||||
|
||||
/**
|
||||
* 根据id查询会员信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public LJUser selectUserById(int id);
|
||||
|
||||
/**
|
||||
* 根据id删除员工信息
|
||||
* 根据id删除会员信息
|
||||
* @param id
|
||||
*/
|
||||
public void deleteUserById(Integer id);
|
||||
|
||||
/**
|
||||
* 增加员工信息
|
||||
* 增加会员信息
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
public int insertUser(LJUser user);
|
||||
|
||||
/**
|
||||
* 修改员工信息
|
||||
* 修改会员信息
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.business.userManager.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.member.entity.LJStaff;
|
||||
import com.fuint.business.storeInformation.entity.LJStore;
|
||||
@ -37,8 +38,9 @@ public class ChainStoreConfigServiceImpl extends ServiceImpl<ChainStoreConfigMap
|
||||
LJStore store = storeService.selectStoreById();
|
||||
Integer id = store.getChainStoreId();
|
||||
chainStoreConfig.setChainStoreId(id);
|
||||
System.out.println(chainStoreConfig.getLevelClearRule());
|
||||
int row = baseMapper.updateById(chainStoreConfig);
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("chain_store_id",id);
|
||||
int row = baseMapper.update(chainStoreConfig,queryWrapper);
|
||||
return row;
|
||||
}
|
||||
}
|
||||
|
@ -1,18 +1,33 @@
|
||||
package com.fuint.business.userManager.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.userManager.entity.LJUserGrade;
|
||||
import com.fuint.business.userManager.mapper.LJUserGradeMapper;
|
||||
import com.fuint.business.userManager.service.LJUserGradeService;
|
||||
import com.fuint.common.util.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUserGrade> implements LJUserGradeService {
|
||||
@Override
|
||||
public IPage<LJUserGrade> selectUserGradeList(Page page, LJUserGrade userGrade) {
|
||||
return baseMapper.selectUserGradeList(page,userGrade);
|
||||
IPage<LJUserGrade> ljUserGradeIPage = baseMapper.selectUserGradeList(page, userGrade);
|
||||
for (LJUserGrade record : ljUserGradeIPage.getRecords()) {
|
||||
if (StringUtils.isNotEmpty(record.getGasolineRule())){
|
||||
record.setGasolineRuleList(JSONArray.parseArray(record.getGasolineRule(), JSONObject.class));
|
||||
}
|
||||
if (StringUtils.isNotEmpty(record.getDieselRule())){
|
||||
record.setDieselRuleList(JSONArray.parseArray(record.getDieselRule(), JSONObject.class));
|
||||
}
|
||||
if (StringUtils.isNotEmpty(record.getNaturalGasRule())){
|
||||
record.setNaturalGasRuleList(JSONArray.parseArray(record.getNaturalGasRule(), JSONObject.class));
|
||||
}
|
||||
}
|
||||
return ljUserGradeIPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.business.userManager.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -10,6 +11,9 @@ import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 会员信息 业务层
|
||||
*/
|
||||
@ -29,6 +33,32 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
|
||||
return baseMapper.selectUserList(page,user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员统计信息
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> selectStatistic() {
|
||||
Map<String ,Object> map = new HashMap<>();
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
Integer storeId = nowAccountInfo.getStoreId();
|
||||
Double balance = baseMapper.selectSumByStore(storeId, "balance");
|
||||
Double point = baseMapper.selectSumByStore(storeId, "point");
|
||||
Double literCard = baseMapper.selectSumByStore(storeId, "liter_card");
|
||||
Double refuelMoney = baseMapper.selectSumByStore(storeId, "refuel_money");
|
||||
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("TO_DAYS(create_time)","TO_DAYS(NOW())");
|
||||
Integer addNum = baseMapper.selectCount(queryWrapper);
|
||||
|
||||
map.put("balance",balance);
|
||||
map.put("point",point);
|
||||
map.put("literCard",literCard);
|
||||
map.put("refuelMoney",refuelMoney);
|
||||
map.put("addNum",addNum);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询会员信息
|
||||
* @param id
|
||||
|
Loading…
Reference in New Issue
Block a user