Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
c19f1bbbb1
@ -34,6 +34,15 @@ export function addCertifiedMember(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 批量新增固定等级
|
||||||
|
export function addCertifiedMembers(data) {
|
||||||
|
return request({
|
||||||
|
url: '/business/userManager/certifiedMember/members',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 修改固定等级
|
// 修改固定等级
|
||||||
export function updateCertifiedMember(data) {
|
export function updateCertifiedMember(data) {
|
||||||
return request({
|
return request({
|
||||||
|
@ -102,7 +102,15 @@
|
|||||||
@click="handleAddMember"
|
@click="handleAddMember"
|
||||||
v-hasPermi="['member:add']"
|
v-hasPermi="['member:add']"
|
||||||
>新增用户认证</el-button>
|
>新增用户认证</el-button>
|
||||||
<el-table ref="tables" v-loading="loading" :data="listMember" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
icon="el-icon-document-copy"
|
||||||
|
@click="handleAddMembers"
|
||||||
|
v-hasPermi="['member:add']"
|
||||||
|
>新增用户认证</el-button>
|
||||||
|
<el-table ref="tables" v-loading="loading" :data="listMember"
|
||||||
|
@selection-change="handleSelectionChange" :default-sort="defaultSort"
|
||||||
|
@sort-change="handleSortChange">
|
||||||
<el-table-column label="认证类型" prop="fixingLevelId" align="center">
|
<el-table-column label="认证类型" prop="fixingLevelId" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ scope.row.fixingLevelId ? getName(fixingLevelList, scope.row.fixingLevelId) : '-' }}</span>
|
<span>{{ scope.row.fixingLevelId ? getName(fixingLevelList, scope.row.fixingLevelId) : '-' }}</span>
|
||||||
@ -116,7 +124,11 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="姓名" align="center" prop="name" />
|
<el-table-column label="姓名" align="center" prop="name" />
|
||||||
<el-table-column label="车牌号" align="center" prop="carNumber"/>
|
<el-table-column label="车牌号" align="center" prop="carNumber"/>
|
||||||
<el-table-column label="认证资料" align="center" prop="attestationData"/>
|
<el-table-column label="认证资料" align="center" prop="attestationData">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<!-- {{scope.row}}-->
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="备注" align="center" prop="remark"/>
|
<el-table-column label="备注" align="center" prop="remark"/>
|
||||||
<el-table-column label="状态" align="center" prop="status">
|
<el-table-column label="状态" align="center" prop="status">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@ -316,6 +328,71 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
|
<!-- 批量添加用户认证信息 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="openMembers"
|
||||||
|
:close-on-click-modal="false" append-to-body>
|
||||||
|
<el-form ref="form2" :model="form2" :rules="rules2">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="认证类型" prop="fixingLevelId">
|
||||||
|
<el-select
|
||||||
|
v-model="form2.fixingLevelId"
|
||||||
|
placeholder="请选择"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
<el-option v-for="item in fixingLevelList" :key="item.id+''" :label="item.name" :value="item.id"/>
|
||||||
|
</el-select>
|
||||||
|
<div>
|
||||||
|
<div style="color: grey;font-size: 12px;height: 18px;margin-left: 8%">
|
||||||
|
认证会员类型,每个会员仅支持认证一个类型
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="手机号" prop="mobile">
|
||||||
|
<el-input v-model="form2.mobile"
|
||||||
|
type="textarea"
|
||||||
|
maxlength="12000"
|
||||||
|
style="width: 85%;height: 300px;:deep(.el-textarea__inner){height: 300px;}
|
||||||
|
:deep(.el-input__wrapper){height:300px;}"
|
||||||
|
show-word-limit
|
||||||
|
placeholder="请输入会员手机号,多个手机号换行操作,每行一个会员手机号!单次最大支持1000个会员手机号认证~">
|
||||||
|
</el-input>
|
||||||
|
<div>
|
||||||
|
<div style="color: grey;font-size: 12px;height: 18px;margin-left: 8%">
|
||||||
|
多个会员手机号换行操作,每行为一个会员手机号,单次最大支持1000个会员手机号认证,请确保用户手机号已注册为油站会员(在会员列表已显示),否则无法添加认证信息
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitFormMembers">确 定</el-button>
|
||||||
|
<el-button @click="cancelMembers">取 消</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.certified}}</span> 人
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 添加用户认证或修改对话框 -->
|
<!-- 添加用户认证或修改对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="openMember"
|
<el-dialog :title="title" :visible.sync="openMember"
|
||||||
:close-on-click-modal="false" append-to-body>
|
:close-on-click-modal="false" append-to-body>
|
||||||
@ -375,15 +452,16 @@
|
|||||||
<el-form-item label="认证图片1" prop="photo1">
|
<el-form-item label="认证图片1" prop="photo1">
|
||||||
<div>
|
<div>
|
||||||
<el-upload
|
<el-upload
|
||||||
action="https://jsonplaceholder.typicode.com/posts/"
|
action="/dev-api/picture/upload"
|
||||||
|
:show-file-list="false"
|
||||||
list-type="picture-card"
|
list-type="picture-card"
|
||||||
:on-preview="handlePictureCardPreview"
|
:on-success="handleAvatarSuccess1"
|
||||||
:on-remove="handleRemove">
|
:on-change="onChange"
|
||||||
<i class="el-icon-plus"></i>
|
ref="upload"
|
||||||
|
>
|
||||||
|
<img v-if="imageUrl.imageUrl1" :src="imageUrl.imageUrl1" class="avatar">
|
||||||
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<el-dialog :visible.sync="dialogVisible">
|
|
||||||
<img width="100%" :src="dialogImageUrl" alt="">
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -391,15 +469,16 @@
|
|||||||
<el-form-item label="认证图片2" prop="photo2">
|
<el-form-item label="认证图片2" prop="photo2">
|
||||||
<div>
|
<div>
|
||||||
<el-upload
|
<el-upload
|
||||||
action="https://jsonplaceholder.typicode.com/posts/"
|
action="/dev-api/picture/upload"
|
||||||
|
:show-file-list="false"
|
||||||
list-type="picture-card"
|
list-type="picture-card"
|
||||||
:on-preview="handlePictureCardPreview"
|
:on-success="handleAvatarSuccess2"
|
||||||
:on-remove="handleRemove">
|
:on-change="onChange"
|
||||||
<i class="el-icon-plus"></i>
|
ref="upload"
|
||||||
|
>
|
||||||
|
<img v-if="imageUrl.imageUrl2" :src="imageUrl.imageUrl2" class="avatar">
|
||||||
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<el-dialog :visible.sync="dialogVisible">
|
|
||||||
<img width="100%" :src="dialogImageUrl" alt="">
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -407,15 +486,16 @@
|
|||||||
<el-form-item label="认证图片3" prop="photo3">
|
<el-form-item label="认证图片3" prop="photo3">
|
||||||
<div>
|
<div>
|
||||||
<el-upload
|
<el-upload
|
||||||
action="https://jsonplaceholder.typicode.com/posts/"
|
action="/dev-api/picture/upload"
|
||||||
|
:show-file-list="false"
|
||||||
list-type="picture-card"
|
list-type="picture-card"
|
||||||
:on-preview="handlePictureCardPreview"
|
:on-success="handleAvatarSuccess3"
|
||||||
:on-remove="handleRemove">
|
:on-change="onChange"
|
||||||
<i class="el-icon-plus"></i>
|
ref="upload"
|
||||||
|
>
|
||||||
|
<img v-if="imageUrl.imageUrl3" :src="imageUrl.imageUrl3" class="avatar">
|
||||||
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<el-dialog :visible.sync="dialogVisible">
|
|
||||||
<img width="100%" :src="dialogImageUrl" alt="">
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -725,7 +805,7 @@ import {
|
|||||||
updateFixingLevel
|
updateFixingLevel
|
||||||
} from "@/api/staff/user/fixinglevel";
|
} from "@/api/staff/user/fixinglevel";
|
||||||
import {
|
import {
|
||||||
addCertifiedMember,
|
addCertifiedMember, addCertifiedMembers,
|
||||||
delCertifiedMember,
|
delCertifiedMember,
|
||||||
getCertifiedMember, getCertifiedMemberByUserId,
|
getCertifiedMember, getCertifiedMemberByUserId,
|
||||||
listCertifiedMember,
|
listCertifiedMember,
|
||||||
@ -737,10 +817,14 @@ export default {
|
|||||||
dicts: ['yhlx','yes_or_no','zhzt','yhhdz','rzzt'],
|
dicts: ['yhlx','yes_or_no','zhzt','yhhdz','rzzt'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
result:{},
|
||||||
isEdit:false,
|
isEdit:false,
|
||||||
// 上传图片信息
|
// 上传图片信息
|
||||||
dialogImageUrl: '',
|
imageUrl: {
|
||||||
dialogVisible: false,
|
imageUrl1: '',
|
||||||
|
imageUrl2: '',
|
||||||
|
imageUrl3: '',
|
||||||
|
},
|
||||||
mobile:'',
|
mobile:'',
|
||||||
activeName: 'member',
|
activeName: 'member',
|
||||||
// 显示搜索条件
|
// 显示搜索条件
|
||||||
@ -787,6 +871,8 @@ export default {
|
|||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
open: false,
|
open: false,
|
||||||
openMember: false,
|
openMember: false,
|
||||||
|
openMembers: false,
|
||||||
|
openResult: false,
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {
|
form: {
|
||||||
id: '', name: '',discountType:'自定义优惠',gasolineDiscount:'无优惠',
|
id: '', name: '',discountType:'自定义优惠',gasolineDiscount:'无优惠',
|
||||||
@ -798,6 +884,7 @@ export default {
|
|||||||
id: '', name: '',mobile:'',carNumber:'',userId:'',
|
id: '', name: '',mobile:'',carNumber:'',userId:'',
|
||||||
attestationData:'',remark:'',status: 'enable'
|
attestationData:'',remark:'',status: 'enable'
|
||||||
},
|
},
|
||||||
|
form2:{},
|
||||||
// 优惠值
|
// 优惠值
|
||||||
gasolinePreferential:[
|
gasolinePreferential:[
|
||||||
{
|
{
|
||||||
@ -871,7 +958,16 @@ export default {
|
|||||||
status: [
|
status: [
|
||||||
{ required: true, message: "请选择认证状态", trigger: "blur" },
|
{ required: true, message: "请选择认证状态", trigger: "blur" },
|
||||||
],
|
],
|
||||||
}
|
},
|
||||||
|
// 表单校验
|
||||||
|
rules2: {
|
||||||
|
mobile: [
|
||||||
|
{ required: true, message: "请填写认证手机号", trigger: "blur" },
|
||||||
|
],
|
||||||
|
fixingLevelId: [
|
||||||
|
{ required: true, message: "请选择认证类型", trigger: "blur" },
|
||||||
|
],
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -880,13 +976,6 @@ export default {
|
|||||||
this.getUserList();
|
this.getUserList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
checkMobile(){
|
|
||||||
getUserMobile({mobile:this.form1.mobile}).then( response => {
|
|
||||||
if (response.data==null){
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleClick(tab, event) {
|
handleClick(tab, event) {
|
||||||
// console.log(tab, event);
|
// console.log(tab, event);
|
||||||
},
|
},
|
||||||
@ -963,8 +1052,17 @@ export default {
|
|||||||
id: '', name: '',mobile:'',carNumber:'',userId:'',
|
id: '', name: '',mobile:'',carNumber:'',userId:'',
|
||||||
attestationData:'',remark:'',status: 'enable'
|
attestationData:'',remark:'',status: 'enable'
|
||||||
};
|
};
|
||||||
|
this.imageUrl={
|
||||||
|
imageUrl1 : "",
|
||||||
|
imageUrl2 : "",
|
||||||
|
imageUrl3 : "",
|
||||||
|
};
|
||||||
this.resetForm("form1");
|
this.resetForm("form1");
|
||||||
},
|
},
|
||||||
|
reset2() {
|
||||||
|
this.form2 = {};
|
||||||
|
this.resetForm("form2");
|
||||||
|
},
|
||||||
// 新增按钮操作
|
// 新增按钮操作
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.open = true;
|
this.open = true;
|
||||||
@ -975,6 +1073,37 @@ export default {
|
|||||||
this.openMember = true;
|
this.openMember = true;
|
||||||
this.title = "新增用户认证";
|
this.title = "新增用户认证";
|
||||||
},
|
},
|
||||||
|
handleAvatarSuccess1(res, file) {
|
||||||
|
// this.imageUrl.imageUrl1 = `/dev-api/uploadImages/certifiedImage/file.jpg`
|
||||||
|
this.imageUrl.imageUrl1 = URL.createObjectURL(file.raw);
|
||||||
|
},
|
||||||
|
handleAvatarSuccess2(res, file) {
|
||||||
|
this.imageUrl.imageUrl2 = URL.createObjectURL(file.raw);
|
||||||
|
},
|
||||||
|
handleAvatarSuccess3(res, file) {
|
||||||
|
this.imageUrl.imageUrl3 = URL.createObjectURL(file.raw);
|
||||||
|
},
|
||||||
|
onChange (file,fileList) {
|
||||||
|
if(file){
|
||||||
|
const suffix = file.name.split('.')[1]
|
||||||
|
const size = file.size / 1024 / 1024 < 2
|
||||||
|
if(['png','jpeg','jpg'].indexOf(suffix) < 0){
|
||||||
|
this.$message.error('上传图片只支持 png、jpeg、jpg 格式!')
|
||||||
|
this.$refs.upload.clearFiles()
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if(!size){
|
||||||
|
this.$message.error('上传文件大小不能超过 2MB!')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return file
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 新增按钮操作
|
||||||
|
handleAddMembers() {
|
||||||
|
this.openMembers = true;
|
||||||
|
this.title = "批量用户认证";
|
||||||
|
},
|
||||||
// 修改按钮操作
|
// 修改按钮操作
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
@ -994,6 +1123,7 @@ export default {
|
|||||||
this.form1 = response.data;
|
this.form1 = response.data;
|
||||||
this.openMember = true;
|
this.openMember = true;
|
||||||
this.title = "编辑用户认证";
|
this.title = "编辑用户认证";
|
||||||
|
this.imageUrl = JSON.parse(this.form1.attestationData)
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
@ -1007,7 +1137,12 @@ export default {
|
|||||||
this.reset1();
|
this.reset1();
|
||||||
this.isEdit = false;
|
this.isEdit = false;
|
||||||
},
|
},
|
||||||
// 提交按钮
|
// 取消按钮
|
||||||
|
cancelMembers() {
|
||||||
|
this.openMembers = false;
|
||||||
|
this.reset2();
|
||||||
|
},
|
||||||
|
// 提交按钮 固定等级
|
||||||
submitForm: function() {
|
submitForm: function() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
@ -1030,10 +1165,11 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 提交按钮
|
// 提交按钮 单个认证会员信息
|
||||||
submitFormMember: function() {
|
submitFormMember: function() {
|
||||||
this.$refs["form1"].validate(valid => {
|
this.$refs["form1"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
this.form1.attestationData = JSON.stringify(this.imageUrl)
|
||||||
if (this.form1.id) {
|
if (this.form1.id) {
|
||||||
updateCertifiedMember(this.form1).then(response => {
|
updateCertifiedMember(this.form1).then(response => {
|
||||||
this.$modal.msgSuccess("用户认证信息更新成功");
|
this.$modal.msgSuccess("用户认证信息更新成功");
|
||||||
@ -1065,6 +1201,20 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 提交按钮 批量认证会员信息
|
||||||
|
submitFormMembers: function() {
|
||||||
|
this.$refs["form2"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
addCertifiedMembers(this.form2).then(response => {
|
||||||
|
this.openMembers = false;
|
||||||
|
this.openResult = true;
|
||||||
|
this.title = "会员认证结果";
|
||||||
|
this.result = response.data;
|
||||||
|
this.reset2();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
// 删除按钮操作
|
// 删除按钮操作
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const name = row.name
|
const name = row.name
|
||||||
@ -1087,13 +1237,6 @@ export default {
|
|||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
},
|
},
|
||||||
handleRemove(file, fileList) {
|
|
||||||
// console.log(file, fileList);
|
|
||||||
},
|
|
||||||
handlePictureCardPreview(file) {
|
|
||||||
this.dialogImageUrl = file.url;
|
|
||||||
this.dialogVisible = true;
|
|
||||||
},
|
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.id)
|
this.ids = selection.map(item => item.id)
|
||||||
@ -1148,10 +1291,23 @@ export default {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
background: #f6f8f9;
|
background: #f6f8f9;
|
||||||
}
|
}
|
||||||
|
.huiyuan{
|
||||||
|
height: 30px;
|
||||||
|
line-height: 30px;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
.num{
|
||||||
|
font-weight: bold;
|
||||||
|
color: red;
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
.roll-dialog ::v-deep .el-dialog .el-dialog__body {
|
.roll-dialog ::v-deep .el-dialog .el-dialog__body {
|
||||||
padding: 3px 30px;
|
padding: 3px 30px;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
height: 500px;
|
height: 500px;
|
||||||
}
|
}
|
||||||
|
.avatar{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -162,7 +162,9 @@
|
|||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['member:add']"
|
v-hasPermi="['member:add']"
|
||||||
>新增会员</el-button>
|
>新增会员</el-button>
|
||||||
<el-table ref="tables" v-loading="loading" :data="list" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
|
<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="会员ID" prop="id" align="center" width="60"/>
|
||||||
<el-table-column label="头像" align="center" width="70">
|
<el-table-column label="头像" align="center" width="70">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
@ -152,6 +152,13 @@
|
|||||||
<artifactId>poi-ooxml</artifactId>
|
<artifactId>poi-ooxml</artifactId>
|
||||||
<version>3.17</version>
|
<version>3.17</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 上传图片-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-fileupload</groupId>
|
||||||
|
<artifactId>commons-fileupload</artifactId>
|
||||||
|
<version>1.4</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
@ -10,6 +10,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 固定等级 controller层
|
* 固定等级 controller层
|
||||||
*/
|
*/
|
||||||
@ -77,6 +80,40 @@ public class CertifiedMemberController extends BaseController {
|
|||||||
return getSuccessResult(certifiedMemberService.insertCertifiedMember(certifiedMember));
|
return getSuccessResult(certifiedMemberService.insertCertifiedMember(certifiedMember));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加固定等级信息
|
||||||
|
* @param map
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/members")
|
||||||
|
public ResponseObject addMembers(@Validated @RequestBody Map<String ,String > map){
|
||||||
|
Map<String ,Object > map1 = new HashMap<>();
|
||||||
|
int error = 0;
|
||||||
|
int certified = 0;
|
||||||
|
int success = 0;
|
||||||
|
int total = 0;
|
||||||
|
CertifiedMember certifiedMember = new CertifiedMember();
|
||||||
|
certifiedMember.setFixingLevelId(Integer.parseInt(map.get("fixingLevelId")));
|
||||||
|
String[] mobiles = map.get("mobile").split("\n");
|
||||||
|
for (String mobile : mobiles) {
|
||||||
|
total++;
|
||||||
|
certifiedMember.setMobile(mobile);
|
||||||
|
int row = certifiedMemberService.insertCertifiedMember(certifiedMember);
|
||||||
|
if (row==1){
|
||||||
|
success++;
|
||||||
|
} else if (row==2 || row==3) {
|
||||||
|
error++;
|
||||||
|
}else {
|
||||||
|
certified++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
map1.put("success",success);
|
||||||
|
map1.put("error",error);
|
||||||
|
map1.put("certified",certified);
|
||||||
|
map1.put("total",total);
|
||||||
|
return getSuccessResult(map1);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改固定等级信息
|
* 修改固定等级信息
|
||||||
* @param certifiedMember
|
* @param certifiedMember
|
||||||
|
@ -0,0 +1,41 @@
|
|||||||
|
package com.fuint.business.userManager.controller;
|
||||||
|
|
||||||
|
import com.fuint.framework.web.BaseController;
|
||||||
|
import com.fuint.framework.web.ResponseObject;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/picture")
|
||||||
|
public class FileUploadController extends BaseController {
|
||||||
|
@PostMapping("/upload")
|
||||||
|
public ResponseObject handleFileUpload(@RequestParam("file") MultipartFile file) {
|
||||||
|
if (!file.isEmpty()) {
|
||||||
|
try {
|
||||||
|
byte[] bytes = file.getBytes();
|
||||||
|
// 保存文件到服务器
|
||||||
|
String filePath = "D:/workspaces/oilSystem/fuintBackend/fuint-application/src/main/resources/static/uploadImages/certifiedImage/";
|
||||||
|
String imgName = UUID.randomUUID().toString().replace("-","").substring(0,6);
|
||||||
|
// String imgName = file.getName();
|
||||||
|
String path = filePath+imgName+".jpg";
|
||||||
|
FileOutputStream fos = new FileOutputStream(path);
|
||||||
|
fos.write(bytes);
|
||||||
|
fos.close();
|
||||||
|
|
||||||
|
return getSuccessResult("上传成功");
|
||||||
|
} catch (Exception e) {
|
||||||
|
return getSuccessResult("上传失败:" + e.getMessage());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return getSuccessResult("上传失败:文件为空");
|
||||||
|
}
|
||||||
|
// 处理文件上传逻辑
|
||||||
|
// return getSuccessResult("上传成功");
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,8 @@
|
|||||||
package com.fuint.business.userManager.entity;
|
package com.fuint.business.userManager.entity;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.fuint.framework.entity.BaseEntity;
|
import com.fuint.framework.entity.BaseEntity;
|
||||||
@ -11,6 +13,7 @@ import lombok.Setter;
|
|||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 认证会员表(CertifiedMember)实体类
|
* 认证会员表(CertifiedMember)实体类
|
||||||
@ -68,5 +71,10 @@ public class CertifiedMember extends BaseEntity implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@ApiModelProperty("认证状态")
|
@ApiModelProperty("认证状态")
|
||||||
private String status;
|
private String status;
|
||||||
|
/**
|
||||||
|
* 图片URL
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<JSONObject> imgUrlList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,6 +30,13 @@ public interface CertifiedMemberService extends IService<CertifiedMember> {
|
|||||||
*/
|
*/
|
||||||
public CertifiedMember selectCertifiedMemberByUserId(int userId);
|
public CertifiedMember selectCertifiedMemberByUserId(int userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据会员手机号查询认证会员信息
|
||||||
|
* @param mobile
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public CertifiedMember selectCertifiedMemberByMobile(String mobile);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id删除认证会员信息
|
* 根据id删除认证会员信息
|
||||||
* @param id
|
* @param id
|
||||||
|
@ -8,11 +8,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.fuint.business.userManager.entity.CertifiedMember;
|
import com.fuint.business.userManager.entity.CertifiedMember;
|
||||||
import com.fuint.business.userManager.entity.FixingLevel;
|
import com.fuint.business.userManager.entity.FixingLevel;
|
||||||
|
import com.fuint.business.userManager.entity.LJUser;
|
||||||
import com.fuint.business.userManager.mapper.CertifiedMemberMapper;
|
import com.fuint.business.userManager.mapper.CertifiedMemberMapper;
|
||||||
import com.fuint.business.userManager.mapper.FixingLevelMapper;
|
import com.fuint.business.userManager.mapper.FixingLevelMapper;
|
||||||
import com.fuint.business.userManager.service.CertifiedMemberService;
|
import com.fuint.business.userManager.service.CertifiedMemberService;
|
||||||
import com.fuint.business.userManager.service.FixingLevelService;
|
import com.fuint.business.userManager.service.FixingLevelService;
|
||||||
|
import com.fuint.business.userManager.service.LJUserService;
|
||||||
import com.fuint.common.util.StringUtils;
|
import com.fuint.common.util.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -20,6 +23,9 @@ import org.springframework.stereotype.Service;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class CertifiedMemberServiceImpl extends ServiceImpl<CertifiedMemberMapper, CertifiedMember> implements CertifiedMemberService {
|
public class CertifiedMemberServiceImpl extends ServiceImpl<CertifiedMemberMapper, CertifiedMember> implements CertifiedMemberService {
|
||||||
|
@Autowired
|
||||||
|
private LJUserService userService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据条件分页查询固定等级信息
|
* 根据条件分页查询固定等级信息
|
||||||
* @param page
|
* @param page
|
||||||
@ -28,6 +34,11 @@ public class CertifiedMemberServiceImpl extends ServiceImpl<CertifiedMemberMappe
|
|||||||
@Override
|
@Override
|
||||||
public IPage<CertifiedMember> selectCertifiedMemberList(Page page, CertifiedMember certifiedMember) {
|
public IPage<CertifiedMember> selectCertifiedMemberList(Page page, CertifiedMember certifiedMember) {
|
||||||
IPage<CertifiedMember> fixingLevelIPage = baseMapper.selectCertifiedMemberList(page, certifiedMember);
|
IPage<CertifiedMember> fixingLevelIPage = baseMapper.selectCertifiedMemberList(page, certifiedMember);
|
||||||
|
// for (CertifiedMember record : fixingLevelIPage.getRecords()) {
|
||||||
|
// if (StringUtils.isNotEmpty(record.getAttestationData())){
|
||||||
|
// record.setImgUrlList(JSONArray.parseArray(record.getAttestationData(), JSONObject.class));
|
||||||
|
// }
|
||||||
|
// }
|
||||||
return fixingLevelIPage;
|
return fixingLevelIPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,6 +65,19 @@ public class CertifiedMemberServiceImpl extends ServiceImpl<CertifiedMemberMappe
|
|||||||
return certifiedMember;
|
return certifiedMember;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据会员手机号查询认证会员信息
|
||||||
|
* @param mobile
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public CertifiedMember selectCertifiedMemberByMobile(String mobile) {
|
||||||
|
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("mobile",mobile);
|
||||||
|
CertifiedMember certifiedMember = baseMapper.selectOne(queryWrapper);
|
||||||
|
return certifiedMember;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id删除固定等级信息
|
* 根据id删除固定等级信息
|
||||||
* @param id
|
* @param id
|
||||||
@ -70,6 +94,24 @@ public class CertifiedMemberServiceImpl extends ServiceImpl<CertifiedMemberMappe
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertCertifiedMember(CertifiedMember certifiedMember) {
|
public int insertCertifiedMember(CertifiedMember certifiedMember) {
|
||||||
|
if (certifiedMember.getMobile()==null || certifiedMember.getMobile().equals("")){
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
LJUser user = userService.selectUserByMobile(certifiedMember.getMobile());
|
||||||
|
if (user==null){
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("mobile",certifiedMember.getMobile());
|
||||||
|
CertifiedMember member = baseMapper.selectOne(queryWrapper);
|
||||||
|
if (member!=null){
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
if (certifiedMember.getName()==null || certifiedMember.getName().equals("")){
|
||||||
|
LJUser ljUser = userService.selectUserByMobile(certifiedMember.getMobile());
|
||||||
|
certifiedMember.setName(ljUser.getName());
|
||||||
|
certifiedMember.setUserId(ljUser.getId());
|
||||||
|
}
|
||||||
int row = baseMapper.insert(certifiedMember);
|
int row = baseMapper.insert(certifiedMember);
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user