更换图标

master
hanbo 2021-11-04 14:49:26 +08:00
parent 00a2b870bd
commit 2ca051b854
5 changed files with 12 additions and 24 deletions

View File

@ -220,20 +220,14 @@ public class AccountController extends BaseController {
model.put("keywords", keywords);
}
/**
*
* @param keywords
* @param model
* @param response
* @throws IOException
*/
@RequestMapping("/export")
public void export(@RequestParam(value = "keywords",required = false) String keywords,Map<String, Object> model,
HttpServletResponse response) throws IOException {
// 初始化参数
ConcurrentHashMap<String, String> searchInfo = getSearchInfo(keywords,model);
downloadHeader(response , Utils.generateExcelName("人员信息"));
accountService.exportExcel(response,searchInfo);
public void export(@RequestParam(value = "keywords",required = false) String keywords, HttpServletResponse httpServletResponse) throws IOException {
Map<String, String> searchInfo = getSearchInfo(keywords);
downloadHeader(httpServletResponse , Utils.generateExcelName("人员信息"), "application/octet-stream");
String[] headers = {"工号", "手机号码", "姓名", "常驻地", "一级部门", "直接主管", "职位", "所属角色", "公司邮件地址"};
String[] exportColumns = {"empCode", "telephone", "workLocation", "deptName", "directManager", "positionName", "roleName", "companyEmail"};
ExportUtils.exportToExcel(headers, exportColumns, 1, 10000,
httpServletResponse.getOutputStream(), (pN, pS) -> accountService.getAdminList(searchInfo, pN, pS).getList());
}
/**

View File

@ -4,6 +4,7 @@ import cn.palmte.work.model.SysRole;
import top.jfunc.common.db.bean.Page;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
public interface AdminRepositoryCustom {
@ -30,7 +31,7 @@ public interface AdminRepositoryCustom {
* @param pageNum
* @return
*/
Page getAdminList(ConcurrentHashMap<String, String> searchInfo, int pageSize, int pageNum);
Page getAdminList(Map<String, String> searchInfo, int pageSize, int pageNum);
/**
* ID

View File

@ -116,7 +116,7 @@ public class AdminRepositoryImpl implements AdminRepositoryCustom {
}
@Override
public Page<Admin> getAdminList(ConcurrentHashMap<String, String> searchInfo, int pageSize, int pageNum) {
public Page<Admin> getAdminList(Map<String, String> searchInfo, int pageSize, int pageNum) {
Page<Admin> page = new Page(pageNum, pageSize);
int thisPage = (pageNum - 1) * pageSize;
String sql = getSelect() + getSqlExceptSelect(searchInfo) + " limit " + thisPage + "," + pageSize;
@ -158,7 +158,7 @@ public class AdminRepositoryImpl implements AdminRepositoryCustom {
return select;
}
public String getSqlExceptSelect(ConcurrentHashMap<String, String> searchInfo) {
public String getSqlExceptSelect(Map<String, String> searchInfo) {
StringBuffer sqlExceptSelect = new StringBuffer(" from sys_user u LEFT JOIN sys_user_role ur on u.id = ur.user_id LEFT JOIN sys_role r on r.id = ur.role_id ");
Admin admin = InterfaceUtil.getAdmin();

View File

@ -55,7 +55,7 @@ public class AccountService {
@Autowired
private UserPositionRepository userPositionRepository;
public Page<Admin> getAdminList(ConcurrentHashMap<String, String> searchInfo, int pageSize, int pageNum) {
public Page<Admin> getAdminList(Map<String, String> searchInfo, int pageSize, int pageNum) {
Page<Admin> adminList = adminRepositoryImpl.getAdminList(searchInfo, pageSize, pageNum);
return adminList;
}
@ -255,13 +255,6 @@ public class AccountService {
return false;
}
public void exportExcel(HttpServletResponse response, ConcurrentHashMap<String, String> searchInfo) throws IOException {
String[] headers = {"工号", "手机号码", "姓名", "常驻地", "一级部门", "直接主管", "职位", "所属角色", "公司邮件地址"};
String[] exportColumns = {"empCode", "telephone", "workLocation", "deptName", "directManager", "positionName", "roleName", "companyEmail"};
ExportUtils.exportToExcel(headers, exportColumns, 1, 5000,
response.getOutputStream(), (pN, pS) -> getAdminList(searchInfo, pN, pS).getList());
}
public ResponseMsg check(Collection<Map> maps) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 34 KiB