| | |
| | | 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.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springblade.modules.information.vo.ResponseVo; |
| | | 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; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 组织机构详情控制层 2 |
| | |
| | | public R<IPage<InformationVO>> getSecurityUnitServerLessPage(InformationVO information, Query query){ |
| | | return R.data(informationService.getSecurityUnitServerLess2Page(Condition.getPage(query), information)); |
| | | } |
| | | |
| | | /** |
| | | * 首页分局预警统计(保安员预警(表现差,审查异常),保安公司预警(考试通过率低于50%,持证率低于50%,社保缴纳率低于50%,派遣率低于50%)) |
| | | * @return |
| | | */ |
| | | @GetMapping("/selectSubstationWarnInfo") |
| | | public R selectSubstationWarnInfo() { |
| | | //辖区信息 |
| | | List<Map<Object, Object>> list = informationService.selectJur(); |
| | | List<Map<String, Object>> lists = new ArrayList<>(); |
| | | |
| | | //1.保安员表现差预警数量 |
| | | List<ResponseVo> performanceGroupCountList = informationService.getSecurityPerformanceGroupCountList(); |
| | | |
| | | //2.保安员资格异常的数量 |
| | | List<ResponseVo> examinationGroupCountList = informationService.getSecurityExaminationGroupCountList(); |
| | | |
| | | //3.考试通过率低于50% |
| | | List<ResponseVo> examPassingGroupCountList = informationService.getSecurityExamPassingGroupCountList(); |
| | | |
| | | //4.持证率低于50% |
| | | List<ResponseVo> holdGroupCountList = informationService.getSecurityHoldAndSoidAndDispatchGroupCountList(1); |
| | | |
| | | //5.社保缴纳率低于50% |
| | | List<ResponseVo> soidGroupCountList = informationService.getSecurityHoldAndSoidAndDispatchGroupCountList(2); |
| | | |
| | | //6.派遣率低于50% |
| | | List<ResponseVo> dispatchGroupCountList = informationService.getSecurityHoldAndSoidAndDispatchGroupCountList(3); |
| | | |
| | | |
| | | for (int i = 0; i < list.size(); i++) { |
| | | int count = 0; |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | //辖区id |
| | | String id = list.get(i).get("id").toString(); |
| | | //辖区名称 |
| | | String jurname = list.get(i).get("dept_name").toString(); |
| | | |
| | | //1.保安员表现差预警数量 |
| | | //遍历计算总数 |
| | | for (ResponseVo responseVo : performanceGroupCountList) { |
| | | //辖区id相同则数量相加 |
| | | if (responseVo.getId().equals(id)){ |
| | | count += responseVo.getNum(); |
| | | } |
| | | } |
| | | |
| | | |
| | | //2.保安员资格异常的数量 |
| | | //遍历计算总数 |
| | | for (ResponseVo responseVo : examinationGroupCountList) { |
| | | //辖区id相同则数量相加 |
| | | if (responseVo.getId().equals(id)){ |
| | | count += responseVo.getNum(); |
| | | } |
| | | } |
| | | |
| | | //3.考试通过率低于50% |
| | | //遍历计算总数 |
| | | for (ResponseVo responseVo : examPassingGroupCountList) { |
| | | //辖区id相同则数量相加 |
| | | if (responseVo.getId().equals(id)){ |
| | | count += responseVo.getNum(); |
| | | } |
| | | } |
| | | |
| | | //4.持证率低于50% |
| | | //遍历计算总数 |
| | | for (ResponseVo responseVo : holdGroupCountList) { |
| | | //辖区id相同则数量相加 |
| | | if (responseVo.getId().equals(id)){ |
| | | count += responseVo.getNum(); |
| | | } |
| | | } |
| | | |
| | | //5.社保缴纳率低于50% |
| | | //遍历计算总数 |
| | | for (ResponseVo responseVo : soidGroupCountList) { |
| | | //辖区id相同则数量相加 |
| | | if (responseVo.getId().equals(id)){ |
| | | count += responseVo.getNum(); |
| | | } |
| | | } |
| | | |
| | | //6.派遣率低于50% |
| | | //遍历计算总数 |
| | | for (ResponseVo responseVo : dispatchGroupCountList) { |
| | | //辖区id相同则数量相加 |
| | | if (responseVo.getId().equals(id)){ |
| | | count += responseVo.getNum(); |
| | | } |
| | | } |
| | | |
| | | //封装数据 |
| | | map.put("Count", count); |
| | | map.put("jurname", jurname); |
| | | map.put("id", id); |
| | | lists.add(map); |
| | | } |
| | | 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); |
| | | } |
| | | |
| | | |
| | | } |