会员管理 固定等级

This commit is contained in:
cun-nan 2023-10-25 13:17:49 +08:00
parent 090f3842fe
commit 36687535b7
7 changed files with 120 additions and 70 deletions

View File

@ -94,6 +94,8 @@
</el-tabs>
</el-card>
<!-- <img src="file://D:/certifiedPhoto/static/uploadImages/20231025/8c3dbcf4924f40ebb479c17abd573ffb.jpg">-->
<el-card>
<div v-if="activeName=='member'">
<el-button
@ -126,7 +128,12 @@
<el-table-column label="车牌号" align="center" prop="carNumber"/>
<el-table-column label="认证资料" align="center" prop="attestationData">
<template slot-scope="scope">
<!-- {{scope.row}}-->
<!-- <p v-for="(item,index) in scope.row.imgUrlList" :key="index">{{item.imageUrl1}}</p>-->
<span v-for="(item,index) in scope.row.imgUrlList" :key="index">
<img v-if="item.imageUrl1" :src="'/dev-api'+item.imageUrl1" class="attImg">
<img v-if="item.imageUrl2" :src="'/dev-api'+item.imageUrl2" class="attImg">
<img v-if="item.imageUrl3" :src="'/dev-api'+item.imageUrl3" class="attImg">
</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark"/>
@ -356,8 +363,7 @@
<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;}"
style="width: 85%;height: 300px;"
show-word-limit
placeholder="请输入会员手机号多个手机号换行操作每行一个会员手机号单次最大支持1000个会员手机号认证~">
</el-input>
@ -452,14 +458,15 @@
<el-form-item label="认证图片1" prop="photo1">
<div>
<el-upload
action="/dev-api/picture/upload"
action="/dev-api/backendApi/file/upload"
:show-file-list="false"
list-type="picture-card"
:headers="headers"
:on-success="handleAvatarSuccess1"
:on-change="onChange"
:on-change="onChange1"
ref="upload"
>
<img v-if="imageUrl.imageUrl1" :src="imageUrl.imageUrl1" class="avatar">
<img v-if="imageUrl.imageUrl1" :src="'/dev-api'+imageUrl.imageUrl1" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div>
@ -469,14 +476,15 @@
<el-form-item label="认证图片2" prop="photo2">
<div>
<el-upload
action="/dev-api/picture/upload"
action="/dev-api/backendApi/file/upload"
:show-file-list="false"
list-type="picture-card"
:headers="headers"
:on-success="handleAvatarSuccess2"
:on-change="onChange"
:on-change="onChange2"
ref="upload"
>
<img v-if="imageUrl.imageUrl2" :src="imageUrl.imageUrl2" class="avatar">
<img v-if="imageUrl.imageUrl2" :src="'/dev-api'+imageUrl.imageUrl2" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div>
@ -486,14 +494,15 @@
<el-form-item label="认证图片3" prop="photo3">
<div>
<el-upload
action="/dev-api/picture/upload"
action="/dev-api/backendApi/file/upload"
:show-file-list="false"
list-type="picture-card"
:headers="headers"
:on-success="handleAvatarSuccess3"
:on-change="onChange"
:on-change="onChange3"
ref="upload"
>
<img v-if="imageUrl.imageUrl3" :src="imageUrl.imageUrl3" class="avatar">
<img v-if="imageUrl.imageUrl3" :src="'/dev-api'+imageUrl.imageUrl3" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div>
@ -812,11 +821,15 @@ import {
updateCertifiedMember
} from "@/api/staff/user/certifiedmember";
import {getUser, getUserMobile, listUser} from "@/api/staff/user/user";
import {getToken} from "@/utils/auth";
export default {
dicts: ['yhlx','yes_or_no','zhzt','yhhdz','rzzt'],
data() {
return {
headers: {
'Access-Token': getToken(),
},
result:{},
isEdit:false,
//
@ -1074,16 +1087,48 @@ export default {
this.title = "新增用户认证";
},
handleAvatarSuccess1(res, file) {
// this.imageUrl.imageUrl1 = `/dev-api/uploadImages/certifiedImage/file.jpg`
this.imageUrl.imageUrl1 = URL.createObjectURL(file.raw);
// this.imageUrl.imageUrl1 = URL.createObjectURL(file.raw);
this.imageUrl.imageUrl1 = res.data.fileName;
},
handleAvatarSuccess2(res, file) {
this.imageUrl.imageUrl2 = URL.createObjectURL(file.raw);
this.imageUrl.imageUrl2 = res.data.fileName;
},
handleAvatarSuccess3(res, file) {
this.imageUrl.imageUrl3 = URL.createObjectURL(file.raw);
this.imageUrl.imageUrl3 = res.data.fileName;
},
onChange (file,fileList) {
onChange1 (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
}
},
onChange2 (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
}
},
onChange3 (file,fileList) {
if(file){
const suffix = file.name.split('.')[1]
const size = file.size / 1024 / 1024 < 2
@ -1123,7 +1168,9 @@ export default {
this.form1 = response.data;
this.openMember = true;
this.title = "编辑用户认证";
this.imageUrl = JSON.parse(this.form1.attestationData)
if (this.form1.attestationData!=null && this.form1.attestationData!=""){
this.imageUrl = JSON.parse(this.form1.attestationData)
}
});
},
//
@ -1310,4 +1357,10 @@ export default {
width: 100%;
height: 100%;
}
.attImg{
width: 40px;
height: 40px;
margin: 2px;
border-radius: 50%;
}
</style>

View File

@ -5,6 +5,8 @@ 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;
/**
@ -14,25 +16,35 @@ import lombok.Data;
*/
@Data
@TableName("cvs_goods")
@ApiModel(value = "CvsGoods对象", description = "便利店表")
public class CvsGoods extends BaseEntity {
//主键
@TableId(value = "id", type = IdType.AUTO)
@ApiModelProperty("自增ID")
@TableId(value = "ID", type = IdType.AUTO)
private Integer id;
//父分类id
@ApiModelProperty("父分类id")
private Integer pid;
@ApiModelProperty("店铺id")
private Integer storeId;
//编码
@ApiModelProperty("编码")
private String code;
//商品分类
@ApiModelProperty("商品分类")
private String categoryName;
//商品排序
@ApiModelProperty("商品排序")
private Integer sorted;
//商品状态
@ApiModelProperty("商品状态")
private String status;
@TableField(exist = false)

View File

@ -12,7 +12,7 @@ import java.util.List;
/**
* @author :admin
* @date : 2023/10/16
* 便利店商品管理接口
* 便利店商品管理 mapper层
*/
@Mapper
public interface CvsGoodsMapper extends BaseMapper<CvsGoods> {

View File

@ -9,17 +9,41 @@ import io.swagger.models.auth.In;
import java.util.List;
/**
* @author :admin
* @date : 2023/10/16
* 便利店商品信息 业务层
*/
public interface CvsGoodsService {
/**
* 添加商品信息
* @param cvsGoods
* @return
*/
int insertCvsGoods(CvsGoods cvsGoods);
/**
* 根据条件分页查询商品信息
* @param page
* @param goods
* @return
*/
IPage<CvsGoodsVo> selectTree(Page page, CvsGoods goods);
/**
*
* @param goods
* @return
*/
List<CvsGoods> selectCvsGoodsList(CvsGoods goods);
/**
* 根据id查询商品信息
* @param id
* @return
*/
CvsGoods selectParentById(Integer id);
/**
* 根据id删除商品信息
* @param id
*/
void deleteByIdVo(Integer id);
}

View File

@ -38,7 +38,6 @@ public class CvsGoodsServiceImpl extends ServiceImpl<CvsGoodsMapper,CvsGoods> im
baseMapper.updateById(cvsGoods);
return insertGoods;
}
}

View File

@ -1,41 +0,0 @@
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("上传成功");
}
}

View File

@ -18,6 +18,8 @@ import com.fuint.common.util.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collections;
/**
* 认证会员 业务层
*/
@ -34,11 +36,12 @@ public class CertifiedMemberServiceImpl extends ServiceImpl<CertifiedMemberMappe
@Override
public IPage<CertifiedMember> selectCertifiedMemberList(Page page, CertifiedMember 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));
// }
// }
for (CertifiedMember record : fixingLevelIPage.getRecords()) {
if (StringUtils.isNotEmpty(record.getAttestationData())){
// record.setImgUrlList(JSONArray.parseArray(record.getAttestationData(), JSONObject.class));
record.setImgUrlList(Collections.singletonList(JSONObject.parseObject(record.getAttestationData(), JSONObject.class)));
}
}
return fixingLevelIPage;
}