|
|
@@ -18,6 +18,7 @@ import com.goafanti.admin.bo.AdminCustomerBo;
|
|
|
import com.goafanti.admin.bo.AdminCustomerDetailBo;
|
|
|
import com.goafanti.admin.bo.AdminDetail;
|
|
|
import com.goafanti.admin.bo.AdminListBo;
|
|
|
+import com.goafanti.admin.bo.depCountBo;
|
|
|
import com.goafanti.admin.service.AdminService;
|
|
|
import com.goafanti.common.constant.AFTConstants;
|
|
|
import com.goafanti.common.dao.AdminLocationMapper;
|
|
|
@@ -35,6 +36,7 @@ import com.goafanti.core.mybatis.BaseMybatisDao;
|
|
|
import com.goafanti.core.mybatis.page.Pagination;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
import com.goafanti.customer.bo.BusinessListBo;
|
|
|
+import com.goafanti.organization.bo.OrganizationListOut;
|
|
|
|
|
|
@Service
|
|
|
public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements AdminService {
|
|
|
@@ -363,36 +365,81 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public AdminCustomerBo selectAllUser(String depId, String startTime, String endTime, Integer pageSize, Integer pageNo) {
|
|
|
- AdminCustomerBo acb=new AdminCustomerBo();
|
|
|
- List<AdminCustomerBo >deps=new ArrayList<>();
|
|
|
+ public depCountBo selectAllUser(String depId, String startTime, String endTime,String aName) {
|
|
|
+ depCountBo acb=new depCountBo();
|
|
|
+ List<depCountBo >deps=new ArrayList<>();
|
|
|
if (depId==null) {
|
|
|
- acb.setDepName("科德集团");
|
|
|
- //首先把值全部归零
|
|
|
- acb.setCompleteCount(0);
|
|
|
- acb.setInputCount(0);
|
|
|
- acb.setInterviewCount(0);
|
|
|
- acb.setReceiveCount(0);
|
|
|
- acb.setUserCount(0);
|
|
|
- deps=organizationManagementMapper.getDepAll("科德集团",null,startTime, endTime);
|
|
|
- nestingList(deps,startTime, endTime);
|
|
|
- acb.setList(deps);
|
|
|
- }else {
|
|
|
+ acb.setName("科德集团");
|
|
|
+// organizationManagementMapper.getDepAll("科德集团",null,startTime, endTime);
|
|
|
+ deps=organizationManagementMapper.selectBysuperName("科德集团");
|
|
|
|
|
|
+ }else {
|
|
|
+ OrganizationListOut oo=organizationManagementMapper.selectAllById(depId);
|
|
|
+ acb.setName(oo.getName());
|
|
|
+ deps=organizationManagementMapper.selectBysuperName(acb.getName());
|
|
|
}
|
|
|
+ acb.setCompleteCount(0);
|
|
|
+ acb.setInputCount(0);
|
|
|
+ acb.setInterviewCount(0);
|
|
|
+ acb.setReceiveCount(0);
|
|
|
+ acb.setUserCount(0);
|
|
|
+ acb.setaList(new ArrayList<>());
|
|
|
+ //迭代查出所有层级并计算
|
|
|
+ acb.setList(nestingList(deps,startTime, endTime,aName));
|
|
|
+ //计算顶层
|
|
|
+ sumCount(acb,0);
|
|
|
return acb;
|
|
|
}
|
|
|
|
|
|
- private void nestingList(List<AdminCustomerBo >deps,String startTime, String endTime) {
|
|
|
+ private List<depCountBo> nestingList(List<depCountBo>deps,String startTime, String endTime,String name) {
|
|
|
+ List<depCountBo> res=new ArrayList<>();
|
|
|
//循环取出其中
|
|
|
- for (AdminCustomerBo ab : deps) {
|
|
|
+ for (depCountBo ab : deps) {
|
|
|
//找出每一个部门的直部门,并嵌套下去,先获取然后将
|
|
|
- List<AdminCustomerBo >deps2=organizationManagementMapper.getDepAll(null,ab.getDepId(),startTime, endTime);
|
|
|
- nestingList(deps2,startTime, endTime);
|
|
|
- //待继续开发
|
|
|
+ List<depCountBo >deps2=organizationManagementMapper.selectBysuperName(ab.getName());
|
|
|
+ //查找所有部门的人的信息
|
|
|
+ List<AdminCustomerBo> aList=organizationManagementMapper.getDepAll(ab.getName(),null,name,startTime, endTime);
|
|
|
+ ab.setList(nestingList(deps2,startTime, endTime,name));
|
|
|
+ ab.setaList(aList);
|
|
|
+ //计算总数
|
|
|
+ sumCount(ab,1);
|
|
|
+ if (ab.getCompleteCount()!=0||ab.getInputCount()!=0||ab.getInterviewCount()!=0
|
|
|
+ ||ab.getReceiveCount()!=0||ab.getUserCount()!=0) {
|
|
|
+ res.add(ab);
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param ab
|
|
|
+ * @param type 0 部门计算 1人员计算
|
|
|
+ */
|
|
|
+ private void sumCount(depCountBo ab,int type ) {
|
|
|
+ int completeCount=0,inputCount=0,interviewCount=0,receiveCount=0,userCount=0;
|
|
|
+ if (ab.getList()!=null&&!ab.getList().isEmpty()) {
|
|
|
+ for (depCountBo a : ab.getList()) {
|
|
|
+ if ( a.getCompleteCount()!=0) completeCount+=a.getCompleteCount();
|
|
|
+ if ( a.getInputCount()!=0) inputCount+=a.getInputCount();
|
|
|
+ if ( a.getInterviewCount()!=0) interviewCount+=a.getInterviewCount();
|
|
|
+ if ( a.getReceiveCount()!=0) receiveCount+=a.getReceiveCount();
|
|
|
+ if ( a.getUserCount()!=0) userCount+=a.getUserCount();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (ab.getaList()!=null&&!ab.getaList().isEmpty()) {
|
|
|
+ for (AdminCustomerBo a : ab.getaList()) {
|
|
|
+ if ( a.getCompleteCount()!=0) completeCount+=a.getCompleteCount();
|
|
|
+ if ( a.getInputCount()!=0) inputCount+=a.getInputCount();
|
|
|
+ if ( a.getInterviewCount()!=0) interviewCount+=a.getInterviewCount();
|
|
|
+ if ( a.getReceiveCount()!=0) receiveCount+=a.getReceiveCount();
|
|
|
+ if ( a.getUserCount()!=0) userCount+=a.getUserCount();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ab.setCompleteCount(completeCount);
|
|
|
+ ab.setInputCount(inputCount);
|
|
|
+ ab.setInterviewCount(interviewCount);
|
|
|
+ ab.setReceiveCount(receiveCount);
|
|
|
+ ab.setUserCount(userCount);
|
|
|
}
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
@@ -430,6 +477,8 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
|
|
|
return i;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
}
|