Commit 7f17e5be authored by 竹天卫's avatar 竹天卫

人员产值统计导出功能 优化2

parent dcf345c2
......@@ -34,9 +34,9 @@ public class NonStandardApplyController {
@ApiOperation(value = "非标产值申请分页")
@GetMapping("/getPage")
public BaseResponse getPage(PageQuery pageQuery, String name,Integer userId) {
public BaseResponse getPage(PageQuery pageQuery) {
try {
return iNonStandardApplyService.getPage(pageQuery, name,userId);
return iNonStandardApplyService.getPage(pageQuery);
} catch (Exception e) {
log.debug("非标产值申请分页列表{}", e);
}
......@@ -115,9 +115,9 @@ public class NonStandardApplyController {
@ApiOperation("导出-非标产值申请列表")
@PostMapping("/exportList")
public void exportList(String filename, Integer userId, String name, HttpServletResponse response) {
public void exportList(String filename, HttpServletResponse response) {
try {
iNonStandardApplyService.exportList(filename, userId, name, response);
iNonStandardApplyService.exportList(filename, response);
} catch (Exception e) {
log.debug("导出-非标产值申请导出列表{}", e);
}
......
......@@ -27,7 +27,7 @@ public interface INonStandardApplyService extends IService<NonStandardApply> {
* @param pageQuery 非标产值信息分页
* @return IPage<NoneStandardApply>
*/
BaseResponse<IPage<NonStandardApplyVo>> getPage(PageQuery pageQuery, String name,Integer userId);
BaseResponse<IPage<NonStandardApplyVo>> getPage(PageQuery pageQuery);
/**
* 获取所有非标产值申请信息
......@@ -67,15 +67,7 @@ public interface INonStandardApplyService extends IService<NonStandardApply> {
*/
BaseResponse delete(Integer id);
/**
* 非标产值申请列表导出
*
* @param userId 用户id
* @param name 姓名
* @param filename 文件名
* @param response
*/
void exportList(String filename, Integer userId, String name, HttpServletResponse response);
void exportList(String filename, HttpServletResponse response);
/**
* 更改状态信息,达到改变显示的效果
......
......@@ -50,10 +50,11 @@ public class NonStandardApplyServiceImpl extends ServiceImpl<NonStandardApplyMap
private ISysUserService userService;
@Override
public BaseResponse<IPage<NonStandardApplyVo>> getPage(PageQuery pageQuery, String name,Integer userId) {
public BaseResponse<IPage<NonStandardApplyVo>> getPage(PageQuery pageQuery) {
LoginUser loginUser = userService.getLoginUser();
Assert.notNull(loginUser, "用户未登录!");
Map<String, Object> params = new HashMap<>();
params.put("name", name);
params.put("userId", userId);
params.put("userId", loginUser.getId());
Page<NonStandardApplyVo> page = new Page<>(pageQuery.getPageNo(), pageQuery.getPageSize());
IPage<NonStandardApplyVo> pages = nonStandardApplyMapper.getPage(page, params);
return BaseResponse.okData(pages);
......@@ -140,18 +141,12 @@ public class NonStandardApplyServiceImpl extends ServiceImpl<NonStandardApplyMap
}
@Override
public void exportList(String filename, Integer userId, String name, HttpServletResponse response) {
Map<String, Object> params = new HashMap<>();
public void exportList(String filename,HttpServletResponse response) {
LoginUser loginUser = userService.getLoginUser();
Assert.notNull(loginUser, "用户未登录!");
if(loginUser!=null){
if(!loginUser.getRoleList().getName().equals("系统管理员")){
Map<String, Object> params = new HashMap<>();
params.put("userId", loginUser.getId());
}
params.put("name", name);
List<Map<String, Object>> list = nonStandardApplyMapper.exportList(params);
if (!CollectionUtils.isEmpty(list)) {
......@@ -181,7 +176,7 @@ public class NonStandardApplyServiceImpl extends ServiceImpl<NonStandardApplyMap
filename == null || filename.trim().length() <= 0 ? "非标产值申请" : filename, headers,
datas, response);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment