便利店

This commit is contained in:
cun-nan 2023-10-31 18:18:30 +08:00
parent 486da7ca40
commit 906b804b2b
39 changed files with 1316 additions and 182 deletions

View File

@ -17,6 +17,15 @@ export function getStaff(id) {
})
}
// 根据手机号查询员工详情
export function queryStaff(data) {
return request({
url: '/business/member/staff/mobile',
method: 'post',
data: data
})
}
// 新增员工
export function addStaff(data) {
return request({

View File

@ -9,6 +9,15 @@ export function listUser(query) {
})
}
// 查询会员统计列表
export function listUserStatistic(query) {
return request({
url: '/business/userManager/userStatistic/list',
method: 'get',
params: query
})
}
// 查询会员列表
export function listStatistic(query) {
return request({
@ -25,7 +34,7 @@ export function getUser(id) {
method: 'get'
})
}
// 查询会员详细
// 根据手机号查询会员详细
export function getUserMobile(data) {
return request({
url: '/business/userManager/user/mobile' ,

View File

@ -17,6 +17,15 @@ export function getUserGrade(id) {
})
}
// 根据会员等级名称查询会员等级信息
export function queryUserGrade(data) {
return request({
url: '/business/userManager/userGrade/getName',
method: 'post',
data: data
})
}
// 新增会员等级
export function addUserGrade(data) {
return request({

View File

@ -0,0 +1,36 @@
import request from '@/utils/request'
// 查询会员列表
export function listCommission(query) {
return request({
url: '/business/commission/staffCommission/list',
method: 'get',
params: query
})
}
// 查询会员详细
export function getCommission(id) {
return request({
url: '/business/commission/staffCommission/' + id,
method: 'get'
})
}
// 新增会员
export function addCommission(data) {
return request({
url: '/business/commission/staffCommission',
method: 'post',
data: data
})
}
// 修改会员
export function updateCommission(data) {
return request({
url: '/business/commission/staffCommission',
method: 'put',
data: data
})
}

View File

@ -390,7 +390,6 @@ export default {
rules: {
goodsNo: [
{ required: true, message: "商品条码不能为空", trigger: "blur" },
{ required: true, validator: this.checkGoodsNo, trigger: "blur" },
],
name: [
{ required: true, message: "商品名称不能为空", trigger: "blur" },
@ -434,15 +433,6 @@ export default {
computed:{
},
methods:{
checkGoodsNo(rule, value, callback){
queryLJGoods({goodsNo:this.form.goodsNo}).then( response => {
if(response.data!=null){
callback(new Error("商品已存在"))
}else {
callback();
}
})
},
//
selectSupplier(data){
console.log(data)
@ -634,11 +624,18 @@ export default {
this.getList();
});
} else {
addLJGoods(this.form).then(response => {
this.$modal.msgSuccess("商品信息新增成功");
this.open = false;
this.getList();
});
queryLJGoods({goodsNo:this.form.goodsNo}).then( response => {
if(response.data!=null){
this.$modal.msgError("商品已存在");
}else {
addLJGoods(this.form).then(response => {
this.$modal.msgSuccess("商品信息新增成功");
this.open = false;
this.getList();
});
}
})
}
}
});

View File

@ -375,9 +375,13 @@ export default {
});
} else {
insertCvsGoods(this.form).then(response => {
this.$modal.msgSuccess("分类添加成功");
this.open = false;
this.getList();
if (response.data == -1){
this.$modal.msgError("分类名称已存在,添加失败");
}else {
this.$modal.msgSuccess("分类添加成功");
this.open = false;
this.getList();
}
});
}
}

View File

@ -188,7 +188,6 @@ export default {
rules: {
name: [
{ required: true, message: "供应商名称不能为空", trigger: "blur" },
{ required: true, validator: this.checkName, trigger: "blur" },
],
}
}
@ -197,15 +196,6 @@ export default {
this.getList();
},
methods:{
checkName(rule, value, callback){
querySupplier({name:this.form.name}).then( response => {
if(response.data!=null){
callback(new Error("供应商名称已存在"))
}else {
callback();
}
})
},
//
getList() {
this.loading = true;
@ -269,11 +259,17 @@ export default {
this.getList();
});
} else {
addSupplier(this.form).then(response => {
this.$modal.msgSuccess("供应商新增成功");
this.open = false;
this.getList();
});
querySupplier({name:this.form.name}).then( response => {
if(response.data!=null){
this.$modal.msgError("供应商名称已存在");
}else {
addSupplier(this.form).then(response => {
this.$modal.msgSuccess("供应商新增成功");
this.open = false;
this.getList();
});
}
})
}
}
});

View File

@ -928,7 +928,6 @@ export default {
rules: {
name: [
{ required: true, message: "请填写认证名称", trigger: "blur" },
{ required: true, validator: this.checkName, trigger: "blur" },
],
discountType: [
{ required: true, message: "请选择优惠类型", trigger: "blur" },
@ -994,16 +993,6 @@ export default {
this.getUserList();
},
methods: {
//
checkName(rule, value, callback){
queryFixingLevel({name:this.form.name}).then( response => {
if(response.data!=null){
callback(new Error("固定等级名称不可重复"))
}else {
callback();
}
})
},
handleClick(tab, event) {
// console.log(tab, event);
},
@ -1219,11 +1208,17 @@ export default {
this.getList();
});
} else {
addFixingLevel(this.form).then(response => {
this.$modal.msgSuccess("认证类型创建成功");
this.open = false;
this.getList();
});
queryFixingLevel({name:this.form.name}).then( response => {
if(response.data!=null){
this.$modal.msgError("固定等级名称不可重复");
}else {
addFixingLevel(this.form).then(response => {
this.$modal.msgSuccess("认证类型创建成功");
this.open = false;
this.getList();
});
}
})
}
}
});

View File

@ -258,7 +258,7 @@
</el-card>
<!-- 添加会员信息选择是否批量录入-->
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="openUser" append-to-body>
<el-dialog :close-on-click-modal="false" :title="title" width="55%" :visible.sync="openUser" append-to-body>
<el-alert
type="info"
:closable="false">
@ -266,7 +266,7 @@
{{item}}
</p>
</el-alert>
<div>
<div style="margin: 10px 0">
<el-button type="primary"
icon="el-icon-edit-outline" @click="addOne" round>录入单个会员</el-button>
<el-button type="primary"
@ -274,20 +274,24 @@
</div>
<div>
<el-table ref="tables" v-loading="loading" :data="userList">
<el-table-column prop="date" label="批次号"/>
<el-table-column prop="date" label="类型"/>
<el-table-column prop="date" label="会员数"/>
<el-table-column label="执行结果">
<el-table-column prop="date" label="成功人数"/>
<el-table-column prop="date" label="失败人数"/>
<el-table-column prop="date" label="重复人数"/>
<el-table-column prop="batchNumber" align="center" label="批次号" width="200"/>
<el-table-column prop="type" align="center" label="类型"/>
<el-table-column prop="memberNumber" align="center" label="会员数"/>
<el-table-column label="执行结果" align="center" >
<el-table-column prop="successNumber" align="center" label="成功人数"/>
<el-table-column prop="errorNumber" align="center" label="失败人数"/>
<el-table-column prop="repeatNumber" align="center" label="重复人数"/>
</el-table-column>
<el-table-column prop="date" label="处理时间"/>
<el-table-column prop="date" label="处理结果详情"/>
<el-table-column prop="createTime" align="center" label="处理时间" width="160">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<!-- <el-table-column prop="date" align="center" label="处理结果详情"/>-->
</el-table>
<pagination
:total="total"
:total="total1"
:page.sync="queryParams.page"
:limit.sync="queryParams.pageSize"
@pagination="getList"
@ -452,7 +456,16 @@
import { getMemberList, updateMemberStatus, getMemberInfo, saveMember, deleteMember } from "@/api/member";
import balanceRecharge from "./balanceRecharge";
import pointRecharge from "./pointRecharge";
import {addUser, delUser, exportUsers, getUser, listStatistic, listUser, updateUser} from "@/api/staff/user/user";
import {
addUser,
delUser,
exportUsers,
getUser,
getUserMobile,
listStatistic,
listUser, listUserStatistic,
updateUser
} from "@/api/staff/user/user";
import {listUserGrade} from "@/api/staff/user/usergrade";
import {ljStoreList} from "@/api/staff/store";
import {getSysConfig} from "@/api/staff/user/sysconfig";
@ -499,6 +512,7 @@ export default {
showSearch: true,
//
total: 0,
total1: 0,
//
list: [],
//
@ -548,7 +562,9 @@ export default {
{ min: 2, max: 200, message: '会员名称长度必须介于2 和 100 之间', trigger: 'blur' }
],
gradeId: [{ required: true, message: "请选择会员等级", trigger: "blur" }],
mobile: [{ required: true, message: "请输入手机号", trigger: "blur" }],
mobile: [
{ required: true, message: "请输入手机号", trigger: "blur" },
],
}
};
},
@ -556,12 +572,9 @@ export default {
this.getList();
this.getStatistic();
this.getConfig();
this.getUserList();
},
methods: {
exportUser(){
console.log(1)
exportUsers().then(response => {})
},
//
goDedi(id){
this.$router.push({
@ -571,6 +584,14 @@ export default {
}
})
},
getUserList(){
this.loading = true;
listUserStatistic().then( response => {
this.userList = response.data.records;
this.total1 = response.data.total;
this.loading = false;
});
},
//
getList() {
this.loading = true;
@ -579,17 +600,6 @@ export default {
this.total = response.data.total;
this.loading = false;
});
// this.loading = true;
// this.queryParams.storeIds = this.storeIds ? this.storeIds.join(",") : '';
// getMemberList(this.addDateRange(this.queryParams, this.dateRange)).then( response => {
// this.list = response.data.paginationResponse.content;
// this.total = response.data.paginationResponse.totalElements;
// this.userGradeList = response.data.userGradeList;
// this.storeList = response.data.storeList;
// this.loading = false;
// }
// );
},
//
getStatistic(){
@ -662,6 +672,7 @@ export default {
this.openResult = true;
this.title = "会员创建结果";
this.getList();
this.getUserList();
},
//
handlePoint(userId) {
@ -725,11 +736,19 @@ export default {
this.getList();
});
} else {
addUser(this.form).then(response => {
this.$modal.msgSuccess("新增会员成功");
this.open = false;
this.getList();
});
getUserMobile({mobile:this.form.mobile}).then( response => {
if(response.data!=null){
this.$modal.msgError("手机号已存在");
}else {
addUser(this.form).then(response => {
this.$modal.msgSuccess("新增会员成功");
this.open = false;
this.openUser = false;
this.getList();
this.getUserList();
});
}
})
}
}
});

View File

@ -294,7 +294,7 @@
</el-card>
<!-- 会员充值-->
<el-dialog width="75%" :close-on-click-modal="false" :title="title" :visible.sync="openRecharge" append-to-body>
<el-dialog :close-on-click-modal="false" width="60%" :title="title" :visible.sync="openRecharge" append-to-body>
<template>
<el-tabs v-model="activeRecharge" type="card" @tab-click="handleClick">
<el-tab-pane label="储值卡" name="balance">
@ -319,10 +319,11 @@
<div>赠送<span class="amount">{{ item.give }}</span></div>
</div>
</div>
<div style="width: 30%;margin-left: 7%"
<div style="width: 30%;margin-left: 6%;"
:class="activeKey === 4 ? 'select' : ''"
@click="recharge(4)">
<el-input placeholder="请输入充值金额"
size="medium"
v-model="storeCardAmount.recharge">
<template slot="prepend">自定义</template>
<template slot="append"></template>
@ -456,7 +457,7 @@
<div style="line-height: 40px;width: 20%">提成员工</div>
<div>
<el-input placeholder="请选择提成员工">
<template slot="append">选择员工</template>
<el-button slot="append" @click="chooseStaff">选择员工</el-button>
</el-input>
</div>
</div>
@ -870,6 +871,10 @@ export default {
this.getInformation();
},
methods: {
//
chooseStaff(){
},
//
replaceMobile(){
this.openMobile = true;
@ -1077,7 +1082,7 @@ export default {
color: grey;
}
.zeng{
width: 95%;
width: 255px;
line-height: 40px;
}
.mon2{

View File

@ -230,10 +230,10 @@
</template>
</el-col>
<el-col :span="16" style="display: flex">
<span style="margin-right: 10px;width: 70px">审核权限</span>
<el-checkbox-group v-model="auditPrem" @change="getCheckbox">
<span style="margin-right: 10px">特殊权限</span>
<el-checkbox-group v-model="specialPrem" @change="getCheckbox">
<el-checkbox
v-for="dict in dict.type.shqx"
v-for="dict in dict.type.special_prem"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@ -243,10 +243,10 @@
</el-row>
<el-row>
<el-col :span="24" style="display: flex;margin-bottom: 10px">
<span style="margin-right: 10px">特殊权限</span>
<el-checkbox-group v-model="specialPrem" @change="getCheckbox">
<span style="margin-right: 10px;width: 70px">审核权限</span>
<el-checkbox-group v-model="auditPrem" @change="getCheckbox">
<el-checkbox
v-for="dict in dict.type.special_prem"
v-for="dict in dict.type.shqx"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@ -576,7 +576,7 @@
<script>
import {getName} from "../../utils/fuint";
import {addStaff, delStaff, getStaff, listStaff, updateStaff} from "@/api/staff/staff";
import {addStaff, delStaff, getStaff, listStaff, queryStaff, updateStaff} from "@/api/staff/staff";
import {getDuty, listDuty} from "@/api/staff/duty";
export default {
@ -601,20 +601,43 @@ export default {
// role:[],
posPrem:'',
posOptions:[
{value: '首页权限',label: '首页权限',children:[{value: '禁用普通收款权限', label: '禁用普通收款权限' },]},
{value: '会员储值',label: '会员储值'},
{value: '会员实体卡',label: '会员实体卡'},
{value: '会员积分',label: '会员积分'},
{value: '加油金变动',label: '加油金变动'},
{value: '会员卡券',label: '会员卡券'},
{value: '会员成长值',label: '会员成长值'},
{value: '首页权限',label: '首页权限',
children:[
{value: '禁用普通收款', label: '禁用普通收款' },
{value: '禁用会员收款', label: '禁用会员收款' },
{value: '禁用新增会员', label: '禁用新增会员' },
{value: '禁用订单记录', label: '禁用订单记录' },
{value: '禁用员工交班', label: '禁用员工交班' },
]},
{value: '会员储值',label: '会员储值',children:[{value: '禁止会员充值', label: '禁止会员充值' },]},
{value: '会员实体卡',label: '会员实体卡',children:[{value: '禁止绑卡换卡', label: '禁止绑卡换卡' },]},
{value: '会员积分',label: '会员积分',children:[{value: '增加', label: '增加' },{value: '减少', label: '减少' },]},
{value: '加油金变动',label: '加油金变动',children:[{value: '增加', label: '增加' },{value: '减少', label: '减少' },]},
{value: '会员卡券',label: '会员卡券',
children:[
{value: '优惠券赠送', label: '优惠券赠送' },
{value: '兑换券赠送', label: '兑换券赠送' },
]},
{value: '会员成长值',label: '会员成长值',
children:[
{value: '成长值增加', label: '成长值增加' },
{value: '成长值减少', label: '成长值减少' },
]},
],
props: { multiple: true },
appletPrem:'',
appletOptions:[
{value: '首页权限',label: '首页权限',children:[{value: '女装', label: '女装' },]},
{value: '会员储值',label: '会员储值'},
{value: '会员实体卡',label: '会员实体卡'},
{value: '交易',label: '交易',children:[{value: '油品交易', label: '油品交易' },]},
{value: '库存',label: '库存',
children:[
{value: '库存盘点', label: '库存盘点' },
{value: '库存查询', label: '库存查询' },
]},
{value: '核销',label: '核销',
children:[
{value: '扫码核销', label: '扫码核销' },
{value: '核销记录', label: '核销记录' },
]},
],
writeOff:[],
write:[],
@ -654,7 +677,7 @@ export default {
],
mobile: [
{ required: true, message: "手机号不能为空", trigger: "blur" },
{ min: 11, max: 20, message: '手机号长度必须11', trigger: 'blur' }
{ min: 11, max: 20, message: '手机号长度必须11', trigger: 'blur' },
],
role: [
{ required: true, message: "请选择员工角色", trigger: "blur" }
@ -663,7 +686,7 @@ export default {
{ required: true, message: "请选择加油状态", trigger: "blur" }
],
pos: [
{ required: true, message: "请选择员状态", trigger: "blur" }
{ required: true, message: "请选择", trigger: "blur" }
],
transaction: [
{ required: true, message: "请选择", trigger: "blur" }
@ -811,13 +834,19 @@ export default {
this.$refs["form"].validate(valid => {
if (valid) {
if (!this.form.id) {
this.form.posPrem = JSON.stringify(this.form.posPrem);
this.form.appletPrem = JSON.stringify(this.form.appletPrem);
addStaff(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
queryStaff({mobile:this.form.mobile}).then( response => {
if(response.data!=null){
this.$modal.msgError("手机号已存在");
}else {
this.form.posPrem = JSON.stringify(this.form.posPrem);
this.form.appletPrem = JSON.stringify(this.form.appletPrem);
addStaff(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
})
} else {
updateStaff(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
@ -838,11 +867,21 @@ export default {
// this.form.category = response.data.staffInfo.category + '';
this.open = true;
this.title = "编辑员工信息";
this.writeOff = this.form.writeOff.split(",");
this.specialPrem = this.form.specialPrem.split(",");
this.auditPrem = this.form.auditPrem.split(",");
this.posPrem = JSON.parse(this.form.posPrem);
this.appletPrem = JSON.parse(this.form.appletPrem);
if (this.auditPrem.length > 0){
this.auditPrem = this.form.auditPrem.split(",");
}
if (this.writeOff.length > 0){
this.writeOff = this.form.writeOff.split(",");
}
if (this.specialPrem.length > 0){
this.specialPrem = this.form.specialPrem.split(",");
}
if (this.posPrem != null && this.posPrem != ""){
this.posPrem = JSON.parse(this.form.posPrem);
}
if (this.appletPrem != null && this.appletPrem != ""){
this.appletPrem = JSON.parse(this.form.appletPrem);
}
});
},
//

View File

@ -0,0 +1,381 @@
<template>
<div class="app-container">
<el-card>
<div slot="header" class="clearfix">
<span>油品提成方案</span>
</div>
<el-alert
title="方案说明"
type="info"
description="同一生效时间内同一角色组、同一参与油品只能设置一种启用的提成方案">
</el-alert>
<div style="margin-top: 20px">
<el-button
type="primary"
icon="el-icon-plus"
@click="handleAdd"
v-hasPermi="['member:add']"
>新增提成方案</el-button>
<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"/>
<el-table-column label="方案名称" prop="name" align="center"/>
<el-table-column label="员工角色组" prop="staffRoleGroup" align="center">
<template slot-scope="scope">
<dict-tag :options="dict.type.role" :value="scope.row.staffRoleGroup"/>
</template>
</el-table-column>
<el-table-column label="提成来源" prop="commissionSource" align="center" />
<el-table-column label="满足条件" prop="meetCondition" align="center">
<template slot-scope="scope">
<span v-if="form.type == 'orderAmount'">
订单金额消费满{{scope.row.meetCondition}}
</span>
<span v-if="form.type == 'payAmount'">
实际金额消费满{{scope.row.meetCondition}}
</span>
<span v-if="form.type == 'refuleNum'">
加油数量消费满{{scope.row.meetCondition}}单位/立方
</span>
</template>
</el-table-column>
<el-table-column label="油品提成" prop="royaltyRate" align="center"/>
<el-table-column label="生效时间" prop="takeEffect" align="center">
<template slot-scope="scope">
<span>
{{JSON.parse(scope.row.takeEffect)[0]}}{{JSON.parse(scope.row.takeEffect)[1]}}
</span>
</template>
</el-table-column>
<el-table-column label="方案状态" align="center" prop="status">
<template slot-scope="scope">
<el-tag v-if="scope.row.status=='qy'">启用</el-tag>
<el-tag type="info" v-if="scope.row.status=='jy'">禁用</el-tag>
<!-- <dict-tag :options="dict.type.zhzt" :value="scope.row.status"/>-->
</template>
</el-table-column>
<el-table-column label="更新时间" align="center" width="160" prop="updateTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="120" fixed='right'>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
v-hasPermi="['member:add']"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
v-hasPermi="['member:add']"
>
<span v-if="scope.row.status == 'qy'"
@click="handleStatus(scope.row,'jy')"><i class="el-icon-turn-off"></i>禁用</span>
<span v-else
@click="handleStatus(scope.row,'qy')"><i class="el-icon-open"></i>启用</span>
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</el-card>
<!-- 添加或修改对话框 -->
<el-dialog :close-on-click-modal="false" :title="title" width="40%" :visible.sync="open" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
<el-row>
<el-col :span="24">
<el-form-item label="方案名称" prop="name" style="width: 420px">
<el-input v-model="form.name" placeholder="请输入方案名称" maxlength="30" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24" style="display: flex;margin-bottom: 10px">
<el-form-item label="提成来源" prop="commissionSource" style="width: 420px">
<el-checkbox-group v-model="commissionSource" ref="" @change="getCheckbox">
<el-checkbox
v-for="dict in dict.type.source"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="角色组" prop="staffRoleGroup">
<el-select v-model="form.staffRoleGroup" placeholder="请选择所属角色">
<el-option
v-for="dict in dict.type.role"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="提成类型" prop="type">
<el-radio-group v-model="form.type">
<el-radio v-for="dict in dict.type.comissionType" :label="dict.value">{{ dict.label }}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="消费条件" prop="meetCondition">
<el-input v-if="form.type == 'orderAmount'" v-model="form.meetCondition">
<template slot="prepend">订单金额消费满</template>
<template slot="append"></template>
</el-input>
<el-input v-if="form.type == 'payAmount'" v-model="form.meetCondition">
<template slot="prepend">实际金额消费满</template>
<template slot="append"></template>
</el-input>
<el-input v-if="form.type == 'refuleNum'" v-model="form.meetCondition">
<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="royaltyRate">
<el-input v-model="form.royaltyRate" placeholder="请输入提成">
<el-select v-model="select" style="width: 70px" slot="append" placeholder="请选择">
<el-option label="元" value="元"></el-option>
<el-option label="%" value="%"></el-option>
</el-select>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="生效时间" prop="takeEffect">
<el-date-picker
v-model="form.takeEffect"
type="daterange"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
<div style="font-size: 12px;color: grey">时间范围内的油品交易有效</div>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="方案状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio v-for="dict in dict.type.zhzt" :label="dict.value">{{ dict.label }}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {addCommission, getCommission, listCommission, updateCommission} from "@/api/staffCommission/staffcommission";
export default {
dicts: ['source','role','zhzt','comissionType'],
data(){
return {
//
dateRange: [],
select:"元",
commissionSource:[],
//
loading: true,
//
title: "",
//
total: 0,
//
list: [],
//
open: false,
//
defaultSort: {prop: 'updateTime', order: 'descending'},
//
queryParams: {
page: 1,
pageSize: 10,
id: '',
name: '',
mobile: '',
},
//
form: {
type:'orderAmount',
status:'qy'
},
//
showSearch: true,
//
rules: {
name: [
{ required: true, message: "供应商名称不能为空", trigger: "blur" },
],
commissionSource: [
{ required: true, message: "请选择提成来源", trigger: "blur" },
],
staffRoleGroup: [
{ required: true, message: "请选择角色组", trigger: "blur" },
],
type: [
{ required: true, message: "请选择提成类型", trigger: "blur" },
],
meetCondition: [
{ required: true, message: "请填写提成消费条件", trigger: "blur" },
],
royaltyRate: [
{ required: true, message: "请填写油品提成", trigger: "blur" },
],
takeEffect: [
{ required: true, message: "请选择方案生效时间", trigger: "change" },
],
status: [
{ required: true, message: "请选择方案状态", trigger: "blur" },
],
}
}
},
created() {
this.getList();
},
methods:{
getCheckbox(){
this.form.commissionSource = this.commissionSource.toString()
},
//
getList() {
this.loading = true;
listCommission(this.queryParams).then(response => {
this.list = response.data.records;
this.total = response.data.total;
this.loading = false;
});
},
//
reset() {
this.resetForm("form");
this.form= {
type:'orderAmount',
status:'qy'
}
},
//
handleAdd() {
this.reset();
this.open = true;
this.title = "新增提成方案";
},
//
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getCommission(id).then(response => {
this.form = response.data;
this.commissionSource = this.form.commissionSource.split(",")
this.form.takeEffect = JSON.parse(this.form.takeEffect)
this.form.royaltyRate = this.form.royaltyRate.slice(0,this.form.royaltyRate.length-1)
this.open = true;
this.title = "编辑提成方案";
});
},
//
handleStatus(row,status) {
row.status = status;
updateCommission(row).then(response => {
this.$modal.msgSuccess("方案状态更新成功");
this.open = false;
this.getList();
});
},
//
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
this.form.commissionSource = this.commissionSource.toString()
this.form.takeEffect = JSON.stringify(this.form.takeEffect)
this.form.royaltyRate = this.form.royaltyRate + this.select
if (this.form.id) {
updateCommission(this.form).then(response => {
this.$modal.msgSuccess("提成方案更新成功");
this.open = false;
this.getList();
});
} else {
addCommission(this.form).then(response => {
this.$modal.msgSuccess("提成方案新增成功");
this.open = false;
this.getList();
});
}
}
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.multiple = !selection.length
},
//
handleSortChange(column, prop, order) {
this.queryParams.orderByColumn = column.prop;
this.queryParams.isAsc = column.order;
this.getList();
},
}
}
</script>
<style lang="scss" scoped>
.app-container{
width: 100%;
height: 100vh;
background: #f6f8f9;
}
</style>

View File

@ -531,7 +531,14 @@
<script>
import { getUserGradeList, updateUserGradeStatus, getUserGradeInfo, saveUserGrade, deleteUserGrade } from "@/api/userGrade";
import {addUserGrade, delUserGrade, getUserGrade, listUserGrade, updateUserGrade} from "@/api/staff/user/usergrade";
import {
addUserGrade,
delUserGrade,
getUserGrade,
listUserGrade,
queryUserGrade,
updateUserGrade
} from "@/api/staff/user/usergrade";
import {getChainStoreConfig, updateChainStoreConfig} from "@/api/staff/user/chainstoreconfig";
import {getSysConfig} from "@/api/staff/user/sysconfig";
export default {
@ -617,7 +624,6 @@ export default {
],
name: [
{ required: true, message: "等级名称不能为空", trigger: "blur" },
{ min: 2, max: 100, message: '等级名称长度必须介于2 和 100 之间', trigger: 'blur' }
],
gasoline: [
{ required: true, message: "请填写汽油成长值", trigger: "blur" },
@ -649,6 +655,15 @@ export default {
this.getRule();
},
methods: {
checkName(rule, value, callback){
queryUserGrade({name:this.form.name}).then( response => {
if(response.data!=null){
callback(new Error("会员等级名称已存在"))
}else {
callback();
}
})
},
editLevel1(){
this.level1 = false;
this.level2 = true;
@ -830,17 +845,19 @@ export default {
this.open = false;
this.getList();
});
// saveUserGrade(this.form).then(response => {
// this.$modal.msgSuccess("");
// this.open = false;
// this.getList();
// });
} else {
addUserGrade(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
queryUserGrade({name:this.form.name}).then( response => {
if(response.data!=null){
this.$modal.msgError("会员等级名称已存在");
}else {
addUserGrade(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
})
// saveUserGrade(this.form).then(response => {
// this.$modal.msgSuccess("");
// this.open = false;

View File

@ -0,0 +1,70 @@
package com.fuint.business.commission.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.commission.entity.StaffCommission;
import com.fuint.business.commission.service.StaffCommissionService;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
* 提成方案信息 controller层
*/
@RestController
@RequestMapping("/business/commission/staffCommission")
public class StaffCommissionController extends BaseController {
@Autowired
private StaffCommissionService commissionService;
/**
* 根据条件分页查询员工提成方案信息
* @param commission
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/list")
public ResponseObject list(StaffCommission commission,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,pageSize);
IPage<StaffCommission> list = commissionService.selectCommissionList(page,commission);
return getSuccessResult(list);
}
/**
* 根据id查询员工提成方案信息
* @param id
* @return
*/
@GetMapping("/{id}")
public ResponseObject staffCommissionInfo(@PathVariable Integer id){
StaffCommission commission = commissionService.selectCommissionById(id);
return getSuccessResult(commission);
}
/**
* 添加员工提成方案信息
* @param commission
* @return
*/
@PostMapping
public ResponseObject add(@Validated @RequestBody StaffCommission commission){
int row = commissionService.insertStaffCommission(commission);
return getSuccessResult(row);
}
/**
* 修改员工提成方案信息
* @param commission
* @return
*/
@PutMapping
public ResponseObject edit(@Validated @RequestBody StaffCommission commission){
int row = commissionService.updateStaffCommission(commission);
return getSuccessResult(row);
}
}

View File

@ -0,0 +1,61 @@
package com.fuint.business.commission.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;
/**
* 提成记录表 (CommissionRecord)实体类
*/
@Data
@TableName("commission_record")
@ApiModel(value = "CommissionRecord对象", description = "提成记录表")
public class CommissionRecord extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@ApiModelProperty("自增ID")
@TableId(value = "ID", type = IdType.AUTO)
private Integer id;
/**
* 店铺id
*/
@ApiModelProperty("店铺ID")
private Integer storeId;
/**
* 员工id
*/
@ApiModelProperty("员工id")
private Integer staffId;
/**
* 类型
*/
@ApiModelProperty("类型")
private String type;
/**
* 金额
*/
@ApiModelProperty("金额")
private Double amount;
/**
* 关联订单号
*/
@ApiModelProperty("关联订单号")
private String orderNo;
/**
* 描述
*/
@ApiModelProperty("描述")
private String description;
}

View File

@ -0,0 +1,85 @@
package com.fuint.business.commission.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;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 员工提成方案表 (StaffCommission)实体类
*/
@Data
@TableName("staff_commission")
@ApiModel(value = "StaffCommission对象", description = "员工提成方案表")
public class StaffCommission extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@ApiModelProperty("自增ID")
@TableId(value = "ID", type = IdType.AUTO)
private Integer id;
/**
* 店铺ID
*/
@ApiModelProperty("店铺ID")
private Integer storeId;
/**
* 方案名称
*/
@ApiModelProperty("方案名称")
private String name;
/**
* 员工角色组
*/
@ApiModelProperty("员工角色组")
private String staffRoleGroup;
/**
* 提成卡来源油品非油品
*/
@ApiModelProperty("提成卡来源")
private String commissionSource;
/**
* 提成类型
*/
@ApiModelProperty("提成类型")
private String type;
/**
* 满足条件
*/
@ApiModelProperty("满足条件")
private String meetCondition;
/**
* 提成率
*/
@ApiModelProperty("提成率")
private String royaltyRate;
/**
* 生效时间
*/
@ApiModelProperty("生效时间")
private String takeEffect;
/**
* 方案状态
*/
@ApiModelProperty("方案状态")
private String status;
/**
* 备注
*/
@ApiModelProperty("备注")
private String remark;
@TableField(exist = false)
private List<JSONObject> takeEffectList;
}

View File

@ -0,0 +1,16 @@
package com.fuint.business.commission.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.commission.entity.StaffCommission;
import org.apache.ibatis.annotations.Param;
public interface StaffCommissionMapper extends BaseMapper<StaffCommission> {
/**
* 根据条件分页查询员工提成方案信息
* @param page
* @return
*/
public IPage<StaffCommission> selectCommissionList(Page page,@Param("commission") StaffCommission commission);
}

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fuint.business.commission.mapper.StaffCommissionMapper">
<sql id="selectCommission">
select * from staff_commission
</sql>
<select id="selectCommissionList" resultType="com.fuint.business.commission.entity.StaffCommission">
<include refid="selectCommission"></include>
<where>
store_id = #{commission.storeId}
</where>
</select>
</mapper>

View File

@ -0,0 +1,40 @@
package com.fuint.business.commission.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.commission.entity.StaffCommission;
import com.fuint.business.member.entity.LJStaff;
/**
* 员工提成方案信息 业务层
*/
public interface StaffCommissionService extends IService<StaffCommission> {
/**
* 根据条件分页查询员工提成方案信息
* @param page
* @return
*/
public IPage<StaffCommission> selectCommissionList(Page page, StaffCommission commission);
/**
* 根据id查询员工提成方案信息
* @param id
* @return
*/
public StaffCommission selectCommissionById(int id);
/**
* 增加员工提成方案信息
* @param commission
* @return
*/
public int insertStaffCommission(StaffCommission commission);
/**
* 修改员工提成方案信息
* @param commission
* @return
*/
public int updateStaffCommission(StaffCommission commission);
}

View File

@ -0,0 +1,53 @@
package com.fuint.business.commission.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.commission.entity.StaffCommission;
import com.fuint.business.commission.mapper.StaffCommissionMapper;
import com.fuint.business.commission.service.StaffCommissionService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.StringUtils;
import com.fuint.common.util.TokenUtil;
import org.apache.commons.lang.StringEscapeUtils;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 员工提成方案信息 业务层
*/
@Service
public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMapper, StaffCommission> implements StaffCommissionService {
@Override
public IPage<StaffCommission> selectCommissionList(Page page, StaffCommission commission) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
commission.setStoreId(storeId);
IPage<StaffCommission> staffCommissionIPage = baseMapper.selectCommissionList(page, commission);
return staffCommissionIPage;
}
@Override
public StaffCommission selectCommissionById(int id) {
StaffCommission commission = baseMapper.selectById(id);
return commission;
}
@Override
public int insertStaffCommission(StaffCommission commission) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
commission.setStoreId(storeId);
int row = baseMapper.insert(commission);
return row;
}
@Override
public int updateStaffCommission(StaffCommission commission) {
int row = baseMapper.updateById(commission);
return row;
}
}

View File

@ -0,0 +1,4 @@
package com.fuint.business.commission.vo;
public class CommissionRecordVo {
}

View File

@ -28,7 +28,7 @@ public class CvsGoodsController extends BaseController {
public ResponseObject insertCvsGoods( @RequestBody CvsGoods goods){
int i = cvsGoodsService.insertCvsGoods(goods);
if(i == -1){
return getFailureResult("新增失败,数据已存在");
return getSuccessResult(-1);
}else {
return getSuccessResult(i);
}

View File

@ -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;
@RestController
@RequestMapping("/business/member/staff")
public class LJStaffController extends BaseController {
@ -43,6 +45,18 @@ public class LJStaffController extends BaseController {
return getSuccessResult(staff);
}
/**
* 根据id查询员工信息
* @param map
* @return
*/
@PostMapping("/mobile")
public ResponseObject staffByMobile(@Validated @RequestBody Map<String ,String > map){
String mobile = map.get("mobile");
LJStaff staff = mtStaffService.selectStaffByMobile(mobile);
return getSuccessResult(staff);
}
/**
* 批量删除员工信息
* @return

View File

@ -23,6 +23,13 @@ public interface ILJStaffService extends IService<LJStaff> {
*/
public LJStaff selectStaffById(int id);
/**
* 根据手机号查询员工信息
* @param mobile
* @return
*/
public LJStaff selectStaffByMobile(String mobile);
/**
* 批量删除员工信息
* @param ids

View File

@ -1,5 +1,6 @@
package com.fuint.business.member.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;
@ -42,6 +43,22 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
return baseMapper.selectById(id);
}
/**
* 根据手机号查询员工信息
* @param mobile
* @return
*/
@Override
public LJStaff selectStaffByMobile(String mobile) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("store_id",storeId);
queryWrapper.eq("mobile",mobile);
LJStaff staff = baseMapper.selectOne(queryWrapper);
return staff;
}
/**
* 根据id批量删除员工信息
* @param ids

View File

@ -3,9 +3,11 @@ package com.fuint.business.userManager.controller;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.EasyExcelFactory;
import com.fuint.business.userManager.entity.LJUser;
import com.fuint.business.userManager.entity.UserStatistic;
import com.fuint.business.userManager.listener.EasyExcelListener;
import com.fuint.business.userManager.mapper.LJUserMapper;
import com.fuint.business.userManager.service.LJUserService;
import com.fuint.business.userManager.service.UserStatisticService;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.springframework.beans.factory.annotation.Autowired;
@ -29,6 +31,8 @@ public class ExportController extends BaseController{
private LJUserService service;
@Autowired
private LJUserMapper mapper;
@Autowired
private UserStatisticService statisticService;
@RequestMapping("/import")
public ResponseObject myImport(MultipartFile file) throws IOException {
@ -70,6 +74,16 @@ public class ExportController extends BaseController{
map.put("success",success);
map.put("error",error);
map.put("repeat",repeat);
// 添加会员统计信息
UserStatistic statistic = new UserStatistic();
statistic.setType("导入");
statistic.setMemberNumber(total);
statistic.setSuccessNumber(success);
statistic.setErrorNumber(error);
statistic.setRepeatNumber(repeat);
statisticService.insertUserStatistic(statistic);
} catch (Exception e) {
e.printStackTrace();
}

View File

@ -3,7 +3,9 @@ package com.fuint.business.userManager.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.userManager.entity.LJUser;
import com.fuint.business.userManager.entity.UserStatistic;
import com.fuint.business.userManager.service.LJUserService;
import com.fuint.business.userManager.service.UserStatisticService;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.springframework.beans.factory.annotation.Autowired;
@ -20,6 +22,8 @@ import java.util.Map;
public class LJUserController extends BaseController {
@Autowired
private LJUserService userService;
@Autowired
private UserStatisticService statisticService;
/**
* 根据条件分页查询会员信息
@ -59,7 +63,7 @@ public class LJUserController extends BaseController {
}
/**
* 根据id查询会员信息
* 根据手机号查询会员信息
* @param map
* @return
*/
@ -87,7 +91,23 @@ public class LJUserController extends BaseController {
*/
@PostMapping
public ResponseObject add(@Validated @RequestBody LJUser user){
return getSuccessResult(userService.insertUser(user));
int row = userService.insertUser(user);
// 添加会员统计信息
UserStatistic statistic = new UserStatistic();
if (row==0){
statistic.setSuccessNumber(0);
statistic.setErrorNumber(1);
statistic.setRepeatNumber(0);
}else {
statistic.setSuccessNumber(1);
statistic.setErrorNumber(0);
statistic.setRepeatNumber(0);
}
statistic.setType("单录");
statistic.setMemberNumber(1);
statisticService.insertUserStatistic(statistic);
return getSuccessResult(row);
}
/**

View File

@ -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层
*/
@ -41,11 +43,23 @@ public class LJUserGradeController extends BaseController {
* @return
*/
@GetMapping("/{id}")
public ResponseObject staffInfo(@PathVariable Integer id){
public ResponseObject userGradeInfo(@PathVariable Integer id){
LJUserGrade userGrade = userGradeService.selectUserGradeById(id);
return getSuccessResult(userGrade);
}
/**
* 根据id查询会员等级信息
* @param map
* @return
*/
@PostMapping("/getName")
public ResponseObject userGradeByName(@Validated @RequestBody Map<String ,String > map){
String name = map.get("name");
LJUserGrade userGrade = userGradeService.selectUserGradeByName(name);
return getSuccessResult(userGrade);
}
/**
* 删除会员等级信息
* @return

View File

@ -0,0 +1,40 @@
package com.fuint.business.userManager.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.userManager.entity.LJUserGrade;
import com.fuint.business.userManager.entity.UserStatistic;
import com.fuint.business.userManager.service.UserStatisticService;
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.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 会员录入统计信息 controller层
*/
@RestController
@RequestMapping("/business/userManager/userStatistic")
public class UserStatisticController extends BaseController {
@Autowired
private UserStatisticService userStatisticService;
/**
* 根据条件分页查询会员等级信息
* @param statistic
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/list")
public ResponseObject list(UserStatistic statistic,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,pageSize);
IPage<UserStatistic> list = userStatisticService.selectUserStatisticList(page, statistic);
return getSuccessResult(list);
}
}

View File

@ -24,7 +24,7 @@ import java.util.List;
@Getter
@Setter
@TableName("mt_user_grade")
@ApiModel(value = "MtUserGrade对象", description = "")
@ApiModel(value = "LJUserGrade对象", description = "会员等级表")
public class LJUserGrade extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
@ -33,8 +33,8 @@ public class LJUserGrade extends BaseEntity implements Serializable {
@TableId(value = "ID", type = IdType.AUTO)
private Integer id;
@ApiModelProperty("商户ID")
private Integer merchantId;
@ApiModelProperty("店铺ID")
private Integer storeId;
@ApiModelProperty("等级")
private Integer grade;

View File

@ -0,0 +1,64 @@
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;
/**
* 会员统计表(UserStatistic)实体类
*/
@Data
@TableName("mt_user_statistic")
@ApiModel(value = "UserStatistic对象", description = "会员统计表")
public class UserStatistic extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@ApiModelProperty("自增ID")
@TableId(value = "ID", type = IdType.AUTO)
private Integer id;
@ApiModelProperty("店铺ID")
private Integer storeId;
/**
* 批次号
*/
@ApiModelProperty("批次号")
private String batchNumber;
/**
* 类型
*/
@ApiModelProperty("类型")
private String type;
/**
* 会员数
*/
@ApiModelProperty("会员数")
private Integer memberNumber;
/**
* 成功人数
*/
@ApiModelProperty("成功人数")
private Integer successNumber;
/**
* 失败人数
*/
@ApiModelProperty("失败人数")
private Integer errorNumber;
/**
* 重复人数
*/
@ApiModelProperty("重复人数")
private Integer repeatNumber;
}

View File

@ -0,0 +1,16 @@
package com.fuint.business.userManager.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.userManager.entity.UserStatistic;
import org.apache.ibatis.annotations.Param;
public interface UserStatisticMapper extends BaseMapper<UserStatistic> {
/**
* 根据条件分页查询会员等级信息
* @param page
* @return
*/
public IPage<UserStatistic> selectUserStatisticList(Page page,@Param("userStatistic") UserStatistic userStatistic);
}

View File

@ -1,47 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fuint.business.userManager.mapper.LJUserGradeMapper">
<resultMap id="UserGradeResult" type="com.fuint.business.userManager.entity.LJUserGrade">
<id property="id" column="id" />
<result property="merchantId" column="merchant_id" />
<result property="name" column="name" />
<result property="grade" column="grade" />
<result property="catchCondition" column="catch_condition" />
<result property="catchType" column="catch_type" />
<result property="catchValue" column="catch_value" />
<result property="userPrivilege" column="user_privilege" />
<result property="validDay" column="valid_day" />
<result property="discount" column="discount" />
<result property="speedPoint" column="speed_point" />
<result property="status" column="status" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="gasoline" column="gasoline" />
<result property="dieselOil" column="diesel_oil" />
<result property="naturalGas" column="natural_gas" />
<result property="preferential" column="preferential" />
<result property="gasolineDiscount" column="gasoline_discount" />
<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,gasoline_rule,
diesel_rule, natural_gas_rule from mt_user_grade
select * from mt_user_grade
</sql>
<select id="selectUserGradeList" resultMap="UserGradeResult">
<select id="selectUserGradeList" resultType="com.fuint.business.userManager.entity.LJUserGrade">
<include refid="selectUserGrade"></include>
<!-- <where>-->
<!-- store_id = #{user.storeId}-->
<where>
store_id = #{userGrade.storeId}
<!-- <if test="userGrade.mobile != null and userGrade.mobile != ''">-->
<!-- and mobile like concat('%', #{userGrade.mobile}, '%')-->
<!-- </if>-->
@ -54,6 +21,6 @@
<!-- <if test="userGrade.gradeId != null and userGrade.gradeId != ''">-->
<!-- and grade_id = #{userGrade.gradeId}-->
<!-- </if>-->
<!-- </where>-->
</where>
</select>
</mapper>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fuint.business.userManager.mapper.UserStatisticMapper">
<sql id="selectUserStatistic">
select * from mt_user_statistic
</sql>
<select id="selectUserStatisticList" resultType="com.fuint.business.userManager.entity.UserStatistic">
<include refid="selectUserStatistic"></include>
<where>
store_id = #{userStatistic.storeId}
</where>
</select>
</mapper>

View File

@ -10,34 +10,41 @@ import com.fuint.business.userManager.entity.LJUserGrade;
*/
public interface LJUserGradeService extends IService<LJUserGrade> {
/**
* 根据条件分页查询员工信息
* 根据条件分页查询会员等级信息
* @param page
* @return
*/
public IPage<LJUserGrade> selectUserGradeList(Page page, LJUserGrade userGrade);
/**
* 根据id查询员工信息
* 根据id查询会员等级信息
* @param id
* @return
*/
public LJUserGrade selectUserGradeById(int id);
/**
* 根据id删除员工信息
* 根据会员等级名称查询会员等级信息
* @param name
* @return
*/
public LJUserGrade selectUserGradeByName(String name);
/**
* 根据id删除会员等级信息
* @param id
*/
public void deleteUserGradeById(Integer id);
/**
* 增加员工信息
* 增加会员等级信息
* @param userGrade
* @return
*/
public int insertUserGrade(LJUserGrade userGrade);
/**
* 修改员工信息
* 修改会员等级信息
* @param userGrade
* @return
*/

View File

@ -0,0 +1,25 @@
package com.fuint.business.userManager.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.userManager.entity.UserStatistic;
/**
* 用户统计信息 业务层
*/
public interface UserStatisticService extends IService<UserStatistic> {
/**
* 根据条件分页查询会员等级信息
* @param page
* @return
*/
public IPage<UserStatistic> selectUserStatisticList(Page page, UserStatistic userStatistic);
/**
* 增加用户统计信息
* @param userStatistic
* @return
*/
public int insertUserStatistic(UserStatistic userStatistic);
}

View File

@ -2,19 +2,25 @@ package com.fuint.business.userManager.service.impl;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
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;
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.dto.AccountInfo;
import com.fuint.common.util.StringUtils;
import com.fuint.common.util.TokenUtil;
import org.springframework.stereotype.Service;
@Service
public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUserGrade> implements LJUserGradeService {
@Override
public IPage<LJUserGrade> selectUserGradeList(Page page, LJUserGrade userGrade) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
userGrade.setStoreId(storeId);
IPage<LJUserGrade> ljUserGradeIPage = baseMapper.selectUserGradeList(page, userGrade);
for (LJUserGrade record : ljUserGradeIPage.getRecords()) {
if (StringUtils.isNotEmpty(record.getGasolineRule())){
@ -35,6 +41,17 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
return baseMapper.selectById(id);
}
@Override
public LJUserGrade selectUserGradeByName(String name) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("store_id",storeId);
queryWrapper.eq("name",name);
LJUserGrade ljUserGrade = baseMapper.selectOne(queryWrapper);
return ljUserGrade;
}
@Override
public void deleteUserGradeById(Integer id) {
baseMapper.deleteById(id);

View File

@ -8,7 +8,6 @@ import com.fuint.business.userManager.entity.CertifiedMember;
import com.fuint.business.userManager.entity.LJUser;
import com.fuint.business.userManager.mapper.CertifiedMemberMapper;
import com.fuint.business.userManager.mapper.LJUserMapper;
import com.fuint.business.userManager.service.CertifiedMemberService;
import com.fuint.business.userManager.service.LJUserService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;

View File

@ -0,0 +1,40 @@
package com.fuint.business.userManager.service.impl;
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.UserStatistic;
import com.fuint.business.userManager.mapper.UserStatisticMapper;
import com.fuint.business.userManager.service.UserStatisticService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;
@Service
public class UserStatisticServiceImpl extends ServiceImpl<UserStatisticMapper, UserStatistic> implements UserStatisticService {
@Override
public IPage<UserStatistic> selectUserStatisticList(Page page, UserStatistic userStatistic) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
userStatistic.setStoreId(storeId);
IPage<UserStatistic> userStatisticIPage = baseMapper.selectUserStatisticList(page, userStatistic);
return userStatisticIPage;
}
@Override
public int insertUserStatistic(UserStatistic userStatistic) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
userStatistic.setStoreId(storeId);
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
String timestamp = dateFormat.format(new Date());
String randomString = UUID.randomUUID().toString().replace("-","").substring(0,6);
userStatistic.setBatchNumber(timestamp+randomString);
int row = baseMapper.insert(userStatistic);
return row;
}
}