Преглед на файлове

添加 根据角色获取用户人员接口

huangpeng преди 1 месец
родител
ревизия
f70085acec

+ 46 - 0
qhse-common/src/main/java/com/rongwei/bscommon/sys/dao/QhseVisitorManagementDao.java

@@ -0,0 +1,46 @@
+package com.rongwei.bscommon.sys.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.rongwei.bsentity.domain.QhseVisitorManagementDo;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 访客管理(QhseVisitorManagement)表数据库访问层
+ *
+ * @author makejava
+ * @since 2025-08-12 15:30:03
+ */
+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);
+}
+

+ 23 - 0
qhse-common/src/main/java/com/rongwei/bscommon/sys/service/QhseVisitorManagementService.java

@@ -0,0 +1,23 @@
+package com.rongwei.bscommon.sys.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.rongwei.bsentity.domain.QhseVisitorManagementDo;
+import com.rongwei.rwcommon.vo.generalsql.MasterSlaveInsertVo;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 访客管理(QhseVisitorManagement)表服务接口
+ *
+ * @author makejava
+ * @since 2025-08-12 15:30:06
+ */
+public interface QhseVisitorManagementService extends IService<QhseVisitorManagementDo> {
+
+    void generalMsInsert(MasterSlaveInsertVo masterSlaveInsert);
+
+    List<Map<String, String>> getUserByCodes(List<String> codes);
+}
+

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

@@ -13,6 +13,6 @@ import com.rongwei.rwcommon.vo.generalsql.MasterSlaveInsertVo;
  */
 public interface SysPagePartService extends IService<SysPagePartDo> {
 
-    void generalMsInsert(MasterSlaveInsertVo masterSlaveInsert);
+
 }
 

+ 40 - 0
qhse-common/src/main/java/com/rongwei/bscommon/sys/service/impl/QhseVisitorManagementServiceImpl.java

@@ -0,0 +1,40 @@
+package com.rongwei.bscommon.sys.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.rongwei.bscommon.sys.common.fegin.AdminFeginService;
+import com.rongwei.bscommon.sys.dao.QhseVisitorManagementDao;
+import com.rongwei.bscommon.sys.service.QhseVisitorManagementService;
+import com.rongwei.bsentity.domain.QhseVisitorManagementDo;
+import com.rongwei.rwcommon.vo.generalsql.MasterSlaveInsertVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 访客管理(QhseVisitorManagement)表服务实现类
+ *
+ * @author makejava
+ * @since 2025-08-12 15:30:07
+ */
+@Service
+public class QhseVisitorManagementServiceImpl extends ServiceImpl<QhseVisitorManagementDao, QhseVisitorManagementDo> implements QhseVisitorManagementService {
+
+    @Autowired
+    private AdminFeginService adminFeginService;
+
+    @Autowired
+    private QhseVisitorManagementDao qhseVisitorManagementDao;
+
+    @Override
+    public void generalMsInsert(MasterSlaveInsertVo masterSlaveInsert) {
+        adminFeginService.generalMsInsert(masterSlaveInsert);
+    }
+
+    @Override
+    public List<Map<String, String>> getUserByCodes(List<String> codes) {
+       return qhseVisitorManagementDao.getUserByCodes(codes);
+    }
+}
+

+ 0 - 6
qhse-common/src/main/java/com/rongwei/bscommon/sys/service/impl/SysPagePartServiceImpl.java

@@ -18,12 +18,6 @@ import org.springframework.stereotype.Service;
 @Service
 public class SysPagePartServiceImpl extends ServiceImpl<SysPagePartDao, SysPagePartDo> implements SysPagePartService {
 
-    @Autowired
-    private AdminFeginService adminFeginService;
 
-    @Override
-    public void generalMsInsert(MasterSlaveInsertVo masterSlaveInsert) {
-        adminFeginService.generalMsInsert(masterSlaveInsert);
-    }
 }
 

+ 275 - 0
qhse-entity/src/main/java/com/rongwei/bsentity/domain/QhseVisitorManagementDo.java

@@ -0,0 +1,275 @@
+package com.rongwei.bsentity.domain;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.rongwei.rwcommon.base.BaseDo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 访客管理(QhseVisitorManagement)表实体类
+ *
+ * @author makejava
+ * @since 2025-08-12 15:30:05
+ */
+@Data
+@TableName(value = "qhse_visitor_management")
+public class QhseVisitorManagementDo extends BaseDo implements Serializable {
+
+    /**
+     * 主键ID
+     **/
+    private String id;
+    
+    /**
+     * 租户ID
+     **/
+    private String tenantid;
+    
+    /**
+     * 扩展json格式配置
+     **/
+    private String roption;
+    
+    /**
+     * 是否删除Y/N
+     **/
+    private String deleted;
+    
+    /**
+     * 备注
+     **/
+    private String remark;
+    
+    /**
+     * 创建时间
+     **/
+    private Date createdate;
+    
+    /**
+     * 创建用户ID
+     **/
+    private String createuserid;
+    
+    /**
+     * 修改日期
+     **/
+    private Date modifydate;
+    
+    /**
+     * 修改用户ID
+     **/
+    private String modifyuserid;
+    
+    /**
+     * 创建人
+     **/
+    private String createusername;
+    
+    /**
+     * 修改人
+     **/
+    private String modifyusername;
+    
+    /**
+     * 访客姓名
+     **/
+    private String visitorname;
+    
+    /**
+     * 身份证号
+     **/
+    private String idnumber;
+    
+    /**
+     * 手机号
+     **/
+    private String mobilephonenumber;
+    
+    /**
+     * 单位/个人(数据字典)
+     **/
+    private String unitindividual;
+    
+    /**
+     * 单位名称
+     **/
+    private String unitname;
+    
+    /**
+     * 来访事由
+     **/
+    private String reasonsforthevisit;
+    
+    /**
+     * 车牌号
+     **/
+    private String licenseplatenumber;
+    
+    /**
+     * 同行人数
+     **/
+    private Integer ofcompanionsnumber;
+    
+    /**
+     * 计划时长(小时0.5小时最低单位)
+     **/
+    private Double durationofvisit;
+    
+    /**
+     * 审批状态(数据字典)
+     **/
+    private String approvalstatus;
+    
+    /**
+     * 进厂时间
+     **/
+    private Date entryfactorytime;
+    
+    /**
+     * 进厂大门(数据字典)
+     **/
+    private String enteringfactorygate;
+    
+    /**
+     * 出厂时间
+     **/
+    private Date leavefactorytime;
+    
+    /**
+     * 在厂时长 实际时长 0.5小时最低单位
+     **/
+    private Double durationofstayinthefactory;
+    
+    /**
+     * 被访客姓名
+     **/
+    private String nameofthevisitor;
+    
+    /**
+     * 工号
+     **/
+    private String employeeid;
+    
+    /**
+     * 拒绝理由
+     **/
+    private String reasonsforrejection;
+    
+    /**
+     * 黑名单原因
+     **/
+    private String reasonsforbeingblacklisted;
+    
+    /**
+     * 被访客ID
+     **/
+    private String idofthevisitor;
+    
+    /**
+     * 出厂大门
+     **/
+    private String leavefactorygate;
+    
+    /**
+     * 性别
+     **/
+    private String sex;
+    
+    /**
+     * 来访日期
+     **/
+    private Date visitdate;
+    
+    /**
+     * 访客类别(数据字典)
+     **/
+    private String visitorcategory;
+    
+    /**
+     * 事由补充说明
+     **/
+    private String mattersupplementaryexplanation;
+    
+    /**
+     * 作业/技服
+类型
+     **/
+    private String worktechnicalservicetype;
+    
+    /**
+     * 作业/技服
+内容
+     **/
+    private String worktechnicalservicecontent;
+    
+    /**
+     * 作业/技服
+场所
+     **/
+    private String worktechnicalserviceplace;
+    
+    /**
+     * 是否已办证
+     **/
+    private String hasobtainedcertificate;
+    
+    /**
+     * 计划访问开始时间
+     **/
+    private Date plannedvisitstarttime;
+    
+    /**
+     * 计划访问结束时间
+     **/
+    private Date plannedvisitendtime;
+    
+    /**
+     * 被访客部门
+     **/
+    private String visiteddepartmentname;
+    
+    /**
+     * 被访客部门ID
+     **/
+    private Integer visiteddepartmentid;
+    
+    /**
+     * 部门安全主管ID
+     **/
+    private String departmentsafesupervisorid;
+    
+    /**
+     * 部门安全主管NAME
+     **/
+    private String departmentsafesupervisorname;
+    
+    /**
+     * 部门经理ID
+     **/
+    private String departmentmanagerid;
+    
+    /**
+     * 部门经理NAME
+     **/
+    private String departmentmanagername;
+    
+    /**
+     * 安监部ID
+     **/
+    private String safetysupervisiondepartmentid;
+    
+    /**
+     * 安监部NAME
+     **/
+    private String safetysupervisiondepartmentname;
+    
+    /**
+     * 流程活动节点
+     **/
+    private String activitydefids;
+    
+}
+
+

+ 0 - 29
qhse-server/src/main/java/com/rongwei/controller/PagePartController.java

@@ -2,10 +2,6 @@ package com.rongwei.controller;
 
 
 import com.rongwei.bscommon.sys.service.SysPagePartService;
-import com.rongwei.bsentity.domain.SysPagePartDo;
-import com.rongwei.rwcommon.base.R;
-import com.rongwei.rwcommon.utils.StringUtils;
-import com.rongwei.rwcommon.vo.generalsql.MasterSlaveInsertVo;
 import lombok.extern.slf4j.Slf4j;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -23,30 +19,5 @@ public class PagePartController {
     SysPagePartService sysPagePartService;
 
 
-    @GetMapping("/getPageInfo/{id}")
-    public R getUserById(@PathVariable String id) {
-        logger.info("/getPageInfo 入参 id: {}", id);
-        SysPagePartDo sysPagePartDo = sysPagePartService.getById(id);
-        return R.ok(sysPagePartDo);
-
-    }
-
-    /**
-     * 通用主从表insert执行
-     *
-     * @param masterSlaveInsert
-     * @throws Exception
-     */
-    @PostMapping("/generalMsInsert")
-    public R generalMsInsert(@RequestBody MasterSlaveInsertVo masterSlaveInsert) {
-        try {
-            sysPagePartService.generalMsInsert(masterSlaveInsert);
-            return R.ok();
-        } catch (Exception e) {
-            log.error(StringUtils.spliceErrorMsg(e), e.fillInStackTrace());
-
-            return R.error(e.getMessage());
-        }
-    }
 
 }

+ 76 - 0
qhse-server/src/main/java/com/rongwei/controller/QhseVisitorManagementController.java

@@ -0,0 +1,76 @@
+package com.rongwei.controller;
+
+import com.rongwei.bscommon.sys.service.QhseVisitorManagementService;
+import com.rongwei.bscommon.sys.service.SysPagePartService;
+import com.rongwei.bsentity.domain.SysPagePartDo;
+import com.rongwei.rwcommon.base.R;
+import com.rongwei.rwcommon.utils.StringUtils;
+import com.rongwei.rwcommon.vo.generalsql.MasterSlaveInsertVo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 访客管理(QhseVisitorManagement)表控制层
+ *
+ * @author makejava
+ * @since 2025-08-12 15:30:00
+ */
+@RestController
+@RequestMapping("qhse-visitor-management")
+public class QhseVisitorManagementController  {
+
+
+    private final Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    QhseVisitorManagementService qhseVisitorManagementService;
+
+    @Autowired
+    SysPagePartService sysPagePartService;
+
+
+    @GetMapping("/getPageInfo/{id}")
+    public R getUserById(@PathVariable String id) {
+        logger.info("/getPageInfo 入参 id: {}", id);
+        SysPagePartDo sysPagePartDo = sysPagePartService.getById(id);
+        return R.ok(sysPagePartDo);
+
+    }
+
+    /**
+     * 通用主从表insert执行
+     *
+     * @param masterSlaveInsert
+     * @throws Exception
+     */
+    @PostMapping("/generalMsInsert")
+    public R generalMsInsert(@RequestBody MasterSlaveInsertVo masterSlaveInsert) {
+        try {
+            qhseVisitorManagementService.generalMsInsert(masterSlaveInsert);
+            return R.ok();
+        } catch (Exception e) {
+            logger.error(StringUtils.spliceErrorMsg(e), e.fillInStackTrace());
+
+            return R.error(e.getMessage());
+        }
+    }
+
+
+    @PostMapping("/getUserByCodes")
+    public R getUserByCodes(@RequestBody List<String> codes) {
+        try {
+            List<Map<String, String>> userByCodes = qhseVisitorManagementService.getUserByCodes(codes);
+            return R.ok(userByCodes);
+        } catch (Exception e) {
+            logger.error(StringUtils.spliceErrorMsg(e), e.fillInStackTrace());
+            return R.error(e.getMessage());
+        }
+    }
+
+}
+