From f9ff113e9d2e9a3e643b185f08652004e5e43d94 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Mon, 06 Dec 2021 16:19:37 +0800
Subject: [PATCH] 保安员统计导出,业务情况统计导出修改

---
 src/main/java/org/springblade/modules/information/excel/ExportInformationSecurityStatistics.java |   94 ++++++++
 src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml                   |  268 ++++++++++++++++++++++++
 src/main/java/org/springblade/modules/information/service/IInformationService.java               |   24 ++
 src/main/java/org/springblade/modules/information/controller/InformationsController.java         |   48 ++++
 src/main/java/org/springblade/modules/information/mapper/InformationMapper.java                  |   31 ++
 src/main/java/org/springblade/modules/information/excel/ExportInformationExcel.java              |   78 +++++++
 src/main/java/org/springblade/modules/information/service/impl/InformationServiceImpl.java       |   96 ++++++++
 7 files changed, 634 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/springblade/modules/information/controller/InformationsController.java b/src/main/java/org/springblade/modules/information/controller/InformationsController.java
index 987eaca..18b19f5 100644
--- a/src/main/java/org/springblade/modules/information/controller/InformationsController.java
+++ b/src/main/java/org/springblade/modules/information/controller/InformationsController.java
@@ -1,17 +1,29 @@
 package org.springblade.modules.information.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
+import org.springblade.core.excel.util.ExcelUtil;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.constant.BladeConstant;
+import org.springblade.core.tool.utils.DateUtil;
+import org.springblade.modules.information.excel.ExportInformationExcel;
+import org.springblade.modules.information.excel.ExportInformationSecurityStatistics;
 import org.springblade.modules.information.service.IInformationService;
 import org.springblade.modules.information.vo.InformationVO;
 import org.springblade.modules.information.vo.ResponseVo;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springblade.modules.system.entity.User;
+import org.springblade.modules.system.excel.UserExcel;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
 
+import javax.servlet.http.HttpServletResponse;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -241,5 +253,35 @@
 		return R.data(lists);
 	}
 
+	/**
+	 * 保安员统计
+	 */
+	@GetMapping("/export-security-statis-info")
+	public void exportSecurityStatisInfo(HttpServletResponse response,
+										 String jurisdiction,
+										 String deptid,
+										 String stats,
+										 String startTime,
+										 String endTime)
+	{
+		List<ExportInformationSecurityStatistics> list = informationService.exportSecurityStatisInfo(jurisdiction, deptid, stats, startTime, endTime);
+		ExcelUtil.export(response, "保安员统计数据" + DateUtil.time(), "保安员统计数据表", list, ExportInformationSecurityStatistics.class);
+	}
+
+	/**
+	 * 业务情况统计
+	 */
+	@GetMapping("/export-business-statis")
+	public void exportBusinessStatis(HttpServletResponse response,
+										 String jurisdiction,
+										 String deptid,
+										 String stats,
+										 String startTime,
+										 String endTime)
+	{
+		List<ExportInformationExcel> list = informationService.exportBusinessStatis(jurisdiction, deptid, stats, startTime, endTime);
+		ExcelUtil.export(response, "业务统计数据" + DateUtil.time(), "业务统计数据表", list, ExportInformationExcel.class);
+	}
+
 
 }
diff --git a/src/main/java/org/springblade/modules/information/excel/ExportInformationExcel.java b/src/main/java/org/springblade/modules/information/excel/ExportInformationExcel.java
new file mode 100644
index 0000000..11b357f
--- /dev/null
+++ b/src/main/java/org/springblade/modules/information/excel/ExportInformationExcel.java
@@ -0,0 +1,78 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.information.excel;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 业务统计导出
+ * @author zhongrj
+ * @since 2021-12-06
+ */
+@Data
+@ColumnWidth(25)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class ExportInformationExcel implements Serializable {
+	private static final long serialVersionUID = 1L;
+
+	@ColumnWidth(30)
+	@ExcelProperty("企业名称")
+	private String enterpriseName;
+
+	/**
+	 * 公司id(忽略不导出)
+	 */
+	@ExcelIgnore
+	private String departmentid;
+
+	@ColumnWidth(15)
+	@ExcelProperty("企业类型")
+	private String stats;
+
+	@ColumnWidth(15)
+	@ExcelProperty("所属辖区")
+	private String jurname;
+
+	@ColumnWidth(15)
+	@ExcelProperty("保安员人数")
+	private Integer znum;
+
+	@ColumnWidth(15)
+	@ExcelProperty("持证人数")
+	private Integer cznum;
+
+	@ColumnWidth(15)
+	@ExcelProperty("派遣人数")
+	private Integer pqnum;
+
+	@ColumnWidth(15)
+	@ExcelProperty("服务对象数量")
+	private Integer fwnum;
+
+	@ColumnWidth(15)
+	@ExcelProperty("服务到期数量")
+	private Integer dqnum;
+
+}
diff --git a/src/main/java/org/springblade/modules/information/excel/ExportInformationSecurityStatistics.java b/src/main/java/org/springblade/modules/information/excel/ExportInformationSecurityStatistics.java
new file mode 100644
index 0000000..5b08f0a
--- /dev/null
+++ b/src/main/java/org/springblade/modules/information/excel/ExportInformationSecurityStatistics.java
@@ -0,0 +1,94 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.information.excel;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 保安员统计
+ *
+ * @author BladeX
+ * @since 2021-12-02
+ */
+@Data
+@ColumnWidth(25)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class ExportInformationSecurityStatistics implements Serializable {
+	private static final long serialVersionUID = 1L;
+
+	@ColumnWidth(30)
+	@ExcelProperty("企业名称")
+	private String deptname;
+
+	/**
+	 * 公司id(忽略不导出)
+	 */
+	@ExcelIgnore
+	private String departmentid;
+
+	@ColumnWidth(15)
+	@ExcelProperty("企业类型")
+	private String stats;
+
+	@ColumnWidth(15)
+	@ExcelProperty("所属辖区")
+	private String jurname;
+
+	@ColumnWidth(15)
+	@ExcelProperty("保安员人数")
+	private Integer num;
+
+	@ColumnWidth(15)
+	@ExcelProperty("持证上岗人数")
+	private Integer cznum;
+
+	@ColumnWidth(15)
+	@ExcelProperty("未派遣人数")
+	private Integer wpqnum;
+
+	@ColumnWidth(15)
+	@ExcelProperty("派遣人数")
+	private Integer pqnum;
+
+	@ColumnWidth(15)
+	@ExcelProperty("已采集照片人数")
+	private Integer ycjzpnum;
+
+	@ColumnWidth(15)
+	@ExcelProperty("未采集照片人数")
+	private Integer wcjzpnum;
+
+	@ColumnWidth(15)
+	@ExcelProperty("已采集指纹人数")
+	private Integer ycjzwnum;
+
+	@ColumnWidth(15)
+	@ExcelProperty("资格审查异常人数")
+	private Integer scycnum;
+
+	@ColumnWidth(15)
+	@ExcelProperty("缴纳社保人数")
+	private Integer jnsbnum;
+}
diff --git a/src/main/java/org/springblade/modules/information/mapper/InformationMapper.java b/src/main/java/org/springblade/modules/information/mapper/InformationMapper.java
index ec5b39b..7e355a0 100644
--- a/src/main/java/org/springblade/modules/information/mapper/InformationMapper.java
+++ b/src/main/java/org/springblade/modules/information/mapper/InformationMapper.java
@@ -21,6 +21,8 @@
 import org.apache.ibatis.annotations.Param;
 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 com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -287,4 +289,33 @@
 	 * @return
 	 */
 	Integer selectInformationUnitJnsbNumCount(@Param("dept")Dept dept);
+
+	/**
+	 * 查询部门信息
+	 * @param departmentid
+	 * @return
+	 */
+	List<Dept> getDeptChildrens(String departmentid);
+
+	/**
+	 * 保安员统计
+	 * @param jurisdiction 辖区id
+	 * @param deptid 部门名称
+	 * @param stats 公司类型
+	 * @param startTime 企业注册时间
+	 * @param endTime 企业注册时间
+	 * @return
+	 */
+	List<ExportInformationSecurityStatistics> exportSecurityStatisInfo(String jurisdiction, String deptid, String stats, String startTime, String endTime);
+
+	/**
+	 * 业务情况统计
+	 * @param jurisdiction 辖区id
+	 * @param deptid 部门名称
+	 * @param stats 公司类型
+	 * @param startTime 企业注册时间
+	 * @param endTime 企业注册时间
+	 * @return
+	 */
+	List<ExportInformationExcel> exportBusinessStatis(String jurisdiction, String deptid, String stats, String startTime, String endTime);
 }
diff --git a/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml b/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
index cd07552..91fcdd8 100644
--- a/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
+++ b/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
@@ -1596,8 +1596,8 @@
         IFNULL( D.dqnum, 0 ) AS dqnum
         FROM
         (
-        SELECT enterpriseName,jurisdiction, departmentid,stats FROM sys_information WHERE stats!=1 GROUP BY
-        enterpriseName,jurisdiction,departmentid,stats) A
+        SELECT enterpriseName,jurisdiction, departmentid,stats,create_time FROM sys_information WHERE stats!=1 GROUP BY
+        enterpriseName,jurisdiction,departmentid,stats,create_time) A
         LEFT JOIN
         (
         SELECT COUNT( * ) AS num, dept_id FROM sys_dispatcher_unit
@@ -3409,5 +3409,269 @@
             )
     </select>
 
+    <!--查询当前单位是否有子级单位-->
+    <select id="getDeptChildrens" resultType="org.springblade.modules.system.entity.Dept">
+        select * from blade_dept where is_deleted = 0 and parent_id = #{param1}
+    </select>
+
+    <!--导出保安员统计查询-->
+    <select id="exportSecurityStatisInfo" resultType="org.springblade.modules.information.excel.ExportInformationSecurityStatistics">
+        SELECT
+        IFNULL( V.num, 0 ) AS num,
+        IFNULL( B.cznum, 0 ) AS cznum,
+        IFNULL( D.num, 0 ) AS wpqnum,
+        IFNULL( C.num, 0 ) AS pqnum,
+        IFNULL( H.ycaijzpnum, 0 ) AS ycjzpnum,
+        IFNULL( F.wcaijnum, 0 ) AS wcjzpnum,
+        IFNULL( I.ycaijzwnum, 0 ) AS ycjzwnum,
+        IFNULL( G.yicnum, 0 ) AS scycnum,
+        IFNULL( E.sbnum, 0 ) AS jnsbnum,
+        A.departmentid,
+        A.enterpriseName AS deptname,
+        case when A.stats=0 then '自招保安单位'
+        when A.stats=2 then '本市保安公司'
+        when A.stats=4 then '分公司'
+        else "其他" end as stats,
+        j.dept_name AS jurname
+        FROM
+        ( SELECT jurisdiction, departmentid, enterpriseName, stats, create_time FROM sys_information WHERE stats != 1 ) A
+        LEFT JOIN (
+        SELECT
+        COUNT( * ) AS num,
+        bu.dept_id
+        FROM
+        blade_user bu
+        WHERE
+        bu.`status` = 1
+        AND bu.is_deleted = 0
+        AND bu.role_id = '1412226235153731586'
+        GROUP BY
+        bu.dept_id
+        ) V ON V.dept_id = A.departmentid
+        LEFT JOIN (
+        SELECT
+        COUNT( * ) AS cznum,
+        dept_id
+        FROM
+        blade_user
+        WHERE
+        role_id = '1412226235153731586'
+        AND STATUS = 1
+        AND is_deleted = 0
+        AND hold = 1
+        GROUP BY
+        dept_id
+        ) B ON A.departmentid = B.dept_id
+        LEFT JOIN (
+        SELECT
+        COUNT( * ) AS num,
+        bu.dept_id
+        FROM
+        blade_user bu
+        WHERE
+        bu.`status` = 1
+        AND bu.is_deleted = 0
+        AND bu.role_id = '1412226235153731586'
+        AND bu.dispatch = 0
+        GROUP BY
+        bu.dept_id
+        ) C ON C.dept_id = A.departmentid
+        LEFT JOIN (
+        SELECT
+        COUNT( * ) AS num,
+        bu.dept_id
+        FROM
+        blade_user bu
+        WHERE
+        bu.`status` = 1
+        AND bu.is_deleted = 0
+        AND bu.role_id = '1412226235153731586'
+        AND bu.dispatch = 1
+        GROUP BY
+        bu.dept_id
+        ) D ON D.dept_id = A.departmentid
+        LEFT JOIN (
+        SELECT COUNT( * ) AS sbnum,dept_id FROM
+        blade_user
+        WHERE
+        role_id = '1412226235153731586'
+        AND STATUS = 1
+        AND is_deleted = 0
+        AND soil = 0
+        GROUP BY
+        dept_id
+        ) E ON E.dept_id = A.departmentid
+        LEFT JOIN (
+        SELECT
+        COUNT( * ) AS wcaijnum,
+        dept_id
+        FROM
+        blade_user
+        WHERE
+        role_id = '1412226235153731586'
+        AND STATUS = 1
+        AND is_deleted = 0
+        AND (avatar is null or avatar = "")
+        GROUP BY
+        dept_id
+        ) F ON F.dept_id = A.departmentid
+        LEFT JOIN (
+        SELECT
+        COUNT( * ) AS ycaijzpnum,
+        dept_id
+        FROM
+        blade_user
+        WHERE
+        role_id = '1412226235153731586'
+        AND STATUS = 1
+        AND is_deleted = 0
+        AND avatar is not null and avatar!=""
+        GROUP BY
+        dept_id
+        ) H ON H.dept_id = A.departmentid
+        LEFT JOIN (
+        SELECT
+        COUNT( * ) AS ycaijzwnum,
+        dept_id
+        FROM
+        blade_user
+        WHERE
+        role_id = '1412226235153731586'
+        AND STATUS = 1
+        AND is_deleted = 0
+        AND fingerprint is not null and fingerprint!=""
+        GROUP BY
+        dept_id
+        ) I ON I.dept_id = A.departmentid
+        LEFT JOIN (
+        SELECT
+        COUNT( * ) AS yicnum,
+        dept_id
+        FROM
+        blade_user
+        WHERE
+        role_id = '1412226235153731586'
+        AND STATUS = 1
+        AND is_deleted = 0
+        AND examination_type = 1
+        GROUP BY
+        dept_id
+        ) G ON G.dept_id = A.departmentid
+        LEFT JOIN blade_dept d ON A.departmentid = d.id
+        LEFT JOIN sys_jurisdiction j ON j.id = A.jurisdiction
+        WHERE
+        1 = 1
+        AND d.dept_category = 1
+        <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'">
+            and (j.id = #{jurisdiction} or j.parent_id = #{jurisdiction})
+        </if>
+        <if test="deptid!=null and deptid!=''">
+            and A.enterpriseName like concat(concat('%', #{deptid}),'%')
+        </if>
+        <if test="stats!=null and stats!=''">
+            and A.stats =#{stats}
+        </if>
+        <if test="startTime!=null and startTime!=''">
+            and A.create_time &gt;= #{startTime}
+        </if>
+        <if test="endTime!=null and endTime!=''">
+            and A.create_time &lt;= #{endTime}
+        </if>
+    </select>
+
+    <!--导出业务统计情况-->
+    <select id="exportBusinessStatis" resultType="org.springblade.modules.information.excel.ExportInformationExcel">
+        SELECT
+        A.enterpriseName,
+        A.departmentid,
+        case when A.stats=0 then '自招保安单位'
+        when A.stats=2 then '本市保安公司'
+        when A.stats=4 then '分公司'
+        else "其他" end as stats,
+        A.jurisdiction,
+        j.dept_name as jurname,
+        IFNULL( C.znum, 0 ) AS znum,
+        IFNULL( E.cznum, 0 ) AS cznum,
+        IFNULL( F.pqnum, 0 ) AS pqnum,
+        IFNULL( B.num, 0 ) AS fwnum,
+        IFNULL( D.dqnum, 0 ) AS dqnum
+        FROM
+        (
+        SELECT enterpriseName,jurisdiction, departmentid,stats,create_time FROM sys_information WHERE stats!=1 GROUP BY
+        enterpriseName,jurisdiction,departmentid,stats,create_time) A
+        LEFT JOIN
+        (
+        SELECT COUNT( * ) AS num, dept_id FROM sys_dispatcher_unit
+        where
+        start_time &lt;= now() and end_time &gt; now()
+        GROUP BY dept_id
+        ) B
+        ON A.departmentid = B.dept_id
+        LEFT JOIN
+        (
+        SELECT
+        COUNT( * ) AS znum,
+        bu.dept_id
+        FROM
+        blade_user bu
+        WHERE
+        bu.`status` = 1
+        AND bu.is_deleted = 0
+        AND bu.role_id = '1412226235153731586'
+        GROUP BY
+        bu.dept_id
+        ) C
+        ON A.departmentid = C.dept_id
+        LEFT JOIN
+        (
+        SELECT COUNT( * ) AS dqnum, dept_id FROM sys_dispatcher_unit where end_time &lt; now() GROUP BY dept_id
+        ) D
+        ON A.departmentid = D.dept_id
+        LEFT JOIN
+        (
+        SELECT COUNT( * ) AS cznum, dept_id FROM blade_user where
+        hold = 1
+        and role_id = '1412226235153731586'
+        and status= 1
+        and is_deleted = 0
+        GROUP BY dept_id
+        ) E
+        ON A.departmentid = E.dept_id
+        LEFT JOIN
+        (
+        SELECT
+        count(*) AS pqnum,
+        dept_id
+        FROM
+        blade_user
+        where 1=1
+        and status = 1
+        and is_deleted = 0
+        and role_id = "1412226235153731586"
+        and dispatch = 0
+        GROUP BY
+        dept_id
+        ) F
+        ON A.departmentid = F.dept_id
+        LEFT JOIN blade_dept d ON A.departmentid = d.id
+        LEFT JOIN sys_jurisdiction j ON j.id = A.jurisdiction
+        WHERE 1 =1
+        and d.dept_category = 1
+        <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'">
+            and (j.id = #{jurisdiction} or j.parent_id = #{jurisdiction})
+        </if>
+        <if test="deptid!=null and deptid!=''">
+            and A.enterpriseName like concat('%', #{deptid},'%')
+        </if>
+        <if test="stats!=null and stats!=''">
+            and A.stats=#{stats}
+        </if>
+        <if test="startTime!=null and startTime!=''">
+            and A.create_time &gt;= #{startTime}
+        </if>
+        <if test="endTime!=null and endTime!=''">
+            and A.create_time &lt;= #{endTime}
+        </if>
+    </select>
 
 </mapper>
diff --git a/src/main/java/org/springblade/modules/information/service/IInformationService.java b/src/main/java/org/springblade/modules/information/service/IInformationService.java
index 9ad0aec..1aea870 100644
--- a/src/main/java/org/springblade/modules/information/service/IInformationService.java
+++ b/src/main/java/org/springblade/modules/information/service/IInformationService.java
@@ -19,6 +19,8 @@
 import org.apache.ibatis.annotations.Param;
 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.InformationVO;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -205,4 +207,26 @@
 	List<ResponseVo> getSecurityHoldAndSoidAndDispatchGroupCountList(Integer type);
 	List<Map<Object,Object>> seleFj(String jurisdiction);
 	IPage selectBxc(IPage<List> page,String jurisdiction,String type);
+
+	/**
+	 * 保安员统计
+	 * @param jurisdiction 辖区id
+	 * @param deptid 部门名称
+	 * @param stats 公司类型
+	 * @param startTime 企业注册时间
+	 * @param endTime 企业注册时间
+	 * @return
+	 */
+	List<ExportInformationSecurityStatistics> exportSecurityStatisInfo(String jurisdiction, String deptid, String stats, String startTime, String endTime);
+
+	/**
+	 * 业务情况统计
+	 * @param jurisdiction 辖区id
+	 * @param deptid 部门名称
+	 * @param stats 公司类型
+	 * @param startTime 企业注册时间
+	 * @param endTime 企业注册时间
+	 * @return
+	 */
+	List<ExportInformationExcel> exportBusinessStatis(String jurisdiction, String deptid, String stats, String startTime, String endTime);
 }
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 1d9c715..e042d83 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,6 +18,8 @@
 
 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;
@@ -540,4 +542,98 @@
 	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;
+	}
 }

--
Gitblit v1.9.3