| @@ -2,6 +2,7 @@ package com.rwk.web.controller.ability; | |||
| import java.util.ArrayList; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import com.rwk.common.utils.DateUtils; | |||
| import com.rwk.system.service.IRwkFamilyMemberService; | |||
| import org.apache.shiro.authz.annotation.RequiresPermissions; | |||
| @@ -158,6 +159,31 @@ public class RwkStaffInformationController extends BaseController | |||
| return toAjax(rwkStaffInformationService.deleteRwkStaffInformationByIds(ids)); | |||
| } | |||
| /** | |||
| * 首页大屏数据集合 | |||
| */ | |||
| @GetMapping("/dashboard") | |||
| @ResponseBody | |||
| public AjaxResult dashboard(ModelMap mmap) { | |||
| List<Map<String, Object>> list1 = rwkStaffInformationService.selectTotalByJob(); | |||
| List<Map<String, Object>> list2 = rwkStaffInformationService.selectTotalByParty(); | |||
| List<Map<String, Object>> list3 = rwkStaffInformationService.selectTotalByAge(); | |||
| List<Map<String, Object>> list4 = rwkStaffInformationService.selectTotalByUnitAttribute(); | |||
| List<Map<String, Object>> list5 = rwkStaffInformationService.selectTotalByQrzQualification(); | |||
| List<Map<String, Object>> list6 = rwkStaffInformationService.selectTotalByQrzDegree(); | |||
| List<Map<String, Object>> list7 = rwkStaffInformationService.selectTotalByZzQualification(); | |||
| List<Map<String, Object>> list8 = rwkStaffInformationService.selectTotalByZzDegree(); | |||
| mmap.put("list1",list1); | |||
| mmap.put("list2",list2); | |||
| mmap.put("list3",list3); | |||
| mmap.put("list4",list4); | |||
| mmap.put("list5",list5); | |||
| mmap.put("list6",list6); | |||
| mmap.put("list7",list7); | |||
| mmap.put("list8",list8); | |||
| return success(mmap); | |||
| } | |||
| private List<List<String>> splitConversion(String string){ | |||
| List<List<String>> result = new ArrayList<>(); | |||
| String[] lines = string.split("\r\n"); | |||
| @@ -279,4 +279,9 @@ dd,dl{ | |||
| } | |||
| .informationText table tr td:last-child{ | |||
| text-align: left; | |||
| } | |||
| #informationTable label.error{ | |||
| position: relative; | |||
| right: 0; | |||
| top: 0; | |||
| } | |||
| @@ -92,16 +92,29 @@ | |||
| <script th:src="@{/ruoyi/js/ry-ui.js?v=4.7.3}"></script> | |||
| <th:block th:include="include :: echarts-js" /> | |||
| <script type="text/javascript"> | |||
| var prefix = "[[@{/}]]" + "system/information"; | |||
| init(); | |||
| //数据初始化加载 | |||
| function init() { | |||
| $(".cut").click(function () { | |||
| $('.cut').removeClass('active'); | |||
| $(this).addClass('active'); | |||
| }); | |||
| // $.ajax({ | |||
| // url: prefix + "/dashboard", | |||
| // type: "get", | |||
| // success: function(result) { | |||
| // console.log(result); | |||
| // } | |||
| // }); | |||
| } | |||
| var array1 = [ | |||
| {name:'数据1',value:235}, | |||
| {name:'数据2',value:274}, | |||
| {name:'数据3',value:310}, | |||
| {name:'数据4',value:335} | |||
| ]; | |||
| $(".cut").click(function () { | |||
| $('.cut').removeClass('active'); | |||
| $(this).addClass('active'); | |||
| }); | |||
| var grid = {left: '10%', right: '6%', bottom: '3%', top:'6%'} | |||
| //饼图1 | |||
| pieChartMethod('pieChart1',array1,"职务层次情况",'60%',"",grid,"",true); | |||
| @@ -12,7 +12,7 @@ | |||
| </div> | |||
| </ul> | |||
| <form class="form-horizontal m information" id="form-information-add"> | |||
| <table> | |||
| <table id="informationTable"> | |||
| <tr> | |||
| <td colspan="2">姓名</td> | |||
| <td colspan="2"><input name="name" class="form-control" type="text"></td> | |||
| @@ -52,8 +52,8 @@ | |||
| <tr> | |||
| <td colspan="2">参加工作时间</td> | |||
| <td colspan="4"><input name="workTime" class="form-control" type="text"></td> | |||
| <td colspan="2">身份证号码(☆必填)</td> | |||
| <td colspan="8"><input name="idCard" class="form-control" type="text"></td> | |||
| <td colspan="2">身份证号码(★必填)</td> | |||
| <td colspan="8"><input name="idCard" class="form-control" type="text" required></td> | |||
| </tr> | |||
| <tr> | |||
| <td colspan="2">党派</td> | |||
| @@ -13,7 +13,7 @@ | |||
| </ul> | |||
| <form class="form-horizontal m information" id="form-information-edit" th:object="${rwkStaffInformation}"> | |||
| <input name="id" th:field="*{id}" type="hidden"> | |||
| <table> | |||
| <table id="informationTable"> | |||
| <tr> | |||
| <td colspan="2">姓名</td> | |||
| <td colspan="2"><input name="name" class="form-control" type="text" th:field="*{name}"></td> | |||
| @@ -53,8 +53,8 @@ | |||
| <tr> | |||
| <td colspan="2">参加工作时间</td> | |||
| <td colspan="4"><input name="workTime" class="form-control" type="text" th:field="*{workTime}"></td> | |||
| <td colspan="2">身份证号码(☆必填)</td> | |||
| <td colspan="8"><input name="idCard" class="form-control" type="text" th:field="*{idCard}"></td> | |||
| <td colspan="2">身份证号码(★必填)</td> | |||
| <td colspan="8"><input name="idCard" class="form-control" type="text" th:field="*{idCard}" required></td> | |||
| </tr> | |||
| <tr> | |||
| <td colspan="2">党派</td> | |||
| @@ -1,8 +1,11 @@ | |||
| package com.rwk.system.mapper; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import com.rwk.system.domain.RwkStaffInformation; | |||
| import com.rwk.system.domain.RwkFamilyMember; | |||
| import org.apache.ibatis.annotations.Mapper; | |||
| import org.apache.ibatis.annotations.Select; | |||
| /** | |||
| * 人员信息Mapper接口 | |||
| @@ -10,6 +13,7 @@ import com.rwk.system.domain.RwkFamilyMember; | |||
| * @author rick | |||
| * @date 2024-11-25 | |||
| */ | |||
| @Mapper | |||
| public interface RwkStaffInformationMapper | |||
| { | |||
| /** | |||
| @@ -84,4 +88,67 @@ public interface RwkStaffInformationMapper | |||
| * @return 结果 | |||
| */ | |||
| public int deleteRwkFamilyMemberByFamilyMemberCode(Long id); | |||
| /** | |||
| * 按照职务层级统计人数 | |||
| */ | |||
| @Select("select job_level name, count(*) \"value\" from rwk_staff_information\n" + | |||
| "group by job_level;") | |||
| public List<Map<String, Object>> selectTotalByJob(); | |||
| /** | |||
| * 按照党派统计人数 | |||
| */ | |||
| @Select("select party name, count(*) \"value\" from rwk_staff_information\n" + | |||
| "group by party;") | |||
| public List<Map<String, Object>> selectTotalByParty(); | |||
| /** | |||
| * 按照性别、年龄统计人数 | |||
| */ | |||
| @Select("select gender,\n" + | |||
| " SUM(CASE WHEN age < 40 THEN 1 ELSE 0 END) AS \"40岁以下\",\n" + | |||
| " SUM(CASE WHEN age >= 40 AND age < 50 THEN 1 ELSE 0 END) AS \"40~50岁\",\n" + | |||
| " SUM(CASE WHEN age >= 50 AND age < 55 THEN 1 ELSE 0 END) AS \"50~55岁\",\n" + | |||
| " SUM(CASE WHEN age >= 55 THEN 1 ELSE 0 END) AS \"55岁以上\"\n" + | |||
| "from (SELECT '男' AS gender UNION SELECT '女' AS gender) genders\n" + | |||
| "LEFT JOIN (SELECT sex,YEAR(CURDATE()) - SUBSTRING(id_card, 7, 4) age FROM rwk_staff_information) AS age_data\n" + | |||
| "ON age_data.sex = genders.gender\n" + | |||
| "GROUP BY gender;") | |||
| public List<Map<String, Object>> selectTotalByAge(); | |||
| /** | |||
| * 按照单位类别统计人数 | |||
| */ | |||
| @Select("select unit_attribute name, count(*) \"value\" from rwk_staff_information\n" + | |||
| "group by unit_attribute;") | |||
| public List<Map<String, Object>> selectTotalByUnitAttribute(); | |||
| /** | |||
| * 按照全日制学历统计人数 | |||
| */ | |||
| @Select("select qrz_qualification name, count(*) \"value\" from rwk_staff_information\n" + | |||
| "group by qrz_qualification;") | |||
| public List<Map<String, Object>> selectTotalByQrzQualification(); | |||
| /** | |||
| * 按照全日制学位统计人数 | |||
| */ | |||
| @Select("select qrz_degree name, count(*) \"value\" from rwk_staff_information\n" + | |||
| "group by qrz_degree;") | |||
| public List<Map<String, Object>> selectTotalByQrzDegree(); | |||
| /** | |||
| * 按照在职学历统计人数 | |||
| */ | |||
| @Select("select zz_qualification name, count(*) \"value\" from rwk_staff_information\n" + | |||
| "group by zz_qualification;") | |||
| public List<Map<String, Object>> selectTotalByZzQualification(); | |||
| /** | |||
| * 按照在职学位统计人数 | |||
| */ | |||
| @Select("select zz_degree name, count(*) \"value\" from rwk_staff_information\n" + | |||
| "group by zz_degree;") | |||
| public List<Map<String, Object>> selectTotalByZzDegree(); | |||
| } | |||
| @@ -1,6 +1,7 @@ | |||
| package com.rwk.system.service; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import com.rwk.system.domain.RwkStaffInformation; | |||
| /** | |||
| @@ -58,4 +59,44 @@ public interface IRwkStaffInformationService | |||
| * @return 结果 | |||
| */ | |||
| public int deleteRwkStaffInformationById(Long id); | |||
| /** | |||
| * 按照职务层级统计人数 | |||
| */ | |||
| public List<Map<String, Object>> selectTotalByJob(); | |||
| /** | |||
| * 按照党派统计人数 | |||
| */ | |||
| public List<Map<String, Object>> selectTotalByParty(); | |||
| /** | |||
| * 按照性别、年龄统计人数 | |||
| */ | |||
| public List<Map<String, Object>> selectTotalByAge(); | |||
| /** | |||
| * 按照单位类别统计人数 | |||
| */ | |||
| public List<Map<String, Object>> selectTotalByUnitAttribute(); | |||
| /** | |||
| * 按照全日制学历统计人数 | |||
| */ | |||
| public List<Map<String, Object>> selectTotalByQrzQualification(); | |||
| /** | |||
| * 按照全日制学位统计人数 | |||
| */ | |||
| public List<Map<String, Object>> selectTotalByQrzDegree(); | |||
| /** | |||
| * 按照在职学历统计人数 | |||
| */ | |||
| public List<Map<String, Object>> selectTotalByZzQualification(); | |||
| /** | |||
| * 按照在职学位统计人数 | |||
| */ | |||
| public List<Map<String, Object>> selectTotalByZzDegree(); | |||
| } | |||
| @@ -4,6 +4,7 @@ import java.util.List; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import java.util.ArrayList; | |||
| import java.util.Map; | |||
| import com.rwk.common.utils.StringUtils; | |||
| import org.springframework.transaction.annotation.Transactional; | |||
| import com.rwk.system.domain.RwkFamilyMember; | |||
| @@ -128,6 +129,46 @@ public class RwkStaffInformationServiceImpl implements IRwkStaffInformationServi | |||
| } | |||
| } | |||
| @Override | |||
| public List<Map<String, Object>> selectTotalByJob() { | |||
| return rwkStaffInformationMapper.selectTotalByJob(); | |||
| } | |||
| @Override | |||
| public List<Map<String, Object>> selectTotalByParty() { | |||
| return rwkStaffInformationMapper.selectTotalByParty(); | |||
| } | |||
| @Override | |||
| public List<Map<String, Object>> selectTotalByAge() { | |||
| return rwkStaffInformationMapper.selectTotalByAge(); | |||
| } | |||
| @Override | |||
| public List<Map<String, Object>> selectTotalByUnitAttribute() { | |||
| return rwkStaffInformationMapper.selectTotalByUnitAttribute(); | |||
| } | |||
| @Override | |||
| public List<Map<String, Object>> selectTotalByQrzQualification() { | |||
| return rwkStaffInformationMapper.selectTotalByQrzQualification(); | |||
| } | |||
| @Override | |||
| public List<Map<String, Object>> selectTotalByQrzDegree() { | |||
| return rwkStaffInformationMapper.selectTotalByQrzDegree(); | |||
| } | |||
| @Override | |||
| public List<Map<String, Object>> selectTotalByZzQualification() { | |||
| return rwkStaffInformationMapper.selectTotalByZzQualification(); | |||
| } | |||
| @Override | |||
| public List<Map<String, Object>> selectTotalByZzDegree() { | |||
| return rwkStaffInformationMapper.selectTotalByZzDegree(); | |||
| } | |||
| private boolean emptyJudge(RwkFamilyMember rwkFamilyMember){ | |||
| boolean flag = true; | |||
| int emptyCount = 0; | |||