更换图标
parent
00a2b870bd
commit
2ca051b854
|
@ -220,20 +220,14 @@ public class AccountController extends BaseController {
|
||||||
model.put("keywords", keywords);
|
model.put("keywords", keywords);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出
|
|
||||||
* @param keywords
|
|
||||||
* @param model
|
|
||||||
* @param response
|
|
||||||
* @throws IOException
|
|
||||||
*/
|
|
||||||
@RequestMapping("/export")
|
@RequestMapping("/export")
|
||||||
public void export(@RequestParam(value = "keywords",required = false) String keywords,Map<String, Object> model,
|
public void export(@RequestParam(value = "keywords",required = false) String keywords, HttpServletResponse httpServletResponse) throws IOException {
|
||||||
HttpServletResponse response) throws IOException {
|
Map<String, String> searchInfo = getSearchInfo(keywords);
|
||||||
// 初始化参数
|
downloadHeader(httpServletResponse , Utils.generateExcelName("人员信息"), "application/octet-stream");
|
||||||
ConcurrentHashMap<String, String> searchInfo = getSearchInfo(keywords,model);
|
String[] headers = {"工号", "手机号码", "姓名", "常驻地", "一级部门", "直接主管", "职位", "所属角色", "公司邮件地址"};
|
||||||
downloadHeader(response , Utils.generateExcelName("人员信息"));
|
String[] exportColumns = {"empCode", "telephone", "workLocation", "deptName", "directManager", "positionName", "roleName", "companyEmail"};
|
||||||
accountService.exportExcel(response,searchInfo);
|
ExportUtils.exportToExcel(headers, exportColumns, 1, 10000,
|
||||||
|
httpServletResponse.getOutputStream(), (pN, pS) -> accountService.getAdminList(searchInfo, pN, pS).getList());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4,6 +4,7 @@ import cn.palmte.work.model.SysRole;
|
||||||
import top.jfunc.common.db.bean.Page;
|
import top.jfunc.common.db.bean.Page;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
public interface AdminRepositoryCustom {
|
public interface AdminRepositoryCustom {
|
||||||
|
@ -30,7 +31,7 @@ public interface AdminRepositoryCustom {
|
||||||
* @param pageNum
|
* @param pageNum
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Page getAdminList(ConcurrentHashMap<String, String> searchInfo, int pageSize, int pageNum);
|
Page getAdminList(Map<String, String> searchInfo, int pageSize, int pageNum);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询用户信息
|
* 根据用户ID查询用户信息
|
||||||
|
|
|
@ -116,7 +116,7 @@ public class AdminRepositoryImpl implements AdminRepositoryCustom {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
Page<Admin> page = new Page(pageNum, pageSize);
|
||||||
int thisPage = (pageNum - 1) * pageSize;
|
int thisPage = (pageNum - 1) * pageSize;
|
||||||
String sql = getSelect() + getSqlExceptSelect(searchInfo) + " limit " + thisPage + "," + pageSize;
|
String sql = getSelect() + getSqlExceptSelect(searchInfo) + " limit " + thisPage + "," + pageSize;
|
||||||
|
@ -158,7 +158,7 @@ public class AdminRepositoryImpl implements AdminRepositoryCustom {
|
||||||
return select;
|
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 ");
|
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();
|
Admin admin = InterfaceUtil.getAdmin();
|
||||||
|
|
|
@ -55,7 +55,7 @@ public class AccountService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserPositionRepository userPositionRepository;
|
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);
|
Page<Admin> adminList = adminRepositoryImpl.getAdminList(searchInfo, pageSize, pageNum);
|
||||||
return adminList;
|
return adminList;
|
||||||
}
|
}
|
||||||
|
@ -255,13 +255,6 @@ public class AccountService {
|
||||||
return false;
|
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) {
|
public ResponseMsg check(Collection<Map> maps) {
|
||||||
|
|
||||||
|
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 34 KiB |
Loading…
Reference in New Issue