导入---09

main
喻忠伟 5 months ago
parent d2f39e82c9
commit 7c94ccf662
  1. 295
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/controller/ExpertController.java
  2. 135
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/entity/UserExpertExcel.java
  3. 4
      jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/entity/SysUser.java
  4. 7
      jeecgboot-vue3-master/src/views/system/user/UserDrawerZJ.vue
  5. 6
      jeecgboot-vue3-master/src/views/system/user/user.data.js
  6. 6
      jeecgboot-vue3-master/src/views/system/user/user.data.ts
  7. 40
      jeecgboot-vue3-master/src/views/system/user/userZJ.data.ts
  8. 22
      jeecgboot-vue3-master/src/views/system/userZJ/UserDrawer.vue
  9. 19
      jeecgboot-vue3-master/src/views/system/userZJ/index.vue
  10. 21
      jeecgboot-vue3-master/src/views/system/userZJ/user.api.ts

@ -1,22 +1,29 @@
package org.jeecg.modules.demo.expert.controller; package org.jeecg.modules.demo.expert.controller;
import java.util.Arrays; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.io.IOException; import java.io.IOException;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.URLDecoder; import java.net.URLDecoder;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.ImportExcelUtil;
import org.jeecg.common.util.PasswordUtil; import org.jeecg.common.util.PasswordUtil;
import org.jeecg.common.util.oConvertUtils; import org.jeecg.common.util.oConvertUtils;
import org.jeecg.config.JeecgBaseConfig;
import org.jeecg.modules.base.service.BaseCommonService; import org.jeecg.modules.base.service.BaseCommonService;
import org.jeecg.modules.demo.annualcomp.entity.AnnualComp; import org.jeecg.modules.demo.annualcomp.entity.AnnualComp;
import org.jeecg.modules.demo.annualcomp.service.IAnnualCompService; import org.jeecg.modules.demo.annualcomp.service.IAnnualCompService;
@ -24,6 +31,7 @@ import org.jeecg.modules.demo.annualcompgroup.service.IAnnualCompGroupService;
import org.jeecg.modules.demo.compexp.entity.CompExp; import org.jeecg.modules.demo.compexp.entity.CompExp;
import org.jeecg.modules.demo.compexp.service.ICompExpService; import org.jeecg.modules.demo.compexp.service.ICompExpService;
import org.jeecg.modules.demo.expert.entity.Expert; import org.jeecg.modules.demo.expert.entity.Expert;
import org.jeecg.modules.demo.expert.entity.UserExpertExcel;
import org.jeecg.modules.demo.expert.service.IExpertService; import org.jeecg.modules.demo.expert.service.IExpertService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -34,14 +42,21 @@ import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.demo.expgroup.entity.ExpGroup; import org.jeecg.modules.demo.expgroup.entity.ExpGroup;
import org.jeecg.modules.demo.expgroup.service.IExpGroupService; import org.jeecg.modules.demo.expgroup.service.IExpGroupService;
import org.jeecg.modules.system.entity.SysUser; import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.entity.SysUserDepart;
import org.jeecg.modules.system.entity.SysUserRole;
import org.jeecg.modules.system.service.ISysUserDepartService;
import org.jeecg.modules.system.service.ISysUserRoleService;
import org.jeecg.modules.system.service.ISysUserService; import org.jeecg.modules.system.service.ISysUserService;
import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams; import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.multipart.MultipartHttpServletRequest;
@ -84,9 +99,19 @@ public class ExpertController extends JeecgController<Expert, IExpertService> {
@Autowired @Autowired
private IExpGroupService expGroupService; private IExpGroupService expGroupService;
@Resource
private JeecgBaseConfig jeecgBaseConfig;
@Value("${jeecg.path.upload}")
private String upLoadPath;
//角色
@Autowired
private ISysUserRoleService sysUserRoleService;
//用户部门
@Autowired
private ISysUserDepartService sysUserDepartService;
/** /**
* 分页列表查询 * 分页列表查询
@ -209,17 +234,22 @@ public class ExpertController extends JeecgController<Expert, IExpertService> {
QueryWrapper<Expert> queryWrapper = QueryGenerator.initQueryWrapper(expert, req.getParameterMap()); QueryWrapper<Expert> queryWrapper = QueryGenerator.initQueryWrapper(expert, req.getParameterMap());
queryWrapper.eq("user_id",id); queryWrapper.eq("user_id",id);
List<Expert> list = expertService.list(queryWrapper); List<Expert> list = expertService.list(queryWrapper);
if(list.size()==0) {
return Result.error("未找到对应数据");
}
Expert model=list.get(0);
CompExp compExp = new CompExp(); CompExp compExp = new CompExp();
QueryWrapper<CompExp> queryWrapper1 = QueryGenerator.initQueryWrapper(compExp, req.getParameterMap()); QueryWrapper<CompExp> queryWrapper1 = QueryGenerator.initQueryWrapper(compExp, req.getParameterMap());
queryWrapper1.eq("expid",list.get(0).getId()); queryWrapper1.eq("expid",model.getId());
List<CompExp> list1 = compExpService.list(queryWrapper1); List<CompExp> list1 = compExpService.list(queryWrapper1);
if(list.size()==0) { if(list1.size()>0) {
return Result.error("未找到对应数据"); CompExp compExpModel=list1.get(0);
model.setCompid(compExpModel.getCompid());
model.setStat(compExpModel.getStat());
model.setCompName(compExpModel.getCompName());
} }
list.get(0).setCompid(list1.get(0).getCompid()); return Result.OK(model);
list.get(0).setStat(list1.get(0).getStat());
list.get(0).setCompName(list1.get(0).getCompName());
return Result.OK(list.get(0));
} }
/** /**
@ -246,7 +276,8 @@ public class ExpertController extends JeecgController<Expert, IExpertService> {
@RequestMapping(value = "/addZJ", method = RequestMethod.POST) @RequestMapping(value = "/addZJ", method = RequestMethod.POST)
public Result<SysUser> addZJ(@RequestBody JSONObject jsonObject) { public Result<SysUser> addZJ(@RequestBody JSONObject jsonObject) {
Result<SysUser> result = new Result<SysUser>(); Result<SysUser> result = new Result<SysUser>();
String selectedRoles = jsonObject.getString("selectedroles"); // String selectedRoles = jsonObject.getString("selectedroles");
String selectedRoles = "1731948288626339841";
String selectedDeparts = jsonObject.getString("selecteddeparts"); String selectedDeparts = jsonObject.getString("selecteddeparts");
String expSc = jsonObject.getString("expSc"); String expSc = jsonObject.getString("expSc");
String expResume = jsonObject.getString("expResume");//简介 String expResume = jsonObject.getString("expResume");//简介
@ -380,15 +411,137 @@ public class ExpertController extends JeecgController<Expert, IExpertService> {
} }
/** /**
* 导出excel * 导出excel模板
* *
* @param request * @param request
* @param expert * @param expert
*/ */
//@RequiresPermissions("expert:expert:exportXls") //@RequiresPermissions("expert:expert:exportXls")
@RequestMapping(value = "/exportXlsMb")
public ModelAndView exportXlsMb(HttpServletRequest request, Expert expert) {
//return super.exportXls(request, expert, Expert.class, "专家表");
//LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
// Step.2 获取导出数据
List<UserExpertExcel> exportList = new ArrayList<>();
// Step.3 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
//此处设置的filename无效 ,前端会重更新设置一下
mv.addObject(NormalExcelConstants.FILE_NAME, "专家表导入模板");
mv.addObject(NormalExcelConstants.CLASS, UserExpertExcel.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;
}
/**
* 导出excel
*
* @param request
* @param sysUser
*/
//@RequiresPermissions("system:user:export")
@RequestMapping(value = "/exportXls") @RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, Expert expert) { public ModelAndView exportXls(SysUser sysUser,HttpServletRequest request) {
return super.exportXls(request, expert, Expert.class, "专家表"); // Step.1 组装查询条件
QueryWrapper<SysUser> queryWrapper = QueryGenerator.initQueryWrapper(sysUser, request.getParameterMap());
//Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
//update-begin--Author:kangxiaolin Date:20180825 for:[03]用户导出,如果选择数据则只导出相关数据--------------------
String selections = request.getParameter("selections");
if(!oConvertUtils.isEmpty(selections)){
queryWrapper.in("id",selections.split(","));
}
//角色
String rolesIds = "1731948288626339841";
if (oConvertUtils.isNotEmpty(rolesIds)) {
List<String> roleIds = Arrays.asList(rolesIds.split(","));
// 使用 exists 子查询方式查询
// 注意:MyBatis-Plus 不直接支持 exists 语法,因此我们使用 inSql 来模拟这个行为
queryWrapper.inSql(
"id",
"SELECT user_id FROM sys_user_role WHERE role_id IN ("
+ StringUtils.join(roleIds.stream().map(id -> "'" + id + "'").collect(Collectors.toList()), ",")
+ ")"
);
}
//update-end--Author:kangxiaolin Date:20180825 for:[03]用户导出,如果选择数据则只导出相关数据----------------------
List<SysUser> pageList = sysUserService.list(queryWrapper);
//批量查询用户的所属部门
//step.1 先拿到全部的 useids
List<String> userIds = pageList.stream().map(SysUser::getId).collect(Collectors.toList());
//step.2 通过 useids,一次性查询用户的所属部门名字
if (!userIds.isEmpty()) {
Map<String, String> depNames = sysUserService.getDepNamesByUserIds(userIds);
// 更新 SysUser 对象,添加部门名称
pageList.forEach(user -> user.setDepartIds(depNames.get(user.getId())));
}
List<UserExpertExcel> exportList = new ArrayList<>();
// 遍历 SysUser 列表
for (SysUser item : pageList) {
// 创建 UserExpertExcel 实例
UserExpertExcel excelItem = new UserExpertExcel();
// 复制 SysUser 的信息
try {
excelItem.setUsername(item.getUsername());//登录账号
excelItem.setWorkNo(item.getWorkNo());//工号
excelItem.setRealname(item.getRealname());//真实姓名
excelItem.setBirthday(item.getBirthday());//生日
excelItem.setSex(item.getSex());//
excelItem.setEmail(item.getEmail());//电子邮件
excelItem.setPhone(item.getPhone());//电话
excelItem.setDepartIds(item.getDepartIds());//负责部门
excelItem.setStatus(item.getStatus());//状态
} catch (Exception e) {
// 处理异常,比如属性类型不匹配
e.printStackTrace();
}
// 创建 QueryWrapper 实例
QueryWrapper<Expert> queryWrapperExpert = new QueryWrapper<>();
queryWrapperExpert.eq("user_id", item.getId());
// 执行查询
Expert exp = expertService.getOne(queryWrapperExpert);
// 如果 Expert 存在,则复制 Expert 的信息
if (exp != null) {
try {
excelItem.setName(exp.getName());//专家名称
excelItem.setExpTitle(exp.getExpTitle());//专家学历
excelItem.setExpZc(exp.getExpZc());//职称
excelItem.setExpXw(exp.getExpXw());//学位
excelItem.setExpCsgz(exp.getExpCsgz());//从事工作
excelItem.setExpYjfx(exp.getExpYjfx());//研究方向
excelItem.setExpSc(exp.getExpSc());//专家毕业院校
excelItem.setExpResume(exp.getExpResume());//简介
} catch (Exception e) {
// 处理异常,比如属性类型不匹配
e.printStackTrace();
}
}
// 将 UserExpertExcel 添加到列表中
exportList.add(excelItem);
}
//导出文件名称
mv.addObject(NormalExcelConstants.FILE_NAME, "用户列表");
mv.addObject(NormalExcelConstants.CLASS, UserExpertExcel.class);
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
ExportParams exportParams = new ExportParams("专家列表数据", "导出人:"+user.getRealname(), "导出信息");
exportParams.setImageBasePath(upLoadPath);
mv.addObject(NormalExcelConstants.PARAMS, exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
return mv;
} }
/** /**
@ -398,10 +551,116 @@ public class ExpertController extends JeecgController<Expert, IExpertService> {
* @param response * @param response
* @return * @return
*/ */
//@RequiresPermissions("expert:expert:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response)throws IOException {
return super.importExcel(request, response, Expert.class); MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
// 错误信息
List<String> errorMessage = new ArrayList<>();
int successLines = 0, errorLines = 0;
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
try {
List<UserExpertExcel> listSysUsers = ExcelImportUtil.importExcel(file.getInputStream(), UserExpertExcel.class, params);
for (int i = 0; i < listSysUsers.size(); i++) {
SysUserRole sysUserRole = new SysUserRole();
UserExpertExcel userExpertExcel = listSysUsers.get(i);
SysUser user=new SysUser();
user.setUsername(userExpertExcel.getUsername());//登录账号
user.setWorkNo(userExpertExcel.getWorkNo());//工号
user.setRealname(userExpertExcel.getRealname());//真实姓名
user.setBirthday(userExpertExcel.getBirthday());//生日
user.setSex(userExpertExcel.getSex());//
user.setEmail(userExpertExcel.getEmail());//电子邮件
user.setPhone(userExpertExcel.getPhone());//电话
user.setDepartIds(userExpertExcel.getDepartIds());//负责部门
user.setStatus(userExpertExcel.getStatus());//状态
user.setPassword("Admin123.");
// 密码加密加盐
String salt = oConvertUtils.randomGen(8);
user.setSalt(salt);
String passwordEncode = PasswordUtil.encrypt(user.getUsername(), user.getPassword(), salt);
user.setPassword(passwordEncode);
try {
if (user.getUsername()=="" || user.getUsername().isEmpty() || user.getUsername()==null) {
}else {
user.setDelFlag(0);
sysUserService.save(user);
sysUserRole.setUserId(user.getId());
sysUserRole.setRoleId("1731948288626339841");
sysUserRoleService.save(sysUserRole);
//专家表
// 执行查询
Expert exp = new Expert();
// 如果 Expert 存在,则复制 Expert 的信息
try {
exp.setUserId(user.getId());//
exp.setName(userExpertExcel.getName());//专家名称
exp.setExpTitle(userExpertExcel.getExpTitle());//专家学历
exp.setExpZc(userExpertExcel.getExpZc());//职称
exp.setExpXw(userExpertExcel.getExpXw());//学位
exp.setExpCsgz(userExpertExcel.getExpCsgz());//从事工作
exp.setExpYjfx(userExpertExcel.getExpYjfx());//研究方向
exp.setExpSc(userExpertExcel.getExpSc());//专家毕业院校
exp.setExpResume(userExpertExcel.getExpResume());//简介
expertService.save(exp);
} catch (Exception e) {
// 处理异常,比如属性类型不匹配
e.printStackTrace();
}
}
successLines++;
} catch (Exception e) {
errorLines++;
String message = e.getMessage().toLowerCase();
int lineNumber = i + 1;
// 通过索引名判断出错信息
if (message.contains(CommonConstant.SQL_INDEX_UNIQ_SYS_USER_USERNAME)) {
errorMessage.add("第 " + lineNumber + " 行:用户名已经存在,忽略导入。");
} else if (message.contains(CommonConstant.SQL_INDEX_UNIQ_SYS_USER_WORK_NO)) {
errorMessage.add("第 " + lineNumber + " 行:工号已经存在,忽略导入。");
} else if (message.contains(CommonConstant.SQL_INDEX_UNIQ_SYS_USER_PHONE)) {
errorMessage.add("第 " + lineNumber + " 行:手机号已经存在,忽略导入。");
} else if (message.contains(CommonConstant.SQL_INDEX_UNIQ_SYS_USER_EMAIL)) {
errorMessage.add("第 " + lineNumber + " 行:电子邮件已经存在,忽略导入。");
} else if (message.contains(CommonConstant.SQL_INDEX_UNIQ_SYS_USER)) {
errorMessage.add("第 " + lineNumber + " 行:违反表唯一性约束。");
} else {
errorMessage.add("第 " + lineNumber + " 行:未知错误,忽略导入");
log.error(e.getMessage(), e);
}
}
// 批量将部门和用户信息建立关联关系
String departIds = userExpertExcel.getDepartIds();
if (StringUtils.isNotBlank(departIds)) {
String userId = user.getId();
String[] departIdArray = departIds.split(",");
List<SysUserDepart> userDepartList = new ArrayList<>(departIdArray.length);
for (String departId : departIdArray) {
userDepartList.add(new SysUserDepart(userId, departId));
}
sysUserDepartService.saveBatch(userDepartList);
}
}
} catch (Exception e) {
errorMessage.add("发生异常:" + e.getMessage());
log.error(e.getMessage(), e);
} finally {
try {
file.getInputStream().close();
} catch (IOException e) {
log.error(e.getMessage(), e);
}
}
}
return ImportExcelUtil.imporReturnRes(errorLines,successLines,errorMessage);
} }
} }

@ -0,0 +1,135 @@
package org.jeecg.modules.demo.expert.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* @Description: 专家表导出导入表
* @Author: jeecg-boot
* @Date: 2023-10-11
* @Version: V1.0
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="expert对象", description="专家表")
public class UserExpertExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 登录账号
*/
@Excel(name = "登录账号(必填且唯一)", width = 15)
private String username;
/**
* 工号唯一键
*/
@Excel(name = "工号(唯一)", width = 15)
private String workNo;
/**
* 真实姓名
*/
@Excel(name = "真实姓名(必填)", width = 15)
private String realname;
/**
* 生日
*/
@Excel(name = "生日(yyyy-MM-dd)", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date birthday;
/**
* 性别1 2
*/
@Excel(name = "性别(1:男 2:女)", width = 15,dicCode="sex")
@Dict(dicCode = "sex")
private Integer sex;
/**
* 电子邮件
*/
@Excel(name = "电子邮件(唯一)", width = 15)
private String email;
/**
* 电话
*/
@Excel(name = "电话(唯一)", width = 15)
private String phone;
/**
* 负责部门
*/
@Excel(name="院系",width = 15,dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
@Dict(dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
private String departIds;
/**专家名称*/
@Excel(name = "专家名称", width = 15)
@ApiModelProperty(value = "专家名称")
private String name;
/**专家学历*/
@Excel(name = "专家学历", width = 15)
@ApiModelProperty(value = "专家学历")
private String expTitle;
/**学位*/
@Excel(name = "学位", width = 15)
@ApiModelProperty(value = "学位")
private String expXw;
/**职称*/
@Excel(name = "职称", width = 15)
@ApiModelProperty(value = "职称")
private String expZc;
/**研究方向*/
@Excel(name = "研究方向", width = 15)
@ApiModelProperty(value = "研究方向")
private String expYjfx;
/**从事工作*/
@Excel(name = "从事工作", width = 15)
@ApiModelProperty(value = "从事工作")
private String expCsgz;
/**专家毕业院校*/
@Excel(name = "专家毕业院校", width = 15)
@ApiModelProperty(value = "专家毕业院校")
private String expSc;
/**简介*/
@Excel(name = "简介", width = 15)
@ApiModelProperty(value = "简介")
private String expResume;
/**
* 状态(1正常 2冻结
*/
@Excel(name = "状态(1:正常 2:冻结 )", width = 15,dicCode="user_status")
@Dict(dicCode = "user_status")
private Integer status;
}

@ -88,13 +88,13 @@ public class SysUser implements Serializable {
/** /**
* 电子邮件 * 电子邮件
*/ */
@Excel(name = "电子邮件", width = 15) @Excel(name = "电子邮件(唯一)", width = 15)
private String email; private String email;
/** /**
* 电话 * 电话
*/ */
@Excel(name = "电话", width = 15) @Excel(name = "电话(唯一)", width = 15)
private String phone; private String phone;
/** /**

@ -68,6 +68,13 @@
data.record.compid = Expert.compid; data.record.compid = Expert.compid;
data.record.compName = Expert.compName; data.record.compName = Expert.compName;
data.record.stat = Expert.stat; data.record.stat = Expert.stat;
data.record.expXw = Expert.expXw;
data.record.expZc = Expert.expZc;
data.record.expYjfx = Expert.expYjfx;
data.record.expCsgz = Expert.expCsgz;
} }
} catch (error) {} } catch (error) {}

@ -38,14 +38,14 @@ export const columns = [
width: 100, width: 100,
}, },
{ {
title: '部门', title: '院系/部门',
width: 150, width: 150,
dataIndex: 'orgCodeTxt', dataIndex: 'orgCodeTxt',
}, },
{ {
title: '负责部门', title: '角色',
width: 150, width: 150,
dataIndex: 'departIds_dictText', dataIndex: 'roleTxt',
}, },
{ {
title: '状态', title: '状态',

@ -40,14 +40,14 @@ export const columns: BasicColumn[] = [
width: 100, width: 100,
}, },
{ {
title: '部门', title: '院系/部门',
width: 150, width: 150,
dataIndex: 'orgCodeTxt', dataIndex: 'orgCodeTxt',
}, },
{ {
title: '负责部门', title: '角色',
width: 150, width: 150,
dataIndex: 'departIds_dictText', dataIndex: 'roleTxt',
}, },
{ {
title: '状态', title: '状态',

@ -182,16 +182,16 @@ export const formSchemaZJ: FormSchema[] = [
labelKey: 'name', labelKey: 'name',
}, },
},*/ },*/
{ /* {
label: '角色', label: '角色',
field: 'selectedroles', field: 'selectedroles',
component: 'ApiSelect', component: 'ApiSelect',
componentProps: { componentProps: {
api: getAllRolesListNoByExcludeTenant, api: getAllRolesListNoByTenant,
labelField: 'roleName', labelField: 'roleName',
valueField: 'id', valueField: 'id',
}, },
}, },*/
{ {
label: '所属部门', label: '所属部门',
field: 'selecteddeparts', field: 'selecteddeparts',
@ -306,20 +306,40 @@ export const formSchemaZJ: FormSchema[] = [
}, },
},*/ },*/
{ {
label: '专家毕业院校', label: '学历',
field: 'expSc', field: 'expTitle',
component: 'Input', component: 'Input',
}, },
{ {
label: '专家履历', label: '学位',
field: 'expResume', field: 'expXw',
component: 'InputTextArea', component: 'Input',
}, },
{ {
label: '专家学历', label: '职称',
field: 'expTitle', field: 'expZc',
component: 'Input', component: 'Input',
}, },
{
label: '研究方向',
field: 'expYjfx',
component: 'Input',
},
{
label: '从事工作',
field: 'expCsgz',
component: 'Input',
},
{
label: '毕业院校',
field: 'expSc',
component: 'Input',
},
{
label: '简介',
field: 'expResume',
component: 'InputTextArea',
},
{ {
label: '比赛', label: '比赛',
field: 'compid', field: 'compid',

@ -20,6 +20,7 @@
import { useDrawerAdaptiveWidth } from '/@/hooks/jeecg/useAdaptiveWidth'; import { useDrawerAdaptiveWidth } from '/@/hooks/jeecg/useAdaptiveWidth';
import { getTenantId } from "/@/utils/auth"; import { getTenantId } from "/@/utils/auth";
import {saveOrUpdateUserZJ} from "/@/views/system/userZJ/userZJ.api"; import {saveOrUpdateUserZJ} from "/@/views/system/userZJ/userZJ.api";
import {queryExpertById} from "/@/views/system/user/userZJ.api";
// Emits // Emits
const emit = defineEmits(['success', 'register']); const emit = defineEmits(['success', 'register']);
@ -59,6 +60,27 @@
} }
} catch (error) {} } catch (error) {}
try {
const Expert = await queryExpertById({ id: data.record.id });
console.log(Expert);
if (Expert!=null) {
data.record.expSc = Expert.expSc;
data.record.expResume = Expert.expResume;
data.record.expTitle = Expert.expTitle;
data.record.compid = Expert.compid;
data.record.compName = Expert.compName;
data.record.stat = Expert.stat;
data.record.expXw = Expert.expXw;
data.record.expZc = Expert.expZc;
data.record.expYjfx = Expert.expYjfx;
data.record.expCsgz = Expert.expCsgz;
}
} catch (error) {}
/// ///
const userDepart = await getUserDepartList({ userId: data.record.id }); const userDepart = await getUserDepartList({ userId: data.record.id });
if (userDepart && userDepart.length > 0) { if (userDepart && userDepart.length > 0) {

@ -6,9 +6,9 @@
<template #tableTitle> <template #tableTitle>
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleCreate"> 新增</a-button> <a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleCreate"> 新增</a-button>
<!-- <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</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>--> <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" preIcon="ant-design:export-outlined" @click="onExportXlsMb"> 模板</a-button>
<JThirdAppButton biz-type="user" :selected-row-keys="selectedRowKeys" syncToApp syncToLocal @sync-finally="onSyncFinally" /> <JThirdAppButton biz-type="user" :selected-row-keys="selectedRowKeys" syncToApp syncToLocal @sync-finally="onSyncFinally" />
<a-dropdown v-if="selectedRowKeys.length > 0"> <a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay> <template #overlay>
@ -62,7 +62,7 @@
import { useModal } from '/@/components/Modal'; import { useModal } from '/@/components/Modal';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import { columns, searchFormSchema } from './user.data'; import { columns, searchFormSchema } from './user.data';
import { listZjNoCareTenant, deleteUser, batchDeleteUser, getImportUrl, getExportUrl, frozenBatch, syncUser,queryByUserId,getExportUrlMb } from './user.api'; import { listZjNoCareTenant, deleteUser, batchDeleteUser, getZjImportUrl, getExportZjUrl, frozenBatch, syncUser,queryByUserId,getExportZjUrlMb } from './user.api';
import {usePermission} from "/@/hooks/web/usePermission"; import {usePermission} from "/@/hooks/web/usePermission";
import {defHttp} from "../../../utils/http/axios"; import {defHttp} from "../../../utils/http/axios";
@ -95,16 +95,16 @@
}, },
}, },
exportConfig: { exportConfig: {
name: '用户列表', name: '专家列表',
url: getExportUrl, url: getExportZjUrl,
}, },
exportConfigMb: { exportConfigMb: {
name: "导模板", name: "导模板",
url: getExportUrlMb, url: getExportZjUrlMb,
params: null, params: null,
}, },
importConfig: { importConfig: {
url: getImportUrl, url: getZjImportUrl,
}, },
}); });
@ -127,7 +127,6 @@
*/ */
async function handleEdit(record: Recordable) { async function handleEdit(record: Recordable) {
await queryByUserId({ id: record.id }).then(res => { await queryByUserId({ id: record.id }).then(res => {
openDrawer(true, { openDrawer(true, {
record, record,
isUpdate: true, isUpdate: true,

@ -19,6 +19,7 @@ enum Api {
deleteBatch = '/sys/user/deleteBatch', deleteBatch = '/sys/user/deleteBatch',
importExcel = '/sys/user/importExcel', importExcel = '/sys/user/importExcel',
exportXls = '/sys/user/exportXls', exportXls = '/sys/user/exportXls',
recycleBinList = '/sys/user/recycleBin', recycleBinList = '/sys/user/recycleBin',
putRecycleBin = '/sys/user/putRecycleBin', putRecycleBin = '/sys/user/putRecycleBin',
deleteRecycleBin = '/sys/user/deleteRecycleBin', deleteRecycleBin = '/sys/user/deleteRecycleBin',
@ -38,6 +39,13 @@ enum Api {
updateUserTenantStatus='/sys/tenant/updateUserTenantStatus', updateUserTenantStatus='/sys/tenant/updateUserTenantStatus',
getUserTenantPageList='/sys/tenant/getUserTenantPageList', getUserTenantPageList='/sys/tenant/getUserTenantPageList',
exportXlsMb = '/sys/user/exportXlsMb', exportXlsMb = '/sys/user/exportXlsMb',
//导出专家
exportZjXls = '/expert/expert/exportXls',
//导出专家模板
exportZjXlsMb = '/expert/expert/exportXlsMb',
//导入专家
getZjImportUrl = '/expert/expert/importExcel',
queryByUserId = '/expert/expert/queryByUserId', queryByUserId = '/expert/expert/queryByUserId',
} }
/** /**
@ -54,6 +62,19 @@ export const queryByUserId = (params) => {
export const getExportUrl = Api.exportXls; export const getExportUrl = Api.exportXls;
export const getExportUrlMb = Api.exportXlsMb; export const getExportUrlMb = Api.exportXlsMb;
/**
*
*/
export const getExportZjUrl = Api.exportZjXls;
/**
*
*/
export const getExportZjUrlMb = Api.exportZjXlsMb;
/**
*
*/
export const getZjImportUrl = Api.getZjImportUrl;
/** /**
* api * api
*/ */

Loading…
Cancel
Save