From e30ffbcb28d5cf24a5cf11d7487b1f9a8d82540e Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Fri, 10 Dec 2021 17:24:56 +0800
Subject: [PATCH] 1.押运

---
 src/main/java/org/springblade/modules/information/service/impl/InformationServiceImpl.java |   50 +++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 43 insertions(+), 7 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 99b412f..83de7b1 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,17 +66,39 @@
 
 	@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){
+					Dept dept = new Dept();
+					dept.setId(Long.parseLong(informationVO.getDepartmentid()));
+					//查询当前子单位的人数
+					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
-	public void deleteIn(String creditcode) {
-		baseMapper.deleteIn(creditcode);
+	public void deleteIn(String departmentid) {
+		baseMapper.deleteIn(departmentid);
 	}
 
 	@Override
-	public void deleteSh(String creditcode) {
-		baseMapper.deleteSh(creditcode);
+	public void deleteSh(String deptId) {
+		baseMapper.deleteSh(deptId);
 	}
 
 	@Override
@@ -85,8 +107,8 @@
 	}
 
 	@Override
-	public void deleteMe(String creditcode) {
-		baseMapper.deleteMe(creditcode);
+	public void deleteMe(String deptId) {
+		baseMapper.deleteMe(deptId);
 	}
 
 	@Override
@@ -177,4 +199,18 @@
 			}
 		});
 	}
+
+	/**
+	 * 根据deptid 删除用户信息
+	 * @param deptId
+	 */
+	@Override
+	public void deleteUserByDeptId(String deptId) {
+		baseMapper.deleteUserByDeptId(deptId);
+	}
+
+	@Override
+	public String selJurchilder(String id) {
+		return baseMapper.selJurchilder(id);
+	}
 }

--
Gitblit v1.9.3