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

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

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