会员管理

This commit is contained in:
cun-nan 2023-10-20 18:42:38 +08:00
parent 3738223f88
commit 3fd0db5a0d
15 changed files with 610 additions and 205 deletions

View File

@ -407,14 +407,34 @@
<div>第二步: 选择用户数据上传并导入会员</div>
<el-upload
class="upload-demo"
v-loading="uploading"
action="/dev-api/excel/import"
:headers="headers"
:limit="1"
:on-change="handleChange"
style="margin-left: 50px"
:file-list="fileList">
<el-button size="small" type="success" icon="el-icon-upload">点击上传</el-button>
<div slot="tip">只能上传xls/xlsx文件单次最大5000行会员数据且不超过1M 超出请分文件处理</div>
</el-upload>
<!-- <el-button type="primary" round @click="importUser">主要按钮</el-button>-->
</div>
</el-dialog>
<!-- 批量导入结果-->
<el-dialog width="400px" style="margin-top: 150px" :title="title" :visible.sync="openResult" append-to-body>
<div class="huiyuan">
会员总数<span class="num">{{result.total}}</span>
</div>
<div class="huiyuan">
成功人数<span class="num">{{result.success}}</span>
</div>
<div class="huiyuan">
失败人数<span class="num">{{result.error}}</span>
<span v-if="result.error!=0" style="color: red;font-size: 12px">手机号不可为空</span>
</div>
<div class="huiyuan">
重复人数<span class="num">{{result.repeat}}</span>
</div>
</el-dialog>
@ -441,6 +461,9 @@ export default {
dicts: ['official','zhzt'],
data() {
return {
result:{},
//
isUpload:false,
headers: {
'Access-Token': getToken(),
},
@ -462,6 +485,8 @@ export default {
yesterdayAddNum:'',
//
loading: true,
uploading: false,
uploadingFile: 0,
//
title: "",
//
@ -485,6 +510,7 @@ export default {
open: false,
openUser: false,
openUpload: false,
openResult: false,
//
userId: '',
//
@ -627,7 +653,9 @@ export default {
},
//
importUser(){
this.openResult = true;
this.title = "会员创建结果";
this.getList();
},
//
handlePoint(userId) {
@ -721,8 +749,16 @@ export default {
}).catch(() => {});
},
handleChange(file, fileList) {
this.fileList = fileList.slice(-3);
}
this.uploading = true;
if(file.status === 'success'){
this.uploading = false;
this.openUpload = false;
this.openUser = false;
this.importUser();
this.fileList.splice(0,1)
this.result = file.response.data
}
},
}
};
</script>
@ -739,9 +775,14 @@ export default {
background: #f6f8f9;
padding-top: 30px;
}
.el-upload, .el-upload--text {
width: 150px;
height: 60px !important;
line-height: 60px !important;
.huiyuan{
height: 30px;
line-height: 30px;
font-size: 16px;
}
.num{
font-weight: bold;
color: red;
font-size: 18px;
}
</style>

View File

@ -17,8 +17,8 @@
<img v-if="form.avatar" :src="form.avatar" style="width: 80px;height: 80px">
<img v-else src="@/assets/images/avatar.png" style="width: 80px;height: 80px">
</div>
<el-button type="warning" plain round size="mini" style="margin: 10px">绑定实体卡</el-button><br>
<el-button type="primary" icon="el-icon-bank-card" round style="margin: 10px;width: 50%;height: 40px">会员充值</el-button>
<el-button type="warning" plain round size="mini" style="margin: 10px" @click="bindIdCard">绑定实体卡</el-button><br>
<el-button type="primary" icon="el-icon-bank-card" round style="margin: 10px;width: 50%;height: 40px" @click="userRecharge">会员充值</el-button>
</div>
<div class="right">
<el-descriptions>
@ -39,7 +39,7 @@
<span style="color: #00afff" @click="secondCard">副卡管理</span>
</el-descriptions-item>
<el-descriptions-item label="会员等级">
<span style="color: #00afff" @click="userGrade">{{ grade.name }}</span>
{{ grade.name }}
</el-descriptions-item>
<el-descriptions-item label="储值优惠"></el-descriptions-item>
<el-descriptions-item label="每日笔数">
@ -293,8 +293,249 @@
</template>
</el-card>
<!-- 会员充值-->
<el-dialog width="75%" :close-on-click-modal="false" :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">
<div>
<el-row>
<el-col :span="24">
<div style="display: flex">
<div style="width: 7%;line-height: 40px">油品类型</div>
<el-radio-button>储值卡充值</el-radio-button>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div style="display: flex;margin: 20px 0">
<div style="height: 50px;line-height: 50px">充值金额</div>
<div class="mon"
v-for="(item,index) in storeCard" :key="index"
:class="activeKey === index ? 'select' : ''"
@click="recharge(index)">
<div class="top1"><span class="amount1">{{ item.recharge }}</span></div>
<div>赠送<span class="amount">{{ item.give }}</span></div>
</div>
</div>
<div style="width: 30%;margin-left: 7%"
:class="activeKey === 4 ? 'select' : ''"
@click="recharge(4)">
<el-input placeholder="请输入充值金额"
v-model="storeCardAmount.recharge">
<template slot="prepend">自定义</template>
<template slot="append"></template>
</el-input>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div style="display: flex;justify-content: space-between;margin: 20px 0">
<div class="jine">
<div class="zeng">赠送金额</div>
<div>
<el-input placeholder="0.00"
v-model="storeCardAmount.give"
disabled>
<template slot="append"></template>
</el-input>
<span class="bom">赠送金额 仅自定义金额模式下可手动输入赠送活动充值赠送金额不可手动更改</span>
</div>
</div>
<div class="jine">
<div class="zeng">赠加油金</div>
<div>
<el-input placeholder="0.00"
v-model="storeCardAmount.refuelMoney"
disabled>
<template slot="append"></template>
</el-input>
<span class="bom">赠送加油金金额 仅自定义金额模式下可手动输入赠送活动充值赠送金额不可手动更改</span>
</div>
</div>
<div class="jine">
<div class="zeng">赠送积分</div>
<div>
<el-input placeholder="0"
v-model="storeCardAmount.point"
disabled>
<template slot="append">积分</template>
</el-input>
<span class="bom">赠送积分 仅自定义金额模式下可手动输入,活动充值赠送积分不可手动更改[需开启积分活动有效]</span>
</div>
</div>
<div class="jine">
<div class="zeng">提成员工</div>
<div>
<el-input placeholder="请选择提成员工">
<template slot="append">选择员工</template>
</el-input>
<span class="bom">仅系统储值档次支持提成员工选择自定义充值金额暂不支持选择提成员工</span>
</div>
</div>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div style="display: flex">
<div style="width: 7%">充值备注</div>
<el-input
type="textarea"
placeholder=""
v-model="rechargeDesc"
maxlength="255"
show-word-limit
>
</el-input>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div style="display: flex;margin: 20px 0">
<div style="width: 7%">支付方式</div>
<div>
<el-radio v-model="payment" label="扫码支付" border>扫码支付</el-radio>
<el-radio v-model="payment" label="现金支付" border>现金支付</el-radio>
<el-radio v-model="payment" label="POS刷卡" border>POS刷卡</el-radio>
<el-radio v-model="payment" label="随便付" border>随便付</el-radio>
<el-radio v-model="payment" label="银行卡" border>银行卡</el-radio>
</div>
</div>
</el-col>
</el-row>
<div style="margin: 20px 0;text-align: center">
<el-button type="primary" @click="confirm">确认充值</el-button>
<el-button @click="cancel"> </el-button>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="升数卡" name="literCard">
<el-row>
<el-col :span="24">
<div style="display: flex">
<div style="width: 7%;line-height: 40px">油品类型</div>
<el-radio-group v-model="tabOilType" style="margin-bottom: 30px;">
<el-radio-button label="92">92#汽油</el-radio-button>
<el-radio-button label="95">95#汽油</el-radio-button>
</el-radio-group>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div style="display: flex;margin: 20px 0">
<div style="height: 50px;line-height: 50px;width: 8%">充值金额</div>
<div class="mon2"
v-for="(item,index) in literCard" :key="index"
:class="activeKey === index ? 'select' : ''"
@click="recharge(index)">
<div class="top1"><span class="amount1">{{ item.liter }}</span>L</div>
<div>售价<span class="amount">{{ item.amount }}</span></div>
<div>锁价<span class="amount">{{ item.lockPrice }}</span>/</div>
</div>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div style="display: flex;margin: 20px 0">
<div class="jine">
<div class="zeng">赠送积分</div>
<div>
<el-input placeholder="300" disabled>
<template slot="append">积分</template>
</el-input>
<span class="bom">升数卡充值不支持自定义积分,选择对应充值活动获得对应积分[需开启积分活动有效]</span>
</div>
</div>
<div style="display:flex;margin-left: 20px">
<div style="line-height: 40px;width: 20%">提成员工</div>
<div>
<el-input placeholder="请选择提成员工">
<template slot="append">选择员工</template>
</el-input>
</div>
</div>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div style="display: flex">
<div style="width: 7%">充值备注</div>
<el-input
type="textarea"
placeholder=""
v-model="rechargeDesc"
maxlength="255"
show-word-limit
>
</el-input>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div style="display: flex;margin: 20px 0">
<div style="width: 7%">支付方式</div>
<div>
<el-radio v-model="payment" label="扫码支付" border>扫码支付</el-radio>
<el-radio v-model="payment" label="现金" border>现金支付</el-radio>
<el-radio v-model="payment" label="POS刷卡" border>POS刷卡</el-radio>
<el-radio v-model="payment" label="随便付" border>随便付</el-radio>
<el-radio v-model="payment" label="银行卡" border>银行卡</el-radio>
</div>
</div>
</el-col>
</el-row>
<div style="margin: 20px 0;text-align: center">
<el-button type="primary" @click="confirm">确认充值</el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-tab-pane>
</el-tabs>
</template>
</el-dialog>
<!-- 更换手机号对话框-->
<!-- 确认充值-->
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="openConfirm" width="500px" append-to-body>
<div style="text-align: center;font-size: 15px;font-weight: bold">付款金额</div>
<div style="text-align: center;font-size: 30px;font-weight: bold;color: red;margin: 10px 0">
300.00
<el-tag
effect="dark">
汽油
</el-tag>
</div>
<div style="text-align: center;margin-bottom: 10px">赠送金额</div>
<div>
<el-input placeholder="扫描或输入付款码、支持微信、支付宝、云闪付">
<i
slot="suffix">
<svg t="1697791915471" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1479" width="32" height="32"><path d="M149.333333 170.858667A21.546667 21.546667 0 0 1 170.858667 149.333333H384V106.666667H170.858667A64.213333 64.213333 0 0 0 106.666667 170.858667V384h42.666666V170.858667zM170.858667 874.666667A21.546667 21.546667 0 0 1 149.333333 853.141333V640H106.666667v213.141333A64.213333 64.213333 0 0 0 170.858667 917.333333H384v-42.666666H170.858667zM853.12 149.333333A21.546667 21.546667 0 0 1 874.666667 170.858667V384h42.666666V170.858667A64.213333 64.213333 0 0 0 853.141333 106.666667H640v42.666666h213.141333zM874.666667 853.141333A21.546667 21.546667 0 0 1 853.141333 874.666667H640v42.666666h213.141333A64.213333 64.213333 0 0 0 917.333333 853.141333V640h-42.666666v213.141333zM106.666667 490.666667h810.666666v42.666666H106.666667v-42.666666z" fill="#3D3D3D" p-id="1480"></path></svg>
</i>
</el-input>
</div>
<div class="demo-image">
<div class="block" style="text-align: center">
<el-image
style="width: 200px; height: 200px"
fit="cover"
src="https://oil.wudb.cn/static/img/scan-demo.fcb8b1ab.png"></el-image>
</div>
</div>
<el-divider></el-divider>
<div style="display: flex;justify-content: space-around">
<el-button @click="cancelCollection">取消收款</el-button>
<el-button type="primary">确定收款</el-button>
</div>
</el-dialog>
<!-- 更换手机号对话框-->
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="openMobile" style="margin-top: 200px" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
@ -360,81 +601,20 @@
</div>
</el-dialog>
<!-- 会员成长值-->
<el-dialog :close-on-click-modal="false" width="60%" :title="title" :visible.sync="openUserGrade" append-to-body>
<!-- 绑定实体卡-->
<el-dialog :close-on-click-modal="false" :title="title" width="450px" :visible.sync="openBindIdCard" append-to-body>
<div style="text-align: center">
<img v-if="form.avatar" :src="form.avatar" style="width: 80px;height: 80px">
<img v-else src="@/assets/images/avatar.png" style="width: 80px;height: 80px">
</div>
<p class="idcard" style="color: #00afff">{{form.name}}</p>
<p class="idcard" style="font-size: 16px">{{form.mobile}}</p>
<p class="idcard" style="font-size: 16px">请绑定实体卡号</p>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="24">
<div style="display: flex;justify-content: center">
<div>
<img v-if="form.avatar" :src="form.avatar">
<img v-else src="@/assets/images/avatar.png">
</div>
<div style="height: 64px;line-height: 32px;width: 100px;margin-left: 20px;margin-bottom: 20px">
<div style="color: #00afff">{{form.name}}</div>
{{form.mobile}}
</div>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="当前成长值" prop="mobile">
<e-row>
<el-col :span="8">
<el-form-item prop="gasoline">
<el-input v-model="grade.gasoline" placeholder="1" disabled>
<template slot="prepend">汽油</template>
<template slot="append">成长值</template>
</el-input>
</el-form-item>
</el-col>
</e-row>
<e-row>
<el-col :span="8">
<el-form-item prop="dieselOil">
<el-input v-model="grade.dieselOil" placeholder="1" disabled>
<template slot="prepend">柴油</template>
<template slot="append">成长值</template>
</el-input>
</el-form-item>
</el-col>
</e-row>
<e-row>
<el-col :span="8">
<el-form-item prop="naturalGas">
<el-input v-model="grade.naturalGas" placeholder="1" disabled>
<template slot="prepend">天然气</template>
<template slot="append">成长值</template>
</el-input>
</el-form-item>
</el-col>
</e-row>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="操作类型" prop="type">
<el-radio-group v-model="type">
<el-radio label="add">增加</el-radio>
<el-radio label="reduce">减少</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="变动数值" prop="type">
<template>
<el-input-number v-model="num" controls-position="right" @change="handleChange" :min="1" :max="10"></el-input-number>
</template>
</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>
<div style="width: 80%;margin: 0 auto">
<el-input v-model="form.idcard" placeholder="请读卡或输入卡号"></el-input>
<p style="font-size: 12px;color: grey;">实体卡号最低5位且不可重复绑定后不可删除如需更换卡号请在会员详情页面内进行卡片重新绑定</p>
</div>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -562,15 +742,7 @@
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="24">
<el-form-item label="当前认证" prop="level" style="width: 420px">
<!-- <dict-tag :options="dict.type.zcrzdj" :value="form.fixingLevel"/>-->
<el-input v-model="form.fixingLevel" disabled />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="变更认证" prop="level" style="width: 420px">
<el-form-item label="变更认证" prop="fixingLevel" style="width: 420px">
<el-select
v-model="form.fixingLevel"
clearable
@ -601,11 +773,42 @@ import {getUser, updateUser} from "@/api/staff/user/user";
import {ljStoreInfo} from "@/api/staff/store";
import {getUserGrade} from "@/api/staff/user/usergrade";
import {getSysConfig} from "@/api/staff/user/sysconfig";
import item from "../../layout/components/Sidebar/Item.vue";
export default {
computed: {
item() {
return item
}
},
dicts: ['official','zhzt','zcrzdj'],
data(){
return{
//
storeCard:[
{recharge:300,give:3,refuelMoney:0,point:0},
{recharge:500,give:5},
{recharge:1000,give:10},
],
storeCardAmount:{
recharge:'',give:0,refuelMoney:0,point:0
},
//
literCard:[
{liter:73.75,amount:500,lockPrice:6.78,point:50},
{liter:151.98,amount:1000,lockPrice:6.58,point:100},
{liter:318.47,amount:2000,lockPrice:6.28,point:200},
{liter:493.42,amount:3000,lockPrice:6.08,point:300},
{liter:896.06,amount:5000,lockPrice:5.58,point:500},
{liter:1968.50,amount:10000,lockPrice:5.08,point:1000},
],
//
amount:'',
//
rechargeDesc:'',
//
payment:'扫码支付',
activeKey:0,
//
transaction:"",
config:'-1',
@ -615,15 +818,18 @@ export default {
title:'',
//
openMobile: false,
openRecharge: false,
openSecondCard:false,
openUserGrade:false,
openBindIdCard:false,
openSubCard:false,
openConfig:false,
openLevel:false,
openConfirm:false,
growthValue:'whole',
cardList:'notUse',
tabPosition: 'giftCard',
balanceRecord: 'first',
tabOilType: '92',
//
aboutSecondCard:[],
//
@ -637,6 +843,7 @@ export default {
grade:'',
activeName: 'refuelOrder',
subCardActive:'subCardManage',
activeRecharge:'balance',
tableData:[],
total:0,
queryParams: {
@ -653,6 +860,7 @@ export default {
rules: {
mobile: [{ required: true, message: "请输入手机号", trigger: "blur" }],
type: [{ required: true, message: "请选择操作类型", trigger: "blur" }],
fixingLevel: [{ required: true, message: "请选择认证信息", trigger: "blur" }],
}
}
},
@ -672,10 +880,10 @@ export default {
this.openSecondCard = true;
this.title = this.form.secondCard+'-副卡账户管理'
},
//
userGrade(){
this.openUserGrade = true;
this.title = '更换手机号'
//
bindIdCard(){
this.openBindIdCard = true;
this.title = '实体卡绑定'
},
//
subCard(){
@ -692,6 +900,16 @@ export default {
this.openLevel = true;
this.title = '固定等级(原专车认证)'
},
//
userRecharge(){
this.openRecharge = true;
this.title = '会员充值'
},
//
confirm(){
this.openConfirm = true;
this.title = this.payment
},
//
getInformation(){
getSysConfig('second_card').then(response => {
@ -717,27 +935,30 @@ export default {
this.store = response.data;
});
},
//
getGrade(id){
getUserGrade(id).then(response => {
this.grade = response.data;
});
},
//
recharge(index){
this.activeKey = index;
},
//
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
console.log(this.form)
if (this.form.id) {
updateUser(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.openMobile = false;
this.openConfig = false;
this.openLevel = false;
this.openBindIdCard = false;
this.getUserInfo();
});
} else {
// addUser(this.form).then(response => {
// this.$modal.msgSuccess("");
// this.open = false;
// this.getList();
// });
}
}
});
@ -750,9 +971,13 @@ export default {
//
cancel() {
this.openMobile = false;
this.openUserGrade = false;
this.openConfig = false;
this.openLevel = false;
this.openBindIdCard = false;
this.openRecharge = false;
},
cancelCollection(){
this.openConfirm = false;
},
handleClick(tab, event) {
console.log(tab, event);
@ -764,6 +989,7 @@ export default {
goBack() {
this.$router.back(-1);
}
//
}
}
</script>
@ -790,4 +1016,78 @@ export default {
margin-top: 10px;
padding-top: 30px;
}
.idcard{
text-align: center;
font-weight: bold
}
.mon{
width: 20%;
height: 50px;
border: 0.5px #dadfe6 solid;
line-height: 25px;
border-radius: 5px;
text-align: center;
margin: 0 10px;
}
.select {
position: relative;
background-color: #fff;
box-shadow: 0px 2px 7px 0px rgba(85, 110, 97, 0.35);
border-radius: 5px;
border: 1px solid #00aaff;
}
.select:before {
content: '';
position: absolute;
right: 0;
bottom: 0;
border: 10px solid #00aaff;
border-top-color: transparent;
border-left-color: transparent;
}
.select:after {
content: '';
width: 4px;
height: 6px;
position: absolute;
right: 4px;
bottom: 3px;
border: 2px solid #fff;
border-top-color: transparent;
border-left-color: transparent;
transform: rotate(45deg);
}
.amount{
color: #00afff;
}
.amount1{
color: #00afff;
font-size: 20px;
}
.top1{
font-size: 16px;
}
.jine{
width: 24%;
display: flex;
}
.bom{
font-size: 12px;
color: grey;
}
.zeng{
width: 95%;
line-height: 40px;
}
.mon2{
width: 20%;
height: 75px;
border: 0.5px #dadfe6 solid;
line-height: 25px;
border-radius: 5px;
text-align: center;
margin: 0 10px;
}
</style>

View File

@ -157,7 +157,7 @@
<dict-tag :options="dict.type.yhlx" :value="scope.row.preferential"/>
</template>
</el-table-column>
<el-table-column label="特权信息" >
<el-table-column label="特权信息" width="180">
<template slot-scope="scope">
<div v-show="scope.row.preferential=='自定义优惠'">
<p>

View File

@ -1,10 +1,9 @@
package com.fuint.business.member.controller;
import com.fuint.business.member.entity.LJDuty;
import com.fuint.business.member.service.ILJDutyService;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import io.swagger.models.auth.In;
import com.fuint.system.role.entity.TDuty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@ -28,7 +27,7 @@ public class LjDutyController extends BaseController {
*/
@GetMapping("/list")
public ResponseObject list(){
List<LJDuty> list = dutyService.selectDutyList();
List<TDuty> list = dutyService.selectDutyList();
return getSuccessResult(list);
}
@ -39,7 +38,7 @@ public class LjDutyController extends BaseController {
*/
@GetMapping("/{id}")
public ResponseObject dutyInfo(@PathVariable Integer id){
LJDuty duty = dutyService.selectDutyById(id);
TDuty duty = dutyService.selectDutyById(id);
return getSuccessResult(duty);
}
}

View File

@ -1,47 +0,0 @@
package com.fuint.business.member.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.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.util.Date;
/**
* 角色表
*
* Created by FSQ
* CopyRight https://www.fuint.cn
*/
@Getter
@Setter
@TableName("t_duty")
@ApiModel(value = "TDuty对象", description = "角色表")
public class LJDuty extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("角色ID")
@TableId(value = "duty_id", type = IdType.AUTO)
private Integer dutyId;
@ApiModelProperty("商户ID")
private Integer merchantId;
@ApiModelProperty("角色名称")
private String dutyName;
@ApiModelProperty("状态(A: 可用 D: 禁用)")
private String status;
@ApiModelProperty("描述")
private String description;
@ApiModelProperty("角色类型")
private String dutyType;
}

View File

@ -1,7 +1,7 @@
package com.fuint.business.member.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fuint.business.member.entity.LJDuty;
import com.fuint.system.role.entity.TDuty;
public interface LJDutyMapper extends BaseMapper<LJDuty> {
public interface LJDutyMapper extends BaseMapper<TDuty> {
}

View File

@ -1,24 +1,24 @@
package com.fuint.business.member.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.member.entity.LJDuty;
import com.fuint.system.role.entity.TDuty;
import java.util.List;
/**
* 角色信息 业务层
*/
public interface ILJDutyService extends IService<LJDuty> {
public interface ILJDutyService extends IService<TDuty> {
/**
* 查询角色信息
* @return
*/
public List<LJDuty> selectDutyList();
public List<TDuty> selectDutyList();
/**
* 根据id查询角色信息
* @param id
* @return
*/
public LJDuty selectDutyById(int id);
public TDuty selectDutyById(int id);
}

View File

@ -1,21 +1,21 @@
package com.fuint.business.member.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.member.entity.LJDuty;
import com.fuint.business.member.mapper.LJDutyMapper;
import com.fuint.business.member.service.ILJDutyService;
import com.fuint.system.role.entity.TDuty;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class LJDutyServiceImpl extends ServiceImpl<LJDutyMapper, LJDuty> implements ILJDutyService {
public class LJDutyServiceImpl extends ServiceImpl<LJDutyMapper, TDuty> implements ILJDutyService {
/**
* 查询角色信息
* @return
*/
@Override
public List<LJDuty> selectDutyList() {
public List<TDuty> selectDutyList() {
return baseMapper.selectList(null);
}
@ -25,7 +25,7 @@ public class LJDutyServiceImpl extends ServiceImpl<LJDutyMapper, LJDuty> impleme
* @return
*/
@Override
public LJDuty selectDutyById(int id) {
public TDuty selectDutyById(int id) {
return baseMapper.selectById(id);
}
}

View File

@ -20,7 +20,9 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/excel")
@ -34,6 +36,11 @@ public class ExportController extends BaseController{
@RequestMapping("/import")
public ResponseObject myImport(MultipartFile file) throws IOException {
Map<String,Integer> map = new HashMap<>();
int success = 0;
int error = 0;
int repeat = 0;
int total = 0;
try {
//获取文件名
String filename = file.getOriginalFilename();
@ -45,17 +52,32 @@ public class ExportController extends BaseController{
EasyExcelFactory.read(inputStream, LJUser.class, listener).headRowNumber(1).build().readAll();
//获取数据
List<Object> list = listener.getDatas();
total = list.size();
if (list.size() > 1) {
for (int i = 0; i < list.size(); i++) {
LJUser user = (LJUser) list.get(i);
//使用mybatis-plus添加到数据库
service.insertUser(user);
LJUser user1 = service.selectUserByMobile(user.getMobile());
if (user1!=null){
repeat += 1;
}else {
//使用mybatis-plus添加到数据库
int row = service.insertUser(user);
if (row == 1){
success++;
}else {
error++;
}
}
}
}
map.put("total",total);
map.put("success",success);
map.put("error",error);
map.put("repeat",repeat);
} catch (Exception e) {
e.printStackTrace();
}
return getSuccessResult("OK");
return getSuccessResult(map);
}

View File

@ -34,126 +34,120 @@ public class LJUser extends BaseEntity implements Serializable {
@ApiModelProperty("会员ID")
@TableId(value = "ID", type = IdType.AUTO)
@ExcelProperty(index = 0,value = "id")
private Integer id;
@ApiModelProperty("会员号")
@ExcelProperty(index = 1,value = "会员号")
@ExcelProperty(value = "会员号")
private String userNo;
@ApiModelProperty("头像")
@ExcelProperty(index = 2,value = "头像")
private String avatar;
@ApiModelProperty("称呼")
@ExcelProperty(index = 3,value = "称呼")
@ExcelProperty(value = "称呼")
private String name;
@ApiModelProperty("微信open_id")
@ExcelProperty(index = 4,value = "微信open_id")
@ApiModelProperty("微信")
@ExcelProperty(value = "微信")
private String openId;
@ApiModelProperty("手机号码")
@ExcelProperty(index = 5,value = "手机号码")
@ExcelProperty(value = "手机号码")
private String mobile;
@ApiModelProperty("证件号码")
@ExcelProperty(index = 6,value = "证件号码")
@ExcelProperty(value = "证件号码")
private String idcard;
@ApiModelProperty("等级ID")
@ExcelProperty(index = 7,value = "等级ID")
@ExcelProperty(value = "等级ID")
private String gradeId;
@ApiModelProperty("会员开始时间")
@TableField(strategy = FieldStrategy.IGNORED)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ExcelProperty(index = 8,value = "会员开始时间")
private Date startTime;
@ApiModelProperty("会员结束时间")
@TableField(strategy=FieldStrategy.IGNORED)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ExcelProperty(index = 9,value = "会员结束时间")
private Date endTime;
@ApiModelProperty("余额")
@ExcelProperty(index = 10,value = "余额")
@ExcelProperty(value = "余额")
private BigDecimal balance;
@ApiModelProperty("积分")
@ExcelProperty(index = 11,value = "积分")
@ExcelProperty(value = "积分")
private Integer point;
@ApiModelProperty("性别 1男0女")
@ExcelProperty(index = 12,value = "性别 1男0女")
@ExcelProperty(value = "性别 1男0女")
private Integer sex;
@ApiModelProperty("出生日期")
@ExcelProperty(index = 13,value = "出生日期")
@ExcelProperty(value = "出生日期")
private String birthday;
@ApiModelProperty("车牌号")
@ExcelProperty(index = 14,value = "车牌号")
@ExcelProperty(value = "车牌号")
private String carNo;
@ApiModelProperty("来源渠道")
@ExcelProperty(index = 15,value = "来源渠道")
@ExcelProperty(value = "来源渠道")
private String source;
@ApiModelProperty("密码")
@ExcelProperty(index = 16,value = "密码")
@ExcelProperty(value = "密码")
private String password;
@ApiModelProperty("salt")
@ExcelProperty(index = 17,value = "salt")
@ExcelProperty(value = "salt")
private String salt;
@ApiModelProperty("地址")
@ExcelProperty(index = 18,value = "地址")
@ExcelProperty(value = "地址")
private String address;
@ApiModelProperty("所属商户ID")
@ExcelProperty(index = 19,value = "所属商户ID")
@ExcelProperty(value = "所属商户ID")
private Integer merchantId;
@ApiModelProperty("默认店铺")
@ExcelProperty(index = 20,value = "默认店铺")
@ExcelProperty(value = "默认店铺")
private Integer storeId;
@ApiModelProperty("状态A激活N禁用D删除")
@ExcelProperty(index = 21,value = "状态")
private String status;
@ApiModelProperty("备注信息")
@ExcelProperty(index = 22,value = "备注信息")
@ExcelProperty(value = "备注信息")
private String description;
@ApiModelProperty("最后操作人")
@ExcelProperty(index = 23,value = "最后操作人")
private String operator;
@ApiModelProperty("升数卡")
@ExcelProperty(index = 24,value = "升数卡")
@ExcelProperty(value = "升数卡")
private BigDecimal literCard;
@ApiModelProperty("公众号")
@ExcelProperty(index = 25,value = "公众号")
@ExcelProperty(value = "公众号")
private String official;
@ApiModelProperty("加油金")
@ExcelProperty(index = 26,value = "加油金")
@ExcelProperty(value = "加油金")
private BigDecimal refuelMoney;
@ApiModelProperty("加油次数")
@ExcelProperty(index = 27,value = "加油次数")
@ExcelProperty(value = "加油次数")
private BigDecimal consumeNum;
@ApiModelProperty("副卡信息")
@ExcelProperty(index = 28,value = "副卡信息")
@ExcelProperty(value = "副卡信息")
private String secondCard;
@ApiModelProperty("固定等级")
@ExcelProperty(index = 29,value = "固定等级")
@ExcelProperty(value = "固定等级")
private String fixingLevel;
}

View File

@ -1,11 +1,12 @@
package com.fuint.business.userManager.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.userManager.entity.ChainStoreConfig;
/**
* 连锁店配置信息 业务层
*/
public interface ChainStoreConfigService {
public interface ChainStoreConfigService extends IService<ChainStoreConfig> {
/**
* 根据id查询连锁店配置信息
* @return

View File

@ -2,12 +2,13 @@ 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.LJUserGrade;
/**
* 会员等级信息 业务层
*/
public interface LJUserGradeService {
public interface LJUserGradeService extends IService<LJUserGrade> {
/**
* 根据条件分页查询员工信息
* @param page

View File

@ -2,6 +2,7 @@ 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.LJUser;
import java.util.Map;
@ -9,7 +10,7 @@ import java.util.Map;
/**
* 会员信息 业务层
*/
public interface LJUserService {
public interface LJUserService extends IService<LJUser> {
/**
* 根据条件分页查询会员信息
* @param page
@ -30,6 +31,13 @@ public interface LJUserService {
*/
public LJUser selectUserById(int id);
/**
* 根据手机号查询会员信息
* @param mobile
* @return
*/
public LJUser selectUserByMobile(String mobile);
/**
* 根据id删除会员信息
* @param id

View File

@ -82,6 +82,18 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
return baseMapper.selectById(id);
}
/**
* 根据手机号查询会员信息
* @param mobile
* @return
*/
@Override
public LJUser selectUserByMobile(String mobile) {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("mobile",mobile);
return baseMapper.selectOne(queryWrapper);
}
/**
* 根据id删除会员信息
* @param id
@ -101,6 +113,9 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
user.setStoreId(storeId);
if (user.getMobile()==null || user.getMobile().equals("")){
return 0;
}
if (user.getUserNo()==null || user.getUserNo().equals("")){
// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
// String timestamp = dateFormat.format(new Date());

View File

@ -0,0 +1,71 @@
package com.fuint.business.userManager.util;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
import java.util.Objects;
/**
* Excel工具类
*/
public class ExcelUtil {
protected static final Logger logger = LoggerFactory.getLogger(ExcelUtil.class);
private static final String XLS = "xls";
private static final String XLSX = "xlsx";
private static final String SPLIT = ".";
// 获取Excel表信息
public static Workbook getWorkbook(MultipartFile file) {
Workbook workbook = null;
try {
// 获取Excel后缀名
String fileName = file.getOriginalFilename();
if (StringUtils.isEmpty(fileName) || fileName.lastIndexOf(SPLIT) < 0) {
logger.warn("解析Excel失败因为获取到的Excel文件名非法");
return null;
}
String fileType = fileName.substring(fileName.lastIndexOf(SPLIT) + 1);
// 获取Excel工作簿
if (fileType.equalsIgnoreCase(XLS)) {
workbook = new HSSFWorkbook(file.getInputStream());
} else if (fileType.equalsIgnoreCase(XLSX)) {
workbook = new XSSFWorkbook(file.getInputStream());
}
} catch (IOException e) {
e.printStackTrace();
}
return workbook;
}
// 获取Excel表头信息
public static List<String> getSheetTitles(Workbook workbook) {
// 拿第一个sheet表
Sheet sheet = workbook.getSheetAt(0);
// 校验sheet是否合法
if (Objects.isNull(sheet)) {
return null;
}
// 获取第一行数据假如第一行就是列名
Row sheetTitleRow = sheet.getRow(sheet.getFirstRowNum());
// 取出最后一列
short lastCellNum = sheetTitleRow.getLastCellNum();
List<String> sheetTitleList = new LinkedList<>();
for (int i = 0; i < lastCellNum; i++) {
// 取出每一列的名
String cellValue = sheetTitleRow.getCell(i).getStringCellValue();
sheetTitleList.add(cellValue);
}
return sheetTitleList;
}
}