Parcourir la source

更新访客申请保存方法

huangpeng il y a 3 semaines
Parent
commit
96633cd561
16 fichiers modifiés avec 546 ajouts et 169 suppressions
  1. 1 1
      qhse-common/src/main/java/com/rongwei/bscommon/sys/dao/QhseDangerRewardManagementDao.java
  2. 7 25
      qhse-common/src/main/java/com/rongwei/bscommon/system/dao/QhseVisitorManagementDao.java
  3. 15 0
      qhse-common/src/main/java/com/rongwei/bscommon/system/dao/QhseVisitorManagementProcessDao.java
  4. 3 1
      qhse-common/src/main/java/com/rongwei/bscommon/sys/service/QhseDangerRewardManagementService.java
  5. 16 0
      qhse-common/src/main/java/com/rongwei/bscommon/system/service/QhseVisitorManagementProcessService.java
  6. 5 4
      qhse-common/src/main/java/com/rongwei/bscommon/system/service/QhseVisitorManagementService.java
  7. 12 4
      qhse-common/src/main/java/com/rongwei/bscommon/sys/service/impl/QhseDangerRewardManagementServiceImpl.java
  8. 19 0
      qhse-common/src/main/java/com/rongwei/bscommon/system/service/impl/QhseVisitorManagementProcessServiceImpl.java
  9. 102 46
      qhse-common/src/main/java/com/rongwei/bscommon/system/service/impl/QhseVisitorManagementServiceImpl.java
  10. 1 1
      qhse-common/src/main/resources/mybatis/QhseDangerRewardManagementDao.xml
  11. 67 0
      qhse-common/src/main/resources/mybatis/QhseVisitorManagementDao.xml
  12. 16 0
      qhse-entity/src/main/java/com/rongwei/bsentity/Dto/QhseVisitorManagementDto.java
  13. 140 59
      qhse-entity/src/main/java/com/rongwei/bsentity/domain/QhseVisitorManagementDo.java
  14. 128 0
      qhse-entity/src/main/java/com/rongwei/bsentity/domain/QhseVisitorManagementProcessDo.java
  15. 4 2
      qhse-server/src/main/java/com/rongwei/controller/QhseDangerRewardManagementController.java
  16. 10 26
      qhse-server/src/main/java/com/rongwei/controller/QhseVisitorManagementController.java

+ 1 - 1
qhse-common/src/main/java/com/rongwei/bscommon/sys/dao/QhseDangerRewardManagementDao.java

@@ -1,4 +1,4 @@
-package com.rongwei.bscommon.sys.dao;
+package com.rongwei.bscommon.system.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.rongwei.bsentity.domain.QhseDangerRewardManagementDo;

+ 7 - 25
qhse-common/src/main/java/com/rongwei/bscommon/system/dao/QhseVisitorManagementDao.java

@@ -3,6 +3,7 @@ package com.rongwei.bscommon.system.dao;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.rongwei.bsentity.domain.QhseVisitorManagementDo;
 import com.rongwei.bsentity.vo.QhseVisitorManagementVo;
+import org.apache.ibatis.annotations.MapKey;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
@@ -18,31 +19,11 @@ import java.util.Map;
 public interface QhseVisitorManagementDao extends BaseMapper<QhseVisitorManagementDo> {
 
 
-    @Select("<script>" +
-            "SELECT " +
-            "  e.code, " +
-            "  LISTAGG(a.ID, ',') WITHIN GROUP (ORDER BY a.ID) AS ids, " +
-            "  LISTAGG(a.NAME, ',') WITHIN GROUP (ORDER BY a.NAME) AS names " +
-            "FROM " +
-            "  sys_user a " +
-            "  LEFT JOIN sys_user_role d ON a.ID = d.USERID AND d.DELETED = '0' " +
-            "  LEFT JOIN sys_role e ON d.ROLEID = e.id AND e.DELETED = '0' " +
-            "  LEFT JOIN sys_user f ON a.CREATEUSERID = f.id AND f.DELETED = '0' " +
-            "  LEFT JOIN sys_user g ON a.MODIFYUSERID = g.id AND g.DELETED = '0' " +
-            "WHERE " +
-            "  a.DELETED = '0' " +
-            "  <if test='codes != null and codes.size() > 0'> " +
-            "    AND e.CODE IN " +
-            "    <foreach collection='codes' item='code' open='(' separator=',' close=')'> " +
-            "      #{code} " +
-            "    </foreach> " +
-            "  </if> " +
-            "GROUP BY " +
-            "  e.code " +
-            "ORDER BY " +
-            "  e.code " +
-            "</script>")
-    List<Map<String, String>> getUserByCodes(@Param("codes") List<String> codes);
+    @MapKey("code")
+    List<Map<String, String>> getUserByCodes(@Param("fitstDeptId") String fitstDeptId,
+                                             @Param("code0") String code0,
+                                             @Param("code1") String code1,
+                                             @Param("code2") String code2);
 
 
     @Select("SELECT\n" +
@@ -61,5 +42,6 @@ public interface QhseVisitorManagementDao extends BaseMapper<QhseVisitorManageme
 
     @Select("SELECT count(ID) \"count\" FROM qhse_blacklist WHERE IDNUMBER = #{idNumber} AND DELETED = '0'")
     int getBlackListByIdNum(@Param("idNumber") String idNumber);
+
 }
 

+ 15 - 0
qhse-common/src/main/java/com/rongwei/bscommon/system/dao/QhseVisitorManagementProcessDao.java

@@ -0,0 +1,15 @@
+package com.rongwei.bscommon.system.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.rongwei.bsentity.domain.QhseVisitorManagementProcessDo;
+
+/**
+ * 流程运行任务表(QhseVisitorManagementProcess)表数据库访问层
+ *
+ * @author makejava
+ * @since 2025-08-27 15:16:44
+ */
+public interface QhseVisitorManagementProcessDao extends BaseMapper<QhseVisitorManagementProcessDo> {
+
+}
+

+ 3 - 1
qhse-common/src/main/java/com/rongwei/bscommon/sys/service/QhseDangerRewardManagementService.java

@@ -1,8 +1,9 @@
-package com.rongwei.bscommon.sys.service;
+package com.rongwei.bscommon.system.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.rongwei.bsentity.domain.QhseDangerRewardManagementDo;
 
+import javax.servlet.http.HttpServletResponse;
 import java.util.HashMap;
 
 /**
@@ -17,5 +18,6 @@ public interface QhseDangerRewardManagementService extends IService<QhseDangerRe
 
 
     void CreatFromExcelTemp(HashMap<String,String> map);
+
 }
 

+ 16 - 0
qhse-common/src/main/java/com/rongwei/bscommon/system/service/QhseVisitorManagementProcessService.java

@@ -0,0 +1,16 @@
+package com.rongwei.bscommon.system.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.rongwei.bsentity.domain.QhseVisitorManagementProcessDo;
+
+
+/**
+ * 流程运行任务表(QhseVisitorManagementProcess)表服务接口
+ *
+ * @author makejava
+ * @since 2025-08-27 15:16:44
+ */
+public interface QhseVisitorManagementProcessService extends IService<QhseVisitorManagementProcessDo> {
+
+}
+

+ 5 - 4
qhse-common/src/main/java/com/rongwei/bscommon/system/service/QhseVisitorManagementService.java

@@ -2,9 +2,9 @@ package com.rongwei.bscommon.system.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.rongwei.bsentity.domain.QhseVisitorManagementDo;
+import com.rongwei.bsentity.dto.QhseVisitorManagementDto;
 import com.rongwei.bsentity.vo.QhseVisitorManagementVo;
 import com.rongwei.rwcommon.base.R;
-import com.rongwei.rwcommon.vo.generalsql.MasterSlaveInsertVo;
 
 import javax.servlet.http.HttpServletResponse;
 import java.util.List;
@@ -19,14 +19,15 @@ import java.util.Map;
  */
 public interface QhseVisitorManagementService extends IService<QhseVisitorManagementDo> {
 
-    R generalMsInsert(MasterSlaveInsertVo masterSlaveInsert);
 
-    List<Map<String, String>> getUserByCodes(List<String> codes);
+
 
     List<QhseVisitorManagementVo> getRecordByPhone(String phone);
 
     int getBlackListByIdNum(String idnumber);
 
-    void previewForAttachmentWithSignature(String signature, String fileId, String fileName, HttpServletResponse response);
+    void previewForAttachmentWithSignature(String signature, String url,HttpServletResponse response);
+
+    R saveData(QhseVisitorManagementDto qhseVisitorManagementDto);
 }
 

+ 12 - 4
qhse-common/src/main/java/com/rongwei/bscommon/sys/service/impl/QhseDangerRewardManagementServiceImpl.java

@@ -1,4 +1,4 @@
-package com.rongwei.bscommon.sys.service.impl;
+package com.rongwei.bscommon.system.service.impl;
 
 import cn.hutool.core.io.FileUtil;
 import com.aspose.cells.PdfCompliance;
@@ -6,10 +6,10 @@ import com.aspose.cells.PdfSaveOptions;
 import com.aspose.words.Document;
 import com.aspose.words.SaveFormat;
 import com.aspose.words.net.System.Data.DataTable;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.rongwei.bscommon.sys.dao.QhseDangerRewardManagementDao;
-import com.rongwei.bscommon.sys.service.QhseDangerRewardManagementService;
-import com.rongwei.bscommon.system.service.impl.QHSEFileItemServiceImpl;
+import com.rongwei.bscommon.system.dao.QhseDangerRewardManagementDao;
+import com.rongwei.bscommon.system.service.QhseDangerRewardManagementService;
 import com.rongwei.bscommon.system.utils.WordMergeHandler;
 import com.rongwei.bscommon.system.utils.WordUtils;
 import com.rongwei.bsentity.domain.QhseDangerRewardManagementDo;
@@ -31,6 +31,10 @@ import java.util.*;
 import java.util.stream.Collectors;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 
+import javax.servlet.http.HttpServletResponse;
+
+import static com.rongwei.bscommon.system.utils.QHSEConstant.FILE_SEPARATOR;
+
 /**
  * 隐患奖励管理(QhseDangerRewardManagement)表服务实现类
  *
@@ -51,6 +55,9 @@ public class QhseDangerRewardManagementServiceImpl extends ServiceImpl<QhseDange
     @Autowired
     private QhseDangerRewardManagementDao qhseDangerRewardManagementDao;
 
+    @Autowired
+    private FileFormatConversionServiceImpl fileFormatConversionService;
+
     public static final PunishmentExcelDto[] PUNISHMENTS = {
             new PunishmentExcelDto("SORT", "序号"),
             new PunishmentExcelDto("REGISTERTIME", "检查日期"),
@@ -239,6 +246,7 @@ public class QhseDangerRewardManagementServiceImpl extends ServiceImpl<QhseDange
 
     }
 
+
     /**
      *  gzh.png-;-e91fe56db91b409fa5b3cb4df0f4cf43^_^cb701d2ccb7e4a0fd59b8c9da0d96666_hpic2847_s - 副本 (2).jpg-;-014abcd9d3c54549865ec344cccc7123
      *  拆解附件 ID ,保存每条信息的 图片 ids

+ 19 - 0
qhse-common/src/main/java/com/rongwei/bscommon/system/service/impl/QhseVisitorManagementProcessServiceImpl.java

@@ -0,0 +1,19 @@
+package com.rongwei.bscommon.system.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.rongwei.bscommon.system.dao.QhseVisitorManagementProcessDao;
+import com.rongwei.bscommon.system.service.QhseVisitorManagementProcessService;
+import com.rongwei.bsentity.domain.QhseVisitorManagementProcessDo;
+import org.springframework.stereotype.Service;
+
+/**
+ * 流程运行任务表(QhseVisitorManagementProcess)表服务实现类
+ *
+ * @author makejava
+ * @since 2025-08-27 15:16:45
+ */
+@Service
+public class QhseVisitorManagementProcessServiceImpl extends ServiceImpl<QhseVisitorManagementProcessDao, QhseVisitorManagementProcessDo> implements QhseVisitorManagementProcessService {
+
+}
+

+ 102 - 46
qhse-common/src/main/java/com/rongwei/bscommon/system/service/impl/QhseVisitorManagementServiceImpl.java

@@ -8,14 +8,17 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.rongwei.bscommon.system.dao.QhseVisitorManagementDao;
 import com.rongwei.bscommon.system.fegin.QhseAdminFeginService;
+import com.rongwei.bscommon.system.service.QhseVisitorManagementProcessService;
 import com.rongwei.bscommon.system.service.QhseVisitorManagementService;
 import com.rongwei.bscommon.system.utils.WordMergeHandler;
 import com.rongwei.bscommon.system.utils.WordUtils;
 import com.rongwei.bsentity.domain.QhseVisitorManagementDo;
+import com.rongwei.bsentity.dto.QhseVisitorManagementDto;
 import com.rongwei.bsentity.vo.QhseVisitorManagementVo;
+import com.rongwei.rwadmincommon.system.domain.SysOrganizationDo;
+import com.rongwei.rwadmincommon.system.service.impl.SysOrganizationServiceImpl;
 import com.rongwei.rwcommon.base.R;
 import com.rongwei.rwcommon.utils.StringUtils;
-import com.rongwei.rwcommon.vo.generalsql.MasterSlaveInsertVo;
 import com.rongwei.rwcommonentity.commonservers.domain.SysFileItemDo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -28,9 +31,8 @@ import java.io.InputStream;
 import java.io.OutputStream;
 import java.nio.file.Files;
 import java.nio.file.Paths;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
+import java.util.stream.Collectors;
 
 import static com.rongwei.bscommon.system.utils.QHSEConstant.FILE_SEPARATOR;
 
@@ -45,8 +47,6 @@ public class QhseVisitorManagementServiceImpl extends ServiceImpl<QhseVisitorMan
 
     private final Logger logger = LoggerFactory.getLogger(getClass());
 
-    @Autowired
-    private QhseAdminFeginService qhseAdminFegin;
 
     @Autowired
     private QhseVisitorManagementDao qhseVisitorManagementDao;
@@ -54,22 +54,20 @@ public class QhseVisitorManagementServiceImpl extends ServiceImpl<QhseVisitorMan
     @Autowired
     private QhseVisitorManagementService qhseVisitorManagementService;
 
+
     @Autowired
     private FileFormatConversionServiceImpl fileFormatConversionService;
 
+    @Autowired
+    private QhseVisitorManagementProcessService qhseVisitorManagementProcessService;
+
 
     @Autowired
     private QHSEFileItemServiceImpl qhseFileItemServiceImpl;
 
-    @Override
-    public R generalMsInsert(MasterSlaveInsertVo masterSlaveInsert) {
-       return qhseAdminFegin.generalMsInsert(masterSlaveInsert);
-    }
+    @Autowired
+    SysOrganizationServiceImpl sysOrganizationServicel;
 
-    @Override
-    public List<Map<String, String>> getUserByCodes(List<String> codes) {
-       return qhseVisitorManagementDao.getUserByCodes(codes);
-    }
 
     /**
      * 查询当天的手机号的访客纪录
@@ -83,37 +81,10 @@ public class QhseVisitorManagementServiceImpl extends ServiceImpl<QhseVisitorMan
 
     }
 
-    /**
-     * 根据身份证查询 改身份证是否在黑名单中
-     * @param idNumber
-     * @return
-     */
-    @Override
-    public int getBlackListByIdNum(String idNumber) {
-        return qhseVisitorManagementDao.getBlackListByIdNum(idNumber);
-    }
 
-    @Override
-    public void previewForAttachmentWithSignature(String signature, String fileId,  String fileName,HttpServletResponse response) {
 
-        SysFileItemDo tempDo = null;
-        if(StringUtils.isBlank(fileId)){
-            tempDo= qhseFileItemServiceImpl.getOne(new LambdaQueryWrapper<SysFileItemDo>().eq(SysFileItemDo::getFilename, fileName).eq(SysFileItemDo::getDeleted, "0"));
-        }else {
-            tempDo = fileFormatConversionService.fileCheck(fileId);
-        }
-
-        if (tempDo == null) {
-            logger.error("无法根据id:{}获取到文件信息", fileId);
-            throw new RuntimeException("无法获取到附件模板");
-        }
-
-        // 模板路径
-        String tempFullpath = tempDo.getFullpath();
-        if (StringUtils.isBlank(tempFullpath)) {
-            logger.error("无法根据id:{}获取到文件信息", fileId);
-            throw new RuntimeException("无法获取到附件模板");
-        }
+    @Override
+    public void previewForAttachmentWithSignature(String signature, String url,  HttpServletResponse response) {
 
         String signatureId = signature.split(FILE_SEPARATOR)[1];
         SysFileItemDo signatureDo = fileFormatConversionService.fileCheck(signatureId);
@@ -128,10 +99,10 @@ public class QhseVisitorManagementServiceImpl extends ServiceImpl<QhseVisitorMan
             throw new RuntimeException("无法获取到签名");
         }
 
-        File file = new File(tempFullpath);
+        File file = new File(url);
 
 
-        try (InputStream templateStream = Files.newInputStream(Paths.get(tempFullpath));
+        try (InputStream templateStream = Files.newInputStream(Paths.get(url));
              OutputStream out = response.getOutputStream();) {
             Document doc = new Document(templateStream);
             // 设置邮件合并回调
@@ -149,7 +120,6 @@ public class QhseVisitorManagementServiceImpl extends ServiceImpl<QhseVisitorMan
 //            }
             response.setContentType("application/pdf");
 
-           response.setHeader("X-Content-Length", String.valueOf(tempDo.getFilesize()));
             response.setHeader("X-Content-Length", String.valueOf( file.length()));
 
 
@@ -165,5 +135,91 @@ public class QhseVisitorManagementServiceImpl extends ServiceImpl<QhseVisitorMan
             throw new RuntimeException("获取签名责任书失败!请联系系统管理员");
         }
     }
+
+    /**
+     * 根据身份证查询 改身份证是否在黑名单中
+     * @param idNumber
+     * @return
+     */
+    @Override
+    public int getBlackListByIdNum(String idNumber) {
+        return qhseVisitorManagementDao.getBlackListByIdNum(idNumber);
+    }
+
+
+
+    /**
+     * 部门安全主管,部门经理,安监部抄送
+     */
+    private static final String[] CODES ={
+            "role103",
+            "role068",
+            "role084"
+    };
+
+
+    /**
+     * 根据被访客部门 VISITEDDEPARTMENTID 查询对应的 部门安全主管,部门经理
+     * 查询安监部人员 塞入主表中
+     * @return
+     */
+    @Override
+    public R saveData(QhseVisitorManagementDto qhseVisitorManagementDto) {
+
+        try {
+
+            QhseVisitorManagementDo qhseVisitorManagementDo = qhseVisitorManagementDto.getQhseVisitorManagementDo();
+            // //1.获取一级部门ID
+            String firstDeptId = getFitstDeptId(qhseVisitorManagementDo.getVisiteddepartmentid());
+
+            //2. 获取对应的部门安全主管,部门经理,安监部
+            List<Map<String, String>> userByCodes = qhseVisitorManagementDao.getUserByCodes(firstDeptId, CODES[0], CODES[1], CODES[2]);
+            userByCodes.forEach(map -> {
+                if ( map.get("code").equals(CODES[0])){
+                    qhseVisitorManagementDo.setDepartmentsafesupervisorid( map.get("ids"));
+                    qhseVisitorManagementDo.setDepartmentsafesupervisorname( map.get("names"));
+                };
+
+                if ( map.get("code").equals(CODES[1])){
+                    qhseVisitorManagementDo.setDepartmentmanagerid( map.get("ids"));
+                    qhseVisitorManagementDo.setDepartmentmanagername( map.get("names"));
+                }
+
+                if ( map.get("code").equals(CODES[2])){
+                    qhseVisitorManagementDo.setSafetysupervisiondepartmentid( map.get("ids"));
+                    qhseVisitorManagementDo.setSafetysupervisiondepartmentname( map.get("names"));
+                }
+            });
+
+            //4.保存
+            qhseVisitorManagementService.save(qhseVisitorManagementDo);
+            qhseVisitorManagementProcessService.saveBatch(qhseVisitorManagementDto.getProcessDos());
+
+
+
+
+        }catch (Exception e){
+            logger.error("保存失败原因: {} ", e.getMessage());
+            return R.error("保存失败,请联系管理员");
+        }
+
+
+        return R.ok();
+    }
+
+    /**
+     * 获取一级部门ID
+     * @param visiteddepartmentid
+     * @return
+     */
+    public String getFitstDeptId(String visiteddepartmentid){
+        SysOrganizationDo organizationDo = sysOrganizationServicel.getById(visiteddepartmentid);
+        if (organizationDo.getLevel() ==2 ){
+            return organizationDo.getId();
+        }else {
+            return organizationDo.getFullpid().split(",")[2];
+        }
+    }
+
 }
 

+ 1 - 1
qhse-common/src/main/resources/mybatis/QhseDangerRewardManagementDao.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 
-<mapper namespace="com.rongwei.bscommon.sys.dao.QhseDangerRewardManagementDao">
+<mapper namespace="com.rongwei.bscommon.system.dao.QhseDangerRewardManagementDao">
 
     <select id="getRewardHzData" resultType="java.util.Map">
         SELECT ROW_NUMBER() OVER (ORDER BY USERNAME DESC) AS SORT,

+ 67 - 0
qhse-common/src/main/resources/mybatis/QhseVisitorManagementDao.xml

@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.rongwei.bscommon.system.dao.QhseVisitorManagementDao">
+
+
+    <select id="getUserByCodes" resultType="java.util.Map">
+
+            SELECT
+                e.code,
+                LISTAGG(a.ID, ',') WITHIN GROUP (ORDER BY a.ID) AS ids,
+                LISTAGG(a.NAME, ',') WITHIN GROUP (ORDER BY a.NAME) AS names
+                FROM
+                sys_user a
+                LEFT JOIN sys_user_org b ON a.ID = b.USERID AND b.DELETED = '0'
+                LEFT JOIN sys_organization c ON b.ORGID = c.id AND c.DELETED = '0'
+                LEFT JOIN sys_user_role d ON a.ID = d.USERID AND d.DELETED = '0'
+                LEFT JOIN sys_role e ON d.ROLEID = e.id AND e.DELETED = '0'
+                LEFT JOIN sys_user f ON a.CREATEUSERID = f.id AND f.DELETED = '0'
+                LEFT JOIN sys_user g ON a.MODIFYUSERID = g.id AND g.DELETED = '0'
+                WHERE
+                a.DELETED = '0' and c.ID =#{fitstDeptId}
+                AND e.CODE =#{code0}
+                GROUP BY
+                e.code
+
+                union
+
+            SELECT
+                e.code,
+                LISTAGG(a.ID, ',') WITHIN GROUP (ORDER BY a.ID) AS ids,
+                LISTAGG(a.NAME, ',') WITHIN GROUP (ORDER BY a.NAME) AS names
+            FROM
+                sys_user a
+                    LEFT JOIN sys_user_org b ON a.ID = b.USERID AND b.DELETED = '0'
+                    LEFT JOIN sys_organization c ON b.ORGID = c.id AND c.DELETED = '0'
+                    LEFT JOIN sys_user_role d ON a.ID = d.USERID AND d.DELETED = '0'
+                    LEFT JOIN sys_role e ON d.ROLEID = e.id AND e.DELETED = '0'
+                    LEFT JOIN sys_user f ON a.CREATEUSERID = f.id AND f.DELETED = '0'
+                    LEFT JOIN sys_user g ON a.MODIFYUSERID = g.id AND g.DELETED = '0'
+            WHERE
+                a.DELETED = '0' and c.ID =#{fitstDeptId}
+              AND e.CODE =#{code1}
+            GROUP BY
+                e.code
+
+
+            union
+
+            SELECT
+                e.code,
+                LISTAGG(a.ID, ',') WITHIN GROUP (ORDER BY a.ID) AS ids,
+                LISTAGG(a.NAME, ',') WITHIN GROUP (ORDER BY a.NAME) AS names
+            FROM
+                sys_user a
+
+                    LEFT JOIN sys_user_role d ON a.ID = d.USERID AND d.DELETED = '0'
+                    LEFT JOIN sys_role e ON d.ROLEID = e.id AND e.DELETED = '0'
+                    LEFT JOIN sys_user f ON a.CREATEUSERID = f.id AND f.DELETED = '0'
+                    LEFT JOIN sys_user g ON a.MODIFYUSERID = g.id AND g.DELETED = '0'
+            WHERE
+               e.CODE =#{code2}
+            GROUP BY
+                e.code
+
+    </select>
+</mapper>

+ 16 - 0
qhse-entity/src/main/java/com/rongwei/bsentity/Dto/QhseVisitorManagementDto.java

@@ -0,0 +1,16 @@
+package com.rongwei.bsentity.dto;
+
+import com.rongwei.bsentity.domain.QhseVisitorManagementDo;
+import com.rongwei.bsentity.domain.QhseVisitorManagementProcessDo;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class QhseVisitorManagementDto {
+
+    private QhseVisitorManagementDo qhseVisitorManagementDo;
+
+    private List<QhseVisitorManagementProcessDo> processDos;
+
+}

+ 140 - 59
qhse-entity/src/main/java/com/rongwei/bsentity/domain/QhseVisitorManagementDo.java

@@ -1,7 +1,8 @@
 package com.rongwei.bsentity.domain;
+
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import com.rongwei.rwcommon.base.BaseDo;
-
 import lombok.Data;
 
 import java.io.Serializable;
@@ -20,256 +21,336 @@ public class QhseVisitorManagementDo extends BaseDo implements Serializable {
     /**
      * 主键ID
      **/
+    @JsonProperty("ID")
     private String id;
-    
+
     /**
      * 租户ID
      **/
+    @JsonProperty("TENANTID")
     private String tenantid;
-    
+
     /**
      * 扩展json格式配置
      **/
+    @JsonProperty("ROPTION")
     private String roption;
-    
+
     /**
      * 是否删除Y/N
      **/
+    @JsonProperty("DELETED")
     private String deleted;
-    
+
     /**
      * 备注
      **/
+    @JsonProperty("REMARK")
     private String remark;
-    
+
     /**
      * 创建时间
      **/
+    @JsonProperty("CREATEDATE")
     private Date createdate;
-    
+
     /**
      * 创建用户ID
      **/
+    @JsonProperty("CREATEUSERID")
     private String createuserid;
-    
+
     /**
      * 修改日期
      **/
+    @JsonProperty("MODIFYDATE")
     private Date modifydate;
-    
+
     /**
      * 修改用户ID
      **/
+    @JsonProperty("MODIFYUSERID")
     private String modifyuserid;
-    
+
     /**
      * 创建人
      **/
+    @JsonProperty("CREATEUSERNAME")
     private String createusername;
-    
+
     /**
      * 修改人
      **/
+    @JsonProperty("MODIFYUSERNAME")
     private String modifyusername;
-    
+
     /**
      * 访客姓名
      **/
+    @JsonProperty("VISITORNAME")
     private String visitorname;
-    
+
     /**
      * 身份证号
      **/
+    @JsonProperty("IDNUMBER")
     private String idnumber;
-    
+
     /**
      * 手机号
      **/
+    @JsonProperty("MOBILEPHONENUMBER")
     private String mobilephonenumber;
-    
+
     /**
      * 单位/个人(数据字典)
      **/
+    @JsonProperty("UNITINDIVIDUAL")
     private String unitindividual;
-    
+
     /**
      * 单位名称
      **/
+    @JsonProperty("UNITNAME")
     private String unitname;
-    
+
     /**
      * 来访事由
      **/
+    @JsonProperty("REASONSFORTHEVISIT")
     private String reasonsforthevisit;
-    
+
     /**
      * 车牌号
      **/
+    @JsonProperty("LICENSEPLATENUMBER")
     private String licenseplatenumber;
-    
+
     /**
      * 同行人数
      **/
+    @JsonProperty("OFCOMPANIONSNUMBER")
     private Integer ofcompanionsnumber;
-    
+
     /**
      * 计划时长(小时0.5小时最低单位)
      **/
+    @JsonProperty("DURATIONOFVISIT")
     private Double durationofvisit;
-    
+
     /**
      * 审批状态(数据字典)
      **/
+    @JsonProperty("APPROVALSTATUS")
     private String approvalstatus;
-    
+
     /**
      * 进厂时间
      **/
+    @JsonProperty("ENTRYFACTORYTIME")
     private Date entryfactorytime;
-    
+
     /**
      * 进厂大门(数据字典)
      **/
+    @JsonProperty("ENTERINGFACTORYGATE")
     private String enteringfactorygate;
-    
+
     /**
      * 出厂时间
      **/
+    @JsonProperty("LEAVEFACTORYTIME")
     private Date leavefactorytime;
-    
+
     /**
      * 在厂时长 实际时长 0.5小时最低单位
      **/
+    @JsonProperty("DURATIONOFSTAYINTHEFACTORY")
     private Double durationofstayinthefactory;
-    
+
     /**
      * 被访客姓名
      **/
+    @JsonProperty("NAMEOFTHEVISITOR")
     private String nameofthevisitor;
-    
+
     /**
      * 工号
      **/
+    @JsonProperty("EMPLOYEEID")
     private String employeeid;
-    
+
     /**
      * 拒绝理由
      **/
+    @JsonProperty("REASONSFORREJECTION")
     private String reasonsforrejection;
-    
+
     /**
      * 黑名单原因
      **/
+    @JsonProperty("REASONSFORBEINGBLACKLISTED")
     private String reasonsforbeingblacklisted;
-    
+
     /**
      * 被访客ID
      **/
+    @JsonProperty("IDOFTHEVISITOR")
     private String idofthevisitor;
-    
+
     /**
      * 出厂大门
      **/
+    @JsonProperty("LEAVEFACTORYGATE")
     private String leavefactorygate;
-    
+
     /**
      * 性别
      **/
+    @JsonProperty("SEX")
     private String sex;
-    
+
     /**
      * 来访日期
      **/
+    @JsonProperty("VISITDATE")
     private Date visitdate;
-    
+
     /**
      * 访客类别(数据字典)
      **/
+    @JsonProperty("VISITORCATEGORY")
     private String visitorcategory;
-    
+
     /**
      * 事由补充说明
      **/
+    @JsonProperty("MATTERSUPPLEMENTARYEXPLANATION")
     private String mattersupplementaryexplanation;
-    
+
     /**
-     * 作业/技服
-类型
+     * 作业/技服 类型
      **/
+    @JsonProperty("WORKTECHNICALSERVICETYPE")
     private String worktechnicalservicetype;
-    
+
     /**
-     * 作业/技服
-内容
+     * 作业/技服 内容
      **/
+    @JsonProperty("WORKTECHNICALSERVICECONTENT")
     private String worktechnicalservicecontent;
-    
+
     /**
-     * 作业/技服
-场所
+     * 作业/技服 场所
      **/
+    @JsonProperty("WORKTECHNICALSERVICEPLACE")
     private String worktechnicalserviceplace;
-    
+
     /**
      * 是否已办证
      **/
+    @JsonProperty("HASOBTAINEDCERTIFICATE")
     private String hasobtainedcertificate;
-    
+
     /**
      * 计划访问开始时间
      **/
+    @JsonProperty("PLANNEDVISITSTARTTIME")
     private Date plannedvisitstarttime;
-    
+
     /**
      * 计划访问结束时间
      **/
+    @JsonProperty("PLANNEDVISITENDTIME")
     private Date plannedvisitendtime;
-    
+
     /**
      * 被访客部门
      **/
+    @JsonProperty("VISITEDDEPARTMENTNAME")
     private String visiteddepartmentname;
-    
+
     /**
      * 被访客部门ID
      **/
-    private Integer visiteddepartmentid;
-    
+    @JsonProperty("VISITEDDEPARTMENTID")
+    private String visiteddepartmentid;
+
     /**
      * 部门安全主管ID
      **/
+    @JsonProperty("DEPARTMENTSAFESUPERVISORID")
     private String departmentsafesupervisorid;
-    
+
     /**
      * 部门安全主管NAME
      **/
+    @JsonProperty("DEPARTMENTSAFESUPERVISORNAME")
     private String departmentsafesupervisorname;
-    
+
     /**
      * 部门经理ID
      **/
+    @JsonProperty("DEPARTMENTMANAGERID")
     private String departmentmanagerid;
-    
+
     /**
      * 部门经理NAME
      **/
+    @JsonProperty("DEPARTMENTMANAGERNAME")
     private String departmentmanagername;
-    
+
     /**
      * 安监部ID
      **/
+    @JsonProperty("SAFETYSUPERVISIONDEPARTMENTID")
     private String safetysupervisiondepartmentid;
-    
+
     /**
      * 安监部NAME
      **/
+    @JsonProperty("SAFETYSUPERVISIONDEPARTMENTNAME")
     private String safetysupervisiondepartmentname;
-    
+
     /**
      * 流程活动节点
      **/
+    @JsonProperty("ACTIVITYDEFIDS")
     private String activitydefids;
-    
-}
 
+    /**
+     * 签名
+     **/
+    @JsonProperty("SIGNATURE")
+    private String signature;
+
+    /**
+     * 上传工作联系单
+     **/
+    @JsonProperty("WORKCONTACTFORM")
+    private String workcontactform;
+
+    /**
+     * 是否在门禁中
+     **/
+    @JsonProperty("INACCESSCONTROL")
+    private String inaccesscontrol;
 
+    /**
+     * 完成状态(0 未完成,1 已完成:游客拜访完成)
+     **/
+    @JsonProperty("COMPLETIONSTATUS")
+    private String completionstatus;
+
+    /**
+     * 完成理由
+     **/
+    @JsonProperty("COMPLETIONREASON")
+    private String completionreason;
+
+    /**
+     * 完成时间
+     **/
+    @JsonProperty("COMPLETIONTIME")
+    private Date completiontime;
+}

+ 128 - 0
qhse-entity/src/main/java/com/rongwei/bsentity/domain/QhseVisitorManagementProcessDo.java

@@ -0,0 +1,128 @@
+package com.rongwei.bsentity.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.rongwei.rwcommon.base.BaseDo;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 流程运行任务表(QhseVisitorManagementProcess)表实体类
+ *
+ * @author makejava
+ * @since 2025-08-27 15:16:44
+ */
+@Data
+@TableName(value = "qhse_visitor_management_process")
+public class QhseVisitorManagementProcessDo extends BaseDo implements Serializable {
+
+    /**
+     * 主键ID
+     **/
+    @JsonProperty("ID")
+    private String id;
+
+    /**
+     * 业务表ID
+     **/
+    @JsonProperty("TASKBUSINESSTABLEID")
+    private String taskbusinesstableid;
+
+    /**
+     * 任务审批人
+     **/
+    @JsonProperty("APPROVERID")
+    private String approverid;
+
+    /**
+     * 操作ID(任务操作者可多个)
+     **/
+    @JsonProperty("OPERATIONID")
+    private String operationid;
+
+    /**
+     * 任务审批人名称
+     **/
+    @JsonProperty("APPROVERNAME")
+    private String approvername;
+
+    /**
+     * 租户ID
+     **/
+    @JsonProperty("TENANTID")
+    private String tenantid;
+
+    /**
+     * 扩展json格式配置
+     **/
+    @JsonProperty("ROPTION")
+    private String roption;
+
+    /**
+     * 是否删除Y/N
+     **/
+    @JsonProperty("DELETED")
+    private String deleted;
+
+    /**
+     * 备注
+     **/
+    @JsonProperty("REMARK")
+    private String remark;
+
+    /**
+     * 创建时间
+     **/
+    @JsonProperty("CREATEDATE")
+    private Date createdate;
+
+    /**
+     * 创建用户ID
+     **/
+    @JsonProperty("CREATEUSERID")
+    private String createuserid;
+
+    /**
+     * 修改日期
+     **/
+    @JsonProperty("MODIFYDATE")
+    private Date modifydate;
+
+    /**
+     * 修改用户ID
+     **/
+    @JsonProperty("MODIFYUSERID")
+    private String modifyuserid;
+
+    /**
+     * 创建人名称
+     **/
+    @JsonProperty("CREATEUSERNAME")
+    private String createusername;
+
+    /**
+     * 修改人名称
+     **/
+    @JsonProperty("MODIFYUSERNAME")
+    private String modifyusername;
+
+    /**
+     * 任务状态(数据字典wf_task_status:10:未签收(抢占式);20:待处理;30:已完成;40:退回)
+     **/
+    @JsonProperty("TASKSTATUS")
+    private String taskstatus;
+
+    /**
+     * 任务名称
+     **/
+    @JsonProperty("TASKNAME")
+    private String taskname;
+
+    /**
+     * 操作人 (任务操作者多个)
+     **/
+    @JsonProperty("OPERATIONNAME")
+    private String operationname;
+}

+ 4 - 2
qhse-server/src/main/java/com/rongwei/controller/QhseDangerRewardManagementController.java

@@ -1,6 +1,5 @@
 package com.rongwei.controller;
-import com.rongwei.bscommon.sys.service.QhseDangerRewardManagementService;
-import com.rongwei.bsentity.domain.MaterialOutboundDo;
+import com.rongwei.bscommon.system.service.QhseDangerRewardManagementService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.web.bind.annotation.*;
@@ -46,5 +45,8 @@ public class QhseDangerRewardManagementController  {
     }
 
 
+
+
+
 }
 

+ 10 - 26
qhse-server/src/main/java/com/rongwei/controller/QhseVisitorManagementController.java

@@ -3,7 +3,9 @@ package com.rongwei.controller;
 import com.rongwei.bscommon.system.dao.SysPagePartDao;
 import com.rongwei.bscommon.system.service.QhseVisitorManagementService;
 import com.rongwei.bscommon.system.service.SysPagePartService;
+import com.rongwei.bsentity.domain.QhseVisitorManagementDo;
 import com.rongwei.bsentity.domain.SysPagePartDo;
+import com.rongwei.bsentity.dto.QhseVisitorManagementDto;
 import com.rongwei.bsentity.vo.QhseVisitorManagementVo;
 import com.rongwei.rwcommon.base.R;
 import com.rongwei.rwcommon.utils.StringUtils;
@@ -45,33 +47,16 @@ public class QhseVisitorManagementController  {
 
     }
 
-    /**
-     * 通用主从表insert执行
-     *
-     * @param masterSlaveInsert
-     * @throws Exception
-     */
-    @PostMapping("/generalMsInsert")
-    public R generalMsInsert(@RequestBody MasterSlaveInsertVo masterSlaveInsert) {
-        logger.info("/generalMsInsert 入参 masterSlaveInsert: {}", masterSlaveInsert.toString());
-        try {
-            return qhseVisitorManagementService.generalMsInsert(masterSlaveInsert);
-        } catch (Exception e) {
-            logger.error(StringUtils.spliceErrorMsg(e), e.fillInStackTrace());
 
-            return R.error(e.getMessage());
-        }
-    }
 
-
-    @PostMapping("/getUserByCodes")
-    public R getUserByCodes(@RequestBody List<String> codes) {
-        logger.info("/getUserByCodes 入参 codes: {}", codes.toString());
+    @PostMapping("/saveData")
+    public R saveData(@RequestBody QhseVisitorManagementDto qhseVisitorManagementDto) {
+        logger.info("/saveData 入参 qhseVisitorManagementDto: {}", qhseVisitorManagementDto);
         try {
-            List<Map<String, String>> userByCodes = qhseVisitorManagementService.getUserByCodes(codes);
-            return R.ok(userByCodes);
+            return qhseVisitorManagementService.saveData(qhseVisitorManagementDto);
         } catch (Exception e) {
             logger.error(StringUtils.spliceErrorMsg(e), e.fillInStackTrace());
+
             return R.error(e.getMessage());
         }
     }
@@ -119,11 +104,10 @@ public class QhseVisitorManagementController  {
      */
     @GetMapping("/previewForAttachmentWithSignature")
     public void previewForAttachmentWithSignature( @RequestParam("signature") String signature,
-                                                   @RequestParam("fileId") String fileId,
-                                                   @RequestParam("fileName") String fileName,
+                                                   @RequestParam("url") String url,
                                                    HttpServletResponse response) {
-        logger.info("增加签名接口入参为:signature:{},fileId:{},fileName:{}", signature,fileId,fileName);
-        qhseVisitorManagementService.previewForAttachmentWithSignature(signature,fileId,fileName, response);
+        logger.info("增加签名接口入参为:signature:{},url:{}", signature,url);
+        qhseVisitorManagementService.previewForAttachmentWithSignature(signature,url, response);
     }