ソースを参照

Merge remote-tracking branch 'origin/V1.0.11' into V1.0.11

jingyuanchao 10 ヶ月 前
コミット
b8be9a1140
24 ファイル変更369 行追加57 行削除
  1. 0 1
      project_data/sql/1.0.11/quartz/quartz.sql
  2. 23 11
      project_data/sql/1.0.11/soc/soc.sql
  3. 26 0
      soc-api/soc-api-system/src/main/java/com/xunmei/system/api/domain/SysOperLog.java
  4. 3 0
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/letter/domain/CoreOutInRecord.java
  5. 2 0
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/letter/vo/CoreOutInRecordVo.java
  6. 2 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/letter/service/impl/CoreOutInRecordServiceImpl.java
  7. 6 2
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/gx/service/ResumptionServiceImpl.java
  8. 1 1
      soc-modules/soc-modules-core/src/main/resources/mapper/board/AppCockpitMapper.xml
  9. 2 1
      soc-modules/soc-modules-core/src/main/resources/mapper/board/CockpitMapper.xml
  10. 49 17
      soc-modules/soc-modules-file/src/main/java/com/xunmei/file/utils/PdfUtil.java
  11. 2 2
      soc-modules/soc-modules-job/src/main/java/com/xunmei/job/task/OperTask.java
  12. 31 1
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysOperlogController.java
  13. 2 0
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysUserInformationController.java
  14. 9 0
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/mapper/SysOperLogMapper.java
  15. 9 0
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/ISysOperLogService.java
  16. 16 0
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysOperLogServiceImpl.java
  17. 3 3
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysUserInformationServiceImpl.java
  18. 11 11
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysUserServiceImpl.java
  19. 72 0
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/util/OperLogExport.java
  20. 39 0
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/util/OperLogStatusConverter.java
  21. 1 1
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/util/SecurityWorkExport.java
  22. 48 0
      soc-modules/soc-modules-system/src/main/resources/mapper/system/SysOperLogMapper.xml
  23. 10 4
      soc-modules/soc-modules-system/src/main/resources/mapper/system/SysOrgMapper.xml
  24. 2 1
      soc-modules/soc-modules-system/src/main/resources/mapper/system/SysUserMapper.xml

+ 0 - 1
project_data/sql/1.0.11/quartz/quartz.sql

@@ -28,7 +28,6 @@ VALUES ('视频诊断绑定获取', 'DEFAULT', 'HostTask.getCameraMissionRules()
 
 delete from sys_job where invoke_target = 'HostTask.checkWsOnLine()';
 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 ('WS在线状态检测', 'DEFAULT', 'HostTask.checkWsOnLine()', '0 0/1 * * * ?', '1', '1', '0', '景远超', '2024-12-12 16:01:15', '', NULL);
-        NULL);
 
 
 delete

+ 23 - 11
project_data/sql/1.0.11/soc/soc.sql

@@ -50,6 +50,15 @@ ALTER TABLE  `iot_server_product`
     ADD COLUMN `producer` varchar(125) NULL AFTER `models`;
 END IF;
 
+IF NOT EXISTS(SELECT *
+                      FROM information_schema.columns
+                      WHERE table_schema = DATABASE()
+                        AND table_name = 'core_out_in_record'
+                        AND column_name = 'remark') THEN
+ALTER TABLE `core_out_in_record`
+    ADD COLUMN `remark` varchar(255) NULL COMMENT '备注信息' AFTER `update_time`;
+END IF;
+
 delete from iot_server_product;
 INSERT INTO `iot_server_product`(`id`, `name`, `display_name`, `enabled`, `categories`, `models`, `producer`) VALUES ('cead84cb-7d99-1b7f-b309-3a0ca885fbe5', 'CrossProcessDemo', 'CrossProcessDemo', 0, '[\"AlarmHost\"]', NULL, NULL);
 INSERT INTO `iot_server_product`(`id`, `name`, `display_name`, `enabled`, `categories`, `models`, `producer`) VALUES ('f6a73ea2-1cc7-d7ff-8018-3a0ad3408d98', 'DaHuaAlarmHost', 'DaHua报警主机', 1, '[\"AlarmHost\"]', '[\"ARC2008\",\"ARC2016C\",\"ARC2016C_V3\",\"ARC9016C\",\"ARC9016C_V3\"]', '大华');
@@ -373,17 +382,6 @@ UPDATE `iot_server_product` SET `display_name` = 'Hik' WHERE `id` = '19ed86f7-78
 UPDATE `iot_server_product` SET `display_name` = 'DaHua_V1' WHERE `id` = '783bb246-6ebe-7e69-e055-3a14adfe10c9';
 UPDATE `iot_server_product` SET `display_name` = 'DaHua' WHERE `id` = '92467897-92ef-647f-e55e-3a13b7f3ca9a';
 
-
-
-
-
-
-
-
-
-
-
-
 drop table if exists `sys_oper_log_history`;
 CREATE TABLE `sys_oper_log_history` (
                                         `oper_id` bigint NOT NULL AUTO_INCREMENT COMMENT '日志主键',
@@ -412,4 +410,18 @@ CREATE TABLE `sys_oper_log_history` (
                                         KEY `idx_sys_oper_log_history_s` (`status`) USING BTREE,
                                         KEY `idx_sys_oper_log_history_ot` (`oper_time`) USING BTREE
 ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='操作日志记录';
+
+-- 前端录像类型字典数据
+delete from `sys_dict_type` where dict_type='video_plan_type';
+INSERT INTO `sys_dict_type` (`dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ( '前端录像类型', 'video_plan_type', '0', '超级管理员', '2024-12-12 15:49:00', '', NULL, NULL);
+delete from `sys_dict_data` where dict_type='video_plan_type';
+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 (0, '全天定时录像', '0', 'video_plan_type', NULL, 'default', 'N', '0', '超级管理员', '2024-12-12 15:51:13', '', NULL, NULL);
+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 (1, '分时段定时录像', '1', 'video_plan_type', NULL, 'default', 'N', '0', '超级管理员', '2024-12-12 15:51:43', '超级管理员', '2024-12-12 15:51:52', NULL);
+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 (2, '全天移动侦测', '2', 'video_plan_type', NULL, 'default', 'N', '0', '超级管理员', '2024-12-12 15:52:11', '', NULL, NULL);
+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 (3, '异常计划', '3', 'video_plan_type', NULL, 'default', 'N', '0', '超级管理员', '2024-12-12 15:52:23', '超级管理员', '2024-12-12 15:53:32', NULL);
+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', 'video_plan_type', NULL, 'default', 'N', '0', '超级管理员', '2024-12-12 15:52:34', '超级管理员', '2024-12-12 15:53:51', NULL);
+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 (5, '分时段动检录像', '5', 'video_plan_type', NULL, 'default', 'N', '0', '超级管理员', '2024-12-12 15:54:03', '', NULL, NULL);
+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 (6, '设备不支持', '-2', 'video_plan_type', NULL, 'default', 'N', '0', '超级管理员', '2024-12-12 15:54:22', '', NULL, NULL);
+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 (7, '通讯失败', '-3', 'video_plan_type', NULL, 'default', 'N', '0', '超级管理员', '2024-12-12 15:54:42', '', NULL, NULL);
+
 -- 升级脚本执行完成

+ 26 - 0
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/domain/SysOperLog.java

@@ -77,6 +77,12 @@ public class SysOperLog extends BaseEntity
     /** 消耗时间 */
     private Long costTime;
 
+    @TableField(exist = false)
+    private Date beginDate;
+
+    @TableField(exist = false)
+    private Date endDate;
+
     public Long getOperId()
     {
         return operId;
@@ -246,4 +252,24 @@ public class SysOperLog extends BaseEntity
     {
         this.costTime = costTime;
     }
+
+    public Date getBeginDate()
+    {
+        return beginDate;
+    }
+
+    public void setBeginDate(Date beginDate)
+    {
+        this.beginDate = beginDate;
+    }
+
+    public Date getEndDate()
+    {
+        return endDate;
+    }
+
+    public void setEndDate(Date endDate)
+    {
+        this.endDate = endDate;
+    }
 }

+ 3 - 0
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/letter/domain/CoreOutInRecord.java

@@ -147,4 +147,7 @@ public class CoreOutInRecord extends BaseEntity {
     @ApiModelProperty(value = "出入人员Id")
     private Long outInRequestUserId;
 
+    @ApiModelProperty(value = "备注信息")
+    private String remark;
+
 }

+ 2 - 0
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/letter/vo/CoreOutInRecordVo.java

@@ -168,5 +168,7 @@ public class CoreOutInRecordVo{
 
     private Long outInRequestUserId;
 
+    /*备注信息*/
+    private String remark;
 
 }

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

@@ -373,7 +373,8 @@ public class CoreOutInRecordServiceImpl extends ServiceImpl<CoreOutInRecordMappe
         data.put("createBy", record.getCreateBy());
         //陪同人员人员
         data.put("accompanyingPerson", record.getAccompanyingPerson());
-
+        //备注信息
+        data.put("remark", record.getRemark());
         return data;
     }
 

+ 6 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/gx/service/ResumptionServiceImpl.java

@@ -152,7 +152,7 @@ public class ResumptionServiceImpl implements ResumptionService {
         }
 
         resumptionDelService.delResumptionData(taskId);
-
+        SysOrg org =null;
 
         //保存新的数据
         AppResumptionData data = null;
@@ -198,7 +198,11 @@ public class ResumptionServiceImpl implements ResumptionService {
                         throw new ServiceException("整改期限为空或不是有效的数值");
                     }
                     //TODO 获取机构数据,应从缓存中获取
-                    SysOrg org = remoteOrgService.selectSysOrgById(sysResumption.getOrgId(), SecurityConstants.INNER);
+                    //不应在循环中获取机构信息, 任务的机构信息只需获取一次, 有异常数据时才获取
+                    if(org ==null)
+                    {
+                        org = remoteOrgService.selectSysOrgById(sysResumption.getOrgId(), SecurityConstants.INNER);
+                    }
 
                     Question question = Question.builder()
                             .srcTaskId(taskId)

+ 1 - 1
soc-modules/soc-modules-core/src/main/resources/mapper/board/AppCockpitMapper.xml

@@ -210,7 +210,7 @@
     <!--    </select>-->
     <select id="selectSyntheticDrill" resultType="com.xunmei.core.board.dto.app.AppSyntheticTaskCategoryDto">
         SELECT count(0)          AS total,
-               sum(r.STATUS = 3) AS completed
+               sum(r.STATUS in (2,3)) AS completed
         FROM core_drill_task r
         WHERE (
                    #{startDate}    <![CDATA[<=]]> r.end_date

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

@@ -90,7 +90,8 @@
         org_id,
         org_path,
         count( 0 ) AS task_total,
-        SUM( CASE `status` WHEN 3 THEN 1 ELSE 0 END ) AS completed_count
+        ifnull(SUM(status in (2,3)),0) AS completed_count
+<!--        SUM( CASE `status` WHEN 3 THEN 1 ELSE 0 END ) AS completed_count-->
         FROM
         core_drill_task r
         <!--                INNER  join ( SELECT id,path FROM sys_org WHERE path LIKE CONCAT(( SELECT path FROM sys_org WHERE id =#{orgId}), '%' ) AND deleted = 0 ) o on r.org_Id=o.id-->

+ 49 - 17
soc-modules/soc-modules-file/src/main/java/com/xunmei/file/utils/PdfUtil.java

@@ -423,7 +423,11 @@ public class PdfUtil {
         dealImageCell((List<String>) data.get("approveSign"), table, 1, 80, 30, 2, 1);
         createPDFCell(tableFont, table, "登记人签字", Element.ALIGN_MIDDLE, 1, 1);
         dealImageCell((List<String>) data.get("submitSign"), table, 1, 80, 30, 2, 1);
-//           /statics/2023/12/05/20231205183106A001.png
+        //第8行
+        createPDFCell(tableFont, table, "备注", Element.ALIGN_MIDDLE, 1, 1);
+        createPDFCell(tableFont, table, data.get("remark").toString(), Element.ALIGN_MIDDLE, 5, 1);
+
+
         //证件图片
         createPDFCell(tableFont, table, "证件图片", Element.ALIGN_MIDDLE, 1, 1);
         //证件图片 图片填充
@@ -440,10 +444,32 @@ public class PdfUtil {
         cell1.addElement(imageTable1);
         table.addCell(cell1);
 
+        // 核查结果图片为非必填,没有图片时不显示
+        List<String> checkImages= (List<String>) data.get("checkImage");
+        if(!checkImages.isEmpty())
+        {
+            createPDFCell(tableFont, table, "核查结果", Element.ALIGN_MIDDLE, 1, 1);
+            final PdfPTable imageTable3 = getImage((List<String>) data.get("checkImage"), 2, 190, 190, 2);
+            final PdfPCell cell3 = new PdfPCell();
+            cell3.setNoWrap(false);
+            cell3.setPaddingLeft(4f);
+            cell3.setPaddingRight(4f);
+            cell3.setPaddingBottom(4f);
+            cell3.setPaddingTop(4f);
+            cell3.setColspan(5);
+            cell3.setRowspan(1);
+            //cell1.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM);
+            cell3.addElement(imageTable3);
+            table.addCell(cell3);
+            document.add(table);
+        }
+
+
         List<String> files= (List<String>) data.get("file");
         List<String> files1=new ArrayList<>();
         List<String> files2= new ArrayList<>();
-        if(ObjectUtil.isNotEmpty(files))
+        // 没有 核查结果 图片 时 需要把 介绍信图片上移
+        if(ObjectUtil.isNotEmpty(files) && ObjectUtil.isEmpty(checkImages))
         {
             files1= files.subList(0,1);
             if(files.size()>1)
@@ -451,22 +477,28 @@ public class PdfUtil {
                 files2= files.subList(1,files.size());
             }
         }
+        else{
+            files2=files;
+        }
+        // 没有 核查结果 图片 时 需要把 介绍信图片上移
+        if(ObjectUtil.isNotEmpty(files1))
+        {
+            createPDFCell(tableFont, table, "介绍信附件", Element.ALIGN_MIDDLE, 1, 1);
+            final PdfPTable imageTable3 = getImage(files1, 1, 380, 320, 1);
+            final PdfPCell cell3 = new PdfPCell();
+            cell3.setNoWrap(false);
+            cell3.setPaddingLeft(4f);
+            cell3.setPaddingRight(4f);
+            cell3.setPaddingBottom(4f);
+            cell3.setPaddingTop(4f);
+            cell3.setColspan(5);
+            cell3.setRowspan(1);
+            //cell1.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM);
+            cell3.addElement(imageTable3);
+            table.addCell(cell3);
+            document.add(table);
+        }
 
-        createPDFCell(tableFont, table, "介绍信附件", Element.ALIGN_MIDDLE, 1, 1);
-        final PdfPTable imageTable3 = getImage(files1, 1, 380, 320, 1);
-        final PdfPCell cell3 = new PdfPCell();
-        cell3.setNoWrap(false);
-        cell3.setPaddingLeft(4f);
-        cell3.setPaddingRight(4f);
-        cell3.setPaddingBottom(4f);
-        cell3.setPaddingTop(4f);
-        cell3.setColspan(5);
-        cell3.setRowspan(1);
-        //cell1.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM);
-        cell3.addElement(imageTable3);
-        table.addCell(cell3);
-
-        document.add(table);
         if(files2.size()>0)
         {
             PdfPTable innerTable = new PdfPTable(6);

+ 2 - 2
soc-modules/soc-modules-job/src/main/java/com/xunmei/job/task/OperTask.java

@@ -21,9 +21,9 @@ public class OperTask {
 
 
     public void transferOperLogToHistroy() {
-        log.info("开始处理 刷新冗余机构Path数据");
+        log.info("开始处理 迁移操作日志数据到历史表");
         logService.transferOperLog(SecurityConstants.INNER);
-        log.info("刷新冗余机构Path 结束处理");
+        log.info("迁移操作日志数据到历史表 结束处理");
     }
 
 }

+ 31 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysOperlogController.java

@@ -1,6 +1,9 @@
 package com.xunmei.system.controller;
 
 import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
 import com.xunmei.common.core.web.controller.BaseController;
 import com.xunmei.common.core.web.domain.AjaxResult;
 import com.xunmei.common.core.web.page.TableDataInfo;
@@ -10,12 +13,17 @@ import com.xunmei.common.security.annotation.InnerAuth;
 import com.xunmei.common.security.annotation.RequiresPermissions;
 import com.xunmei.system.api.domain.SysOperLog;
 import com.xunmei.system.service.ISysOperLogService;
+import com.xunmei.system.util.OperLogExport;
+import com.xunmei.system.util.SecurityUserExport;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
+import java.net.URLEncoder;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
 
 /**
  * 操作日志记录
@@ -41,7 +49,29 @@ public class SysOperlogController extends BaseController
     @PostMapping("/export")
     public void export(HttpServletResponse response, SysOperLog operLog)
     {
-        List<SysOperLog> list = operLogService.selectOperLogList(operLog);
+        List<OperLogExport> list = operLogService.exportOperLogList(operLog);
+        if (ObjectUtil.isEmpty(list)) {
+            throw new RuntimeException("导出数据为空!");
+        }
+        AtomicInteger xh = new AtomicInteger();
+        xh.getAndIncrement();
+        list.forEach(e -> {
+            e.setXh(String.valueOf(xh.getAndIncrement()));
+        });
+        try {
+            // 设置响应头
+            response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("操作日志数据", "utf-8"));
+            response.setContentType("application/octet-stream;charset=UTF-8");
+            response.setCharacterEncoding("utf-8");
+            // 数据导出
+            EasyExcel.write(response.getOutputStream(), OperLogExport.class)
+                    .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).sheet("操作日志").doWrite(list);
+        } catch (Exception e) {
+            // 重置response
+            response.reset();
+            response.setContentType("application/json");
+            response.setCharacterEncoding("utf-8");
+        }
     }
 
     @Log(title = "操作日志", businessType = BusinessType.DELETE)

+ 2 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysUserInformationController.java

@@ -1,5 +1,6 @@
 package com.xunmei.system.controller;
 
+import com.xunmei.common.redis.aop.RepeatSubmitCheck;
 import com.xunmei.system.api.domain.SysUserInformation;
 import com.xunmei.system.dto.SysUserInformationDTO;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -65,6 +66,7 @@ public class SysUserInformationController extends BaseController {
     @RequiresPermissions("system:information:edit")
     @Log(title = "人员管理扩展", businessType = BusinessType.UPDATE)
     @PutMapping("/extendUser")
+    @RepeatSubmitCheck
     public AjaxResult extendUser(@RequestBody SysUserInformationDTO sysUserInformation) {
         return toAjax(sysUserInformationService.extendUser(sysUserInformation));
     }

+ 9 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/mapper/SysOperLogMapper.java

@@ -3,6 +3,7 @@ package com.xunmei.system.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.xunmei.system.api.domain.SysOperLog;
 import com.xunmei.system.domain.SysNotice;
+import com.xunmei.system.util.OperLogExport;
 
 import java.util.Date;
 import java.util.List;
@@ -30,6 +31,14 @@ public interface SysOperLogMapper extends BaseMapper<SysOperLog>
      List<SysOperLog> selectOperLogList(SysOperLog operLog);
 
     /**
+     * 查询系统操作日志集合
+     *
+     * @param operLog 操作日志对象
+     * @return 操作日志集合
+     */
+    List<OperLogExport> exportOperLogList(SysOperLog operLog);
+
+    /**
      * 批量删除系统操作日志
      * 
      * @param operIds 需要删除的操作日志ID

+ 9 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/ISysOperLogService.java

@@ -5,6 +5,7 @@ import com.xunmei.common.core.web.page.TableDataInfo;
 import com.xunmei.system.api.domain.SysLogininfor;
 import com.xunmei.system.api.domain.SysOperLog;
 import com.xunmei.system.domain.SysNotice;
+import com.xunmei.system.util.OperLogExport;
 
 import java.util.Date;
 import java.util.List;
@@ -40,6 +41,14 @@ public interface ISysOperLogService extends IService<SysOperLog>
     List<SysOperLog> selectOperLogList(SysOperLog operLog);
 
     /**
+     * 导出系统操作日志集合
+     *
+     * @param operLog 操作日志对象
+     * @return 操作日志集合
+     */
+    List<OperLogExport> exportOperLogList(SysOperLog operLog);
+
+    /**
      * 批量删除系统操作日志
      *
      * @param operIds 需要删除的操作日志ID

+ 16 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysOperLogServiceImpl.java

@@ -11,6 +11,7 @@ import com.xunmei.system.domain.SysNotice;
 import com.xunmei.system.mapper.SysNoticeMapper;
 import com.xunmei.system.mapper.SysOperLogMapper;
 import com.xunmei.system.service.ISysOperLogService;
+import com.xunmei.system.util.OperLogExport;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -72,6 +73,21 @@ public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOper
         return operLogMapper.selectOperLogList(operLog);
     }
 
+    @Override
+    public List<OperLogExport> exportOperLogList(SysOperLog operLog) {
+
+        Object beginTime = operLog.getParams().get("beginTime");
+        Object endTime = operLog.getParams().get("endTime");
+        if(beginTime != null){
+            operLog.setBeginDate(DateUtils.parseDate(beginTime));
+        }
+        if(endTime != null) {
+            operLog.setEndDate(DateUtils.parseDate(endTime));
+        }
+        return operLogMapper.exportOperLogList(operLog);
+
+    }
+
     /**
      * 批量删除系统操作日志
      *

+ 3 - 3
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysUserInformationServiceImpl.java

@@ -97,9 +97,9 @@ public Date getTime(Date time){
         SysUserInformation informationByUserId = sysUserInformationMapper.getInformationByUserId(sysUserInformation.getUserId());
         int i = 0;
         LoginUser loginUser = SecurityUtils.getLoginUser();
-        sysUserInformation.setWorkTime(getTime(sysUserInformation.getWorkTime()));
-        sysUserInformation.setEntryTime(getTime(sysUserInformation.getEntryTime()));
-        sysUserInformation.setBornTime(getTime(sysUserInformation.getBornTime()));
+        sysUserInformation.setWorkTime(sysUserInformation.getWorkTime());
+        sysUserInformation.setEntryTime(sysUserInformation.getEntryTime());
+        sysUserInformation.setBornTime(sysUserInformation.getBornTime());
         if (null != informationByUserId) {
             sysUserInformation.setUpdateTime(DateUtils.getNowDate());
             sysUserInformation.setUpdateBy(loginUser.getUsername());

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

@@ -792,18 +792,18 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
         SysOrg sysOrg2 = orgService.selectSysOrgById(SecurityUtils.getLoginUser().getOrgId());
         String findInSetOrder = this.handleFindInSetOrder(sysOrg2.getPath());
         List<SecurityUserExport> securityUserExports = userMapper.selectSecurityUser(sysOrg2.getPath(),findInSetOrder);
-        List<SysOrg> diquOrgs = orgService.list(new LambdaQueryWrapper<SysOrg>().likeRight(SysOrg::getShortName, "地区行社").eq(SysOrg::getIsLock, 0).eq(SysOrg::getDeleted, 0));
+//        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());
-            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));
-            }
+//            s.setCity("福建");
+//            SysOrg sysOrg = sysOrgMapper.selectById(s.getOrgId());
+//            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));
+//            }
 //            SysOrg sysOrg1 = new SysOrg();
 //            if (sysOrg.getShortName().endsWith("地区行社")) {
 //                s.setCity(sysOrg.getBreviary());

+ 72 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/util/OperLogExport.java

@@ -0,0 +1,72 @@
+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;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 安保人员导出
+ * @author :LuoWei
+ * @date : 2023/11/23
+ */
+@Data
+@ColumnWidth(15) //列宽,最大值为255
+@HeadRowHeight(16) //表头行高
+@ContentRowHeight(16) //数据行高
+public class OperLogExport {
+
+
+    @ExcelProperty(value = "序号", index = 0)
+    private String xh;
+
+    @ExcelProperty(value = "日志编号", index = 1)
+    private String operId;
+
+    @ExcelProperty(value = "系统模块", index = 2)
+    private String title;
+
+    @ExcelProperty(value = "操作类型", index = 3)
+    private String businessType;
+
+    @ExcelProperty(value = "请求方式", index = 4)
+    private String requestMethod;
+
+    @ExcelProperty(value = "操作人员", index = 5)
+    private String operName;
+
+    @ExcelProperty(value = "主机", index = 6)
+    private String operIp;
+
+    @ExcelProperty(value = "操作状态", index = 7,converter = OperLogStatusConverter.class)
+    private String status;
+
+    @ExcelProperty(value = "操作日期", index = 8)
+    private Date operTime;
+
+    @ExcelProperty(value = "消耗时间", index = 9)
+    private String costTime;
+
+    @ExcelProperty(value = "请求地址", index = 10)
+    private String operUrl;
+
+    @ExcelProperty(value = "method", index = 11)
+    private String method;
+
+
+    @ExcelProperty(value = "请求参数", index = 12)
+    private String operParam;
+
+    @ExcelProperty(value = "返回参数", index = 13)
+    private String jsonResult;
+
+    @ExcelProperty(value= {"异常信息"}, index = 14)
+    private String errorMsg;
+}

+ 39 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/util/OperLogStatusConverter.java

@@ -0,0 +1,39 @@
+package com.xunmei.system.util;
+
+import com.alibaba.excel.converters.Converter;
+import com.alibaba.excel.enums.CellDataTypeEnum;
+import com.alibaba.excel.metadata.CellData;
+import com.alibaba.excel.metadata.GlobalConfiguration;
+import com.alibaba.excel.metadata.property.ExcelContentProperty;
+public class OperLogStatusConverter implements Converter<String> {
+
+
+
+    @Override
+    public Class supportJavaTypeKey() {
+        return null;
+    }
+
+    @Override
+    public CellDataTypeEnum supportExcelTypeKey() {
+        return null;
+    }
+
+    @Override
+    public String convertToJavaData(CellData cellData, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) throws Exception {
+        return null;
+    }
+
+    @Override
+    public CellData convertToExcelData(String status, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) throws Exception {
+        if ("0".equals(status)) {
+            return new CellData("成功");
+        } else if ("1".equals(status)) {
+            return new CellData("失败");
+        }
+        else {
+            return new CellData(status+"");
+        }
+
+    }
+}

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

@@ -103,7 +103,7 @@ public class SecurityWorkExport {
     private Integer innerPeople;
     @ExcelProperty(value = {"机构及人员配备", "监控中心人员情况", "其中,外聘员工人数"}, index = 41)
     private Integer outPeople;
-    @ExcelProperty(value = {"机构及人员配备", "监控中心安保卫持证人数"}, index = 42)
+    @ExcelProperty(value = {"机构及人员配备", "监控中心安保卫持证人数"}, index = 42)
     private Integer certificatePeopleNumber;
     @ExcelProperty(value = {"机构及人员配备", "营业网点保安人员数", "人员合计"}, index = 43)
     private Integer certificateTotal;

+ 48 - 0
soc-modules/soc-modules-system/src/main/resources/mapper/system/SysOperLogMapper.xml

@@ -23,6 +23,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<result property="costTime"       column="cost_time"      />
 	</resultMap>
 
+	<resultMap type="com.xunmei.system.util.OperLogExport" id="SysOperLogExportResult">
+		<id     property="operId"         column="oper_id"        />
+		<result property="title"          column="title"          />
+		<result property="businessType"   column="business_type"  />
+		<result property="method"         column="method"         />
+		<result property="requestMethod"  column="request_method" />
+		<result property="operName"       column="oper_name"      />
+		<result property="operUrl"        column="oper_url"       />
+		<result property="operIp"         column="oper_ip"        />
+		<result property="operParam"      column="oper_param"     />
+		<result property="jsonResult"     column="json_result"    />
+		<result property="status"         column="status"         />
+		<result property="errorMsg"       column="error_msg"      />
+		<result property="operTime"       column="oper_time"      />
+		<result property="costTime"       column="cost_time"      />
+	</resultMap>
+
 	<sql id="selectOperLogVo">
         select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_param, json_result, status, error_msg, oper_time, cost_time
         from sys_oper_log
@@ -63,6 +80,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		</where>
 		order by oper_id desc
 	</select>
+
+	<select id="exportOperLogList" parameterType="com.xunmei.system.api.domain.SysOperLog" resultMap="SysOperLogExportResult">
+		<include refid="selectOperLogVo"/>
+		<where>
+			<if test="title != null and title != ''">
+				AND title like concat('%', #{title}, '%')
+			</if>
+			<if test="businessType != null">
+				AND business_type = #{businessType}
+			</if>
+			<if test="businessTypes != null and businessTypes.length > 0">
+				AND business_type in
+				<foreach collection="businessTypes" item="businessType" open="(" separator="," close=")">
+					#{businessType}
+				</foreach>
+			</if>
+			<if test="status != null">
+				AND status = #{status}
+			</if>
+			<if test="operName != null and operName != ''">
+				AND oper_name like concat('%', #{operName}, '%')
+			</if>
+			<if test="beginDate != null"><!-- 开始时间检索 -->
+				AND oper_time &gt;= #{beginDate}
+			</if>
+			<if test="endDate != null"><!-- 结束时间检索 -->
+				AND oper_time &lt;= #{endDate}
+			</if>
+		</where>
+		order by oper_id desc
+	</select>
 	
 	<delete id="deleteOperLogByIds" parameterType="Long">
  		delete from sys_oper_log where oper_id in

+ 10 - 4
soc-modules/soc-modules-system/src/main/resources/mapper/system/SysOrgMapper.xml

@@ -1098,9 +1098,9 @@ and
                         LEFT JOIN sys_user_information b ON a.id = b.user_id
                         LEFT JOIN sys_org c ON a.org_id = c.id
                 WHERE
-                    1 = 1
-                  AND b.dept_id = 2
+                  a.deleted = 0
                   AND b.certificate_work = '1'
+                  AND b.duties IN ( 2, 4, 5 )
                   AND a.is_manage = 'Y'
                   AND c.deleted = 0
                   and c.is_lock = 0
@@ -1159,7 +1159,7 @@ and
               --  LEFT JOIN core_drill_plan b ON a.plan_id = b.id
             LEFT JOIN sys_org c ON a.org_id = c.id
         WHERE c.type=3
-          AND a.`status`=2
+          AND a.`status`in (2,3)
           and a.org_path    like concat(concat('%',#{orgPath}),'%')
           AND a.drill_start_time BETWEEN #{startTime} and #{endTime}
     </select>
@@ -1181,7 +1181,7 @@ and
             core_drill_task a
                 LEFT JOIN core_drill_plan b ON a.plan_id = b.id
         WHERE b.exec_org_type=4
-          and a.`status`=2
+          and a.`status` in (2,3)
           and a.org_path    like concat(concat('%',#{orgPath}),'%')
           AND a.drill_start_time BETWEEN #{startTime} and #{endTime}
     </select>
@@ -1194,8 +1194,10 @@ and
                 LEFT JOIN core_drill_task_to_user c ON c.drill_task_id = a.id
         WHERE
             b.exec_org_type = 4
+          and a.`status` in (2,3)
           and a.org_path    like concat(concat('%',#{orgPath}),'%')
           AND a.drill_start_time BETWEEN #{startTime} and #{endTime}
+          and c.type =1
     </select>
     <select id="getAlone" resultType="java.lang.Integer">
         select count(*) from sys_org_extend  a
@@ -1215,6 +1217,7 @@ and
           AND a.is_full_time = #{isFull}
           AND a.duties in ('1','2','3')
           AND b.is_manage = 'Y'
+          AND b.deleted =0
           AND c.path LIKE concat(#{orgPath}, '%')
     </select>
     <select id="getManagerCertificate" resultType="java.lang.Integer">
@@ -1231,6 +1234,7 @@ and
           AND a.certificate_work = 1
           AND a.duties in ('1','2','3')
           AND b.is_manage = 'Y'
+          AND b.deleted =0
           AND c.path LIKE concat(#{orgPath}, '%')
     </select>
     <select id="getIsMonitor" resultType="java.lang.String">
@@ -1246,6 +1250,7 @@ and
           and c.deleted = 0
           and c.is_lock = 0
           AND b.is_manage = 'Y'
+          AND b.deleted =0
           AND c.path LIKE concat(#{orgPath}, '%')
     </select>
     <select id="getMonitorPeople" resultType="java.util.Map">
@@ -1262,6 +1267,7 @@ and
           AND c.deleted = 0
           and c.is_lock = 0
           AND b.is_manage = 'Y'
+          AND b.deleted =0
           AND c.path LIKE concat(#{orgPath}, '%')
     </select>
     <select id="getSafeHeadToNetwork" resultType="java.lang.Integer">

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

@@ -734,7 +734,8 @@
     </select>
     <select id="selectSecurityUser" resultType="com.xunmei.system.util.SecurityUserExport">
         SELECT c.id                                     AS orgId,
-               c.short_name                             AS orgName,
+               c.affiliated_area                        AS city,
+               c.affiliated_bank                        AS orgName,
                b.`name`                                 AS name,
                IFNULL(b.gender, 2)                      AS gender,
                b.card                                   AS card,