jiawuxian 1 год назад
Родитель
Сommit
e9a2c58c0a

+ 6 - 1
project_data/sql/0.0.5/soc/soc.sql

@@ -443,4 +443,9 @@ INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value
 update sys_menu set perms="core:safetytask:list" WHERE menu_name ="检查登记跟踪" and platform_type=1;
 update sys_menu set perms="core:safetytask:list" WHERE parent_id in (SELECT id from (SELECT id from sys_menu WHERE  menu_name ="检查登记跟踪" and platform_type=1) a) and menu_name ="列表" and platform_type=1;
 update sys_menu set perms="core:safetytask:query" WHERE parent_id in (SELECT id from (SELECT id from sys_menu WHERE  menu_name ="检查登记跟踪" and platform_type=1) a) and menu_name ="详细信息" and platform_type=1;
-DELETE FROM sys_menu where  parent_id in (SELECT id from (SELECT id from sys_menu WHERE  menu_name ="检查登记跟踪" and platform_type=1) a) and menu_name in("新增","修改") and platform_type=1;
+DELETE FROM sys_menu where  parent_id in (SELECT id from (SELECT id from sys_menu WHERE  menu_name ="检查登记跟踪" and platform_type=1) a) and menu_name in("新增","修改") and platform_type=1;
+
+
+update sys_dict_data set dict_label='大专' WHERE dict_type='sys_highest_education' and dict_label='专科';
+DELETE from `sys_dict_data` WHERE dict_type='sys_highest_education' and dict_label='中专';
+INSERT INTO `sys_dict_data` ( `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ( 4, '中专', '4', 'sys_highest_education', NULL, 'default', 'N', '0', '何悦', '2023-08-22 14:17:59', '超级管理员', '2023-09-15 16:59:16', NULL);

+ 13 - 13
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/service/impl/AppCockpitServiceImpl.java

@@ -64,7 +64,7 @@ public class AppCockpitServiceImpl implements AppCockpitService {
      */
     @Override
     public List<AppTaskRankingVo> taskRanking(AppTaskRankingDto dto) {
-        if(ObjectUtil.isNull(dto.getMonth())){
+        if (ObjectUtil.isNull(dto.getMonth())) {
             dto.setMonth(new Date());
         }
         DateRange range = DateUtils.getStartAndEnd(dto.getMonth(), CycleCommonEnum.MONTHLY);
@@ -96,7 +96,7 @@ public class AppCockpitServiceImpl implements AppCockpitService {
         childrenStatistic.forEach(i -> {
             AppTaskRankingVo vo = new AppTaskRankingVo();
             vo.setOrgName(i.getOrgName());
-            vo.setRate(NumberUtils.computeRate(i.getTaskTotal(),i.getCompletedCount()));
+            vo.setRate(NumberUtils.computeRate(i.getTaskTotal(), i.getCompletedCount()));
             r.add(vo);
         });
         r.sort(new Comparator<AppTaskRankingVo>() {
@@ -130,22 +130,22 @@ public class AppCockpitServiceImpl implements AppCockpitService {
         vo.setSecurityFacilities(new AppBaseInfoSecurityFacilitiesVo());
         vo.getSecurityFacilities().setGa382015(baseInfoDto.getBankingGA382015() + baseInfoDto.getOffATMGA382015());
         vo.getSecurityFacilities().setGa382021(baseInfoDto.getBankingGA382021() + baseInfoDto.getOffATMGA382021());
-        vo.getSecurityFacilities().setGa38Unreached(baseInfoDto.getUnreachedCount());
+        vo.getSecurityFacilities().setGa38Unreached(baseInfoDto.getTotal() - vo.getSecurityFacilities().getGa382015() - vo.getSecurityFacilities().getGa382021());
 
         vo.setBankingGa38(new AppGa38RateVo());
         vo.getBankingGa38().setGa382021(baseInfoDto.getBankingGA382021());
         vo.getBankingGa38().setGa382015(baseInfoDto.getBankingGA382015());
-        vo.getBankingGa38().setNotreach(baseInfoDto.getBankingCount()-baseInfoDto.getBankingGA382021()-baseInfoDto.getBankingGA382015());
+        vo.getBankingGa38().setNotreach(baseInfoDto.getBankingCount() - baseInfoDto.getBankingGA382021() - baseInfoDto.getBankingGA382015());
 
         vo.setOnlineGa38(new AppGa38RateVo());
         vo.getOnlineGa38().setGa382021(baseInfoDto.getOnlineGA382021());
         vo.getOnlineGa38().setGa382015(baseInfoDto.getOnlineGA382015());
-        vo.getOnlineGa38().setNotreach(baseInfoDto.getOnlineATMCount()-baseInfoDto.getOnlineGA382021()-baseInfoDto.getOnlineGA382015());
+        vo.getOnlineGa38().setNotreach(baseInfoDto.getOnlineATMCount() - baseInfoDto.getOnlineGA382021() - baseInfoDto.getOnlineGA382015());
 
         vo.setOfflineGa38(new AppGa38RateVo());
         vo.getOfflineGa38().setGa382021(baseInfoDto.getOffATMGA382021());
         vo.getOfflineGa38().setGa382015(baseInfoDto.getOffATMGA382015());
-        vo.getOfflineGa38().setNotreach(baseInfoDto.getOffATMCount()-baseInfoDto.getOffATMGA382021()-baseInfoDto.getOffATMGA382015());
+        vo.getOfflineGa38().setNotreach(baseInfoDto.getOffATMCount() - baseInfoDto.getOffATMGA382021() - baseInfoDto.getOffATMGA382015());
 //        vo.setBanking2021(new AppGa38RateVo());
 //        vo.getBanking2021().setTotal(baseInfoDto.getBankingCount());
 //        vo.getBanking2021().setRate(NumberUtils.computeRate(baseInfoDto.getBankingCount(), baseInfoDto.getBankingGA382021()));
@@ -193,7 +193,7 @@ public class AppCockpitServiceImpl implements AppCockpitService {
         AppOverviewVo vo = new AppOverviewVo();
 
         Date currentMonth = DateUtil.beginOfMonth(new Date());
-        Date currentMonthEnd= DateUtil.endOfMonth(new Date());
+        Date currentMonthEnd = DateUtil.endOfMonth(new Date());
         Date prevMonth = DateUtil.beginOfMonth(new Date()).offset(DateField.MONTH, -1);
 
         CompletableFuture<AppOverviewVo> orgOverview = CompletableFuture.supplyAsync(() -> {
@@ -240,7 +240,7 @@ public class AppCockpitServiceImpl implements AppCockpitService {
 
         CompletableFuture<AppOverviewTaskInfoDto> edu = CompletableFuture.supplyAsync(() ->
                 {
-                    AppOverviewTaskInfoDto result = appCockpitMapper.selectOverViewEduTaskInfo(org.getPath(), currentMonth,currentMonthEnd, prevMonth);
+                    AppOverviewTaskInfoDto result = appCockpitMapper.selectOverViewEduTaskInfo(org.getPath(), currentMonth, currentMonthEnd, prevMonth);
                     if (ObjectUtil.isNull(result)) {
                         result = new AppOverviewTaskInfoDto();
                     }
@@ -251,7 +251,7 @@ public class AppCockpitServiceImpl implements AppCockpitService {
 
         CompletableFuture<AppOverviewTaskInfoDto> monitor = CompletableFuture.supplyAsync(() ->
                 {
-                    AppOverviewTaskInfoDto result = appCockpitMapper.selectOverViewMonitorTaskInfo(org.getPath(), currentMonth,currentMonthEnd, prevMonth);
+                    AppOverviewTaskInfoDto result = appCockpitMapper.selectOverViewMonitorTaskInfo(org.getPath(), currentMonth, currentMonthEnd, prevMonth);
                     if (ObjectUtil.isNull(result)) {
                         result = new AppOverviewTaskInfoDto();
                     }
@@ -265,7 +265,7 @@ public class AppCockpitServiceImpl implements AppCockpitService {
         Date prevQuarter = DateUtil.beginOfMonth(currentQuarter).offset(DateField.MONTH, -3);
         CompletableFuture<AppOverviewTaskInfoDto> drill = CompletableFuture.supplyAsync(() ->
                 {
-                    AppOverviewTaskInfoDto result = appCockpitMapper.selectOverViewDrillTaskInfo(org.getPath(), currentQuarter,currentQuarterEnd, prevQuarter);
+                    AppOverviewTaskInfoDto result = appCockpitMapper.selectOverViewDrillTaskInfo(org.getPath(), currentQuarter, currentQuarterEnd, prevQuarter);
                     if (ObjectUtil.isNull(result)) {
                         result = new AppOverviewTaskInfoDto();
                     }
@@ -309,7 +309,7 @@ public class AppCockpitServiceImpl implements AppCockpitService {
         AppOverviewItemVo questionVo = new AppOverviewItemVo();
         questionVo.setShouldComplete(question.get().getTotal());
         questionVo.setCurrentCompletedCount(question.get().getCompleted());
-        questionVo.setCurrentCompletedRate(NumberUtils.computeRate(questionVo.getShouldComplete(),questionVo.getCurrentCompletedCount()));
+        questionVo.setCurrentCompletedRate(NumberUtils.computeRate(questionVo.getShouldComplete(), questionVo.getCurrentCompletedCount()));
 
         vo.getTaskInfo().put("问题整改", questionVo);
         return vo;
@@ -351,7 +351,7 @@ public class AppCockpitServiceImpl implements AppCockpitService {
     public AppSyntheticQuestionVo syntheticQuestion(Long orgId, Date month) {
         SysOrg org = getLoginOrg(orgId);
         DateRange range = DateUtils.getStartAndEnd(month, CycleCommonEnum.MONTHLY);
-        AppSyntheticQuestionDto questionDto = appCockpitMapper.selectSyntheticQuestion(org.getPath(), range.getStartTime(), range.getEndTime(),DateUtil.beginOfDay(new Date()));
+        AppSyntheticQuestionDto questionDto = appCockpitMapper.selectSyntheticQuestion(org.getPath(), range.getStartTime(), range.getEndTime(), DateUtil.beginOfDay(new Date()));
         if (ObjectUtil.isNull(questionDto)) {
             questionDto = new AppSyntheticQuestionDto();
         }
@@ -418,7 +418,7 @@ public class AppCockpitServiceImpl implements AppCockpitService {
 //        predicate3.test(Arrays.asList("1"), "省联社检查", null);
         predicate3.test(Arrays.asList("5"), "阶段性检查", null);
         predicate3.test(Arrays.asList("6"), "专项检查", null);
-        predicate3.test(Arrays.asList("7",null), "其它检查", null);
+        predicate3.test(Arrays.asList("7", null), "其它检查", null);
 
         return vo;
     }

+ 4 - 4
soc-modules/soc-modules-core/src/main/resources/mapper/board/CockpitMapper.xml

@@ -145,10 +145,10 @@
     </select>
     <select id="orgGA38" resultType="com.xunmei.core.board.dto.web.WebGA38InfoDto">
         SELECT o.path,
-               if(m.ga382021 is null, 0, 1)        as ga382021,
-               if(m.ga382021current is null, 0, 1) as ga382021current,
-               if(m.ga382015 is null, 0, 1)        as ga382015,
-               if(m.ga382015current is null, 0, 1) as ga382015current
+               if(m.ga382021 is null or m.ga382021=0, 0, 1)        as ga382021,
+               if(m.ga382021current is null or m.ga382021current=0, 0, 1) as ga382021current,
+               if(m.ga382015 is null or m.ga382015=0, 0, 1)        as ga382015,
+               if(m.ga382015current is null or m.ga382015current=0, 0, 1) as ga382015current
         from sys_org o
                  LEFT JOIN (SELECT org_id,
                                    sum(standard = 1)                                             AS ga382021,

+ 14 - 10
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysOrgServiceImpl.java

@@ -775,7 +775,7 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
         if (ObjectUtil.hasEmpty(org, org.getType())) {
             throw new ServiceException(ErrorMsgConstants.CUR_USER_ORT_TYPE_ERROR);
         }
-        List<SysOrgVO> sysOrgList = getOrgCache();
+        List<SysOrg> sysOrgList =baseMapper.selectList(new LambdaQueryWrapper<>());
         sysOrgList.forEach(sysOrg -> {
             if (ObjectUtil.isNull(sysOrg.getSort())) {
                 sysOrg.setSort(0);
@@ -786,20 +786,22 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
         });
         sysOrgList.removeIf(sysOrg -> ObjectUtil.isEmpty(sysOrg.getPath()) || sysOrg.getName().contains("各部门"));
         OrgTypeEnum orgTypeEnum = OrgTypeEnum.getOrgTypeEnum(org.getType());
-        List<SysOrgVO> result = new ArrayList<>();
+        List<SysOrg> result = new ArrayList<>();
         switch (orgTypeEnum) {
             case SHEGN_LIAN_SHE:
                 result = sysOrgList.stream()
                         .filter(sysOrg -> ObjectUtil.equal(sysOrg.getType(), OrgTypeEnum.DIQU_HANG_SHE.getCode()))
                         .filter(sysOrg -> sysOrg.getName().contains("地区行社"))
-                        .sorted(Comparator.comparing(SysOrgVO::getSort))
+                        .filter(sysOrg -> ObjectUtil.equal(sysOrg.getIsLock(),0) && ObjectUtil.equal(sysOrg.getDeleted(),0))
+                        .sorted(Comparator.comparing(SysOrg::getSort))
                         .collect(Collectors.toList());
                 break;
             case BAN_SHI_CHU:
                 result = sysOrgList.stream()
                         .filter(sysOrg -> sysOrg.getPath().startsWith(org.getPath()))
                         .filter(sysOrg -> ObjectUtil.equal(sysOrg.getType(), OrgTypeEnum.HANG_SHE.getCode()))
-                        .sorted(Comparator.comparing(SysOrgVO::getSort))
+                        .filter(sysOrg -> ObjectUtil.equal(sysOrg.getIsLock(),0) && ObjectUtil.equal(sysOrg.getDeleted(),0))
+                        .sorted(Comparator.comparing(SysOrg::getSort))
                         .collect(Collectors.toList());
                 break;
             default:
@@ -807,19 +809,21 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
                     result = sysOrgList.stream()
                             .filter(sysOrg -> sysOrg.getPath().startsWith(org.getPath()))
                             .filter(sysOrg -> ObjectUtil.equal(sysOrg.getType(), OrgTypeEnum.HANG_SHE.getCode()))
-                            .sorted(Comparator.comparing(SysOrgVO::getSort))
+                            .sorted(Comparator.comparing(SysOrg::getSort))
+                            .filter(sysOrg -> ObjectUtil.equal(sysOrg.getIsLock(),0) && ObjectUtil.equal(sysOrg.getDeleted(),0))
                             .collect(Collectors.toList());
                 } else {
                     result = sysOrgList.stream()
                             .filter(sysOrg -> ObjectUtil.equal(sysOrg.getParentId(), org.getId()))
                             //.filter(sysOrg -> sysOrg.getPath().startsWith(org.getPath()))
-                            .sorted(Comparator.comparing(SysOrgVO::getSort))
+                            .sorted(Comparator.comparing(SysOrg::getSort))
+                            .filter(sysOrg -> ObjectUtil.equal(sysOrg.getIsLock(),0) && ObjectUtil.equal(sysOrg.getDeleted(),0))
                             .collect(Collectors.toList());
                 }
         }
-        final List<SysOrg> orgList = BeanHelper.copyProperties(result, SysOrg.class);
-        orgList.sort(Comparator.comparing(SysOrg::getSort));
-        return orgList;
+//        final List<SysOrg> orgList = BeanHelper.copyProperties(result, SysOrg.class);
+        result.sort(Comparator.comparing(SysOrg::getSort));
+        return result;
     }
 
     /**
@@ -836,7 +840,7 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
         OrgTypeEnum orgTypeEnum = OrgTypeEnum.getOrgTypeEnum(org.getType());
         LambdaQueryWrapper<SysOrg> wrapper = new LambdaQueryWrapper<SysOrg>();
         wrapper.notLike(SysOrg::getName, "各部门").notLike(SysOrg::getShortName, "各部门").isNotNull(SysOrg::getPath);
-        wrapper.eq(SysOrg::getIsLock, 0);
+        wrapper.eq(SysOrg::getIsLock, 0).eq(SysOrg::getDeleted,0);
 
         switch (orgTypeEnum) {
             case SHEGN_LIAN_SHE:

+ 23 - 14
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysUserServiceImpl.java

@@ -51,6 +51,7 @@ import java.security.Security;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Optional;
 import java.util.stream.Collectors;
 
 /**
@@ -707,23 +708,32 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
     public List<SecurityUserExport> downSecurityUser() {
         SysOrg sysOrg2 = orgService.selectSysOrgById(SecurityUtils.getLoginUser().getOrgId());
         List<SecurityUserExport> securityUserExports = userMapper.selectSecurityUser(sysOrg2.getPath());
+        List<SysOrg> diquOrgs = orgService.list(new LambdaQueryWrapper<SysOrg>().likeRight(SysOrg::getShortName, "地区行社").eq(SysOrg::getIsLock, 0).eq(SysOrg::getDeleted, 0));
         securityUserExports.forEach(s -> {
             s.setCity("福建");
             SysOrg sysOrg = sysOrgMapper.selectById(s.getOrgId());
-            SysOrg sysOrg1 = new SysOrg();
-            if (sysOrg.getShortName().endsWith("地区行社")) {
-                s.setCity(sysOrg.getShortName().substring(0, 2));
-            } else if (sysOrg.getType() < 3 || sysOrg.getType() == 9) {
-                sysOrg1 = sysOrgMapper.selectSysOrgById(sysOrg.getParentId());
-            } else {
-                sysOrg1 = sysOrgMapper.selectSysOrgById(sysOrgMapper.selectSysOrgById(sysOrg.getParentId()).getParentId());
-                if (-1 == sysOrg1.getShortName().indexOf("地区行社")) {
-                    sysOrg1 = sysOrgMapper.selectSysOrgById(sysOrgMapper.selectSysOrgById(sysOrgMapper.selectSysOrgById(sysOrg.getParentId()).getParentId()).getParentId());
+            Optional<SysOrg> diquOrg = diquOrgs.stream().filter(o -> sysOrg.getPath().startsWith(o.getPath())).findFirst();
+            if (diquOrg.isPresent()) {
+                String name = diquOrg.get().getName();
+                if (ObjectUtil.isNotEmpty(diquOrg.get().getShortName())) {
+                    name = diquOrg.get().getShortName();
                 }
+                s.setCity(name.substring(0, 2));
             }
-            if (null != sysOrg1) {
-                s.setCity(sysOrg1.getShortName().indexOf("地区行社") == -1 ? sysOrg1.getShortName().substring(0, 2) : sysOrg1.getShortName().split("地区行社")[0]);
-            }
+//            SysOrg sysOrg1 = new SysOrg();
+//            if (sysOrg.getShortName().endsWith("地区行社")) {
+//                s.setCity(sysOrg.getBreviary());
+//            } else if (sysOrg.getType() < 3 || sysOrg.getType() == 9) {
+//                sysOrg1 = sysOrgMapper.selectSysOrgById(sysOrg.getParentId());
+//            } else {
+//                sysOrg1 = sysOrgMapper.selectSysOrgById(sysOrgMapper.selectSysOrgById(sysOrg.getParentId()).getParentId());
+//                if (-1 == sysOrg1.getShortName().indexOf("地区行社")) {
+//                    sysOrg1 = sysOrgMapper.selectSysOrgById(sysOrgMapper.selectSysOrgById(sysOrgMapper.selectSysOrgById(sysOrg.getParentId()).getParentId()).getParentId());
+//                }
+//            }
+//            if (null != sysOrg1) {
+//                s.setCity(sysOrg1.getShortName().indexOf("地区行社") == -1 ? sysOrg1.getShortName().substring(0, 2) : sysOrg1.getShortName().split("地区行社")[0]);
+//            }
             //部门名称
             String departmentName = iSysDictDataService.selectDictLabel("department_name", s.getDepartmentName());
             s.setDepartmentName(departmentName);
@@ -765,8 +775,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
         final List<Long> collect = roleList.stream().map(SysUserRole::getRoleId).collect(Collectors.toList());
         boolean isAdmin = SecurityUtils.isAdmin(userId);
         // 不是管理员 且没有角色时 返回空,管理员返回所有菜单
-        if(!isAdmin && ObjectUtil.isEmpty(collect))
-        {
+        if (!isAdmin && ObjectUtil.isEmpty(collect)) {
             return new ArrayList<>();
         }
 

+ 3 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/util/SecurityUserExport.java

@@ -2,6 +2,7 @@ package com.xunmei.system.util;
 
 import com.alibaba.excel.annotation.ExcelIgnore;
 import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.format.DateTimeFormat;
 import com.alibaba.excel.annotation.write.style.ColumnWidth;
 import com.alibaba.excel.annotation.write.style.ContentRowHeight;
 import com.alibaba.excel.annotation.write.style.HeadRowHeight;
@@ -46,7 +47,8 @@ public class SecurityUserExport {
     private String isFullTime;
     @ExcelProperty(value = "用工形式", index = 10)
     private String workType;
-    @ExcelProperty(value = "现任职时间", index = 11)
+    @ExcelProperty(value = "任现职时间", index = 11)
+    @DateTimeFormat("yyyy-MM-dd")
     private Date entryTime;
     @ExcelProperty(value = "工作年限", index = 12)
     private String workDuration;

+ 1 - 1
soc-modules/soc-modules-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -724,7 +724,7 @@
                a.is_full_time                           AS isFullTime,
                a.work_type                              AS workType,
                a.entry_time                             AS entryTime,
-               TIMESTAMPDIFF(MONTH, a.work_time, NOW()) AS workDuration,
+               TIMESTAMPDIFF(YEAR, a.work_time, NOW()) AS workDuration,
                a.highest_education                      AS highestEducation,
                a.education_type                         AS educationType,
                a.professional_qualifications            AS professionalQualifications,