From 5cdadbb29f95f35b5eabdc733ce60b16d0338037 Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Tue, 20 Jul 2021 09:29:06 +0800
Subject: [PATCH] 1.保安员证编码
---
src/main/java/org/springblade/modules/jurisdiction/mapper/JurisdictionMapper.java | 1
src/main/java/org/springblade/modules/social/mapper/SocialMapper.xml | 27
src/main/java/org/springblade/modules/jurisdiction/mapper/JurisdictionMapper.xml | 26
src/main/java/org/springblade/modules/social/controller/SocialController.java | 158 +++++
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml | 621 ++++++++++++++++++++
src/main/java/org/springblade/modules/information/controller/InformationController.java | 309 ++++++++++
src/main/java/org/springblade/modules/information/mapper/InformationMapper.java | 17
src/main/java/org/springblade/modules/jurisdiction/service/impl/JurisdictionServiceImpl.java | 5
src/main/java/org/springblade/modules/social/service/ISocialService.java | 52 +
src/main/java/org/springblade/modules/social/excel/SocialExcel.java | 82 ++
src/main/java/sql/social.menu.mysql | 10
src/main/java/org/springblade/common/config/BladeConfiguration.java | 1
src/main/java/org/springblade/modules/social/dto/SocialDTO.java | 34 +
src/main/java/org/springblade/modules/social/vo/SocialVO.java | 36 +
src/main/java/org/springblade/modules/jurisdiction/service/JurisdictionService.java | 1
src/main/java/org/springblade/modules/social/service/impl/SocialServiceImpl.java | 66 ++
src/main/java/org/springblade/modules/social/entity/Social.java | 115 +++
src/main/java/org/springblade/modules/information/service/IInformationService.java | 16
src/main/java/org/springblade/modules/system/controller/UserController.java | 1
src/main/java/org/springblade/modules/information/service/impl/InformationServiceImpl.java | 74 ++
src/main/java/org/springblade/modules/social/mapper/SocialMapper.java | 42 +
21 files changed, 1,668 insertions(+), 26 deletions(-)
diff --git a/src/main/java/org/springblade/common/config/BladeConfiguration.java b/src/main/java/org/springblade/common/config/BladeConfiguration.java
index 23e1ff3..fe163d9 100644
--- a/src/main/java/org/springblade/common/config/BladeConfiguration.java
+++ b/src/main/java/org/springblade/common/config/BladeConfiguration.java
@@ -69,6 +69,7 @@
secureRegistry.excludePathPatterns("/recordk/**");
secureRegistry.excludePathPatterns("/punish/**");
secureRegistry.excludePathPatterns("/blade-resource/attach/**");
+ secureRegistry.excludePathPatterns("/social/**");
return secureRegistry;
}
diff --git a/src/main/java/org/springblade/modules/information/controller/InformationController.java b/src/main/java/org/springblade/modules/information/controller/InformationController.java
index 9a5d54a..e73fad0 100644
--- a/src/main/java/org/springblade/modules/information/controller/InformationController.java
+++ b/src/main/java/org/springblade/modules/information/controller/InformationController.java
@@ -29,6 +29,8 @@
import org.springblade.modules.desk.entity.Notice;
import org.springblade.modules.desk.vo.NoticeVO;
import org.springblade.modules.desk.wrapper.NoticeWrapper;
+import org.springblade.modules.jurisdiction.service.JurisdictionService;
+import org.springblade.modules.jurisdiction.vo.JurisdictionVO;
import org.springblade.modules.member.service.IMemberService;
import org.springblade.modules.shareholder.service.IShareholderService;
import org.springblade.modules.system.service.IDeptService;
@@ -41,10 +43,7 @@
import org.springblade.core.boot.ctrl.BladeController;
import springfox.documentation.annotations.ApiIgnore;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
/**
* 控制器
@@ -60,6 +59,7 @@
private final IInformationService informationService;
private final IDeptService iDeptService;
+ private final JurisdictionService jurisdictionService;
/**
@@ -198,9 +198,47 @@
* 统计保安公司未持证的保安的公司数量
*/
@PostMapping("/selectInCount")
- public R selectInCount() {
- List<Map<Object, String>> maps = informationService.selectInCount();
- return R.data(maps);
+ public R selectInCount(String jurisdiction,String deptid) {
+ List<Map<Object, String>> maps = informationService.selectInCount(jurisdiction,deptid);
+ Map<String, Object> map = new HashMap<String, Object>();
+ map.put("Count",maps.size());
+ map.put("List",maps);
+ List<Map<String, Object>> lists = new ArrayList<>();
+ lists.add(map);
+ return R.data(lists);
+ }
+
+
+ /**
+ * 通过辖区查询机构id,然后通过机构id查询当前机构交社保的人数(numj单位已交社保数量;numz单位人员总数)
+ */
+ @PostMapping("/selectCs")
+ public R selectCs(String jurisdiction,String deptid) {
+ List<Map<String, Object>> maps = informationService.selectCs(jurisdiction,deptid);
+ List<Map<String, Object>> lists = new ArrayList<>();
+ List<Map<String, Object>> lists1 = new ArrayList<>();
+ Map<String, Object> map1 = new HashMap<String, Object>();
+ Integer count=0;
+ for (int i=0;i<maps.size();i++){
+ Map<String, Object> map = new HashMap<String, Object>();
+ //交社保数
+ String numjs = maps.get(i).get("numj").toString();
+ Integer numj = Integer.parseInt(numjs);
+ //单位总人数
+ String numzs = maps.get(i).get("numz").toString();
+ Integer numz = Integer.parseInt(numzs);
+ String deptname = maps.get(i).get("deptname").toString();
+ //统计未交社保人数
+ int i1 = numz - numj;
+ count+=i1;
+ map.put("count",i1);
+ map.put("name",deptname);
+ lists1.add(map);
+ }
+ map1.put("Count",count);
+ map1.put("List",lists1);
+ lists.add(map1);
+ return R.data(lists);
}
@@ -213,4 +251,261 @@
return R.data(maps);
}
+ /**
+ * 管辖区域下拉
+ */
+ @PostMapping("/lazyTreeJu")
+ public R lazyTreeJu() {
+ List<JurisdictionVO> jurisdictionVOS = jurisdictionService.lazyTreeJu();
+ return R.data(jurisdictionVOS);
+ }
+
+
+ /**
+ * 统计这个月和上个月交社保的人数,以及金额
+ * @return
+ */
+ @PostMapping("/selectTo")
+ public R selectTo(String jurisdiction,String deptid) {
+ //上个月人数数量
+ Integer lnum=0;
+ //这个月人数数量
+ Integer tnum=0;
+ //上个月金额
+ Double lmount=0.0;
+ //这个月金额
+ Double tmount=0.0;
+ Map<String, Object> map = new HashMap<String, Object>();
+ List<Map<String, Object>> lists = new ArrayList<>();
+ List<Map<String, Object>> list = informationService.selectTo(jurisdiction,deptid);
+ for (int i=0;i<list.size();i++){
+ String lastmonths = list.get(i).get("lastmonth").toString();
+ Integer lastmonth=Integer.parseInt(lastmonths);
+ lnum+=lastmonth;
+ String thismouths = list.get(i).get("thismouth").toString();
+ Integer thismouth=Integer.parseInt(thismouths);
+ tnum+=thismouth;
+ String lastamounts = list.get(i).get("lastamount").toString();
+ Double lastamount =Double.parseDouble(lastamounts);
+ lmount+=lastamount;
+ String thisamounts = list.get(i).get("thisamount").toString();
+ Double thisamount =Double.parseDouble(thisamounts);
+ tmount+=thisamount;
+ }
+ map.put("lastmonth",lnum);
+ map.put("thismouth",tnum);
+ map.put("lastamount",lmount);
+ map.put("thisamount",tmount);
+ lists.add(map);
+ return R.data(lists);
+ }
+
+
+ /**
+ * 查询本年所有月份交社保人数
+ * @return
+ */
+ @GetMapping("/queryYearSoil")
+ public R queryYearSoil(String jurisdiction,String deptid) {
+ Calendar cal = Calendar.getInstance();
+ String year = String.valueOf(cal.get(Calendar.YEAR));
+ Map<String, String> map = informationService.queryYearSoil(year,jurisdiction,deptid);
+ map = (HashMap<String, String>) sortMapBykeyAsc(map) ;//key升序
+ return R.data(map);
+ }
+
+ /**
+ * 查询本年所有月份社保金额
+ * @return
+ */
+ @GetMapping("/queryYearAn")
+ public R queryYearAn(String jurisdiction,String deptid) {
+ Calendar cal = Calendar.getInstance();
+ String year = String.valueOf(cal.get(Calendar.YEAR));
+ Map<String, String> map = informationService.queryYearAn(year,jurisdiction,deptid);
+ map = (HashMap<String, String>) sortMapBykeyAsc(map) ;//key升序
+ return R.data(map);
+ }
+
+
+ /**
+ * 公司运营智能统计
+ * @return
+ */
+ @GetMapping("/queryCounts")
+ public R queryCounts(String jurisdiction,String deptid) {
+ List<Map<String, Object>> lists = new ArrayList<>();
+ Integer a=0;
+ Integer b=0;
+ Integer zca=0;
+ Integer zcb=0;
+ Integer cza=0;
+ Integer czb=0;
+ Integer sba=0;
+ Integer sbb=0;
+ Integer kha=0;
+ Integer khb=0;
+ Integer pqa=0;
+ Integer pqb=0;
+ //保安员数量
+ Map<String, Object> map = new HashMap<String, Object>();
+ Map<String, Object> mapzc = new HashMap<String, Object>();
+ Map<String, Object> mapcz = new HashMap<String, Object>();
+ Map<String, Object> mapsb = new HashMap<String, Object>();
+ Map<String, Object> mapkh = new HashMap<String, Object>();
+ Map<String, Object> mappq = new HashMap<String, Object>();
+ Map<String, Object> mapC = new HashMap<String, Object>();
+ List<Map<Object, Integer>> maps = informationService.queryCountB(jurisdiction, deptid);
+ for (int i=0;i<maps.size();i++){
+ //这个月数量
+ a+=maps.get(i).get("thisnum");
+ //上个月数量
+ b+= maps.get(i).get("lastnum");
+
+ }
+ map.put("thisnum",a);
+ map.put("lastnum",b);
+ mapC.put("baoan",map);
+ //正常保安员数量
+ List<Map<Object, Integer>> maps1 = informationService.queryCountZc(jurisdiction, deptid);
+ for (int i=0;i<maps1.size();i++){
+ //这个月数量
+ zca+= maps1.get(i).get("thisnum");
+ //上个月数量
+ zcb+= maps1.get(i).get("lastnum");
+ }
+ mapzc.put("thisnum",zca);
+ mapzc.put("lastnum",zcb);
+ mapC.put("zcbaoan",mapzc);
+ //持证保安数量
+ List<Map<Object, Integer>> maps2 = informationService.queryCountCz(jurisdiction, deptid);
+ for (int i=0;i<maps2.size();i++){
+ //这个月数量
+ cza+=maps2.get(i).get("thisnum");
+ //上个月数量
+ czb+= maps2.get(i).get("lastnum");
+ }
+ mapcz.put("thisnum",cza);
+ mapcz.put("lastnum",czb);
+ mapC.put("czbaoan",mapcz);
+ //缴纳社保数量
+ List<Map<Object, Integer>> maps3 = informationService.queryCountSb(jurisdiction, deptid);
+ for (int i=0;i<maps3.size();i++){
+ //这个月数量
+ sba+=maps3.get(i).get("thisnum");
+ //上个月数量
+ sbb+=maps3.get(i).get("lastnum");
+ }
+ mapsb.put("thisnum",sba);
+ mapsb.put("lastnum",sbb);
+ mapC.put("sbbaoan",mapsb);
+ //服务客户数量
+ List<Map<Object, Integer>> maps4 = informationService.queryCountKh(jurisdiction, deptid);
+ for (int i=0;i<maps4.size();i++){
+ //这个月数量
+ kha+=maps4.get(i).get("thisnum");
+ //上个月数量
+ khb+=maps4.get(i).get("lastnum");
+ }
+ mapkh.put("thisnum",kha);
+ mapkh.put("lastnum",khb);
+ mapC.put("kh",mapkh);
+ //保安派遣数量
+ List<Map<Object, Integer>> maps5 = informationService.queryCountPq(jurisdiction, deptid);
+ for (int i=0;i<maps5.size();i++){
+ //这个月数量
+ pqa+=maps5.get(i).get("thisnum");
+ //上个月数量
+ pqb+=maps5.get(i).get("lastnum");
+ }
+ mappq.put("thisnum",pqa);
+ mappq.put("lastnum",pqb);
+ mapC.put("paiq",mappq);
+ lists.add(mapC);
+ return R.data(lists);
+ }
+
+
+
+ /**
+ * 查询本年公司运营智能统计
+ * @return
+ */
+ @GetMapping("/queryYearG")
+ public R queryYearG(String jurisdiction,String deptid) {
+ Calendar cal = Calendar.getInstance();
+ String year = String.valueOf(cal.get(Calendar.YEAR));
+ Map<String, Object> mapz = new HashMap<String, Object>();
+ Map<String, Object> mapzc1= new HashMap<String, Object>();
+ Map<String, Object> mapcz1= new HashMap<String, Object>();
+ Map<String, Object> mapsb1= new HashMap<String, Object>();
+ List<Map<String, Object>> lists = new ArrayList<>();
+ Map<String, String> map = informationService.queryYearZ(year,jurisdiction,deptid);
+ map = (HashMap<String, String>) sortMapBykeyAsc(map) ;//key升序
+ mapz.put("baoan",map);
+ lists.add(mapz);
+ //正常保安数量
+ Map<String, String> mapzc = informationService.queryYearZc(year,jurisdiction,deptid);
+ mapzc = (HashMap<String, String>) sortMapBykeyAsc(mapzc) ;//key升序
+ mapzc1.put("zc",mapzc);
+ lists.add(mapzc1);
+ //保安持证数量
+ Map<String, String> mapcz = informationService.queryYearZc(year,jurisdiction,deptid);
+ mapcz = (HashMap<String, String>) sortMapBykeyAsc(mapcz) ;//key升序
+ mapcz1.put("cz",mapcz);
+ lists.add(mapcz1);
+ //缴纳社保数
+ Map<String, String> mapsb = informationService.queryYearSoil(year,jurisdiction,deptid);
+ mapsb = (HashMap<String, String>) sortMapBykeyAsc(mapsb) ;//key升序
+ mapsb1.put("sb",mapsb);
+ lists.add(mapsb1);
+ return R.data(lists);
+ }
+
+
+ /**
+ * 查询本年所有月份的客户数量
+ * @return
+ */
+ @GetMapping("/queryYearKh")
+ public R queryYearKh(String jurisdiction,String deptid) {
+ Calendar cal = Calendar.getInstance();
+ String year = String.valueOf(cal.get(Calendar.YEAR));
+ Map<String, String> map = informationService.queryYearKh(year,jurisdiction,deptid);
+ map = (HashMap<String, String>) sortMapBykeyAsc(map) ;//key升序
+ return R.data(map);
+ }
+ //升序
+ public static Map<String, String> sortMapBykeyAsc(Map<String, String> oriMap) {
+ Map<String, String> sortedMap = new LinkedHashMap<String, String>();
+ try {
+ if (oriMap != null && !oriMap.isEmpty()) {
+ List<Map.Entry<String, String>> entryList = new ArrayList<Map.Entry<String, String>>(oriMap.entrySet());
+ Collections.sort(entryList,
+ new Comparator<Map.Entry<String, String>>() {
+ public int compare(Map.Entry<String, String> entry2,
+ Map.Entry<String, String> entry1) {
+ int value2 = 0, value1 = 0;
+ try {
+ value2 = Integer.parseInt(entry1.getKey());
+ value1 = Integer.parseInt(entry2.getKey());
+ } catch (NumberFormatException e) {
+ value2 = 0;
+ value1 = 0;
+ }
+ return value1 - value2;
+ }
+ });
+ Iterator<Map.Entry<String, String>> iter = entryList.iterator();
+ Map.Entry<String, String> tmpEntry = null;
+ while (iter.hasNext()) {
+ tmpEntry = iter.next();
+ sortedMap.put(tmpEntry.getKey(), tmpEntry.getValue());
+ }
+ }
+ } catch (Exception e) {
+ }
+ return sortedMap;
+ }
+
}
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 c6c547d..c59468f 100644
--- a/src/main/java/org/springblade/modules/information/mapper/InformationMapper.java
+++ b/src/main/java/org/springblade/modules/information/mapper/InformationMapper.java
@@ -44,5 +44,20 @@
void deleteSh(String creditcode);
void deleteMe(String creditcode);
Map selectCount(String departmentid);
- List<Map<Object,String>> selectInCount();
+ List<Map<Object,String>> selectInCount(String jurisdiction,String deptid);
+ List<Map<String, Object>> selectCs(String jurisdiction,String deptid);
+ List<Map<String, Object>> selectTo(String jurisdiction,String deptid);
+ Map<String, String> queryYearSoil(String year,String jurisdiction,String deptid);
+ Map<String, String> queryYearAn(String year,String jurisdiction,String deptid);
+ List<Map<Object,Integer>> queryCountB(String jurisdiction,String deptid);
+ List<Map<Object,Integer>> queryCountZc(String jurisdiction,String deptid);
+ List<Map<Object,Integer>> queryCountCz(String jurisdiction,String deptid);
+ List<Map<Object,Integer>> queryCountSb(String jurisdiction,String deptid);
+ List<Map<Object,Integer>> queryCountKh(String jurisdiction,String deptid);
+ List<Map<Object,Integer>> queryCountPq(String jurisdiction,String deptid);
+
+ Map<String, String> queryYearZ(String year,String jurisdiction,String deptid);
+ Map<String, String> queryYearZc(String year,String jurisdiction,String deptid);
+ Map<String, String> queryYearCz(String year,String jurisdiction,String deptid);
+ Map<String, String> queryYearKh(String year,String jurisdiction,String deptid);
}
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 bfdd344..f153c96 100644
--- a/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
+++ b/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
@@ -59,23 +59,616 @@
</delete>
<select id="selectCount" resultType="java.util.HashMap">
- SELECT
- isnull( B.confess, 0 ) AS confess,
- isnull( C.staff, 0 ) AS staff,
- isnull( D.security, 0 ) AS security,
- isnull( E.armed, 0 ) AS armed
- FROM
- ( SELECT jurisdiction FROM sys_information GROUP BY jurisdiction ) A
- FULL JOIN ( SELECT COUNT ( stats ) AS confess, jurisdiction FROM sys_information WHERE stats = 0 GROUP BY jurisdiction ) B ON A.jurisdiction = B.jurisdiction
- FULL JOIN ( SELECT COUNT ( stats ) AS staff, jurisdiction FROM sys_information WHERE stats = 1 GROUP BY jurisdiction ) C ON A.jurisdiction = C.jurisdiction
- FULL JOIN ( SELECT COUNT ( stats ) AS security, jurisdiction FROM sys_information WHERE stats = 2 GROUP BY jurisdiction ) D ON A.jurisdiction = D.jurisdiction
- FULL JOIN ( SELECT COUNT ( stats ) AS armed, jurisdiction FROM sys_information WHERE stats = 3 GROUP BY jurisdiction ) E ON A.jurisdiction = E.jurisdiction
- WHERE
- A.jurisdiction = #{departmentid}
+ SELECT isnull(B.confess, 0) AS confess,
+ isnull(C.staff, 0) AS staff,
+ isnull(D.security, 0) AS security,
+ isnull(E.armed, 0) AS armed
+ FROM (SELECT jurisdiction FROM sys_information GROUP BY jurisdiction) A
+ FULL JOIN (SELECT COUNT(stats) AS confess, jurisdiction
+ FROM sys_information
+ WHERE stats = 0
+ GROUP BY jurisdiction) B ON A.jurisdiction = B.jurisdiction
+ FULL JOIN (SELECT COUNT(stats) AS staff, jurisdiction
+ FROM sys_information
+ WHERE stats = 1
+ GROUP BY jurisdiction) C ON A.jurisdiction = C.jurisdiction
+ FULL JOIN (SELECT COUNT(stats) AS security, jurisdiction
+ FROM sys_information
+ WHERE stats = 2
+ GROUP BY jurisdiction) D ON A.jurisdiction = D.jurisdiction
+ FULL JOIN (SELECT COUNT(stats) AS armed, jurisdiction
+ FROM sys_information
+ WHERE stats = 3
+ GROUP BY jurisdiction) E ON A.jurisdiction = E.jurisdiction
+ WHERE A.jurisdiction = #{departmentid}
</select>
+
+ <!--保安公司未持证预警-->
<select id="selectInCount" resultType="java.util.HashMap">
- SELECT COUNT(u.dept_id) AS number,d.dept_name FROM blade_user u LEFT JOIN blade_dept d ON d.id=u.dept_id WHERE u.hold=1 GROUP BY u.dept_id,d.dept_name
+ SELECT
+ d.dept_name,
+ j.dept_name as jurname
+ FROM
+ blade_user u
+ LEFT JOIN blade_dept d ON d.id= u.dept_id
+ LEFT JOIN sys_jurisdiction j ON j.id= u.jurisdiction
+ WHERE
+ hold = 1
+ <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">
+ and u.jurisdiction =#{jurisdiction}
+ </if>
+ <if test="deptid!=null and deptid!=''">
+ and u.dept_id =#{deptid}
+ </if>
+ GROUP BY
+ d.dept_name,
+ j.dept_name
</select>
+ <!--通过辖区查询机构id,然后通过机构id查询当前机构交社保的人数(numj单位已交社保数量;numz单位人员总数)-->
+ <select id="selectCs" resultType="java.util.HashMap">
+ SELECT A.numj,
+ B.numz,
+ d.dept_name as deptname
+ FROM (
+ SELECT COUNT
+ (*) AS numj,
+ deptid
+ FROM sys_socil
+ WHERE deptid IN (SELECT i.departmentid
+ FROM sys_information i
+ LEFT JOIN sys_jurisdiction j ON j.id = i.jurisdiction where 1=1
+ <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">
+ and i.jurisdiction =#{jurisdiction}
+ </if>
+ GROUP BY i.departmentid)
+ GROUP BY deptid
+ ) A
+ FULL JOIN (
+ SELECT COUNT
+ (*) AS numz,
+ dept_id
+ FROM blade_user
+ WHERE dept_id IN (SELECT i.departmentid
+ FROM sys_information i
+ LEFT JOIN sys_jurisdiction j ON j.id = i.jurisdiction where 1=1
+ <if test="jurisdiction!=null and jurisdiction!=''">
+ and i.jurisdiction =#{jurisdiction}
+ </if>
+ GROUP BY i.departmentid)
+ GROUP BY dept_id
+ ) B ON A.deptid = B.dept_id
+ LEFT JOIN (SELECT id, dept_name FROM blade_dept) d ON d.id = A.deptid where 1=1
+ <if test="deptid!=null and deptid!=''">
+ and A.deptid =#{deptid}
+ </if>
+ </select>
+
+ <!--统计上个月和这个月交社保的人数以及缴纳金额-->
+ <select id="selectTo" resultType="java.util.HashMap">
+ SELECT ISNULL(A.lastmonth, 0) AS lastmonth,
+ ISNULL(B.thismouth, 0) AS thismouth,
+ ISNULL(A.amount, 0) AS lastamount,
+ ISNULL(b.amount, 0) AS thisamount
+ FROM (
+ SELECT COUNT
+ (*) AS lastmonth,
+ amount,
+ deptid
+ FROM
+ sys_socil
+ WHERE
+ deptid IN ( SELECT i.departmentid FROM sys_information i LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction
+ where 1=1
+ <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">
+ and i.jurisdiction =#{jurisdiction}
+ </if>
+ GROUP BY i.departmentid )
+ AND datediff(month
+ , insuredtime
+ , getdate())=1
+ <if test="deptid!=null and deptid!=''">
+ and deptid =#{deptid}
+ </if>
+ GROUP BY
+ amount,
+ deptid
+ ) A
+ FULL JOIN (
+ SELECT COUNT
+ (*) AS thismouth,
+ amount,
+ deptid
+ FROM
+ sys_socil
+ WHERE
+ deptid IN ( SELECT i.departmentid FROM sys_information i LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction
+ where 1=1
+ <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">
+ and i.jurisdiction =#{jurisdiction}
+ </if>
+ GROUP BY i.departmentid )
+ AND datediff(month
+ , insuredtime
+ , getdate())=0
+ <if test="deptid!=null and deptid!=''">
+ and deptid =#{deptid}
+ </if>
+ GROUP BY
+ amount,
+ deptid
+ ) B ON A.deptid = B.deptid
+ </select>
+
+
+ <!--查询本年所有月份的交社保的数量-->
+ <select id="queryYearSoil" resultType="java.util.HashMap">
+ SELECT COUNT
+ (CASE WHEN MONTH (
+ s.insuredtime ) = 1 THEN s.cardid END ) AS '1', COUNT(CASE WHEN MONTH ( s.insuredtime ) = 2 THEN s.cardid END )
+ AS '2', COUNT(CASE WHEN MONTH ( s.insuredtime ) = 3 THEN s.cardid END ) AS '3', COUNT(CASE WHEN MONTH (
+ s.insuredtime ) = 4 THEN s.cardid END ) AS '4', COUNT(CASE WHEN MONTH ( s.insuredtime ) = 5 THEN s.cardid END )
+ AS '5', COUNT(CASE WHEN MONTH ( s.insuredtime ) = 6 THEN s.cardid END ) AS '6', COUNT(CASE WHEN MONTH (
+ s.insuredtime ) = 7 THEN s.cardid END ) AS '7', COUNT(CASE WHEN MONTH ( s.insuredtime ) = 8 THEN s.cardid END )
+ AS '8', COUNT(CASE WHEN MONTH ( s.insuredtime ) = 9 THEN s.cardid END ) AS '9', COUNT(CASE WHEN MONTH (
+ s.insuredtime ) = 10 THEN s.cardid END ) AS '10', COUNT(CASE WHEN MONTH ( s.insuredtime ) = 11 THEN s.cardid END
+ ) AS '11', COUNT(CASE WHEN MONTH ( s.insuredtime ) = 12 THEN s.cardid END ) AS '12'
+ FROM sys_socil AS s
+ WHERE
+ YEAR ( s.insuredtime ) =#{year}
+ AND deptid IN (
+ SELECT
+ i.departmentid
+ FROM
+ sys_information i
+ LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction where 1=1
+ <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">
+ and i.jurisdiction =#{jurisdiction}
+ </if>
+ GROUP BY
+ i.departmentid )
+ <if test="deptid!=null and deptid!=''">
+ and deptid =#{deptid}
+ </if>
+ </select>
+
+ <!--查询本年所有月份的交社保的金额-->
+ <select id="queryYearAn" resultType="java.util.HashMap">
+ SELECT ISNULL(SUM(CASE WHEN MONTH (s.insuredtime) = 1 THEN s.amount END ), 0) AS '1', ISNULL(SUM(CASE WHEN MONTH
+ (s.insuredtime) = 2 THEN s.amount END ), 0) AS '2', ISNULL(SUM(CASE WHEN MONTH (s.insuredtime) = 3 THEN s.amount
+ END ), 0) AS '3', ISNULL(SUM(CASE WHEN MONTH (s.insuredtime) = 4 THEN s.amount END ), 0) AS '4', ISNULL(SUM(CASE
+ WHEN MONTH (s.insuredtime) = 5 THEN s.amount END ), 0) AS '5', ISNULL(SUM(CASE WHEN MONTH (s.insuredtime) = 6
+ THEN s.amount END ), 0) AS '6', ISNULL(SUM(CASE WHEN MONTH (s.insuredtime) = 7 THEN s.amount END ), 0) AS '7',
+ ISNULL(SUM(CASE WHEN MONTH (s.insuredtime) = 8 THEN s.amount END ), 0) AS '8', ISNULL(SUM(CASE WHEN MONTH
+ (s.insuredtime) = 9 THEN s.amount END ), 0) AS '9', ISNULL(SUM(CASE WHEN MONTH (s.insuredtime) = 10 THEN
+ s.amount END ), 0) AS '10', ISNULL(SUM(CASE WHEN MONTH (s.insuredtime) = 11 THEN s.amount END ), 0) AS '11',
+ ISNULL(SUM(CASE WHEN MONTH (s.insuredtime) = 12 THEN s.amount END ), 0) AS '12'
+ FROM sys_socil AS s
+ WHERE YEAR (s.insuredtime) =#{year}
+ AND deptid IN (SELECT i.departmentid FROM sys_information i LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction
+ where 1=1
+ <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">
+ and i.jurisdiction =#{jurisdiction}
+ </if>
+ GROUP BY i.departmentid )
+ <if test="deptid!=null and deptid!=''">
+ and deptid =#{deptid}
+ </if>
+ </select>
+
+
+ <!--总保安数量-->
+ <select id="queryCountB" resultType="java.util.HashMap">
+ SELECT ISNULL(A.thisnum, 0) as thisnum,
+ ISNULL(B.lastnum, 0) as lastnum
+ FROM (
+ SELECT COUNT
+ (*) AS thisnum,
+ dept_id
+ FROM blade_user
+ WHERE dept_id IN (SELECT i.departmentid
+ FROM sys_information i
+ LEFT JOIN sys_jurisdiction j ON j.id = i.jurisdiction where 1=1
+ <if test="jurisdiction!=null and jurisdiction!=''">
+ and i.jurisdiction =#{jurisdiction}
+ </if>
+ GROUP BY i.departmentid)
+ AND role_id = '1413323482159321089'
+ <if test="deptid!=null and deptid!=''">
+ and deptid =#{deptid}
+ </if>
+ AND datediff(
+ MONTH, create_time,
+ getdate()) = 0
+ GROUP BY dept_id
+ ) A
+ FULL JOIN (
+ SELECT COUNT
+ (*) AS lastnum,
+ dept_id
+ FROM blade_user
+ WHERE dept_id IN (SELECT i.departmentid
+ FROM sys_information i
+ LEFT JOIN sys_jurisdiction j ON j.id = i.jurisdiction
+ GROUP BY i.departmentid)
+ AND role_id = '1413323482159321089'
+ AND datediff(
+ MONTH, create_time,
+ getdate()) = 1
+ GROUP BY dept_id
+ ) B ON A.dept_id = B.dept_id
+ </select>
+
+ <!--正常保安数量-->
+ <select id="queryCountZc" resultType="java.util.HashMap">
+ SELECT ISNULL(A.thisnum, 0) as thisnum,
+ ISNULL(B.lastnum, 0) as lastnum
+ FROM (
+ SELECT COUNT
+ (*) AS thisnum,
+ dept_id
+ FROM blade_user
+ WHERE dept_id IN (SELECT i.departmentid
+ FROM sys_information i
+ LEFT JOIN sys_jurisdiction j ON j.id = i.jurisdiction where 1=1
+ <if test="jurisdiction!=null and jurisdiction!=''">
+ and i.jurisdiction =#{jurisdiction}
+ </if>
+ GROUP BY i.departmentid)
+ AND role_id = '1413323482159321089'
+ AND examination = 0
+ <if test="deptid!=null and deptid!=''">
+ and deptid =#{deptid}
+ </if>
+ AND datediff(
+ MONTH, create_time,
+ getdate()) = 0
+ GROUP BY dept_id
+ ) A
+ FULL JOIN (
+ SELECT COUNT
+ (*) AS lastnum,
+ dept_id
+ FROM blade_user
+ WHERE dept_id IN (SELECT i.departmentid
+ FROM sys_information i
+ LEFT JOIN sys_jurisdiction j ON j.id = i.jurisdiction
+ GROUP BY i.departmentid)
+ AND role_id = '1413323482159321089'
+ AND examination = 0
+ AND datediff(
+ MONTH, create_time,
+ getdate()) = 1
+ GROUP BY dept_id
+ ) B ON A.dept_id = B.dept_id
+ </select>
+
+ <!--持证保安数量-->
+ <select id="queryCountCz" resultType="java.util.HashMap">
+ SELECT ISNULL(A.thisnum, 0) as thisnum,
+ ISNULL(B.lastnum, 0) as lastnum
+ FROM (
+ SELECT COUNT
+ (*) AS thisnum,
+ dept_id
+ FROM blade_user
+ WHERE dept_id IN (SELECT i.departmentid
+ FROM sys_information i
+ LEFT JOIN sys_jurisdiction j ON j.id = i.jurisdiction where 1=1
+ <if test="jurisdiction!=null and jurisdiction!=''">
+ and i.jurisdiction =#{jurisdiction}
+ </if>
+ GROUP BY i.departmentid)
+ AND role_id = '1413323482159321089'
+ AND hold = 0
+ <if test="deptid!=null and deptid!=''">
+ and deptid =#{deptid}
+ </if>
+ AND datediff(
+ MONTH, create_time,
+ getdate()) = 0
+ GROUP BY dept_id
+ ) A
+ FULL JOIN (
+ SELECT COUNT
+ (*) AS lastnum,
+ dept_id
+ FROM blade_user
+ WHERE dept_id IN (SELECT i.departmentid
+ FROM sys_information i
+ LEFT JOIN sys_jurisdiction j ON j.id = i.jurisdiction
+ GROUP BY i.departmentid)
+ AND role_id = '1413323482159321089'
+ AND hold = 0
+ AND datediff(
+ MONTH, create_time,
+ getdate()) = 1
+ GROUP BY dept_id
+ ) B ON A.dept_id = B.dept_id
+ </select>
+
+ <!--缴纳社保数量-->
+ <select id="queryCountSb" resultType="java.util.HashMap">
+ SELECT ISNULL(A.thisnum, 0) AS thisnum,
+ ISNULL(B.lastnum, 0) AS lastnum
+ FROM (
+ SELECT COUNT
+ (*) AS thisnum,
+ deptid
+ FROM
+ sys_socil
+ WHERE
+ deptid IN ( SELECT i.departmentid FROM sys_information i LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction
+ where 1=1
+ <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">
+ and i.jurisdiction =#{jurisdiction}
+ </if>
+ GROUP BY i.departmentid )
+ AND datediff(month
+ , insuredtime
+ , getdate())=0
+ <if test="deptid!=null and deptid!=''">
+ and deptid =#{deptid}
+ </if>
+ GROUP BY
+ deptid
+ ) A
+ FULL JOIN (
+ SELECT COUNT
+ (*) AS lastnum,
+ deptid
+ FROM
+ sys_socil
+ WHERE
+ deptid IN ( SELECT i.departmentid FROM sys_information i LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction
+ where 1=1
+ <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">
+ and i.jurisdiction =#{jurisdiction}
+ </if>
+ GROUP BY i.departmentid )
+ AND datediff(month
+ , insuredtime
+ , getdate())=1
+ <if test="deptid!=null and deptid!=''">
+ and deptid =#{deptid}
+ </if>
+ GROUP BY
+ deptid
+ ) B ON A.deptid = B.deptid
+ </select>
+
+ <!--服务客户数量-->
+ <select id="queryCountKh" resultType="java.util.HashMap">
+ SELECT ISNULL(A.thisnum, 0) AS thisnum,
+ ISNULL(B.lastnum, 0) AS lastnum
+ FROM (
+ SELECT COUNT
+ (*) AS thisnum,
+ dept_id
+ FROM
+ sys_dispatcher_unit
+ WHERE
+ dept_id IN ( SELECT i.departmentid FROM sys_information i LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction
+ where 1=1
+ <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">
+ and i.jurisdiction =#{jurisdiction}
+ </if>
+ GROUP BY i.departmentid )
+ AND datediff(month
+ , create_time
+ , getdate())=0
+ <if test="deptid!=null and deptid!=''">
+ and dept_id =#{deptid}
+ </if>
+ GROUP BY
+ dept_id
+ ) A
+ FULL JOIN (
+ SELECT COUNT
+ (*) AS lastnum,
+ dept_id
+ FROM
+ sys_dispatcher_unit
+ WHERE
+ dept_id IN ( SELECT i.departmentid FROM sys_information i LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction
+ where 1=1
+ <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">
+ and i.jurisdiction =#{jurisdiction}
+ </if>
+ GROUP BY i.departmentid )
+ AND datediff(month
+ , create_time
+ , getdate())=1
+ <if test="deptid!=null and deptid!=''">
+ and dept_id =#{deptid}
+ </if>
+ GROUP BY
+ dept_id
+ ) B ON A.dept_id = B.dept_id
+ </select>
+
+ <!--保安派遣数量-->
+ <select id="queryCountPq" resultType="java.util.HashMap">
+ SELECT ISNULL(A.thisnum, 0) AS thisnum,
+ ISNULL(B.lastnum, 0) AS lastnum
+ FROM (
+ SELECT COUNT
+ (*) AS thisnum,
+ dept_id
+ FROM
+ sys_dispatcher
+ WHERE
+ dept_id IN ( SELECT i.departmentid FROM sys_information i LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction
+ where 1=1
+ <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">
+ and i.jurisdiction =#{jurisdiction}
+ </if>
+ GROUP BY i.departmentid )
+ AND datediff(month
+ , dispatcherTime
+ , getdate())=0
+ <if test="deptid!=null and deptid!=''">
+ and dept_id =#{deptid}
+ </if>
+ GROUP BY
+ dept_id
+ ) A
+ FULL JOIN (
+ SELECT COUNT
+ (*) AS lastnum,
+ dept_id
+ FROM
+ sys_dispatcher
+ WHERE
+ dept_id IN ( SELECT i.departmentid FROM sys_information i LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction
+ where 1=1
+ <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">
+ and i.jurisdiction =#{jurisdiction}
+ </if>
+ GROUP BY i.departmentid )
+ AND datediff(month
+ , dispatcherTime
+ , getdate())=1
+ <if test="deptid!=null and deptid!=''">
+ and dept_id =#{deptid}
+ </if>
+ GROUP BY
+ dept_id
+ ) B ON A.dept_id = B.dept_id
+ </select>
+
+
+ <!--查询本年所有月份的总人数-->
+ <select id="queryYearZ" resultType="java.util.HashMap">
+ SELECT COUNT
+ (CASE WHEN MONTH (
+ s.create_time ) = 1 THEN s.role_id END ) AS '1', COUNT(CASE WHEN MONTH ( s.create_time ) = 2 THEN s.role_id END
+ ) AS '2', COUNT(CASE WHEN MONTH ( s.create_time ) = 3 THEN s.role_id END ) AS '3', COUNT(CASE WHEN MONTH (
+ s.create_time ) = 4 THEN s.role_id END ) AS '4', COUNT(CASE WHEN MONTH ( s.create_time ) = 5 THEN s.role_id END
+ ) AS '5', COUNT(CASE WHEN MONTH ( s.create_time ) = 6 THEN s.role_id END ) AS '6', COUNT(CASE WHEN MONTH (
+ s.create_time ) = 7 THEN s.role_id END ) AS '7', COUNT(CASE WHEN MONTH ( s.create_time ) = 8 THEN s.role_id END
+ ) AS '8', COUNT(CASE WHEN MONTH ( s.create_time ) = 9 THEN s.role_id END ) AS '9', COUNT(CASE WHEN MONTH (
+ s.create_time ) = 10 THEN s.role_id END ) AS '10', COUNT(CASE WHEN MONTH ( s.create_time ) = 11 THEN s.role_id
+ END ) AS '11', COUNT(CASE WHEN MONTH ( s.create_time ) = 12 THEN s.role_id END ) AS '12'
+ FROM blade_user AS s
+ WHERE
+ YEAR ( s.create_time ) =#{year}
+ AND dept_id IN (
+ SELECT
+ i.departmentid
+ FROM
+ sys_information i
+ LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction where 1=1
+ <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">
+ and i.jurisdiction =#{jurisdiction}
+ </if>
+ GROUP BY
+ i.departmentid
+ )
+ AND role_id='1413323482159321089'
+ <if test="deptid!=null and deptid!=''">
+ and dept_id =#{deptid}
+ </if>
+ </select>
+ <!--查询本年所有月份的正常保安人数-->
+ <select id="queryYearZc" resultType="java.util.HashMap">
+ SELECT COUNT
+ (CASE WHEN MONTH (
+ s.create_time ) = 1 THEN s.role_id END ) AS '1', COUNT(CASE WHEN MONTH ( s.create_time ) = 2 THEN s.role_id END
+ ) AS '2', COUNT(CASE WHEN MONTH ( s.create_time ) = 3 THEN s.role_id END ) AS '3', COUNT(CASE WHEN MONTH (
+ s.create_time ) = 4 THEN s.role_id END ) AS '4', COUNT(CASE WHEN MONTH ( s.create_time ) = 5 THEN s.role_id END
+ ) AS '5', COUNT(CASE WHEN MONTH ( s.create_time ) = 6 THEN s.role_id END ) AS '6', COUNT(CASE WHEN MONTH (
+ s.create_time ) = 7 THEN s.role_id END ) AS '7', COUNT(CASE WHEN MONTH ( s.create_time ) = 8 THEN s.role_id END
+ ) AS '8', COUNT(CASE WHEN MONTH ( s.create_time ) = 9 THEN s.role_id END ) AS '9', COUNT(CASE WHEN MONTH (
+ s.create_time ) = 10 THEN s.role_id END ) AS '10', COUNT(CASE WHEN MONTH ( s.create_time ) = 11 THEN s.role_id
+ END ) AS '11', COUNT(CASE WHEN MONTH ( s.create_time ) = 12 THEN s.role_id END ) AS '12'
+ FROM blade_user AS s
+ WHERE
+ YEAR ( s.create_time ) =#{year}
+ AND dept_id IN (
+ SELECT
+ i.departmentid
+ FROM
+ sys_information i
+ LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction where 1=1
+ <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">
+ and i.jurisdiction =#{jurisdiction}
+ </if>
+ GROUP BY
+ i.departmentid
+ )
+ AND role_id='1413323482159321089' AND examination=0
+ <if test="deptid!=null and deptid!=''">
+ and dept_id =#{deptid}
+ </if>
+ </select>
+ <!--查询本年所有月份的保安持证人数-->
+ <select id="queryYearCz" resultType="java.util.HashMap">
+ SELECT COUNT
+ (CASE WHEN MONTH (
+ s.create_time ) = 1 THEN s.role_id END ) AS '1', COUNT(CASE WHEN MONTH ( s.create_time ) = 2 THEN s.role_id END
+ ) AS '2', COUNT(CASE WHEN MONTH ( s.create_time ) = 3 THEN s.role_id END ) AS '3', COUNT(CASE WHEN MONTH (
+ s.create_time ) = 4 THEN s.role_id END ) AS '4', COUNT(CASE WHEN MONTH ( s.create_time ) = 5 THEN s.role_id END
+ ) AS '5', COUNT(CASE WHEN MONTH ( s.create_time ) = 6 THEN s.role_id END ) AS '6', COUNT(CASE WHEN MONTH (
+ s.create_time ) = 7 THEN s.role_id END ) AS '7', COUNT(CASE WHEN MONTH ( s.create_time ) = 8 THEN s.role_id END
+ ) AS '8', COUNT(CASE WHEN MONTH ( s.create_time ) = 9 THEN s.role_id END ) AS '9', COUNT(CASE WHEN MONTH (
+ s.create_time ) = 10 THEN s.role_id END ) AS '10', COUNT(CASE WHEN MONTH ( s.create_time ) = 11 THEN s.role_id
+ END ) AS '11', COUNT(CASE WHEN MONTH ( s.create_time ) = 12 THEN s.role_id END ) AS '12'
+ FROM blade_user AS s
+ WHERE
+ YEAR ( s.create_time ) =#{year}
+ AND dept_id IN (
+ SELECT
+ i.departmentid
+ FROM
+ sys_information i
+ LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction where 1=1
+ <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">
+ and i.jurisdiction =#{jurisdiction}
+ </if>
+ GROUP BY
+ i.departmentid
+ )
+ AND role_id='1413323482159321089' AND hold=0
+ <if test="deptid!=null and deptid!=''">
+ and dept_id =#{deptid}
+ </if>
+ </select>
+
+ <!--查询本年所有月份的客户数量-->
+ <select id="queryYearKh" resultType="java.util.HashMap">
+ SELECT COUNT
+ ( CASE WHEN MONTH ( s.create_time ) = 1 THEN s.dept_id END ) AS '1',
+ COUNT ( CASE WHEN MONTH ( s.create_time ) = 2 THEN s.dept_id END ) AS '2',
+ COUNT ( CASE WHEN MONTH ( s.create_time ) = 3 THEN s.dept_id END ) AS '3',
+ COUNT ( CASE WHEN MONTH ( s.create_time ) = 4 THEN s.dept_id END ) AS '4',
+ COUNT ( CASE WHEN MONTH ( s.create_time ) = 5 THEN s.dept_id END ) AS '5',
+ COUNT ( CASE WHEN MONTH ( s.create_time ) = 6 THEN s.dept_id END ) AS '6',
+ COUNT ( CASE WHEN MONTH ( s.create_time ) = 7 THEN s.dept_id END ) AS '7',
+ COUNT ( CASE WHEN MONTH ( s.create_time ) = 8 THEN s.dept_id END ) AS '8',
+ COUNT ( CASE WHEN MONTH ( s.create_time ) = 9 THEN s.dept_id END ) AS '9',
+ COUNT ( CASE WHEN MONTH ( s.create_time ) = 10 THEN s.dept_id END ) AS '10',
+ COUNT ( CASE WHEN MONTH ( s.create_time ) = 11 THEN s.dept_id END ) AS '11',
+ COUNT ( CASE WHEN MONTH ( s.create_time ) = 12 THEN s.dept_id END ) AS '12'
+ FROM
+ sys_dispatcher_unit AS s
+ WHERE
+ YEAR ( s.create_time ) =#{year}
+ AND dept_id IN (
+ SELECT
+ i.departmentid
+ FROM
+ sys_information i
+ LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction where 1=1
+ <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">
+ and i.jurisdiction =#{jurisdiction}
+ </if>
+ GROUP BY
+ i.departmentid
+ )
+ <if test="deptid!=null and deptid!=''">
+ and dept_id =#{deptid}
+ </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 1b916d7..2809c84 100644
--- a/src/main/java/org/springblade/modules/information/service/IInformationService.java
+++ b/src/main/java/org/springblade/modules/information/service/IInformationService.java
@@ -45,5 +45,19 @@
void deleteSh(String creditCode);
void deleteMe(String creditCode);
Map selectCount(String departmentid);
- List<Map<Object,String>> selectInCount();
+ List<Map<Object,String>> selectInCount(String jurisdiction,String deptid);
+ List<Map<String, Object>> selectCs(String jurisdiction,String deptid);
+ List<Map<String, Object>> selectTo(String jurisdiction,String deptid);
+ Map<String, String> queryYearSoil(String year,String jurisdiction,String deptid);
+ Map<String, String> queryYearAn(String year,String jurisdiction,String deptid);
+ List<Map<Object,Integer>> queryCountB(String jurisdiction,String deptid);
+ List<Map<Object,Integer>> queryCountZc(String jurisdiction,String deptid);
+ List<Map<Object,Integer>> queryCountCz(String jurisdiction,String deptid);
+ List<Map<Object,Integer>> queryCountSb(String jurisdiction,String deptid);
+ List<Map<Object,Integer>> queryCountKh(String jurisdiction,String deptid);
+ List<Map<Object,Integer>> queryCountPq(String jurisdiction,String deptid);
+ Map<String, String> queryYearZ(String year,String jurisdiction,String deptid);
+ Map<String, String> queryYearZc(String year,String jurisdiction,String deptid);
+ Map<String, String> queryYearCz(String year,String jurisdiction,String deptid);
+ Map<String, String> queryYearKh(String year,String jurisdiction,String deptid);
}
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 f772b3c..f914a0f 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
@@ -62,8 +62,78 @@
}
@Override
- public List<Map<Object, String>> selectInCount() {
- return baseMapper.selectInCount();
+ public List<Map<Object, String>> selectInCount(String jurisdiction,String deptid) {
+ return baseMapper.selectInCount(jurisdiction,deptid);
}
+ @Override
+ public List<Map<String, Object>>selectCs(String jurisdiction,String deptid) {
+ return baseMapper.selectCs(jurisdiction,deptid);
+ }
+
+ @Override
+ public List<Map<String, Object>> selectTo(String jurisdiction,String deptid) {
+ return baseMapper.selectTo(jurisdiction,deptid);
+ }
+
+ @Override
+ public Map<String, String> queryYearSoil(String year,String jurisdiction,String deptid) {
+ return baseMapper.queryYearSoil(year,jurisdiction,deptid);
+ }
+ @Override
+ public Map<String, String> queryYearAn(String year,String jurisdiction,String deptid) {
+ return baseMapper.queryYearAn(year,jurisdiction,deptid);
+ }
+
+ @Override
+ public List<Map<Object, Integer>> queryCountB(String jurisdiction, String deptid) {
+ return baseMapper.queryCountB(jurisdiction, deptid);
+ }
+
+ @Override
+ public List<Map<Object, Integer>> queryCountZc(String jurisdiction, String deptid) {
+ return baseMapper.queryCountZc(jurisdiction, deptid);
+ }
+
+ @Override
+ public List<Map<Object, Integer>> queryCountCz(String jurisdiction, String deptid) {
+ return baseMapper.queryCountCz(jurisdiction, deptid);
+ }
+
+ @Override
+ public List<Map<Object, Integer>> queryCountSb(String jurisdiction, String deptid) {
+ return baseMapper.queryCountSb(jurisdiction, deptid);
+ }
+
+ @Override
+ public List<Map<Object, Integer>> queryCountKh(String jurisdiction, String deptid) {
+ return baseMapper.queryCountKh(jurisdiction, deptid);
+ }
+
+ @Override
+ public List<Map<Object, Integer>> queryCountPq(String jurisdiction, String deptid) {
+ return baseMapper.queryCountPq(jurisdiction, deptid);
+ }
+
+ @Override
+ public Map<String, String> queryYearZ(String year, String jurisdiction, String deptid) {
+ return baseMapper.queryYearZ(year, jurisdiction, deptid);
+ }
+
+ @Override
+ public Map<String, String> queryYearZc(String year, String jurisdiction, String deptid) {
+ return baseMapper.queryYearZc(year, jurisdiction, deptid);
+ }
+
+ @Override
+ public Map<String, String> queryYearCz(String year, String jurisdiction, String deptid) {
+ return baseMapper.queryYearCz(year, jurisdiction, deptid);
+ }
+
+ @Override
+ public Map<String, String> queryYearKh(String year, String jurisdiction, String deptid) {
+ return baseMapper.queryYearKh(year, jurisdiction, deptid);
+ }
+
+
}
diff --git a/src/main/java/org/springblade/modules/jurisdiction/mapper/JurisdictionMapper.java b/src/main/java/org/springblade/modules/jurisdiction/mapper/JurisdictionMapper.java
index 5cabfba..a9a817b 100644
--- a/src/main/java/org/springblade/modules/jurisdiction/mapper/JurisdictionMapper.java
+++ b/src/main/java/org/springblade/modules/jurisdiction/mapper/JurisdictionMapper.java
@@ -58,6 +58,7 @@
* @return
*/
List<JurisdictionVO> lazyTree(String tenantId, Long parentId);
+ List<JurisdictionVO> lazyTreeJu();
/**
* 懒加载获取树形节点
diff --git a/src/main/java/org/springblade/modules/jurisdiction/mapper/JurisdictionMapper.xml b/src/main/java/org/springblade/modules/jurisdiction/mapper/JurisdictionMapper.xml
index 76b395e..a186876 100644
--- a/src/main/java/org/springblade/modules/jurisdiction/mapper/JurisdictionMapper.xml
+++ b/src/main/java/org/springblade/modules/jurisdiction/mapper/JurisdictionMapper.xml
@@ -113,4 +113,30 @@
sys_jurisdiction dept
WHERE dept.is_deleted = 0
</select>
+ <select id="lazyTreeJu" resultMap="treeNodeResultMap" >
+ SELECT
+ dept.id,
+ dept.parent_id,
+ dept.dept_name AS title,
+ dept.id AS "value",
+ dept.id AS "key",
+ (
+ SELECT
+ CASE
+
+ WHEN COUNT
+ ( 1 ) > 0 THEN
+ 1 ELSE 0
+ END
+ FROM
+ sys_jurisdiction
+ WHERE
+ parent_id = dept.id
+ AND is_deleted = 0
+ ) AS "has_children"
+ FROM
+ sys_jurisdiction dept
+ WHERE
+ dept.is_deleted = 0
+ </select>
</mapper>
diff --git a/src/main/java/org/springblade/modules/jurisdiction/service/JurisdictionService.java b/src/main/java/org/springblade/modules/jurisdiction/service/JurisdictionService.java
index e65f2a7..857deb7 100644
--- a/src/main/java/org/springblade/modules/jurisdiction/service/JurisdictionService.java
+++ b/src/main/java/org/springblade/modules/jurisdiction/service/JurisdictionService.java
@@ -56,6 +56,7 @@
* @return
*/
List<JurisdictionVO> lazyTree(String tenantId, Long parentId);
+ List<JurisdictionVO> lazyTreeJu();
/**
* 懒加载获取树形节点
diff --git a/src/main/java/org/springblade/modules/jurisdiction/service/impl/JurisdictionServiceImpl.java b/src/main/java/org/springblade/modules/jurisdiction/service/impl/JurisdictionServiceImpl.java
index 4cb49ab..1150fd5 100644
--- a/src/main/java/org/springblade/modules/jurisdiction/service/impl/JurisdictionServiceImpl.java
+++ b/src/main/java/org/springblade/modules/jurisdiction/service/impl/JurisdictionServiceImpl.java
@@ -86,6 +86,11 @@
}
@Override
+ public List<JurisdictionVO> lazyTreeJu() {
+ return baseMapper.lazyTreeJu();
+ }
+
+ @Override
public List<JurisdictionVO> lazyTrees() {
return ForestNodeMerger.merge(baseMapper.lazyTrees());
}
diff --git a/src/main/java/org/springblade/modules/social/controller/SocialController.java b/src/main/java/org/springblade/modules/social/controller/SocialController.java
new file mode 100644
index 0000000..336bb51
--- /dev/null
+++ b/src/main/java/org/springblade/modules/social/controller/SocialController.java
@@ -0,0 +1,158 @@
+/*
+ * 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.social.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+
+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.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.social.excel.SocialExcel;
+import org.springblade.modules.social.excel.SocialImporter;
+import org.springblade.modules.system.excel.UserExcel;
+import org.springblade.modules.system.excel.UserImporter;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.modules.social.entity.Social;
+import org.springblade.modules.social.vo.SocialVO;
+import org.springblade.modules.social.service.ISocialService;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 控制器
+ *
+ * @author BladeX
+ * @since 2021-07-16
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/social")
+@Api(value = "", tags = "接口")
+public class SocialController extends BladeController {
+
+ private final ISocialService socialService;
+
+ /**
+ * 详情
+ */
+ @GetMapping("/detail")
+ @ApiOperationSupport(order = 1)
+ @ApiOperation(value = "详情", notes = "传入social")
+ public R<Social> detail(Social social) {
+ Social detail = socialService.getOne(Condition.getQueryWrapper(social));
+ return R.data(detail);
+ }
+
+ /**
+ * 分页
+ */
+ @GetMapping("/list")
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "分页", notes = "传入social")
+ public R<IPage<Social>> list(Social social, Query query) {
+ IPage<Social> pages = socialService.page(Condition.getPage(query), Condition.getQueryWrapper(social));
+ return R.data(pages);
+ }
+
+ /**
+ * 自定义分页
+ */
+ @GetMapping("/page")
+ @ApiOperationSupport(order = 3)
+ @ApiOperation(value = "分页", notes = "传入social")
+ public R<IPage<SocialVO>> page(SocialVO social, Query query) {
+ IPage<SocialVO> pages = socialService.selectSocialPage(Condition.getPage(query), social);
+ return R.data(pages);
+ }
+
+ /**
+ * 新增
+ */
+ @PostMapping("/save")
+ @ApiOperationSupport(order = 4)
+ @ApiOperation(value = "新增", notes = "传入social")
+ public R save(@Valid @RequestBody Social social) {
+ return R.status(socialService.save(social));
+ }
+
+ /**
+ * 修改
+ */
+ @PostMapping("/update")
+ @ApiOperationSupport(order = 5)
+ @ApiOperation(value = "修改", notes = "传入social")
+ public R update(@Valid @RequestBody Social social) {
+ return R.status(socialService.updateById(social));
+ }
+
+ /**
+ * 新增或修改
+ */
+ @PostMapping("/submit")
+ @ApiOperationSupport(order = 6)
+ @ApiOperation(value = "新增或修改", notes = "传入social")
+ public R submit(@Valid @RequestBody Social social) {
+ return R.status(socialService.saveOrUpdate(social));
+ }
+
+
+ /**
+ * 删除
+ */
+ @PostMapping("/remove")
+ @ApiOperationSupport(order = 8)
+ @ApiOperation(value = "删除", notes = "传入ids")
+ public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+ return R.status(socialService.removeByIds(Func.toLongList(ids)));
+ }
+
+
+ /**
+ * 导入用户
+ */
+ @PostMapping("import-user")
+ @ApiOperationSupport(order = 12)
+ public R importUser(MultipartFile file, Integer isCovered,String deptid) {
+ SocialImporter socialImporter = new SocialImporter(socialService, isCovered == 0,deptid);
+ ExcelUtil.save(file, socialImporter, SocialExcel.class);
+ return R.success("操作成功");
+ }
+
+ /**
+ * 导出模板
+ */
+ @GetMapping("export-template")
+ @ApiOperationSupport(order = 14)
+ @ApiOperation(value = "导出模板")
+ public void exportUser(HttpServletResponse response) {
+ List<SocialExcel> list = new ArrayList<>();
+ ExcelUtil.export(response, "社保数据模板", "社保数据模板", list, SocialExcel.class);
+ }
+}
diff --git a/src/main/java/org/springblade/modules/social/dto/SocialDTO.java b/src/main/java/org/springblade/modules/social/dto/SocialDTO.java
new file mode 100644
index 0000000..2aae309
--- /dev/null
+++ b/src/main/java/org/springblade/modules/social/dto/SocialDTO.java
@@ -0,0 +1,34 @@
+/*
+ * 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.social.dto;
+
+import org.springblade.modules.social.entity.Social;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2021-07-16
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class SocialDTO extends Social {
+ private static final long serialVersionUID = 1L;
+
+}
diff --git a/src/main/java/org/springblade/modules/social/entity/Social.java b/src/main/java/org/springblade/modules/social/entity/Social.java
new file mode 100644
index 0000000..60c5a44
--- /dev/null
+++ b/src/main/java/org/springblade/modules/social/entity/Social.java
@@ -0,0 +1,115 @@
+/*
+ * 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.social.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.format.annotation.DateTimeFormat;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2021-07-16
+ */
+@Data
+@TableName("sys_socil")
+@ApiModel(value = "Social对象", description = "Social对象")
+public class Social implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 姓名
+ */
+ @ApiModelProperty(value = "姓名")
+ private String namb;
+ /**
+ * 性别
+ */
+ @ApiModelProperty(value = "性别")
+ private String sex;
+ /**
+ * 民族
+ */
+ @ApiModelProperty(value = "民族")
+ private String nation;
+ /**
+ * 出生日期
+ */
+ @ApiModelProperty(value = "出生日期")
+ @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+ @DateTimeFormat(pattern = "yyyy-MM-dd")
+ private Date birthday;
+ /**
+ * 联系电话
+ */
+ @ApiModelProperty(value = "联系电话")
+ private String telephone;
+ /**
+ * 身份证号
+ */
+ @ApiModelProperty(value = "身份证号")
+ private String cardid;
+ /**
+ * 户籍所在地址
+ */
+ @ApiModelProperty(value = "户籍所在地址")
+ private String residence;
+ /**
+ * 居住地址
+ */
+ @ApiModelProperty(value = "居住地址 ")
+ private String address;
+ /**
+ * 户籍性质
+ */
+ @ApiModelProperty(value = "户籍性质")
+ private String nature;
+ /**
+ * 个人缴费额
+ */
+ @ApiModelProperty(value = "个人缴费额")
+ private float amount ;
+ /**
+ * 参保时间
+ */
+ @ApiModelProperty(value = "参保时间")
+ @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+ @DateTimeFormat(pattern = "yyyy-MM-dd")
+ private Date insuredtime;
+ /**
+ * 单位id
+ */
+ @ApiModelProperty(value = "单位id")
+ private String deptid;
+
+ @TableId(value = "id", type = IdType.AUTO)
+ private Integer id;
+
+
+}
diff --git a/src/main/java/org/springblade/modules/social/excel/SocialExcel.java b/src/main/java/org/springblade/modules/social/excel/SocialExcel.java
new file mode 100644
index 0000000..4ae9aa3
--- /dev/null
+++ b/src/main/java/org/springblade/modules/social/excel/SocialExcel.java
@@ -0,0 +1,82 @@
+/*
+ * 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.social.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;
+import java.util.Date;
+
+/**
+ * UserExcel
+ *
+ * @author Chill
+ */
+@Data
+@ColumnWidth(25)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class SocialExcel implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ @ColumnWidth(15)
+ @ExcelProperty("姓名")
+ private String namb;
+
+ @ColumnWidth(10)
+ @ExcelProperty("性别")
+ private String sex;
+
+ @ColumnWidth(15)
+ @ExcelProperty("民族")
+ private String nation;
+
+ @ColumnWidth(15)
+ @ExcelProperty("出生日期")
+ private Date birthday;
+
+ @ColumnWidth(15)
+ @ExcelProperty("联系电话")
+ private String telephone;
+
+ @ExcelProperty("身份证号")
+ private String cardid;
+
+ @ColumnWidth(15)
+ @ExcelProperty("户籍所在地")
+ private String residence;
+
+ @ExcelProperty("地址")
+ private String address;
+
+ @ExcelProperty("户籍性质")
+ private String nature;
+
+ @ExcelProperty("个人缴费")
+ private String amount ;
+
+ @ExcelProperty("参保时间")
+ private Date insuredtime;
+
+
+
+}
diff --git a/src/main/java/org/springblade/modules/social/mapper/SocialMapper.java b/src/main/java/org/springblade/modules/social/mapper/SocialMapper.java
new file mode 100644
index 0000000..56d0e1b
--- /dev/null
+++ b/src/main/java/org/springblade/modules/social/mapper/SocialMapper.java
@@ -0,0 +1,42 @@
+/*
+ * 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.social.mapper;
+
+import org.springblade.modules.social.entity.Social;
+import org.springblade.modules.social.vo.SocialVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * Mapper 接口
+ *
+ * @author BladeX
+ * @since 2021-07-16
+ */
+public interface SocialMapper extends BaseMapper<Social> {
+
+ /**
+ * 自定义分页
+ *
+ * @param page
+ * @param social
+ * @return
+ */
+ List<SocialVO> selectSocialPage(IPage page, SocialVO social);
+
+}
diff --git a/src/main/java/org/springblade/modules/social/mapper/SocialMapper.xml b/src/main/java/org/springblade/modules/social/mapper/SocialMapper.xml
new file mode 100644
index 0000000..6c2fcbc
--- /dev/null
+++ b/src/main/java/org/springblade/modules/social/mapper/SocialMapper.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.social.mapper.SocialMapper">
+
+ <!-- 通用查询映射结果 -->
+ <resultMap id="socialResultMap" type="org.springblade.modules.social.entity.Social">
+ <id column="id" property="id"/>
+ <result column="namb" property="namb"/>
+ <result column="sex" property="sex"/>
+ <result column="nation" property="nation"/>
+ <result column="birthday" property="birthday"/>
+ <result column="telephone" property="telephone"/>
+ <result column="cardid" property="cardid"/>
+ <result column="residence" property="residence"/>
+ <result column="address" property="address"/>
+ <result column="nature" property="nature"/>
+ <result column="amount" property="amount"/>
+ <result column="insuredtime" property="insuredtime"/>
+ <result column="deptid" property="deptid"/>
+ </resultMap>
+
+
+ <select id="selectSocialPage" resultMap="socialResultMap">
+ select * from sys_social
+ </select>
+
+</mapper>
diff --git a/src/main/java/org/springblade/modules/social/service/ISocialService.java b/src/main/java/org/springblade/modules/social/service/ISocialService.java
new file mode 100644
index 0000000..b3a7e47
--- /dev/null
+++ b/src/main/java/org/springblade/modules/social/service/ISocialService.java
@@ -0,0 +1,52 @@
+/*
+ * 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.social.service;
+
+import org.springblade.modules.social.entity.Social;
+import org.springblade.modules.social.excel.SocialExcel;
+import org.springblade.modules.social.vo.SocialVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.modules.system.excel.UserExcel;
+
+import java.util.List;
+
+/**
+ * 服务类
+ *
+ * @author BladeX
+ * @since 2021-07-16
+ */
+public interface ISocialService extends IService<Social> {
+
+ /**
+ * 自定义分页
+ *
+ * @param page
+ * @param social
+ * @return
+ */
+ IPage<SocialVO> selectSocialPage(IPage<SocialVO> page, SocialVO social);
+ /**
+ * 导入用户数据
+ *
+ * @param data
+ * @param isCovered
+ * @return
+ */
+ void importUser(List<SocialExcel> data, Boolean isCovered,String deptid);
+}
diff --git a/src/main/java/org/springblade/modules/social/service/impl/SocialServiceImpl.java b/src/main/java/org/springblade/modules/social/service/impl/SocialServiceImpl.java
new file mode 100644
index 0000000..c1b043d
--- /dev/null
+++ b/src/main/java/org/springblade/modules/social/service/impl/SocialServiceImpl.java
@@ -0,0 +1,66 @@
+/*
+ * 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.social.service.impl;
+
+import org.springblade.common.cache.DictCache;
+import org.springblade.common.cache.ParamCache;
+import org.springblade.common.cache.SysCache;
+import org.springblade.common.cache.UserCache;
+import org.springblade.common.enums.DictEnum;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.core.tool.utils.StringUtil;
+import org.springblade.modules.social.entity.Social;
+import org.springblade.modules.social.excel.SocialExcel;
+import org.springblade.modules.social.vo.SocialVO;
+import org.springblade.modules.social.mapper.SocialMapper;
+import org.springblade.modules.social.service.ISocialService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.modules.system.entity.User;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
+import java.util.Objects;
+
+import static org.springblade.common.constant.CommonConstant.DEFAULT_PARAM_PASSWORD;
+
+/**
+ * 服务实现类
+ *
+ * @author BladeX
+ * @since 2021-07-16
+ */
+@Service
+public class SocialServiceImpl extends ServiceImpl<SocialMapper, Social> implements ISocialService {
+
+ @Override
+ public IPage<SocialVO> selectSocialPage(IPage<SocialVO> page, SocialVO social) {
+ return page.setRecords(baseMapper.selectSocialPage(page, social));
+ }
+
+ @Override
+ public void importUser(List<SocialExcel> data, Boolean isCovered,String deptid) {
+ data.forEach(SocialExcel -> {
+ Social social = Objects.requireNonNull(BeanUtil.copy(SocialExcel, Social.class));
+ social.setDeptid(deptid);
+ this.save(social);
+ });
+ }
+
+}
diff --git a/src/main/java/org/springblade/modules/social/vo/SocialVO.java b/src/main/java/org/springblade/modules/social/vo/SocialVO.java
new file mode 100644
index 0000000..b58fe9d
--- /dev/null
+++ b/src/main/java/org/springblade/modules/social/vo/SocialVO.java
@@ -0,0 +1,36 @@
+/*
+ * 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.social.vo;
+
+import org.springblade.modules.social.entity.Social;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2021-07-16
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "SocialVO对象", description = "SocialVO对象")
+public class SocialVO extends Social {
+ private static final long serialVersionUID = 1L;
+
+}
diff --git a/src/main/java/org/springblade/modules/system/controller/UserController.java b/src/main/java/org/springblade/modules/system/controller/UserController.java
index 3bec228..93e978c 100644
--- a/src/main/java/org/springblade/modules/system/controller/UserController.java
+++ b/src/main/java/org/springblade/modules/system/controller/UserController.java
@@ -123,7 +123,6 @@
@ApiOperation(value = "列表", notes = "传入account和realName")
//@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
public R<IPage<UserVO>> page(@ApiIgnore User user, Query query, Long deptId, BladeUser bladeUser) {
- user.setAccount("admin");
IPage<User> pages = userService.selectUserPage(Condition.getPage(query), user, deptId, (bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID) ? StringPool.EMPTY : bladeUser.getTenantId()));
return R.data(UserWrapper.build().pageVO(pages));
}
diff --git a/src/main/java/sql/social.menu.mysql b/src/main/java/sql/social.menu.mysql
new file mode 100644
index 0000000..9c51fc6
--- /dev/null
+++ b/src/main/java/sql/social.menu.mysql
@@ -0,0 +1,10 @@
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1415934484235374599', 1123598815738675201, 'social', '社保管理', 'menu', '/social/social', NULL, 1, 1, 0, 1, NULL, 0);
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1415934484235374600', '1415934484235374599', 'social_add', '新增', 'add', '/social/social/add', 'plus', 1, 2, 1, 1, NULL, 0);
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1415934484235374601', '1415934484235374599', 'social_edit', '修改', 'edit', '/social/social/edit', 'form', 2, 2, 2, 1, NULL, 0);
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1415934484235374602', '1415934484235374599', 'social_delete', '删除', 'delete', '/api/blade-social/social/remove', 'delete', 3, 2, 3, 1, NULL, 0);
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1415934484235374603', '1415934484235374599', 'social_view', '查看', 'view', '/social/social/view', 'file-text', 4, 2, 2, 1, NULL, 0);
--
Gitblit v1.9.3