From dca2532f01dac86be25ad09fa9ee8035bccdca6a Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Sat, 27 Nov 2021 17:11:33 +0800
Subject: [PATCH] 1.部门tree修改 2.用户查询修改 3.培训报名年龄拦截

---
 src/main/java/org/springblade/modules/information/service/impl/InformationServiceImpl.java |   29 ++++++++++++++++++++++++++++-
 1 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/src/main/java/org/springblade/modules/information/service/impl/InformationServiceImpl.java b/src/main/java/org/springblade/modules/information/service/impl/InformationServiceImpl.java
index 81d63c3..f431ef3 100644
--- a/src/main/java/org/springblade/modules/information/service/impl/InformationServiceImpl.java
+++ b/src/main/java/org/springblade/modules/information/service/impl/InformationServiceImpl.java
@@ -66,7 +66,29 @@
 
 	@Override
 	public IPage<InformationVO> selectInformationPage(IPage<InformationVO> page, InformationVO information) {
-		return page.setRecords(baseMapper.selectInformationPage(page, information));
+		List<InformationVO> informationVOS = baseMapper.selectInformationPage(page, information);
+		//遍历
+		if (informationVOS.size()>0){
+			//判断有无子级
+			for (InformationVO informationVO : informationVOS) {
+				List<Dept> deptList = baseMapper.getDeptHashChildren(informationVO);
+				//有子级
+				if (deptList.size()>0){
+					for (Dept dept : deptList) {
+						//查询当前子单位的人数
+						Integer z = baseMapper.selectInformationUserNumCount(dept) + Integer.parseInt(informationVO.getZnum());
+						informationVO.setZnum(z.toString());
+						//已派遣人数
+						Integer p = baseMapper.selectInformationDispatcherNumCount(dept) + Integer.parseInt(informationVO.getPnum());
+						informationVO.setPnum(p.toString());
+						//持证人数
+						Integer c = baseMapper.selectInformationHoldNumCount(dept) + Integer.parseInt(informationVO.getCnum());
+						informationVO.setCnum(c.toString());
+					}
+				}
+			}
+		}
+		return page.setRecords(informationVOS);
 	}
 
 	@Override
@@ -186,4 +208,9 @@
 	public void deleteUserByDeptId(String deptId) {
 		baseMapper.deleteUserByDeptId(deptId);
 	}
+
+	@Override
+	public String selJurchilder(String id) {
+		return baseMapper.selJurchilder(id);
+	}
 }

--
Gitblit v1.9.3