main
王家东 1 year ago
parent b0a71386cf
commit 93d8526049
  1. 35
      jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java
  2. 10
      jeecgboot-vue3-master/src/views/system/user/index.vue
  3. 3
      jeecgboot-vue3-master/src/views/system/user/user.api.js
  4. 3
      jeecgboot-vue3-master/src/views/system/user/user.api.ts

@ -20,6 +20,7 @@ import org.jeecg.common.aspect.annotation.PermissionData;
import org.jeecg.common.config.TenantContext;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.constant.SymbolConstant;
import org.jeecg.config.JeecgBaseConfig;
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
import org.jeecg.modules.base.service.BaseCommonService;
import org.jeecg.common.system.query.QueryGenerator;
@ -46,6 +47,7 @@ import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@ -100,6 +102,8 @@ public class SysUserController {
@Autowired
private ISysUserTenantService userTenantService;
@Resource
private JeecgBaseConfig jeecgBaseConfig;
/**
* 获取租户下用户数据支持租户隔离
@ -514,7 +518,15 @@ public class SysUserController {
String passwordEncode = PasswordUtil.encrypt(sysUserExcel.getUsername(), sysUserExcel.getPassword(), salt);
sysUserExcel.setPassword(passwordEncode);
try {
sysUserService.save(sysUserExcel);
if (sysUserExcel.getUsername()=="" || sysUserExcel.getUsername().isEmpty() || sysUserExcel.getUsername()==null) {
}else {
if (sysUserExcel.getJuese().equals("学生")) {
sysUserExcel.setDelFlag(0);
sysUserService.save(sysUserExcel);
} else {
errorMessage.add("第 " + i + 1 + " 行:目前仅允许导入学生身份的用户,其他身份请手动导入");
}
}
successLines++;
} catch (Exception e) {
errorLines++;
@ -1742,4 +1754,25 @@ public class SysUserController {
sysUserService.editTenantUser(sysUser,tenantId,departs,roles);
return Result.ok("修改成功");
}
@RequestMapping(value = "/exportXlsMb")
public ModelAndView exportXlsMb(HttpServletRequest request, SysUser awardPersion) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
// Step.2 获取导出数据
List<SysUser> exportList = new ArrayList<>();
// Step.3 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
//此处设置的filename无效 ,前端会重更新设置一下
mv.addObject(NormalExcelConstants.FILE_NAME, "学生导入模板");
mv.addObject(NormalExcelConstants.CLASS, SysUser.class);
//update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
ExportParams exportParams=new ExportParams("学生导入模板", "用户名和学号均为学号" , "学生导入模板");
exportParams.setImageBasePath(jeecgBaseConfig.getPath().getUpload());
//update-end--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
mv.addObject(NormalExcelConstants.PARAMS,exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
return mv;
}
}

@ -8,6 +8,7 @@
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleCreateZJ"> 新增专家</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls" >导入</j-upload-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXlsMb"> 导出模板</a-button>
<a-button type="primary" @click="handleSyncUser" preIcon="ant-design:sync-outlined"> 同步流程</a-button>
<a-button type="primary" @click="openModal(true, {})" preIcon="ant-design:hdd-outlined"> 回收站</a-button>
<JThirdAppButton biz-type="user" :selected-row-keys="selectedRowKeys" syncToApp syncToLocal @sync-finally="onSyncFinally" />
@ -73,7 +74,7 @@
import { useModal } from '/@/components/Modal';
import { useMessage } from '/@/hooks/web/useMessage';
import { columns, searchFormSchema } from './user.data';
import { listNoCareTenant, deleteUser, batchDeleteUser, getImportUrl, getExportUrl, frozenBatch, syncUser,queryByUserId } from './user.api';
import { listNoCareTenant, deleteUser, batchDeleteUser, getImportUrl, getExportUrl, frozenBatch, syncUser,queryByUserId,getExportUrlMb } from './user.api';
import {usePermission} from "/@/hooks/web/usePermission";
import {defHttp} from "../../../utils/http/axios";
@ -94,7 +95,7 @@
const [registerQuitModal, { openModal: openQuitModal }] = useModal();
//
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
const { prefixCls, tableContext, onExportXls, onImportXls,onExportXlsMb } = useListPage({
designScope: 'user-list',
tableProps: {
title: '用户列表',
@ -116,6 +117,11 @@
name: '用户列表',
url: getExportUrl,
},
exportConfigMb: {
name: "导出模板",
url: getExportUrlMb,
params: null,
},
importConfig: {
url: getImportUrl,
},

@ -17,6 +17,7 @@ var Api;
Api["deleteBatch"] = "/sys/user/deleteBatch";
Api["importExcel"] = "/sys/user/importExcel";
Api["exportXls"] = "/sys/user/exportXls";
Api["exportXlsMb"] = "/sys/user/exportXlsMb";
Api["recycleBinList"] = "/sys/user/recycleBin";
Api["putRecycleBin"] = "/sys/user/putRecycleBin";
Api["deleteRecycleBin"] = "/sys/user/deleteRecycleBin";
@ -45,6 +46,8 @@ export const getExportUrl = Api.exportXls;
* 导入api
*/
export const getImportUrl = Api.importExcel;
export const getExportUrlMb = Api.exportXlsMb;
/**
* 根据userid判断是否为专家
* @param params

@ -34,6 +34,7 @@ enum Api {
putCancelQuit = '/sys/user/putCancelQuit',
updateUserTenantStatus='/sys/tenant/updateUserTenantStatus',
getUserTenantPageList='/sys/tenant/getUserTenantPageList',
exportXlsMb = '/sys/user/exportXlsMb',
queryByUserId = '/expert/expert/queryByUserId',
}
/**
@ -48,6 +49,8 @@ export const queryByUserId = (params) => {
* @param params
*/
export const getExportUrl = Api.exportXls;
export const getExportUrlMb = Api.exportXlsMb;
/**
* api
*/

Loading…
Cancel
Save