From b5960d1968e007b91d4d33dd7cbb74f1b566f2c1 Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Fri, 24 May 2024 10:20:01 +0800
Subject: [PATCH] 到期时间修改

---
 src/main/java/org/springblade/modules/information/service/impl/InformationServiceImpl.java |  221 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 216 insertions(+), 5 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 127d786..c395148 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
@@ -18,11 +18,15 @@
 
 import org.springblade.modules.dispatcher.vo.DispatcherVO;
 import org.springblade.modules.information.entity.Information;
+import org.springblade.modules.information.excel.ExportInformationExcel;
+import org.springblade.modules.information.excel.ExportInformationSecurityStatistics;
+import org.springblade.modules.information.vo.InformationStatisticsVO;
 import org.springblade.modules.information.vo.InformationVO;
 import org.springblade.modules.information.mapper.InformationMapper;
 import org.springblade.modules.information.service.IInformationService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springblade.modules.information.vo.ResponseVo;
+import org.springblade.modules.system.entity.Dept;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 
@@ -40,7 +44,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){
+					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
@@ -188,8 +214,47 @@
 	}
 
 	@Override
-	public IPage selectLi(IPage page,String jurisdiction, String deptid,String stats) {
-		return page.setRecords(baseMapper.selectLi(page,jurisdiction, deptid,stats));
+	public IPage selectLi(IPage page,String jurisdiction, String deptid,String stats,String startTime,String endTime) {
+		List<InformationStatisticsVO> list = baseMapper.selectLi(page, jurisdiction, deptid, stats, startTime, endTime);
+		if (list.size()>0) {
+			//遍历
+			for (InformationStatisticsVO informationStatisticsVO : list) {
+				List<Dept> deptList = baseMapper.getDeptHashChildrens(informationStatisticsVO);
+				//有子级
+				if (deptList.size()>0){
+					Dept dept = new Dept();
+					dept.setId(Long.parseLong(informationStatisticsVO.getDepartmentid()));
+					//查询当前子单位的人数
+					Integer z = baseMapper.selectInformationUserNumCount(dept) + informationStatisticsVO.getNum();
+					informationStatisticsVO.setNum(z);
+					//持证人数
+					Integer c = baseMapper.selectInformationHoldNumCount(dept) + informationStatisticsVO.getCznum();
+					informationStatisticsVO.setCznum(c);
+					//已派遣人数
+					Integer p = baseMapper.selectInformationDispatcherNumCount(dept) + informationStatisticsVO.getPqnum();
+					informationStatisticsVO.setPqnum(p);
+					//未派遣人数
+					Integer wpq = baseMapper.selectInformationNotDispatcherNumCount(dept) + informationStatisticsVO.getWpqnum();
+					informationStatisticsVO.setWpqnum(wpq);
+					//已采集照片数
+					Integer ycjzp = baseMapper.selectInformationUnitAvatarNumCount(dept) + informationStatisticsVO.getYcjzpnum();
+					informationStatisticsVO.setYcjzpnum(ycjzp);
+					//未采集照片数
+					Integer wcjzp = baseMapper.selectInformationUnitNotAvatarNumCount(dept) + informationStatisticsVO.getWcjzpnum();
+					informationStatisticsVO.setWcjzpnum(wcjzp);
+					//已采集指纹数
+					Integer ycjzw = baseMapper.selectInformationUnitZwNumCount(dept) + informationStatisticsVO.getYcjzwnum();
+					informationStatisticsVO.setYcjzwnum(ycjzw);
+					//审查异常数
+					Integer scyc = baseMapper.selectInformationUnitYcNumCount(dept) + informationStatisticsVO.getScycnum();
+					informationStatisticsVO.setScycnum(scyc);
+					//缴纳社保数
+					Integer jnsb = baseMapper.selectInformationUnitJnsbNumCount(dept) + informationStatisticsVO.getJnsbnum();
+					informationStatisticsVO.setJnsbnum(jnsb);
+				}
+			}
+		}
+		return page.setRecords(list);
 	}
 
 	@Override
@@ -223,8 +288,35 @@
 	}
 
 	@Override
-	public IPage selectYw(IPage page,String jurisdiction, String deptid,String stats) {
-		return page.setRecords(baseMapper.selectYw(page,jurisdiction, deptid,stats));
+	public IPage selectYw(IPage page,String jurisdiction, String deptid,String stats,String startTime,String endTime) {
+		List<InformationStatisticsVO> list = baseMapper.selectYw(page, jurisdiction, deptid, stats, startTime, endTime);
+		if (list.size()>0) {
+			//遍历
+			for (InformationStatisticsVO informationStatisticsVO : list) {
+				List<Dept> deptList = baseMapper.getDeptHashChildrens(informationStatisticsVO);
+				//有子级
+				if (deptList.size()>0){
+					Dept dept = new Dept();
+					dept.setId(Long.parseLong(informationStatisticsVO.getDepartmentid()));
+					//查询当前子单位的人数
+					Integer z = baseMapper.selectInformationUserNumCount(dept) + informationStatisticsVO.getZnum();
+					informationStatisticsVO.setZnum(z);
+					//已派遣人数
+					Integer p = baseMapper.selectInformationDispatcherNumCount(dept) + informationStatisticsVO.getPqnum();
+					informationStatisticsVO.setPqnum(p);
+					//持证人数
+					Integer c = baseMapper.selectInformationHoldNumCount(dept) + informationStatisticsVO.getCznum();
+					informationStatisticsVO.setCznum(c);
+					//服务单位数
+					Integer f = baseMapper.selectInformationUnitNumCount(dept) + informationStatisticsVO.getFwnum();
+					informationStatisticsVO.setFwnum(f);
+					//服务单位到期数
+					Integer d = baseMapper.selectInformationUnitExpireNumCount(dept) + informationStatisticsVO.getDqnum();
+					informationStatisticsVO.setDqnum(d);
+				}
+			}
+		}
+		return page.setRecords(list);
 	}
 
 	@Override
@@ -441,4 +533,123 @@
 	public List<ResponseVo> getSecurityHoldAndSoidAndDispatchGroupCountList(Integer type) {
 		return baseMapper.getSecurityHoldAndSoidAndDispatchGroupCountList(type);
 	}
+
+	@Override
+	public List<Map<Object, Object>> seleFj(String jurisdiction) {
+		return baseMapper.seleFj(jurisdiction);
+	}
+	@Override
+	public IPage selectBxc(IPage page,String jurisdiction,String type) {
+		return page.setRecords(baseMapper.selectBxc(page,jurisdiction,type));
+	}
+
+	/**
+	 * 保安员统计
+	 * @param jurisdiction 辖区id
+	 * @param deptid 部门名称
+	 * @param stats 公司类型
+	 * @param startTime 企业注册时间
+	 * @param endTime 企业注册时间
+	 * @return
+	 */
+	@Override
+	public List<ExportInformationSecurityStatistics> exportSecurityStatisInfo(String jurisdiction, String deptid, String stats, String startTime, String endTime) {
+		List<ExportInformationSecurityStatistics> list = baseMapper.exportSecurityStatisInfo(jurisdiction, deptid, stats, startTime, endTime);
+		if (list.size()>0) {
+			//遍历
+			for (ExportInformationSecurityStatistics informationStatisticsVO : list) {
+				List<Dept> deptList = baseMapper.getDeptChildrens(informationStatisticsVO.getDepartmentid());
+				//有子级
+				if (deptList.size()>0){
+					Dept dept = new Dept();
+					dept.setId(Long.parseLong(informationStatisticsVO.getDepartmentid()));
+					//查询当前子单位的人数
+					Integer z = baseMapper.selectInformationUserNumCount(dept) + informationStatisticsVO.getNum();
+					informationStatisticsVO.setNum(z);
+					//持证人数
+					Integer c = baseMapper.selectInformationHoldNumCount(dept) + informationStatisticsVO.getCznum();
+					informationStatisticsVO.setCznum(c);
+					//已派遣人数
+					Integer p = baseMapper.selectInformationDispatcherNumCount(dept) + informationStatisticsVO.getPqnum();
+					informationStatisticsVO.setPqnum(p);
+					//未派遣人数
+					Integer wpq = baseMapper.selectInformationNotDispatcherNumCount(dept) + informationStatisticsVO.getWpqnum();
+					informationStatisticsVO.setWpqnum(wpq);
+					//已采集照片数
+					Integer ycjzp = baseMapper.selectInformationUnitAvatarNumCount(dept) + informationStatisticsVO.getYcjzpnum();
+					informationStatisticsVO.setYcjzpnum(ycjzp);
+					//未采集照片数
+					Integer wcjzp = baseMapper.selectInformationUnitNotAvatarNumCount(dept) + informationStatisticsVO.getWcjzpnum();
+					informationStatisticsVO.setWcjzpnum(wcjzp);
+					//已采集指纹数
+					Integer ycjzw = baseMapper.selectInformationUnitZwNumCount(dept) + informationStatisticsVO.getYcjzwnum();
+					informationStatisticsVO.setYcjzwnum(ycjzw);
+					//审查异常数
+					Integer scyc = baseMapper.selectInformationUnitYcNumCount(dept) + informationStatisticsVO.getScycnum();
+					informationStatisticsVO.setScycnum(scyc);
+					//缴纳社保数
+					Integer jnsb = baseMapper.selectInformationUnitJnsbNumCount(dept) + informationStatisticsVO.getJnsbnum();
+					informationStatisticsVO.setJnsbnum(jnsb);
+				}
+			}
+		}
+		return list;
+	}
+
+	/**
+	 * 业务情况统计
+	 * @param jurisdiction 辖区id
+	 * @param deptid 部门名称
+	 * @param stats 公司类型
+	 * @param startTime 企业注册时间
+	 * @param endTime 企业注册时间
+	 * @return
+	 */
+	@Override
+	public List<ExportInformationExcel> exportBusinessStatis(String jurisdiction, String deptid, String stats, String startTime, String endTime) {
+		List<ExportInformationExcel> list = baseMapper.exportBusinessStatis(jurisdiction, deptid, stats, startTime, endTime);
+		if (list.size()>0) {
+			//遍历
+			for (ExportInformationExcel informationStatisticsVO : list) {
+				List<Dept> deptList = baseMapper.getDeptChildrens(informationStatisticsVO.getDepartmentid());
+				//有子级
+				if (deptList.size()>0){
+					Dept dept = new Dept();
+					dept.setId(Long.parseLong(informationStatisticsVO.getDepartmentid()));
+					//查询当前子单位的人数
+					Integer z = baseMapper.selectInformationUserNumCount(dept) + informationStatisticsVO.getZnum();
+					informationStatisticsVO.setZnum(z);
+					//已派遣人数
+					Integer p = baseMapper.selectInformationDispatcherNumCount(dept) + informationStatisticsVO.getPqnum();
+					informationStatisticsVO.setPqnum(p);
+					//持证人数
+					Integer c = baseMapper.selectInformationHoldNumCount(dept) + informationStatisticsVO.getCznum();
+					informationStatisticsVO.setCznum(c);
+					//服务单位数
+					Integer f = baseMapper.selectInformationUnitNumCount(dept) + informationStatisticsVO.getFwnum();
+					informationStatisticsVO.setFwnum(f);
+					//服务单位到期数
+					Integer d = baseMapper.selectInformationUnitExpireNumCount(dept) + informationStatisticsVO.getDqnum();
+					informationStatisticsVO.setDqnum(d);
+				}
+			}
+		}
+		return list;
+	}
+
+
+	/**
+	 * 获取部门信息()
+	 * @param information
+	 * @return
+	 */
+	@Override
+	public Object getInformationDetails(InformationVO information) {
+		//根据部门id 查询部门信息(如果有总公司,则遍历出总公司来)
+		List<String> deptIdList = baseMapper.getDeptDetails(information);
+		//取第一个查询部门信息
+		InformationVO informationVO = baseMapper.getInformationDetails(deptIdList.get(0));
+		//返回
+		return informationVO;
+	}
 }

--
Gitblit v1.9.3