|
|
@@ -4,6 +4,7 @@ import com.goafanti.admin.bo.*;
|
|
|
import com.goafanti.admin.service.AdminService;
|
|
|
import com.goafanti.admin.service.DepartmentService;
|
|
|
import com.goafanti.admin.service.NewAdminService;
|
|
|
+import com.goafanti.common.bo.Result;
|
|
|
import com.goafanti.common.constant.AFTConstants;
|
|
|
import com.goafanti.common.dao.*;
|
|
|
import com.goafanti.common.error.BusinessException;
|
|
|
@@ -11,6 +12,7 @@ import com.goafanti.common.model.*;
|
|
|
import com.goafanti.common.utils.LoggerUtils;
|
|
|
import com.goafanti.common.utils.PasswordUtil;
|
|
|
import com.goafanti.common.utils.StringUtils;
|
|
|
+import com.goafanti.common.utils.excel.NewExcelUtil;
|
|
|
import com.goafanti.core.mybatis.BaseMybatisDao;
|
|
|
import com.goafanti.core.mybatis.page.Pagination;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
@@ -18,6 +20,7 @@ import com.goafanti.customer.bo.BusinessListBo;
|
|
|
import com.goafanti.organization.bo.OrganizationListOut;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
@@ -60,6 +63,9 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
|
|
|
@Autowired
|
|
|
private FinanceCountMapper financeCountMapper;
|
|
|
|
|
|
+ @Value(value = "${upload.path}")
|
|
|
+ private String uploadPath = null;
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
@@ -707,6 +713,33 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Result selectAllUserExport(String depId, String startTime, String endTime, String aName) {
|
|
|
+ if (endTime!=null)endTime=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,endTime,seniorstaff);
|
|
|
+ NewExcelUtil excel=new NewExcelUtil(AdminCustomerBo.class);
|
|
|
+ return excel.exportExcel(list,"部门统计表",uploadPath);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
*
|
|
|
* @param list
|