Browse Source

统计表修改

anderx 11 months ago
parent
commit
df79f96bb0
1 changed files with 9 additions and 19 deletions
  1. 9 19
      src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java

+ 9 - 19
src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java

@@ -385,7 +385,12 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 	@Override
 	public DepCountBo selectAllUser(String depId, String startTime, String endTime,String aName) {
 		DepCountBo acb=new DepCountBo();
-		if (endTime!=null)endTime=endTime+" 23:59:59";
+		if (StringUtils.isNotBlank(startTime))startTime=null;
+		if (StringUtils.isNotBlank(endTime)){
+			endTime = null;
+		}else {
+			endTime=endTime+" 23:59:59";
+		}
 		List<DepCountBo >deps=new ArrayList<>();
 		List<Department> depIds=new ArrayList<>();
 		//总裁助力不查看老员工
@@ -716,30 +721,15 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 
 	@Override
 	public Result selectAllUserExport(String depId, String startTime, String endTime, String aName) {
-		String endTimeStr=endTime+" 23:59:59";
-		List<Department> depIds=new ArrayList<>();
-		//总裁助力不查看老员工
-		Integer seniorstaff = null;
-		if (TokenManager.hasRole(AFTConstants.CED_ASSISTANT)){
-			seniorstaff=0;
-		}
-		OrganizationListOut oo=departmentMapper.selectAllById(depId);
 		if(TokenManager.hasRole(AFTConstants.OPERATION_MANAGER)){
 			List<String> myShiroDep = departmentService.selectMyDeps();
 			if (!myShiroDep.contains(depId))throw new BusinessException("无权查看此部门信息");
 		}
-		depIds =departmentService.selectSubordinateDeps(depId);
-		Department department = new Department();
-		department.setId(depId);
-		depIds.add(department);
-		List<AdminCustomerBo> list =null;
-		//原sql计算
-//		list=departmentMapper.AlldepCount(depIds,startTime,  endTime);
-		//新java计算
-		list=AllDepCount(depIds,startTime,endTimeStr,seniorstaff);
+		DepCountBo depCountBo = selectAllUser(depId, startTime, endTime, aName);
+		List<AdminCustomerBo> adminCustomerBos = depCountBo.getaList();
 		NewExcelUtil excel=new NewExcelUtil(AdminCustomerBo.class);
 		String sheetName=String.format("部门统计表_%s~%s",startTime,endTime);
-		return excel.exportExcel(list,sheetName,uploadPath);
+		return excel.exportExcel(adminCustomerBos,sheetName,uploadPath);
 	}
 
 	/**