anderx 4 years ago
parent
commit
f3f8ad6c83

+ 4 - 6
src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java

@@ -28,6 +28,7 @@ import com.goafanti.common.dao.UserBusinessMapper;
 import com.goafanti.common.dao.UserLockReleaseMapper;
 import com.goafanti.common.dao.UserRoleMapper;
 import com.goafanti.common.model.Admin;
+import com.goafanti.common.model.OrganizationManagement;
 import com.goafanti.common.model.UserBusiness;
 import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.PasswordUtil;
@@ -368,12 +369,7 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 	public depCountBo selectAllUser(String depId, String startTime, String endTime,String aName) {
 		depCountBo acb=new depCountBo();
 		List<depCountBo >deps=new ArrayList<>();
-		if (depId==null) {
-			acb.setName("科德集团");
-//			organizationManagementMapper.getDepAll("科德集团",null,startTime,  endTime);
-			deps=organizationManagementMapper.selectBysuperName("科德集团");
-			
-		}else {
+		if (depId!=null){
 			OrganizationListOut oo=organizationManagementMapper.selectAllById(depId);
 			acb.setName(oo.getName());
 			deps=organizationManagementMapper.selectBysuperName(acb.getName());
@@ -383,9 +379,11 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 		acb.setInterviewCount(0);
 		acb.setReceiveCount(0);
 		acb.setUserCount(0);
+		//从一级开是计算待开发
 		//迭代查出所有层级并计算
 		acb.setList(nestingList(deps,startTime,  endTime,aName));
 		//计算顶层
+		
 		acb.setaList(organizationManagementMapper.getDepAll(acb.getName(),null,aName,startTime,  endTime));
 		sumCount(acb,0);
 		return acb;

+ 2 - 2
src/main/java/com/goafanti/common/mapper/OrganizationManagementMapper.xml

@@ -624,8 +624,8 @@
 	</select>
 	
 		<select id="selectBysuperName"  resultType="com.goafanti.admin.bo.depCountBo">
-		select a.id ,a.name ,0 userCount,0 inputCount,0 receiveCount, 0 completeCount, 0 interviewCount
-		from department a left join department b on a.super_id=b.id where b.name= #{superName,jdbcType=VARCHAR}
+		select a.id ,#{superName} ,0 userCount,0 inputCount,0 receiveCount, 0 completeCount, 0 interviewCount
+		from department a left join department b on a.super_id=b.id 
 	</select>
 	
 	<!-- 查询所有 -->

+ 9 - 9
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -1923,13 +1923,13 @@ inner join(
 	on x.rid=y.id)b on a.id =b.uid left join department c  on a.department_id=c.id
 	left join (select x.aid,count(1)as count from (select aid,uid from user_lock_release 
 		where type=1 and status=0 group by aid,uid)x group by aid)d on a.id=d.aid
-	left join (select aid,count(1) as count from user where integrity=1 and type=1 and status=0 and share_type=0 group by aid) e on a.id=e.aid
+	left join (select aid,count(1) as count from user where integrity=1 and type=1 and status=0 and share_type in (0,2) group by aid) e on a.id=e.aid
 	left join (select aid,count(1) as count 
-		from user where integrity=1 and type=1 and status=0 and share_type=0 and to_days(update_time)=to_days(now()) group by aid) f on a.id=f.aid
+		from user where integrity=1 and type=1 and status=0 and share_type in (0,2) and to_days(update_time)=to_days(now()) group by aid) f on a.id=f.aid
 	left join (select aid,count(1) as count 
-		from user where type=1 and status=0 and share_type=0 and to_days(create_time)=to_days(now()) group by aid) g on a.id=g.aid
+		from user where type=1 and status=0 and share_type in (0,2) and to_days(create_time)=to_days(now()) group by aid) g on a.id=g.aid
 	left join (select aid,count(1) as count 
-		from user where type=1 and status=0 and share_type=0  group by aid) h on a.id=h.aid
+		from user where type=1 and status=0 and share_type in (0,2)  group by aid) h on a.id=h.aid
 	left join (select x.aid,count(1)as count from (select x1.aid,x1.uid from user_lock_release x1
 				left join user y on x1.uid=y.id where x1.type=1 
 				and x1.status=0 and y.integrity=1 group by aid,uid)x group by aid) i on a.id=i.aid
@@ -1940,7 +1940,7 @@ inner join(
 	</select>
 	<select id="userDataStatisticsCount" resultType="com.goafanti.report.bo.userDataListBo">
 	select sum(z.signUser) as signUser,sum(z.fullUser) as fullUser,sum(z.dayFullUser) as dayFullUser,
-		sum(z.dayNewUser) as dayNewUser,sum(z.countUser) as countUser,sum(z.signFullUser) as signFullUser  from (select a.name ,c.name as  depName,ifnull(d.count,0) as signUser,ifnull(e.count,0) as fullUser,
+		sum(z.dayNewUser) as dayNewUser,sum(z.countUser) as countUser,sum(z.signFullUser) as signFullUser  from ( select a.name ,c.name as  depName,ifnull(d.count,0) as signUser,ifnull(e.count,0) as fullUser,
 	ifnull(f.count,0) as dayFullUser,ifnull(g.count,0) as dayNewUser,ifnull(h.count,0) as countUser,
 	ifnull(i.count,0) as signFullUser
 	from admin a inner join (select uid from user_role x 
@@ -1948,13 +1948,13 @@ inner join(
 	on x.rid=y.id)b on a.id =b.uid left join department c  on a.department_id=c.id
 	left join (select x.aid,count(1)as count from (select aid,uid from user_lock_release 
 		where type=1 and status=0 group by aid,uid)x group by aid)d on a.id=d.aid
-	left join (select aid,count(1) as count from user where integrity=1 and type=1 and status=0 and share_type=0 group by aid) e on a.id=e.aid
+	left join (select aid,count(1) as count from user where integrity=1 and type=1 and status=0 and share_type in (0,2) group by aid) e on a.id=e.aid
 	left join (select aid,count(1) as count 
-		from user where integrity=1 and type=1 and status=0 and share_type=0 and to_days(update_time)=to_days(now()) group by aid) f on a.id=f.aid
+		from user where integrity=1 and type=1 and status=0 and share_type in (0,2) and to_days(update_time)=to_days(now()) group by aid) f on a.id=f.aid
 	left join (select aid,count(1) as count 
-		from user where type=1 and status=0 and share_type=0 and to_days(create_time)=to_days(now()) group by aid) g on a.id=g.aid
+		from user where type=1 and status=0 and share_type in (0,2) and to_days(create_time)=to_days(now()) group by aid) g on a.id=g.aid
 	left join (select aid,count(1) as count 
-		from user where type=1 and status=0 and share_type=0  group by aid) h on a.id=h.aid
+		from user where type=1 and status=0 and share_type in (0,2)  group by aid) h on a.id=h.aid
 	left join (select x.aid,count(1)as count from (select x1.aid,x1.uid from user_lock_release x1
 				left join user y on x1.uid=y.id where x1.type=1 
 				and x1.status=0 and y.integrity=1 group by aid,uid)x group by aid) i on a.id=i.aid