Переглянути джерело

Merge branch 'V0.0.4' of http://10.87.21.221:8000/jzyd_yyds/soc into V0.0.4

jiawuxian 1 рік тому
батько
коміт
0d2e42ae6b
20 змінених файлів з 282 додано та 62 видалено
  1. 9 1
      project_data/sql/0.0.4/quartz/quartz.sql
  2. 60 2
      project_data/sql/0.0.4/soc/soc.sql
  3. 16 1
      soc-api/soc-api-system/src/main/java/com/xunmei/system/api/RemoteSafetyIndexService.java
  4. 10 2
      soc-api/soc-api-system/src/main/java/com/xunmei/system/api/factory/RemoteSafetyIndexFallbackFactory.java
  5. 6 1
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/letter/vo/CoreIntroduceLetterApprovedPersonVo.java
  6. 2 2
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/letter/service/impl/CoreIntroduceLetterServiceImpl.java
  7. 1 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/monitor/vo/MonitoringAccessVO.java
  8. 24 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/controller/ResumptionReportController.java
  9. 3 3
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/service/impl/ResumptionReportServiceImpl.java
  10. 11 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/vo/IntrusionTestReportVO.java
  11. 24 5
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/vo/ResumptionDayVO.java
  12. 9 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/controller/SafetyInspectReportController.java
  13. 5 4
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/vo/SafetyInspectVO.java
  14. 4 3
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/ResumptionServiceImpl.java
  15. 3 4
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/controller/CoreSafetyExceptionDataController.java
  16. 4 4
      soc-modules/soc-modules-core/src/main/resources/mapper/drill/CoreDrillTaskMapper.xml
  17. 37 26
      soc-modules/soc-modules-core/src/main/resources/mapper/reportForms/ResumptionReportMapper.xml
  18. 50 0
      soc-modules/soc-modules-job/src/main/java/com/xunmei/job/task/CoreSafetyIndexTask.java
  19. 1 0
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysDeviceController.java
  20. 3 3
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/util/DeviceExport.java

+ 9 - 1
project_data/sql/0.0.4/quartz/quartz.sql

@@ -1,3 +1,11 @@
 
 -- 新增定时任务登记簿临时文件删除:凌晨删除下载的固化pdf
-INSERT INTO `sys_job`(`job_id`, `job_name`, `job_group`, `invoke_target`, `cron_expression`, `misfire_policy`, `concurrent`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (213, '登记簿临时文件删除', 'DEFAULT', 'RegisterBookPdfTask.deletedZipFile()', '59 59 23 * * ?', '1', '1', '0', null,now(), null, NULL);
+delete from sys_job where invoke_target='RegisterBookPdfTask.deletedZipFile()';
+INSERT INTO `sys_job`(`job_name`, `job_group`, `invoke_target`, `cron_expression`, `misfire_policy`, `concurrent`, `status`, `create_by`, `create_time`, `update_by`, `update_time`)VALUES ('登记簿临时文件删除', 'DEFAULT', 'RegisterBookPdfTask.deletedZipFile()', '59 59 23 * * ?', '1', '1', '0', null,now(), null, NULL);
+
+
+delete from sys_job where invoke_target in ('CoreSafetyIndexTask.collectExceptionData()','CoreSafetyIndexTask.calculateSafetyIndex()','CoreSafetyIndexTask.collectExceptionData(\'date\')', 'CoreSafetyIndexTask.calculateSafetyIndex(\'date\')');
+INSERT INTO `sys_job`(`job_name`, `job_group`, `invoke_target`, `cron_expression`, `misfire_policy`, `concurrent`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('安全指数异常数据固化', 'DEFAULT', 'CoreSafetyIndexTask.collectExceptionData()', '0 1 1 * * ?', '1', '1', '0', null,now(), null, NULL);
+INSERT INTO `sys_job`(`job_name`, `job_group`, `invoke_target`, `cron_expression`, `misfire_policy`, `concurrent`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('安全指数异常数据固化(补偿接口)', 'DEFAULT', 'CoreSafetyIndexTask.collectExceptionData(\'date\')', '0 1 1 * * ?', '1', '1', '1', null,now(), null, NULL);
+INSERT INTO `sys_job`(`job_name`, `job_group`, `invoke_target`, `cron_expression`, `misfire_policy`, `concurrent`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('安全指数分数计算', 'DEFAULT', 'CoreSafetyIndexTask.calculateSafetyIndex()', '0 2 1 * * ?', '1', '1', '0', null,now(), null, NULL);
+INSERT INTO `sys_job`(`job_name`, `job_group`, `invoke_target`, `cron_expression`, `misfire_policy`, `concurrent`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('安全指数分数计算(补偿接口)', 'DEFAULT', 'CoreSafetyIndexTask.calculateSafetyIndex(\'date\')', '0 2 1 * * ?', '1', '1', '1', null,now(), null, NULL);

+ 60 - 2
project_data/sql/0.0.4/soc/soc.sql

@@ -5,6 +5,8 @@ DELETE FROM `sys_dict_data` WHERE dict_type='rule_status';
 INSERT INTO `sys_dict_type` (`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (20231113157, '手册状态', 'rule_status', '0', 'jwx', '2023-11-27 14:55:51', '', NULL, NULL);
 INSERT INTO `sys_dict_data` (`dict_code`, `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 (20231114641, 0, '启用', '0', 'rule_status', NULL, 'default', 'N', '0', 'jwx', '2023-11-27 14:56:36', '', NULL, NULL);
 INSERT INTO `sys_dict_data` (`dict_code`, `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 (20231114643, 1, '停用', '1', 'rule_status', NULL, 'default', 'N', '0', 'jwx', '2023-11-27 14:56:44', '', NULL, NULL);
+-- 字典名称修改: "教育培训资料类型"->"知识库资料类型"
+update sys_dict_type set dict_name='知识库资料类型' where dict_type='edu_materials_type' limit 1;
 
 -- 修改教育培训任务状态字典描述
 update sys_dict_data set dict_label='待登记' where dict_type='edu_training_do_status' and dict_label='待培训' and dict_value=0 LIMIT 1;
@@ -12,10 +14,66 @@ update sys_dict_data set dict_label='登记中' where dict_type='edu_training_do
 -- 履职状态描述变更
 update sys_dict_data set dict_label='履职中' where dict_type='resumption_status' and dict_label='进行中' and dict_value=2 LIMIT 1;
 
-delete from sys_menu where id in (1729308502301728769);
+delete from sys_menu where id in (1731503585113534466,1729308502301728769,1731496383090913282,1731498925506031618,1731499700525330433,1731501484262158338,1731502833360039937);
 INSERT INTO sys_menu (id, menu_name, parent_id, order_num, path, component, query, is_frame, is_cache, menu_type, visible, status, perms, platform_type, icon, image_path, create_by, create_time, update_by, update_time, remark)
 VALUES (1729308502301728769, '导出全省农信系统物防建设达标情况', 103, 5, '', null, null, 1, 0, 'F', '0', '0', 'system:dept:exportConstruction', '1', null, null, null, now(), '', null, '');
-delete from sys_role_menu where menu_id=1729308502301728769;
+INSERT INTO `sys_menu`(`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
+ VALUES (1731496383090913282, '导出', 1720000571298115585, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'core:monitorAccessReport:export', '1', NULL, NULL, '省联社账号', '2023-11-28 15:52:54', '', NULL, '');
+INSERT INTO `sys_menu`(`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
+VALUES (1731498925506031618, '导出', 1722523915868221442, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'core:resumptionReport:export', '1', NULL, NULL, '省联社账号', '2023-11-28 15:52:54', '', NULL, '');
+INSERT INTO `sys_menu`(`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
+VALUES (1731499700525330433, '导出', 1723993298998222849, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'core:resumptionReport:export', '1', NULL, NULL, '省联社账号', '2023-11-28 15:52:54', '', NULL, '');
+INSERT INTO `sys_menu`(`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
+VALUES (1731501484262158338, '导出', 1724355771043504129, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'core:resumptionReport:export', '1', NULL, NULL, '省联社账号', '2023-11-28 15:52:54', '', NULL, '');
+INSERT INTO `sys_menu`(`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
+VALUES (1731502833360039937, '导出', 1724607752400044034, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'core:resumptionReport:export', '1', NULL, NULL, '省联社账号', '2023-11-28 15:52:54', '', NULL, '');
+INSERT INTO `sys_menu`(`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
+VALUES (1731503585113534466, '导出', 1726904309791121409, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'core:safetyInspectReport:export', '1', NULL, NULL, '省联社账号', '2023-11-28 15:52:54', '', NULL, '');
+
+
+delete from sys_role_menu where menu_id in (1731503585113534466,1731502833360039937,1729308502301728769,1731496383090913282,1731498925506031618,1731499700525330433,1731501484262158338);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (115, 1731503585113534466);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (116, 1731503585113534466);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (117, 1731503585113534466);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (118, 1731503585113534466);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (119, 1731503585113534466);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (120, 1731503585113534466);
+
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (115, 1731502833360039937);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (116, 1731502833360039937);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (117, 1731502833360039937);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (118, 1731502833360039937);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (119, 1731502833360039937);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (120, 1731502833360039937);
+
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (115, 1731501484262158338);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (116, 1731501484262158338);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (117, 1731501484262158338);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (118, 1731501484262158338);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (119, 1731501484262158338);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (120, 1731501484262158338);
+
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (115, 1731499700525330433);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (116, 1731499700525330433);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (117, 1731499700525330433);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (118, 1731499700525330433);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (119, 1731499700525330433);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (120, 1731499700525330433);
+
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (115, 1731498925506031618);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (116, 1731498925506031618);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (117, 1731498925506031618);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (118, 1731498925506031618);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (119, 1731498925506031618);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (120, 1731498925506031618);
+
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (115, 1731496383090913282);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (116, 1731496383090913282);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (117, 1731496383090913282);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (118, 1731496383090913282);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (119, 1731496383090913282);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (120, 1731496383090913282);
+
 INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (115, 1729308502301728769);
 INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (116, 1729308502301728769);
 INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (117, 1729308502301728769);

+ 16 - 1
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/RemoteSafetyIndexService.java

@@ -1,12 +1,27 @@
 package com.xunmei.system.api;
 
+import com.xunmei.common.core.constant.SecurityConstants;
 import com.xunmei.common.core.constant.ServiceNameConstants;
+import com.xunmei.common.core.web.domain.AjaxResult;
+import com.xunmei.system.api.domain.SysRole;
 import com.xunmei.system.api.factory.RemoteSafetyIndexFallbackFactory;
 import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestHeader;
+import org.springframework.web.bind.annotation.RequestParam;
 
-@FeignClient(contextId = "remoteSafetyIndexService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteSafetyIndexFallbackFactory.class)
+import java.util.List;
+
+@FeignClient(contextId = "remoteSafetyIndexService", value = ServiceNameConstants.CORE_SERVICE, fallbackFactory = RemoteSafetyIndexFallbackFactory.class)
 public interface RemoteSafetyIndexService {
 
 
 
+    @GetMapping("/safetyExceptionData/data/{date}")
+    AjaxResult collectExceptionData(@PathVariable("date") String date, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
+
+    @GetMapping("/safetyExceptionData/calculate/{date}")
+    AjaxResult calculateSafetyIndex(@PathVariable("date") String date, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
+
 }

+ 10 - 2
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/factory/RemoteSafetyIndexFallbackFactory.java

@@ -4,6 +4,7 @@ import com.xunmei.common.core.domain.R;
 import com.xunmei.common.core.domain.worktime.domain.SysWorkTime;
 import com.xunmei.common.core.domain.worktime.dto.WorkTimeDto;
 import com.xunmei.common.core.utils.Ymd;
+import com.xunmei.common.core.web.domain.AjaxResult;
 import com.xunmei.system.api.RemoteSafetyIndexService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -20,10 +21,17 @@ public class RemoteSafetyIndexFallbackFactory implements FallbackFactory<RemoteS
 
     @Override
     public RemoteSafetyIndexService create(Throwable throwable) {
-        log.error("作息服务调用失败:{}", throwable.getMessage());
+        log.error("安全指数服务调用失败:{}", throwable.getMessage());
         return new RemoteSafetyIndexService() {
+            @Override
+            public AjaxResult collectExceptionData(String date, String source) {
+                return null;
+            }
 
-
+            @Override
+            public AjaxResult calculateSafetyIndex(String date, String source) {
+                return null;
+            }
         };
     }
 }

+ 6 - 1
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/letter/vo/CoreIntroduceLetterApprovedPersonVo.java

@@ -49,7 +49,12 @@ public class CoreIntroduceLetterApprovedPersonVo {
     private String imgFile;
 
     /**
-     * 介绍信文件
+     * 证件类型
+     */
+    private String idType;
+
+    /**
+     * 证件号码
      */
     private String idCard;
 

+ 2 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/letter/service/impl/CoreIntroduceLetterServiceImpl.java

@@ -250,8 +250,8 @@ public class CoreIntroduceLetterServiceImpl extends ServiceImpl<CoreIntroduceLet
         introduceLetter.setOrgId(sysOrg.getId());
         introduceLetter.setOrgPath(sysOrg.getPath());
         introduceLetter.setOrgName(sysOrg.getName());
-        introduceLetter.setStartTime(coreIntroduceLetter.getStartTime());
-        introduceLetter.setEndTime(DateUtil.offsetDay(coreIntroduceLetter.getStartTime(),coreIntroduceLetter.getEffectiveDays()-1));
+        introduceLetter.setStartTime(DateUtil.beginOfDay(coreIntroduceLetter.getStartTime()));
+        introduceLetter.setEndTime(DateUtil.offsetDay(introduceLetter.getStartTime(),coreIntroduceLetter.getEffectiveDays()-1));
 //        if(ObjectUtil.isNotEmpty(coreIntroduceLetter.getRange())) {
 //            introduceLetter.setStartTime(coreIntroduceLetter.getRange().get(0));
 //            introduceLetter.setEndTime(coreIntroduceLetter.getRange().get(1));

+ 1 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/monitor/vo/MonitoringAccessVO.java

@@ -18,6 +18,7 @@ public class MonitoringAccessVO {
      */
     @ExcelProperty("序号")
     private Integer orderNum;
+    @ExcelProperty("地区")
     private String city;
 
     @ExcelProperty("单位名称")

+ 24 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/controller/ResumptionReportController.java

@@ -47,6 +47,14 @@ public class ResumptionReportController {
     @Log(title = "履职报表导出", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(ResumptionDTO request, HttpServletResponse response) throws IOException {
+        if (null == request.getSearchTime()) {
+            LocalDate currentDate = LocalDate.now();
+            if (null == request.getCycle() || request.getCycle() == 1) {
+                request.setSearchTime(currentDate.toString());
+            } else {
+                request.setSearchTime(currentDate.getYear() + "-" + currentDate.getMonthValue());
+            }
+        }
         resumptionReportService.export(request, response);
     }
     @ApiOperation(value = "每日安全保卫履职-日报表")
@@ -77,6 +85,10 @@ public class ResumptionReportController {
     @RequiresPermissions("core:resumptionReport:export")
     @PostMapping("/intrusionTestExport")
     public void intrusionTestExport(ResumptionDTO request, HttpServletResponse response) throws IOException {
+        if (null == request.getSearchTime()) {
+            LocalDate currentDate = LocalDate.now();
+            request.setSearchTime(currentDate.getYear() + "-" + currentDate.getMonthValue());
+        }
         resumptionReportService.intrusionTestExport(request, response);
     }
     @ApiOperation(value = "报警测试报表")
@@ -91,12 +103,20 @@ public class ResumptionReportController {
         List<IntrusionTestReportVO> intrusionTestReportVOList = resumptionReportService.intrusionTest(resumptionDTO);
         ajaxResult.put(AjaxResult.DATA_TAG, intrusionTestReportVOList);
         ajaxResult.put(TITLE, "报警测试报表(" + resumptionDTO.getSearchTime() + ")");
+        SysOrg sysOrg = remoteOrgService.selectSysOrgById(resumptionDTO.getOrgId(), SecurityConstants.INNER);
+        ajaxResult.put("orgName", sysOrg.getShortName());
         return ajaxResult;
     }
     @ApiOperation(value = "备用电源报表导出")
     @RequiresPermissions("core:resumptionReport:export")
     @PostMapping("/standbyPowerExport")
     public void standbyPowerExport(ResumptionDTO request, HttpServletResponse response) throws IOException {
+        if (null == request.getSearchTime()) {
+            DateTime beginOfQuarter = DateUtil.beginOfQuarter(new java.util.Date());
+            DateTime endOfQuarter = DateUtil.endOfQuarter(new Date());
+            request.setStartTime(beginOfQuarter);
+            request.setEndTime(endOfQuarter);
+        }
         resumptionReportService.standbyPowerExport(request, response);
     }
     @ApiOperation(value = "备用电源维护报表")
@@ -130,6 +150,10 @@ public class ResumptionReportController {
     @RequiresPermissions("core:resumptionReport:export")
     @PostMapping("/serviceBankExport")
     public void serviceBankExport(ResumptionDTO request, HttpServletResponse response) throws IOException {
+        if (null == request.getSearchTime()) {
+            LocalDate currentDate = LocalDate.now();
+            request.setSearchTime(currentDate.getYear() + "-" + currentDate.getMonthValue());
+        }
         resumptionReportService.serviceBankExport(request, response);
     }
     @ApiOperation(value = "离行式自助银行巡检报表")

+ 3 - 3
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/service/impl/ResumptionReportServiceImpl.java

@@ -165,7 +165,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
         String fileName = URLEncoder.encode("【" + orgName + "】-报警测试报表" + DateHelper.getDateString(new Date()), "UTF-8");
         response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
         // 调用EasyExcel的导出方法
-        EasyExcel.write(response.getOutputStream(), ResumptionDayVO.class).sheet("Sheet1").doWrite(report);
+        EasyExcel.write(response.getOutputStream(), IntrusionTestReportVO.class).sheet("Sheet1").doWrite(report);
     }
 
     @Override
@@ -229,7 +229,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
         String fileName = URLEncoder.encode("【" + orgName + "】-备用电源维护报表" + DateHelper.getDateString(new Date()), "UTF-8");
         response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
         // 调用EasyExcel的导出方法
-        EasyExcel.write(response.getOutputStream(), ResumptionDayVO.class).sheet("Sheet1").doWrite(report);
+        EasyExcel.write(response.getOutputStream(), IntrusionTestReportVO.class).sheet("Sheet1").doWrite(report);
     }
 
 
@@ -342,7 +342,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
         String fileName = URLEncoder.encode("【" + orgName + "】-离行式自助银行巡检报表" + DateHelper.getDateString(new Date()), "UTF-8");
         response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
         // 调用EasyExcel的导出方法
-        EasyExcel.write(response.getOutputStream(), ResumptionDayVO.class).sheet("Sheet1").doWrite(report);
+        EasyExcel.write(response.getOutputStream(), IntrusionTestReportVO.class).sheet("Sheet1").doWrite(report);
     }
 
 

+ 11 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/vo/IntrusionTestReportVO.java

@@ -6,7 +6,8 @@ import lombok.Data;
 
 /**
  * 入侵报警测试报表
- *
+ *离行
+ * 备用电源
  * @author :LuoWei
  * @date : 2023/11/13
  */
@@ -14,20 +15,29 @@ import lombok.Data;
 public class IntrusionTestReportVO {
     @ExcelProperty("序号")
     private Integer orderNum;
+    @ExcelProperty("地区")
     private String city;
+    @ExcelProperty("单位名称")
     private String orgName;
+    @ExcelProperty("网点数量")
     @ApiModelProperty(value = "网点数量")
     private Integer networkNumber;
+    @ExcelProperty("应履职次数")
     @ApiModelProperty(value = "应履职次数")
     private Integer planNumber;
+    @ExcelProperty("已履职次数")
     @ApiModelProperty(value = "已履职次数")
     private Integer realityNumber;
+    @ExcelProperty("履职完成率")
     @ApiModelProperty(value = "履职完成率")
     private String realityRate;
+    @ExcelProperty("隐患数量")
     @ApiModelProperty(value = "隐患数量")
     private Integer abnormalNumber;
+    @ExcelProperty("已整改数量")
     @ApiModelProperty(value = "已整改数量")
     private Integer realityRectificationNumber;
+    @ExcelProperty("整改完成率")
     @ApiModelProperty(value = "整改完成率")
     private String realityRectificationRate;
 }

+ 24 - 5
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/vo/ResumptionDayVO.java

@@ -1,5 +1,6 @@
 package com.xunmei.core.reportForms.resumption.vo;
 
+import com.alibaba.excel.annotation.ExcelIgnore;
 import com.alibaba.excel.annotation.ExcelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -12,48 +13,66 @@ import lombok.Data;
 public class ResumptionDayVO {
     @ExcelProperty("序号")
     private Integer orderNum;
+    @ExcelProperty("地区")
     private String city;
+    @ExcelProperty("单位名称")
     private String orgName;
+    @ExcelProperty("网点数量")
     @ApiModelProperty(value = "网点数量")
     private Integer networkNumber;
+    @ExcelProperty(value = {"总计","应履职次数"})
     @ApiModelProperty(value = "总计应履职次数")
     private Integer totalPlanNumber;
+    @ExcelProperty(value = {"总计","已履职次数"})
     @ApiModelProperty(value = "总计实际履职次数")
     private Integer totalRealityNumber;
+    @ExcelProperty(value = {"总计","履职完成率"})
     @ApiModelProperty(value = "总计检查率")
     private String totalRate;
+    @ExcelProperty(value = {"总计","隐患数量"})
+    @ApiModelProperty(value = "总计隐患问题数")
+    private Integer totalAbnormalNumber;
+    @ExcelProperty(value = {"总计","已整改数量"})
     @ApiModelProperty(value = "总计已整改数量")
     private Integer totalRealityRectificationNumber;
+    @ExcelProperty(value = {"总计","整改完成率"})
     @ApiModelProperty(value = "总计整改完成率")
     private String totalRealityRectificationRate;
 
-
-    @ApiModelProperty(value = "总计隐患问题数")
-    private Integer totalAbnormalNumber;
+    @ExcelIgnore
     @ApiModelProperty(value = "前应履职次数")
     private Integer frontPlanNumber;
+    @ExcelIgnore
     @ApiModelProperty(value = "前实际履职次数")
     private Integer frontRealityNumber;
+    @ExcelProperty(value = "营业前完成率")
     @ApiModelProperty(value = "前检查率")
     private String frontRate;
+    @ExcelIgnore
     @ApiModelProperty(value = "前隐患问题数")
     private Integer frontAbnormalNumber;
-
+    @ExcelIgnore
     @ApiModelProperty(value = "中应履职次数")
     private Integer centrePlanNumber;
+    @ExcelIgnore
     @ApiModelProperty(value = "中实际履职次数")
     private Integer centreRealityNumber;
+    @ExcelProperty(value = "营业期间完成率")
     @ApiModelProperty(value = "中检查率")
     private String centreRate;
+    @ExcelIgnore
     @ApiModelProperty(value = "中隐患问题数")
     private Integer centreAbnormalNumber;
-
+    @ExcelIgnore
     @ApiModelProperty(value = "中应履职次数")
     private Integer afterPlanNumber;
+    @ExcelIgnore
     @ApiModelProperty(value = "中实际履职次数")
     private Integer afterRealityNumber;
+    @ExcelProperty(value = "营业终了完成率")
     @ApiModelProperty(value = "中检查率")
     private String afterRate;
+    @ExcelIgnore
     @ApiModelProperty(value = "中隐患问题数")
     private Integer afterAbnormalNumber;
 

+ 9 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/controller/SafetyInspectReportController.java

@@ -88,6 +88,10 @@ public class SafetyInspectReportController {
     @Log(title = "行社全面检查报表", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(SafetyInspectDTO request, HttpServletResponse response) throws IOException {
+        if (null==request.getYear()){
+            LocalDate localDate= LocalDate.now();
+            request.setYear(String.valueOf(localDate.getYear()));
+        }
         safetyInspectService.export(request, response);
     }
     @ApiOperation(value = "网点负责人自查报表导出")
@@ -95,6 +99,11 @@ public class SafetyInspectReportController {
     @Log(title = "网点负责人自查报表导出", businessType = BusinessType.EXPORT)
     @PostMapping("/selfInspectExport")
     public void selfInspectExport(SafetyInspectDTO request, HttpServletResponse response) throws IOException {
+        if (null== request.getYear()){
+            request.setCycle(1);
+            LocalDate localDate= LocalDate.now();
+            request.setYear(localDate.getYear()+"-"+  localDate.getMonthValue());
+        }
         safetyInspectService.selfInspectExport(request, response);
     }
 }

+ 5 - 4
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/vo/SafetyInspectVO.java

@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 /**
+ * 自查
  * @author :LuoWei
  * @date : 2023/10/31
  */
@@ -18,13 +19,13 @@ public class SafetyInspectVO {
     @ExcelProperty("单位名称")
     @ApiModelProperty(value = "单位名称")
     private String orgName;
-    @ExcelProperty("被查机构数量")
-    @ApiModelProperty(value = "被查机构数量")
+    @ExcelProperty("网点数量")
+    @ApiModelProperty(value = "网点数量")
     private Integer planInspectOrg;
-    @ExcelProperty("已查机构数量")
+    @ExcelIgnore
     @ApiModelProperty(value = "已查机构数量")
     private Integer realityInspectOrg;
-    @ExcelProperty("检查覆盖率")
+    @ExcelIgnore
     @ApiModelProperty(value = "检查覆盖率")
     private String inspectCoverRate;
 

+ 4 - 3
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/ResumptionServiceImpl.java

@@ -349,13 +349,14 @@ public class ResumptionServiceImpl extends ServiceImpl<ResumptionMapper, Resumpt
                 .in(Resumption::getId, dataIdList)
                 .eq(Resumption::getYmdYear, DateUtil.year(request.getDate()))
                 .eq(Resumption::getYmdQuarter, DateUtil.quarter(request.getDate())));
-        List<Long> roleIdList = taskList.stream().map(Resumption::getRoleId).distinct().collect(Collectors.toList());
+        //List<Long> roleIdList = taskList.stream().map(Resumption::getRoleId).distinct().collect(Collectors.toList());
         List<SafeScoreResumptionDataVo> list = new ArrayList<>();
-        Map<Long, String> map = getRoleNames(roleIdList);
+        //Map<Long, String> map = getRoleNames(roleIdList);
         for (Resumption resumption : taskList) {
             SafeScoreResumptionDataVo resumptionDataVo = new SafeScoreResumptionDataVo();
             resumptionDataVo.setId(resumption.getId().toString());
-            resumptionDataVo.setExecPostName(map.get(resumption.getRoleId()));
+            resumptionDataVo.setExecPostName("网点安全员");
+            //resumptionDataVo.setExecPostName(map.get(resumption.getRoleId()));
             resumptionDataVo.setPlanTimeStart(resumption.getPlanStartTime());
             resumptionDataVo.setPlanTimeEnd(resumption.getPlanEndTime());
             resumptionDataVo.setOrgName(resumption.getOrgName());

+ 3 - 4
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/controller/CoreSafetyExceptionDataController.java

@@ -28,7 +28,7 @@ public class CoreSafetyExceptionDataController extends BaseController {
     @ApiOperation(value = "固化异常数据")
     @GetMapping("/data/{date}")
     public AjaxResult collectExceptionData(@PathVariable String date) {
-
+        //date应传递当月时间,业务代码会自行计算的时候上个月的时间
         exceptionDataService.countExceptionData(date);
         return AjaxResult.success();
 
@@ -38,7 +38,7 @@ public class CoreSafetyExceptionDataController extends BaseController {
     @ApiOperation(value = "计算得分")
     @GetMapping("/calculate/{date}")
     public AjaxResult calculateSafetyIndex(@PathVariable String date) {
-
+        //date应传递当月时间,业务代码会自行计算的时候上个月的时间
         exceptionDataService.calculateSafetyIndex(date);
         return AjaxResult.success();
 
@@ -48,10 +48,9 @@ public class CoreSafetyExceptionDataController extends BaseController {
     @RequiresPermissions("core:safetyExceptionData:reCalculate")
     @PostMapping("/reCalculate")
     public AjaxResult reCalculate(@RequestBody CoreSafetyIndexReCalculateDto request) {
-
+        //date应传递当月时间,业务代码会自行计算的时候上个月的时间
         exceptionDataService.reCalculate(request);
         return AjaxResult.success();
 
     }
-
 }

+ 4 - 4
soc-modules/soc-modules-core/src/main/resources/mapper/drill/CoreDrillTaskMapper.xml

@@ -287,17 +287,17 @@
 
     <select id="selectWaitRecTaskList" resultType="com.xunmei.common.core.domain.panel.vo.PanelListVo">
         select distinct t.id as id, title as taskName,t.start_date startTime,t.end_date as endTime,t.status,t.rec_status
-        from core_drill_task t inner join sys_org o on t.org_id=o.id
+        from core_drill_task t
         where t.org_path like concat(#{request.orgPath},'%')
         <include refid="timeRangeSql"/>
         <if test="request.orgType==3">
-            and t.rec_status =0 and o.type=4
+            and t.rec_status =0
         </if>
         <if test="request.orgType==2">
-            and t.rec_status =2 and o.type=3
+            and t.rec_status =2
         </if>
         <if test="request.orgType==1">
-            and t.rec_status =4 and o.type=2
+            and t.rec_status =4
         </if>
         order by  t.drill_end_time desc
     </select>

+ 37 - 26
soc-modules/soc-modules-core/src/main/resources/mapper/reportForms/ResumptionReportMapper.xml

@@ -101,32 +101,35 @@
     <select id="selectStandbyPower"
             resultType="com.xunmei.core.reportForms.resumption.vo.IntrusionTestReportVO">
         SELECT
-            IFNULL( a.exception_count, 0 ) AS abnormalNumber,
-            COUNT( a.id ) AS planNumber,
-            IFNULL( SUM( IF ( a.`status` = 3, 1, 0 )), 0 ) AS realityNumber,
-            IF
-                (
-                            IFNULL( SUM( IF ( a.`status` = 3, 1, 0 )), 0 )= 0
-                        OR COUNT( a.id )= 0,
-                            '0%',
-                            CONCAT(
-                                            IFNULL( SUM( IF ( a.`status` = 3, 1, 0 )), 0 )/ COUNT( a.id )* 100,
-                                            '%'
-                                )) AS realityRate,
-            COUNT( c.id ) AS realityRectificationNumber,
-            IF
-                (
-                            COUNT( c.id )= 0
-                        OR IFNULL( a.exception_count, 0 )= 0,
-                            '0%',
-                            CONCAT( COUNT( c.id )/ IFNULL( a.exception_count, 0 )* 100, '%' )) AS realityRectificationRate
+        IFNULL( a.exception_count, 0 ) AS abnormalNumber,
+        COUNT( a.id ) AS planNumber,
+        IFNULL( SUM( IF ( a.`status` = 3, 1, 0 )), 0 ) AS realityNumber,
+        IF
+        (
+        IFNULL( SUM( IF ( a.`status` = 3, 1, 0 )), 0 )= 0
+        OR COUNT( a.id )= 0,
+        '0%',
+        CONCAT(
+        ROUND(
+        IFNULL( SUM( IF ( a.`status` = 3, 1, 0 )), 0 )/ COUNT( a.id )* 100,
+        2
+        ),
+        '%'
+        )) AS realityRate,
+        COUNT( c.id ) AS realityRectificationNumber,
+        IF
+        (
+        COUNT( c.id )= 0
+        OR IFNULL( a.exception_count, 0 )= 0,
+        '0%',
+        CONCAT( COUNT( c.id )/ IFNULL( a.exception_count, 0 )* 100, '%' )) AS realityRectificationRate
         FROM
-            core_resumption a
-                LEFT JOIN core_resumption_plan b ON a.plan_id = b.id
-                LEFT JOIN core_question c ON c.src_task_id = a.id
-                AND reform_status = 11
+        core_resumption a
+        LEFT JOIN core_resumption_plan b ON a.plan_id = b.id
+        LEFT JOIN core_question c ON c.src_task_id = a.id
+        AND reform_status = 11
         WHERE
-            b.plan_type =5
+        b.plan_type =5
         <if test="startTime !=null and endTime !=null">
         and    a.ymd_date BETWEEN #{startTime} AND #{endTime}
         </if>
@@ -137,7 +140,7 @@
     <select id="selectServiceBankReport"
             resultType="com.xunmei.core.reportForms.resumption.vo.IntrusionTestReportVO">
         SELECT
-        IFNULL(a.exception_count,0) AS abnormalNumber,
+        IFNULL( a.exception_count, 0 ) AS abnormalNumber,
         COUNT( a.id ) AS planNumber,
         IFNULL( SUM( IF ( a.`status` = 3, 1, 0 )), 0 ) AS realityNumber,
         IF
@@ -146,11 +149,19 @@
         OR COUNT( a.id )= 0,
         '0%',
         CONCAT(
+        ROUND(
         IFNULL( SUM( IF ( a.`status` = 3, 1, 0 )), 0 )/ COUNT( a.id )* 100,
+        2
+        ),
         '%'
         )) AS realityRate,
         COUNT( c.id ) AS realityRectificationNumber,
-        IF(COUNT( c.id )=0 OR IFNULL(a.exception_count,0)=0,'0%',CONCAT(COUNT( c.id )/IFNULL(a.exception_count,0)*100,'%'))	 AS realityRectificationRate
+        IF
+        (
+        COUNT( c.id )= 0
+        OR IFNULL( a.exception_count, 0 )= 0,
+        '0%',
+        CONCAT( COUNT( c.id )/ IFNULL( a.exception_count, 0 )* 100, '%' )) AS realityRectificationRate
         FROM
         core_resumption a
         LEFT JOIN core_resumption_plan b ON a.plan_id = b.id

+ 50 - 0
soc-modules/soc-modules-job/src/main/java/com/xunmei/job/task/CoreSafetyIndexTask.java

@@ -0,0 +1,50 @@
+package com.xunmei.job.task;
+
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.lang.UUID;
+import com.alibaba.fastjson2.JSON;
+import com.xunmei.common.core.constant.CacheConstants;
+import com.xunmei.common.core.constant.Constants;
+import com.xunmei.common.core.constant.SecurityConstants;
+import com.xunmei.common.core.web.domain.AjaxResult;
+import com.xunmei.system.api.RemoteDrillService;
+import com.xunmei.system.api.RemoteSafetyIndexService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+@Slf4j
+@Component("CoreSafetyIndexTask")
+public class CoreSafetyIndexTask {
+
+    @Autowired
+    RemoteSafetyIndexService service;
+
+    public void collectExceptionData() {
+        log.info("安全指数固化异常数据定时任务开始执行(无参)");
+        final Date date = new Date();
+        AjaxResult result = service.collectExceptionData(DateUtil.format(DateUtil.beginOfMonth(date), Constants.DAILY_FORMAT), SecurityConstants.INNER);
+        log.info("安全指数固化异常数据定时任务执行完成(无参),返回参数:{}", JSON.toJSONString(result));
+    }
+
+    public void collectExceptionData(String date) {
+        log.info("安全指数固化异常数据定时任务开始执行(有参)");
+        AjaxResult result = service.collectExceptionData(date, SecurityConstants.INNER);
+        log.info("安全指数固化异常数据定时任务执行完成(有参),返回参数:{}", JSON.toJSONString(result));
+    }
+
+    public void calculateSafetyIndex() {
+        log.info("安全指数计算指标分数定时任务开始执行(无参)");
+        final Date date = new Date();
+        AjaxResult result = service.calculateSafetyIndex(DateUtil.format(DateUtil.beginOfMonth(date), Constants.DAILY_FORMAT), SecurityConstants.INNER);
+        log.info("安全指数计算指标分数定时任务执行完成(无参),返回参数:{}", JSON.toJSONString(result));
+    }
+
+    public void calculateSafetyIndex(String date) {
+        log.info("安全指数计算指标分数定时任务开始执行(有参)");
+        AjaxResult result = service.calculateSafetyIndex(date, SecurityConstants.INNER);
+        log.info("安全指数计算指标分数定时任务执行完成(有参),返回参数:{}", JSON.toJSONString(result));
+    }
+}

+ 1 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysDeviceController.java

@@ -212,6 +212,7 @@ public class SysDeviceController extends BaseController {
                         List<SysDictData> deviceTypeByAssetType = dictTypeService.getDeviceTypeByAssetType(sys_asset_type);
                         List<String> collect = deviceTypeByAssetType.stream().map(SysDictData::getDictLabel).collect(Collectors.toList());
                         Set<String> sc = new HashSet<>();
+                        sc.addAll(collect);
                         if (sc.contains(d.getDeviceType())) {
                             deviceTypeByAssetType.forEach(de -> {
                                 if (de.getDictLabel().equals(d.getDeviceType())) {

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

@@ -23,7 +23,7 @@ public class DeviceExport {
     private String deviceName;
     @ExcelProperty(value = "机构名称", index = 1)
     private String orgName;
-    @ExcelProperty(value = "资产类别", index = 2)
+    @ExcelProperty(value = "设备类别", index = 2)
     private String assetType;
     @ExcelProperty(value = "设备分类", index = 3)
     private String deviceType;
@@ -32,8 +32,8 @@ public class DeviceExport {
     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     @ExcelProperty(value = "有效期至", index = 5)
     private Date checkTime;
-    @ExcelProperty(value = "机", index = 6)
+    @ExcelProperty(value = "硬盘录像机", index = 6)
     private String hostName;
-    @ExcelProperty(value = "通道", index = 7)
+    @ExcelProperty(value = "通道", index = 7)
     private Long channel;
 }