From ab6a4a5279135c61dd7e2e6bb525dac903ac5523 Mon Sep 17 00:00:00 2001
From: cun-nan <19819293608@163.com>
Date: Thu, 19 Oct 2023 18:47:09 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E5=91=98=E7=AE=A1=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/components/FileUpload/index.vue | 11 +-
fuintAdmin/src/views/member/index.vue | 138 +++++--
fuintAdmin/src/views/member/userInfo.vue | 376 +++++++++++++++++-
fuintAdmin/src/views/userGrade/index.vue | 8 +-
fuintBackend/fuint-application/pom.xml | 17 +
...StoreMapper.xml => ExportExcelService.xml} | 0
.../controller/ExportController.java | 94 +++++
.../business/userManager/entity/LJUser.java | 37 ++
.../listener/EasyExcelListener.java | 38 ++
.../userManager/mapper/xml/LJUserMapper.xml | 3 +-
.../java/com/fuint/common/util/ExcelUtil.java | 2 +-
11 files changed, 664 insertions(+), 60 deletions(-)
rename fuintBackend/fuint-application/src/main/java/com/fuint/business/store/mapper/xml/{MtStoreMapper.xml => ExportExcelService.xml} (100%)
create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/ExportController.java
create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/listener/EasyExcelListener.java
diff --git a/fuintAdmin/src/components/FileUpload/index.vue b/fuintAdmin/src/components/FileUpload/index.vue
index 472db7699..f41befa4f 100644
--- a/fuintAdmin/src/components/FileUpload/index.vue
+++ b/fuintAdmin/src/components/FileUpload/index.vue
@@ -2,7 +2,7 @@
新增
+ >新增会员
@@ -173,10 +173,6 @@
-
-
-
-
{{ scope.row.name }}
@@ -193,25 +189,11 @@
{{ scope.row.balance ? scope.row.balance.toFixed(2) : '0.00' }}
-
-
-
-
-
-
-
{{ scope.row.literCard ? scope.row.literCard.toFixed(2) : '0.00' }}L
-
-
-
-
-
-
-
@@ -222,13 +204,6 @@
{{ scope.row.point ? scope.row.point : '0.00' }}
-
-
-
-
-
-
-
@@ -242,14 +217,6 @@
-
-
-
-
-
-
-
-
@@ -288,6 +255,44 @@
/>
+
+
+
+
+ {{item}}
+
+
+
+ 录入单个会员
+ 批量导入会员
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -391,6 +396,28 @@
+
+
+
+
+
第二步: 选择用户数据上传并导入会员
+
+ 点击上传
+ 只能上传xls/xlsx文件,单次最大5000行会员数据且不超过1M 超出请分文件处理
+
+
+
+
+
@@ -406,12 +433,21 @@ import pointRecharge from "./pointRecharge";
import {addUser, delUser, getUser, listStatistic, listUser, 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";
+import { getToken } from "@/utils/auth";
export default {
name: "MemberIndex",
components: { balanceRecharge, pointRecharge },
dicts: ['official','zhzt'],
data() {
return {
+ headers: {
+ 'Access-Token': getToken(),
+ },
+ // 文件上传信息
+ fileList: [],
+
+ addMember:[],
// 余额
balance:'',
// 积分
@@ -438,6 +474,8 @@ export default {
total: 0,
// 表格数据
list: [],
+ // 会员表格数据
+ userList: [],
// 会员等级列表
userGradeList: [],
// 店铺列表
@@ -445,6 +483,8 @@ export default {
storeIds: [],
// 是否显示修改对话框
open: false,
+ openUser: false,
+ openUpload: false,
// 当前操作用户
userId: '',
// 是否弹层充值
@@ -487,6 +527,7 @@ export default {
created() {
this.getList();
this.getStatistic();
+ this.getConfig();
},
methods: {
// 跳转详情页
@@ -583,6 +624,10 @@ export default {
handleBalance(userId) {
this.openBalance = true;
this.userId = userId.toString();
+ },
+ // 导入会员信息
+ importUser(){
+
},
// 积分变更操作
handlePoint(userId) {
@@ -602,9 +647,24 @@ export default {
},
// 新增按钮操作
handleAdd() {
+ this.openUser = true;
+ this.title = "新增会员";
+ },
+ // 新增按钮操作
+ addOne() {
this.reset();
this.open = true;
- this.title = "新增会员";
+ this.title = "录入会员";
+ },
+ addMult(){
+ this.openUpload = true;
+ this.title = "批量导入会员";
+ },
+ // 获取配置信息
+ getConfig(){
+ getSysConfig('addMember').then(response => {
+ this.addMember = response.data.split(";")
+ });
},
// 表单重置
reset() {
@@ -659,6 +719,9 @@ export default {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
+ },
+ handleChange(file, fileList) {
+ this.fileList = fileList.slice(-3);
}
}
};
@@ -676,4 +739,9 @@ export default {
background: #f6f8f9;
padding-top: 30px;
}
+ .el-upload, .el-upload--text {
+ width: 150px;
+ height: 60px !important;
+ line-height: 60px !important;
+ }
diff --git a/fuintAdmin/src/views/member/userInfo.vue b/fuintAdmin/src/views/member/userInfo.vue
index decdcbf1b..7a5cff03a 100644
--- a/fuintAdmin/src/views/member/userInfo.vue
+++ b/fuintAdmin/src/views/member/userInfo.vue
@@ -1,11 +1,12 @@
-
-
-
+
@@ -34,11 +35,20 @@
{{form.refuelMoney}}
{{ store.name }}
{{form.createTime}}
-
{{form.secondCard}}
-
{{ grade.name }}
+
+ 副卡管理
+
+
+ {{ grade.name }}
+
-
-
+
+ 跟随全局总配置
+
+
+
+
+
{{ form.description }}
@@ -113,7 +123,6 @@
取 消
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+

+
+
+
{{form.name}}
+ {{form.mobile}}
+
+
+
+
+
+
+
+
+
+
+
+ 汽油
+ 成长值
+
+
+
+
+
+
+
+
+ 柴油
+ 成长值
+
+
+
+
+
+
+
+
+ 天然气
+ 成长值
+
+
+
+
+
+
+
+
+
+
+
+ 增加
+ 减少
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
会员信息:{{form.mobile}}
+
新增子卡
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 新增子卡
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{transaction}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -318,18 +600,32 @@
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";
export default {
- dicts: ['official','zhzt'],
+ dicts: ['official','zhzt','zcrzdj'],
data(){
return{
+ // 每日交易介绍
+ transaction:"",
+ config:'-1',
+ num:1,
+ // 操作类型
+ type:'add',
title:'',
// 是否显示修改对话框
openMobile: false,
+ openSecondCard:false,
+ openUserGrade:false,
+ openSubCard:false,
+ openConfig:false,
+ openLevel:false,
growthValue:'whole',
cardList:'notUse',
tabPosition: 'giftCard',
balanceRecord: 'first',
+ // 关于副卡信息
+ aboutSecondCard:[],
// 遮罩层
loading: false,
id:'',
@@ -340,8 +636,9 @@ export default {
// 会员等级信息
grade:'',
activeName: 'refuelOrder',
+ subCardActive:'subCardManage',
tableData:[],
- total:'',
+ total:0,
queryParams: {
page: 1,
pageSize: 10,
@@ -350,16 +647,19 @@ export default {
name: '',
status: '',
},
+ subCardList:[],
list: [],
// 表单校验
rules: {
mobile: [{ required: true, message: "请输入手机号", trigger: "blur" }],
+ type: [{ required: true, message: "请选择操作类型", trigger: "blur" }],
}
}
},
created() {
this.id = this.$route.query.id;
this.getUserInfo();
+ this.getInformation();
},
methods: {
// 更换手机号
@@ -367,6 +667,40 @@ export default {
this.openMobile = true;
this.title = '更换手机号'
},
+ // 副卡管理
+ secondCard(){
+ this.openSecondCard = true;
+ this.title = this.form.secondCard+'-副卡账户管理'
+ },
+ // 会员等级成长值
+ userGrade(){
+ this.openUserGrade = true;
+ this.title = '更换手机号'
+ },
+ // 子卡管理
+ subCard(){
+ this.openSubCard = true;
+ this.title = '子卡管理'
+ },
+ // 每日笔数
+ configuration(){
+ this.openConfig = true;
+ this.title = '每日交易次数'
+ },
+ // 固定等级
+ level(){
+ this.openLevel = true;
+ this.title = '固定等级(原专车认证)'
+ },
+ // 获取副卡信息
+ getInformation(){
+ getSysConfig('second_card').then(response => {
+ this.aboutSecondCard = response.data.split(";")
+ });
+ getSysConfig('transaction').then(response => {
+ this.transaction = response.data
+ });
+ },
getList(){
},
@@ -416,10 +750,16 @@ export default {
// 取消按钮
cancel() {
this.openMobile = false;
+ this.openUserGrade = false;
+ this.openConfig = false;
+ this.openLevel = false;
},
handleClick(tab, event) {
console.log(tab, event);
},
+ handleChange(value) {
+ console.log(value);
+ },
// 返回
goBack() {
this.$router.back(-1);
diff --git a/fuintAdmin/src/views/userGrade/index.vue b/fuintAdmin/src/views/userGrade/index.vue
index 6969de6d6..aa80b264f 100644
--- a/fuintAdmin/src/views/userGrade/index.vue
+++ b/fuintAdmin/src/views/userGrade/index.vue
@@ -259,7 +259,7 @@
-
+
@@ -281,7 +281,7 @@
-
+
汽油
成长值
@@ -291,7 +291,7 @@
-
+
柴油
成长值
@@ -301,7 +301,7 @@
-
+
天然气
成长值
diff --git a/fuintBackend/fuint-application/pom.xml b/fuintBackend/fuint-application/pom.xml
index d6ba80849..8f79f90bb 100644
--- a/fuintBackend/fuint-application/pom.xml
+++ b/fuintBackend/fuint-application/pom.xml
@@ -135,6 +135,23 @@
org.springframework.boot
spring-boot-starter-validation
+
+
+
+ com.alibaba
+ easyexcel
+ 2.1.4
+
+
+ org.apache.poi
+ poi
+ 3.17
+
+
+ org.apache.poi
+ poi-ooxml
+ 3.17
+
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/mapper/xml/MtStoreMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/mapper/xml/ExportExcelService.xml
similarity index 100%
rename from fuintBackend/fuint-application/src/main/java/com/fuint/business/store/mapper/xml/MtStoreMapper.xml
rename to fuintBackend/fuint-application/src/main/java/com/fuint/business/store/mapper/xml/ExportExcelService.xml
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/ExportController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/ExportController.java
new file mode 100644
index 000000000..804a37299
--- /dev/null
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/ExportController.java
@@ -0,0 +1,94 @@
+package com.fuint.business.userManager.controller;
+
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.EasyExcelFactory;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.fuint.business.userManager.entity.LJUser;
+import com.fuint.business.userManager.listener.EasyExcelListener;
+import com.fuint.business.userManager.mapper.LJUserMapper;
+import com.fuint.business.userManager.service.LJUserService;
+import com.fuint.framework.web.BaseController;
+import com.fuint.framework.web.ResponseObject;
+import org.apache.poi.ss.formula.functions.T;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URLEncoder;
+import java.util.List;
+
+@RestController
+@RequestMapping("/excel")
+public class ExportController extends BaseController{
+ @Autowired
+ private EasyExcelListener listener;
+ @Autowired
+ private LJUserService service;
+ @Autowired
+ private LJUserMapper mapper;
+
+ @RequestMapping("/import")
+ public ResponseObject myImport(MultipartFile file) throws IOException {
+ try {
+ //获取文件名
+ String filename = file.getOriginalFilename();
+ //获取文件流
+ InputStream inputStream = file.getInputStream();
+ //实例化实现了AnalysisEventListener接口的类
+ EasyExcelListener listener = new EasyExcelListener();
+
+ EasyExcelFactory.read(inputStream, LJUser.class, listener).headRowNumber(1).build().readAll();
+ //获取数据
+ List