lvy 2 сар өмнө
parent
commit
feeddf5030
20 өөрчлөгдсөн 1254 нэмэгдсэн , 16 устгасан
  1. 54 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/SignConfigDTO.java
  2. 81 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/SignConfig.java
  3. 66 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/SignConfigRelation.java
  4. 53 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/SignConfigRelationVO.java
  5. 34 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/SignConfigVO.java
  6. 4 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/TextdictInfoVO.java
  7. 25 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsFormElementVO3.java
  8. 178 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/SignConfigController.java
  9. 44 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/SignConfigMapper.java
  10. 84 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/SignConfigMapper.xml
  11. 35 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/SignConfigRelationMapper.java
  12. 21 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/SignConfigRelationMapper.xml
  13. 5 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/TextdictInfoMapper.xml
  14. 12 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/ISignConfigRelationService.java
  15. 34 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/ISignConfigService.java
  16. 38 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/SignConfigRelationServiceImpl.java
  17. 379 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/SignConfigServiceImpl.java
  18. 34 15
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/TextdictInfoServiceImpl.java
  19. 25 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/utils/WbsElementUtil.java
  20. 48 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/wrapper/SignConfigWrapper.java

+ 54 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/SignConfigDTO.java

@@ -0,0 +1,54 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.manager.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.manager.entity.SignConfig;
+import org.springblade.manager.entity.TableInfo;
+
+import java.util.List;
+
+/**
+ * 实体主表信息数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2022-11-30
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class SignConfigDTO extends SignConfig {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 电签元素id
+     */
+    @ApiModelProperty(value = "电签元素id")
+    private String elementId;
+    /**
+     * 元素表ids
+     */
+    @ApiModelProperty(value = "元素表ids")
+    private List<String> tableIds;
+    /**
+     * 角色ids
+     */
+    @ApiModelProperty(value = "角色ids")
+    private List<String> roleIds;
+
+}

+ 81 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/SignConfig.java

@@ -0,0 +1,81 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.manager.entity;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+/**
+ * 电签配置表实体类
+ *
+ * @author BladeX
+ * @since 2022-05-18
+ */
+@Data
+@TableName("m_sign_config")
+@EqualsAndHashCode(callSuper = true)
+public class SignConfig extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 电签元素名称
+     */
+    @ApiModelProperty(value = "电签元素名称")
+    @JsonProperty("eName")
+    private String eName;
+
+    /**
+     * 电签元素id
+     */
+    @ApiModelProperty(value = "电签元素id")
+    private Long eId;
+
+
+    /**
+     * 电签元素key
+     */
+    @ApiModelProperty(value = "电签元素key")
+    @JsonProperty("eKey")
+    private String eKey;
+
+    /**
+     * 元素类型,1:字符串、2:整数、3:小数、4:日期、5:数值、6:签名、7:文件、0:其他
+     */
+    @ApiModelProperty(value = "元素类型,1:字符串、2:整数、3:小数、4:日期、5:数值、6:签名、7:文件、0:其他")
+    private Integer elementType;
+
+    /**
+     * 租户ID
+     */
+    @ApiModelProperty(value = "租户ID")
+    private String tenantId;
+
+
+    /**
+     * 元素表类型,0:所有、1:部分
+     */
+    @ApiModelProperty(value = "元素表类型,0:所有、1:部分")
+    private Integer tableType;
+
+
+}

+ 66 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/SignConfigRelation.java

@@ -0,0 +1,66 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.manager.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+/**
+ * 电签配置关联表实体类
+ *
+ * @author BladeX
+ * @since 2022-05-18
+ */
+@Data
+@TableName("m_sign_config_relation")
+@EqualsAndHashCode(callSuper = true)
+public class SignConfigRelation extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 电签配置id
+     */
+    @ApiModelProperty(value = "电签配置id")
+    private Long confId;
+    /**
+     * 关联的岗位/角色 id
+     */
+    @ApiModelProperty(value = "关联的岗位/角色 id")
+    private Long relationId;
+    /**
+     * 关联类型,0:元素表、1:角色
+     */
+    @ApiModelProperty(value = "关联类型,0:元素表、1:角色")
+    private Integer type;
+
+    /**
+     * 关联类型,0:元素表、1:角色
+     */
+    @ApiModelProperty(value = "关联的元素表、角色类型")
+    private Integer relationType;
+
+    /**
+     * 岗位/角色 名称
+     */
+    @ApiModelProperty(value = "关联的岗位/角色名称")
+    private String relationName;
+
+}

+ 53 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/SignConfigRelationVO.java

@@ -0,0 +1,53 @@
+package org.springblade.manager.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.manager.entity.SignConfig;
+import org.springblade.manager.entity.SignConfigRelation;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Data
+public class SignConfigRelationVO  implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "id")
+    private Long id;
+
+    @ApiModelProperty(value = "名称")
+    private String name;
+
+    @ApiModelProperty(value = "类型")
+    private String type;
+
+    public static SignConfigRelationVO build(SignConfigRelation entity) {
+        SignConfigRelationVO vo = new SignConfigRelationVO();
+        vo.setId(entity.getRelationId());
+        vo.setName(entity.getRelationName());
+        if (entity.getType() == 1 &&  entity.getRelationType() != null) {
+            if (entity.getRelationType() == 1) {
+                vo.setType("施工方");
+            } else if (entity.getRelationType() == 2) {
+                vo.setType("监理方");
+            } else if (entity.getRelationType() == 3) {
+                vo.setType("业主方");
+            } else {
+                vo.setType("");
+            }
+        } else {
+            vo.setType(entity.getRelationType() + "");
+        }
+        return vo;
+    }
+    public static List<SignConfigRelationVO> build(List<SignConfigRelation> entityList) {
+        if (entityList == null) {
+            return new ArrayList<>();
+        }
+        return entityList.stream().map(SignConfigRelationVO::build).collect(Collectors.toList());
+    }
+}

+ 34 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/SignConfigVO.java

@@ -0,0 +1,34 @@
+package org.springblade.manager.vo;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.tool.node.INode;
+import org.springblade.manager.entity.ArchiveTree;
+import org.springblade.manager.entity.SignConfig;
+import org.springblade.manager.entity.SignConfigRelation;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class SignConfigVO extends SignConfig implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "元素类型名称")
+    private String elementTypeName;
+
+    @ApiModelProperty(value = "岗位ids")
+    private List<String> roleIds;
+
+    @ApiModelProperty(value = "元素表ids")
+    private List<String> tableIds;
+
+    private List<SignConfigRelation> relations;
+}

+ 4 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/TextdictInfoVO.java

@@ -16,6 +16,7 @@
  */
 package org.springblade.manager.vo;
 
+import io.swagger.annotations.ApiModelProperty;
 import org.springblade.manager.entity.TextdictInfo;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -34,4 +35,7 @@ public class TextdictInfoVO extends TextdictInfo {
     private String parentRoleId;
     //1.电签配置 2.系统识别
     private Integer showType;
+
+    @ApiModelProperty("是否引用系统级电签配置,1 系统级,0 项目级")
+    private Integer isSystem = 0;
 }

+ 25 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsFormElementVO3.java

@@ -0,0 +1,25 @@
+package org.springblade.manager.vo;
+
+import lombok.Data;
+import org.springblade.manager.entity.WbsFormElement;
+
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+public class WbsFormElementVO3 implements Serializable {
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 实体表名
+     */
+    private String eName;
+
+    private Integer eType;
+
+    private String eTypeName;
+}

+ 178 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/SignConfigController.java

@@ -0,0 +1,178 @@
+package org.springblade.manager.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.*;
+import lombok.AllArgsConstructor;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.*;
+import org.springblade.manager.dto.SaveUserInfoByProjectDTO;
+import org.springblade.manager.dto.SignConfigDTO;
+import org.springblade.manager.entity.*;
+import org.springblade.manager.service.*;
+import org.springblade.manager.vo.*;
+import org.springblade.manager.wrapper.SignConfigWrapper;
+import org.springblade.system.entity.Dict;
+import org.springblade.system.feign.IDictClient;
+import org.springblade.system.user.entity.User;
+import org.springblade.system.vo.RoleVO;
+import org.springblade.system.vo.RoleVO2;
+import org.springframework.beans.BeanUtils;
+import org.springframework.web.bind.annotation.*;
+import javax.validation.Valid;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+
+/**
+ * 电签配置 控制器
+ *
+ * @author BladeX
+ * @since 2022-05-18
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/signConfig")
+@Api(value = "电签配置表", tags = "电签配置表接口")
+public class SignConfigController extends BladeController {
+
+    private final ISignConfigService signConfigService;
+
+    private final IDictClient dictClient;
+
+    /**
+     * 获取参建方 角色列表
+     */
+    @GetMapping("/roleList")
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "岗位列表")
+    public R<List<RoleVO2>> roleMenuList(@ApiParam(value = "参建方类型,1:施工,2:监理,3:业主", required = true) @RequestParam Integer type, @ApiParam(value = "岗位名称") @RequestParam(required = false) String roleName) {
+        return R.data(signConfigService.getRoleList(type, roleName));
+    }
+
+    /**
+     * 分页
+     */
+    @GetMapping("/list")
+    @ApiOperationSupport(order = 2)
+    @ApiOperation(value = "分页", notes = "传入excelTab")
+    public R<IPage<SignConfigVO>> list(@ApiParam(value = "岗位id") @RequestParam(required = false) Long roleId, @ApiParam(value = "搜索keyword") @RequestParam(required = false) String keyword, Query query) {
+        return R.data(signConfigService.selectPageByRoleId(Condition.getPage(query), roleId, keyword));
+    }
+
+    /**
+     * 岗位详情
+     */
+    @GetMapping("/roleDetail")
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "岗位详情", notes = "传入id")
+    public R<List<SignConfigRelationVO>> roleDetail(@RequestParam Long id) {
+        List<SignConfigRelation> signConfigRelationList = signConfigService.getSignConfigRelationListByConfId(id, 1);
+        return R.data(SignConfigRelationVO.build(signConfigRelationList));
+    }
+
+    /**
+     * 元素详情
+     */
+    @GetMapping("/elementDetail")
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "元素详情", notes = "传入id")
+    public R<List<SignConfigRelationVO>> elementDetail(@RequestParam Long id) {
+        List<SignConfigRelation> signConfigRelations = signConfigService.getSignConfigRelationListByConfId(id, 0);
+        R<List<Dict>> type = dictClient.getList("table_type");
+        List<SignConfigRelationVO> list = SignConfigRelationVO.build(signConfigRelations);
+        if (type.isSuccess() && type.getData() != null) {
+            List<Dict> data = type.getData();
+            Map<String, String> map = data.stream().collect(Collectors.toMap(Dict::getDictKey, Dict::getDictValue));
+            list.forEach(vo -> vo.setType(map.getOrDefault(vo.getType(), vo.getType())));
+        }
+        return R.data(list);
+    }
+
+    /**
+     * 元素表分类列表
+     */
+    @GetMapping("/tableType")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "元素表分类列表")
+    public R<List<Dict>> tableType() {
+        return dictClient.getList("table_type");
+    }
+
+    /**
+     * 元素表列表
+     */
+    @GetMapping("/tableList")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "获取元素表列表")
+    public R<List<TableInfo>> tableList(@RequestParam(required = false) Integer tableType, @RequestParam(required = false) String name) {
+        return R.data( signConfigService.tableList(tableType, name));
+    }
+
+    /**
+     * 元素列表
+     */
+    @GetMapping("/elementList")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "获取所有元素列表")
+    public R<List<WbsFormElementVO3>> elementList() {
+        List<WbsFormElementVO3> elements =  signConfigService.elementList();
+        return R.data(elements);
+    }
+
+    /**
+     * 获取所有施工方、监理方、业主方的角色列表
+     */
+    @GetMapping("/queryAllRoleList")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "获取所有施工方、监理方、业主方的角色列表")
+    public R<List<RoleVO>> queryAllRoleList(@ApiParam(value = "参建方类型,1:施工,2:监理,3:业主", required = true) @RequestParam Integer type, @RequestParam(required = false) String roleName) {
+        List<RoleVO> roleVOS = signConfigService.queryAllRoleList(type, roleName);
+        return R.data(roleVOS);
+    }
+
+
+
+    /**
+     * 新增或修改 清表基础数据表
+     */
+    @PostMapping("/submit")
+    @ApiOperationSupport(order = 6)
+    @ApiOperation(value = "新增或修改")
+    public R submit(@Valid @RequestBody List<SignConfigDTO> signConfigDTOs) {
+        return R.status(signConfigService.addOrEdit(signConfigDTOs));
+    }
+
+
+    /**
+     * 删除
+     */
+    @PostMapping("/remove")
+    @ApiOperationSupport(order = 7)
+    @ApiOperation(value = "逻辑删除", notes = "传入ids")
+    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+        signConfigService.deleteLogic(Func.toLongList(ids));
+        return R.status(true);
+    }
+
+    /**
+     * 停用\启用
+     */
+    @PostMapping("/updateStatus")
+    @ApiOperationSupport(order = 8)
+    @ApiOperation(value = "停用、启用", notes = "传入ids")
+    public R updateStatus(@ApiParam(value = "主键集合", required = true) @RequestParam String ids, @ApiParam(value = "状态", required = true) @RequestParam Integer status) {
+        if (status == null || status < 0 || status > 1) {
+            return R.fail("状态错误");
+        }
+        return R.status(signConfigService.changeStatus(Func.toLongList(ids),  status));
+    }
+
+}

+ 44 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/SignConfigMapper.java

@@ -0,0 +1,44 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.manager.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.manager.entity.SignConfig;
+import org.springblade.manager.entity.SignConfigRelation;
+import org.springblade.manager.vo.SignConfigVO;
+import org.springblade.system.vo.RoleVO2;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * 电签配置 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2025-05-27
+ */
+public interface SignConfigMapper extends BaseMapper<SignConfig> {
+
+    List<RoleVO2> getRoleList(@Param("relationType") Integer relationType,@Param("roleName") String roleName);
+    List<SignConfigRelation> getSignConfigRelationListByConfId(@Param("confId") Long confId, @Param("type") Integer type);
+
+    List<SignConfig> selectPageByRoleId(IPage<SignConfig> page,@Param("roleId") Long roleId,@Param("keyword") String keyword);
+
+    List<SignConfigVO> getConfigByENames(@Param("names") Set<String> names);
+}

+ 84 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/SignConfigMapper.xml

@@ -0,0 +1,84 @@
+<?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="org.springblade.manager.mapper.SignConfigMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="signConfigResultMap" type="org.springblade.manager.entity.SignConfig">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="e_name" property="eName"/>
+        <result column="e_id" property="eId"/>
+        <result column="e_key" property="eKey"/>
+        <result column="table_type" property="tableType"/>
+        <result column="element_type" property="elementType"/>
+        <result column="tenant_id" property="tenantId"/>
+    </resultMap>
+    <resultMap id="signConfigRelationResultMap" type="org.springblade.manager.entity.SignConfigRelation">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="relation_id" property="relationId"/>
+        <result column="relation_name" property="relationName"/>
+        <result column="relation_type" property="relationType"/>
+        <result column="type" property="type"/>
+        <result column="conf_id" property="confId"/>
+    </resultMap>
+    <resultMap id="signConfigVO" type="org.springblade.manager.vo.SignConfigVO" extends="signConfigResultMap">
+        <association property="relations" resultMap="signConfigRelationResultMap"/>
+    </resultMap>
+    <select id="getRoleList" resultType="org.springblade.system.vo.RoleVO2">
+        select distinct relation_id as roleId,relation_name as roleName from m_sign_config_relation
+            WHERE  type = 1 and is_deleted = 0
+        <if test="roleName != null and roleName != ''">
+            and relation_name like concat('%',#{roleName},'%')
+        </if>
+        <if test="relationType != null">
+            and relation_type = #{relationType}
+        </if>
+    </select>
+
+    <select id="getSignConfigRelationListByConfId" resultMap="signConfigRelationResultMap">
+        select id,conf_id,type,relation_type,relation_id,relation_name,create_user,create_dept,create_time,update_user,update_time,status,is_deleted from m_sign_config_relation
+        WHERE is_deleted = 0
+        <if test="type != null">
+            and type = #{type}
+        </if>
+        <if test="confId != null">
+            and conf_id = #{confId}
+        </if>
+    </select>
+    <select id="selectPageByRoleId" resultType="org.springblade.manager.entity.SignConfig">
+        select a.id,a.e_name,a.e_id,a.e_key,a.table_type,a.element_type,a.tenant_id,a.create_user,a.create_dept,a.create_time,a.update_user,a.update_time,a.status,a.is_deleted from m_sign_config a LEFT JOIN m_sign_config_relation b
+            on a.id = b.conf_id WHERE b.type = 1 and a.is_deleted = 0
+        <if test="roleId != null">
+            and b.relation_id = #{roleId}
+        </if>
+        <if test="keyword != null and keyword != ''">
+            and a.e_name like concat('%',#{keyword},'%')
+        </if>
+    </select>
+    <select id="getConfigByENames" resultType="org.springblade.manager.vo.SignConfigVO">
+        select a.id,a.e_name,a.e_id,a.e_key,a.table_type,a.element_type,a.tenant_id,a.create_user,a.create_dept,a.create_time,a.update_user,a.update_time,a.status,a.is_deleted
+        from m_sign_config a LEFT JOIN m_sign_config_relation b
+            on a.id = b.conf_id WHERE a.`status` = 1 and a.is_deleted = 0 and b.is_deleted = 0
+        <if test="names != null">
+            and a.e_name in
+            <foreach item="item" index="index" collection="names" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+    </select>
+
+
+</mapper>

+ 35 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/SignConfigRelationMapper.java

@@ -0,0 +1,35 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.manager.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.manager.entity.SignConfig;
+import org.springblade.manager.entity.SignConfigRelation;
+import org.springblade.system.vo.RoleVO2;
+
+import java.util.List;
+
+/**
+ * 电签配置关联表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2025-05-27
+ */
+public interface SignConfigRelationMapper extends BaseMapper<SignConfigRelation> {
+
+}

+ 21 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/SignConfigRelationMapper.xml

@@ -0,0 +1,21 @@
+<?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="org.springblade.manager.mapper.SignConfigRelationMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="signConfigRelationResultMap" type="org.springblade.manager.entity.SignConfigRelation">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="relation_id" property="relationId"/>
+        <result column="relation_name" property="relationName"/>
+        <result column="relation_type" property="relationType"/>
+        <result column="conf_id" property="confId"/>
+    </resultMap>
+
+</mapper>

+ 5 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/TextdictInfoMapper.xml

@@ -23,6 +23,10 @@
         <result column="time_col_key" property="timeColKey"/>
     </resultMap>
 
+    <resultMap id="textdictInfoVoResultMap" type="org.springblade.manager.vo.TextdictInfoVO" extends="textdictInfoResultMap">
+
+    </resultMap>
+
     <select id="selectTextdictInfoPage" resultMap="textdictInfoResultMap">
         select distinct * from m_textdict_info where is_deleted = 0
         <if test="param2.type== 2 ">
@@ -46,7 +50,7 @@
         where a.tab_id=b.tab_id and a.is_deleted = 0 and a.type in('2','6') and a.excel_id=#{param2.excelId}
     </select>
 
-    <select id="selectTextdictBYIds" resultMap="textdictInfoResultMap">
+    <select id="selectTextdictBYIds" resultMap="textdictInfoVoResultMap">
         SELECT a.* from m_textdict_info a
         where project_id=#{projectId} and  id in
         <foreach collection="ids" item="id" open="(" close=")" separator=",">

+ 12 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/ISignConfigRelationService.java

@@ -0,0 +1,12 @@
+package org.springblade.manager.service;
+
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.manager.entity.SignConfig;
+import org.springblade.manager.entity.SignConfigRelation;
+import org.springblade.system.vo.RoleVO2;
+
+import java.util.List;
+
+public interface ISignConfigRelationService extends BaseService<SignConfigRelation> {
+
+}

+ 34 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/ISignConfigService.java

@@ -0,0 +1,34 @@
+package org.springblade.manager.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.manager.dto.SignConfigDTO;
+import org.springblade.manager.entity.SignConfig;
+import org.springblade.manager.entity.SignConfigRelation;
+import org.springblade.manager.entity.TableInfo;
+import org.springblade.manager.vo.SignConfigVO;
+import org.springblade.manager.vo.TextdictInfoVO;
+import org.springblade.manager.vo.WbsFormElementVO3;
+import org.springblade.system.vo.RoleVO;
+import org.springblade.system.vo.RoleVO2;
+
+import java.util.List;
+
+public interface ISignConfigService extends BaseService<SignConfig> {
+
+    List<RoleVO2> getRoleList(Integer type, String roleName);
+
+    List<SignConfigRelation> getSignConfigRelationListByConfId(Long confId, Integer type);
+
+    Boolean addOrEdit(List<SignConfigDTO> signConfigDTOs);
+
+    List<WbsFormElementVO3> elementList();
+
+    IPage<SignConfigVO> selectPageByRoleId(IPage<SignConfig> page, Long roleId, String keyword);
+
+    List<RoleVO> queryAllRoleList(Integer type, String roleName);
+
+    List<TableInfo> tableList(Integer tableType, String name);
+
+    List<TextdictInfoVO> hasSignConfig(String initTableName, List<String> keys, TextdictInfoVO vo);
+}

+ 38 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/SignConfigRelationServiceImpl.java

@@ -0,0 +1,38 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.manager.service.impl;
+
+
+import lombok.AllArgsConstructor;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.manager.entity.SignConfigRelation;
+import org.springblade.manager.mapper.SignConfigRelationMapper;
+import org.springblade.manager.service.ISignConfigRelationService;
+import org.springframework.stereotype.Service;
+
+
+/**
+ * 电签配置关联表 服务实现类
+ *
+ * @author BladeX
+ * @since 2025-05-27
+ */
+@Service
+@AllArgsConstructor
+public class SignConfigRelationServiceImpl extends BaseServiceImpl<SignConfigRelationMapper, SignConfigRelation> implements ISignConfigRelationService {
+
+}

+ 379 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/SignConfigServiceImpl.java

@@ -0,0 +1,379 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.manager.service.impl;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import lombok.AllArgsConstructor;
+import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.StringUtil;
+import org.springblade.manager.dto.SignConfigDTO;
+import org.springblade.manager.entity.SignConfig;
+import org.springblade.manager.entity.SignConfigRelation;
+import org.springblade.manager.entity.TableInfo;
+import org.springblade.manager.entity.WbsFormElement;
+import org.springblade.manager.mapper.SignConfigMapper;
+import org.springblade.manager.mapper.WbsFormElementMapper;
+import org.springblade.manager.service.ISignConfigRelationService;
+import org.springblade.manager.service.ISignConfigService;
+import org.springblade.manager.service.ITableInfoService;
+import org.springblade.manager.utils.WbsElementUtil;
+import org.springblade.manager.vo.SignConfigVO;
+import org.springblade.manager.vo.TextdictInfoVO;
+import org.springblade.manager.vo.WbsFormElementVO3;
+import org.springblade.manager.wrapper.SignConfigWrapper;
+import org.springblade.system.feign.ISysClient;
+import org.springblade.system.vo.RoleVO;
+import org.springblade.system.vo.RoleVO2;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.support.TransactionTemplate;
+
+import javax.validation.constraints.NotEmpty;
+import java.util.*;
+import java.util.stream.Collectors;
+
+
+/**
+ * 电签配置 服务实现类
+ *
+ * @author BladeX
+ * @since 2025-05-27
+ */
+@Service
+@AllArgsConstructor
+public class SignConfigServiceImpl extends BaseServiceImpl<SignConfigMapper, SignConfig> implements ISignConfigService {
+
+    private final ITableInfoService tableInfoService;
+
+    private final WbsFormElementMapper wbsFormElementMapper;
+
+    private final TransactionTemplate transactionTemplate;
+
+    private final ISignConfigRelationService signConfigRelationService;
+
+    private final ISysClient sysClient;
+
+    @Override
+    public List<RoleVO2> getRoleList(Integer relationType, String roleName) {
+        return this.baseMapper.getRoleList(relationType, roleName);
+    }
+
+    @Override
+    public List<SignConfigRelation> getSignConfigRelationListByConfId(Long confId, Integer type) {
+        return this.baseMapper.getSignConfigRelationListByConfId(confId, type);
+    }
+
+    @Override
+    public Boolean addOrEdit(List<SignConfigDTO> signConfigDTOs) {
+        signConfigDTOs.forEach(signConfigDTO -> {
+            SignConfig config = new SignConfig();
+            BeanUtil.copyProperties(signConfigDTO, config);
+            if (signConfigDTO.getElementId() == null) {
+                if (signConfigDTO.getEId() == null) {
+                    throw new ServiceException("请选择元素");
+                }
+                signConfigDTO.setElementId(signConfigDTO.getEId() + "");
+            }
+            WbsFormElement element = wbsFormElementMapper.selectById(signConfigDTO.getElementId());
+            if (element == null) {
+                throw new ServiceException("未查找到该元素,请重新选择");
+            }
+            config.setEId(element.getId());
+            config.setTenantId(AuthUtil.getTenantId());
+            config.setEKey(element.getEKey());
+            config.setElementType(element.getEType());
+            config.setEName(element.getEName());
+            List<String> roleIds = signConfigDTO.getRoleIds();
+            List<SignConfigRelation> signConfigRelationsByRoles = new ArrayList<>();
+            List<SignConfigRelation> signConfigRelationsByTables = new ArrayList<>();
+            if (roleIds != null && !roleIds.isEmpty()) {
+                R<List<RoleVO>> roleResult = sysClient.search();
+                if (!roleResult.isSuccess() || roleResult.getData() == null || roleResult.getData().isEmpty()) {
+                    throw new ServiceException("获取岗位信息失败");
+                }
+                List<RoleVO> data = roleResult.getData();
+                Map<String, RoleVO> roleVOMap = new HashMap<>();
+                //先处理管理员
+                for (RoleVO vos : data) {
+                    if (vos.getRoleName().contains("施工方") || vos.getRoleName().contains("监理方") || vos.getRoleName().contains("业主方")) {
+                        List<RoleVO> children = vos.getChildren();
+                        roleVOMap.put(vos.getId() + "", vos);
+                        if (children != null && !children.isEmpty()) {
+                            children.forEach(child -> roleVOMap.put(child.getId() + "", child));
+                        }
+                    }
+                }
+                for (String roleId : roleIds) {
+                    RoleVO roleVO = roleVOMap.get(roleId);
+                    if (roleVO != null) {
+                        SignConfigRelation signConfigRelation = new SignConfigRelation();
+                        signConfigRelation.setRelationId(Long.valueOf(roleId));
+                        signConfigRelation.setType(1);
+                        signConfigRelation.setRelationName(roleVO.getRoleName());
+                        RoleVO parent = roleVOMap.get(roleVO.getParentId() + "");
+                        if (parent != null) {
+                            if (parent.getRoleName().contains("施工方")) {
+                                signConfigRelation.setRelationType(1);
+                            }
+                            if (parent.getRoleName().contains("监理方")) {
+                                signConfigRelation.setRelationType(2);
+                            }
+                            if (parent.getRoleName().contains("业主方")) {
+                                signConfigRelation.setRelationType(3);
+                            }
+                        }
+                        signConfigRelationsByRoles.add(signConfigRelation);
+                    }
+                }
+            }
+            List<String> tableIds = signConfigDTO.getTableIds();
+            if (tableIds != null && !tableIds.isEmpty()) {
+                List<TableInfo> tableInfos = tableInfoService.list(Wrappers.<TableInfo>lambdaQuery().select(TableInfo::getTabChName, TableInfo::getId, TableInfo::getTabType).in(TableInfo::getId, tableIds));
+                if (tableInfos == null || tableInfos.isEmpty()) {
+                    throw new ServiceException("获取元素表信息失败");
+                }
+                Map<String, TableInfo> tableMap = tableInfos.stream().collect(Collectors.toMap(tableInfo -> tableInfo.getId() + "", tab -> tab, (v1, v2) -> v1));
+                for (String tableId : tableIds) {
+                    TableInfo tableInfo = tableMap.get(tableId);
+                    if (tableInfo != null) {
+                        SignConfigRelation signConfigRelation = new SignConfigRelation();
+                        signConfigRelation.setRelationId(Long.valueOf(tableId));
+                        signConfigRelation.setType(0);
+                        signConfigRelation.setRelationName(tableInfo.getTabChName());
+                        signConfigRelation.setRelationType(tableInfo.getTabType());
+                        signConfigRelationsByTables.add(signConfigRelation);
+                    }
+                }
+                config.setTableType(1);
+            } else {
+                config.setTableType(0);
+            }
+            transactionTemplate.execute(transactionStatus -> {
+                if (config.getId() !=  null) {
+                    this.updateById(config);
+                    if (!signConfigRelationsByTables.isEmpty()) {
+                        signConfigRelationService.remove(Wrappers.<SignConfigRelation>lambdaQuery().eq(SignConfigRelation::getConfId, config.getId()).eq(SignConfigRelation::getType, 0));
+                    }
+                    if (!signConfigRelationsByRoles.isEmpty()) {
+                        signConfigRelationService.remove(Wrappers.<SignConfigRelation>lambdaQuery().eq(SignConfigRelation::getConfId, config.getId()).eq(SignConfigRelation::getType, 1));
+                    }
+                } else {
+                    this.save(config);
+                }
+                if (!signConfigRelationsByRoles.isEmpty()) {
+                    signConfigRelationsByRoles.forEach(signConfigRelation -> signConfigRelation.setConfId(config.getId()));
+                    this.signConfigRelationService.saveBatch(signConfigRelationsByRoles);
+                }
+                if (!signConfigRelationsByTables.isEmpty()) {
+                    signConfigRelationsByTables.forEach(signConfigRelation -> signConfigRelation.setConfId(config.getId()));
+                    this.signConfigRelationService.saveBatch(signConfigRelationsByTables);
+                }
+                return true;
+            });
+        });
+        return true;
+    }
+
+    @Override
+    public List<WbsFormElementVO3> elementList() {
+        List<WbsFormElement> list = wbsFormElementMapper.selectList(Wrappers.<WbsFormElement>lambdaQuery().select(WbsFormElement::getEName, WbsFormElement::getId, WbsFormElement::getEType)
+                .eq(WbsFormElement::getEType, WbsElementUtil.getElementType("签名")).groupBy(WbsFormElement::getEName));
+        List<WbsFormElementVO3> result =  list.stream().map(element -> {
+            WbsFormElementVO3 vo = new WbsFormElementVO3();
+            vo.setId(element.getId());
+            vo.setEName(element.getEName());
+            vo.setEType(element.getEType());
+            vo.setETypeName(WbsElementUtil.getElementTypeName(element.getEType()));
+            return vo;
+        }).collect(Collectors.toList());
+        return result;
+    }
+
+    @Override
+    public IPage<SignConfigVO> selectPageByRoleId(IPage<SignConfig> page, Long roleId, String keyword) {
+        if (roleId == null && (keyword == null || keyword.trim().isEmpty())) {
+            page = this.page(page);
+        } else {
+            List<SignConfig> signConfigs = baseMapper.selectPageByRoleId(page, roleId, keyword);
+            page.setRecords(signConfigs);
+        }
+        IPage<SignConfigVO> pageVO = SignConfigWrapper.build().pageVO(page);
+        List<SignConfigVO> records = pageVO.getRecords();
+        List<Long> ids = records.stream().map(SignConfigVO::getId).collect(Collectors.toList());
+        if (!ids.isEmpty()) {
+            List<SignConfigRelation> signConfigRelations = signConfigRelationService.list(Wrappers.<SignConfigRelation>lambdaQuery().select(SignConfigRelation::getConfId, SignConfigRelation::getRelationId, SignConfigRelation::getType)
+                    .in(SignConfigRelation::getConfId, ids).eq(SignConfigRelation::getIsDeleted, 0));
+            Map<Long, Map<Integer, List<SignConfigRelation>>> map = signConfigRelations.stream().collect(Collectors.groupingBy(SignConfigRelation::getConfId, Collectors.groupingBy(SignConfigRelation::getType)));
+            records.forEach(record -> {
+                Map<Integer, List<SignConfigRelation>> listMap = map.get(record.getId());
+                if (listMap != null) {
+                    List<SignConfigRelation> list = listMap.get(1);
+                    if (list != null) {
+                        record.setRoleIds(list.stream().map(SignConfigRelation::getRelationId).map(String::valueOf).collect(Collectors.toList()));
+                    }
+                    list = listMap.get(0);
+                    if (list != null) {
+                        record.setTableIds(list.stream().map(SignConfigRelation::getRelationId).map(String::valueOf).collect(Collectors.toList()));
+                    }
+                }
+            });
+        }
+        return pageVO;
+    }
+
+    @Override
+    public List<RoleVO> queryAllRoleList(Integer type, String roleName) {
+        //获取当前系统配置的角色划分
+        R<List<RoleVO>> result = this.sysClient.search();
+        if (!result.isSuccess() || result.getData() == null || result.getData().isEmpty()) {
+            throw new ServiceException("获取岗位信息失败");
+        }
+        List<RoleVO> roleVOS = result.getData();
+        List<RoleVO> roles = new ArrayList<>();
+        //先处理管理员
+        for (RoleVO vos : roleVOS) {
+            if (vos.getRoleName().contains("施工方") || vos.getRoleName().contains("监理方") || vos.getRoleName().contains("业主方")) {
+                if (type != null ) {
+                    if (type == 1 && vos.getRoleName().contains("施工方")) {
+                        roles = vos.getChildren();
+                    } else if (type == 2 && vos.getRoleName().contains("监理方")) {
+                        roles = vos.getChildren();
+                    } else if (type == 3 && vos.getRoleName().contains("业主方")) {
+                        roles = vos.getChildren();
+                    }
+                } else {
+                    roles.addAll(vos.getChildren());
+                }
+            }
+        }
+        if (roleName != null && !roleName.isEmpty()) {
+            if (roles != null && !roles.isEmpty()) {
+                List<RoleVO> temp = new ArrayList<>();
+                for (RoleVO role : roles) {
+                    if (role.getRoleName().contains(roleName)) {
+                        temp.add(role);
+                        List<RoleVO> children = role.getChildren();
+                        if (children != null && !children.isEmpty()) {
+                            List<RoleVO> temp1 = new ArrayList<>();
+                            for (RoleVO child2 : children) {
+                                if (child2.getRoleName().contains(roleName)) {
+                                    temp1.add(child2);
+                                }
+                            }
+                            role.setChildren(temp1);
+                        }
+                    }
+                }
+                return temp;
+            }
+        }
+        return roles;
+    }
+
+    @Override
+    public List<TableInfo> tableList(Integer tableType, String name) {
+        List<TableInfo> tableInfos = this.tableInfoService.list(Wrappers.<TableInfo>lambdaQuery().eq(tableType != null, TableInfo::getTabType, tableType).like(name != null && !name.isEmpty(), TableInfo::getTabChName, name));
+        tableInfos.sort(Comparator.comparingInt(TableInfo::getTabType));
+        return tableInfos;
+    }
+
+    @Override
+    public List<TextdictInfoVO> hasSignConfig(String initTableName, List<String> keyNames, TextdictInfoVO vo) {
+        List<TextdictInfoVO> textdictInfoVOS = new ArrayList<>();
+        if (keyNames == null || keyNames.isEmpty()) {
+            return textdictInfoVOS;
+        }
+        Map<String, String> keyMap = keyNames.stream().collect(Collectors.toMap(key -> key.split("__")[0], key -> key, (key1, key2) -> key1));
+        List<TableInfo> tableInfos = this.tableInfoService.list(Wrappers.<TableInfo>lambdaQuery().select(TableInfo::getId).eq(TableInfo::getTabEnName, initTableName));
+        if (tableInfos == null || tableInfos.isEmpty()) {
+            return textdictInfoVOS;
+        }
+        List<WbsFormElement> list = this.wbsFormElementMapper.selectList(Wrappers.<WbsFormElement>lambdaQuery().select(WbsFormElement::getEName, WbsFormElement::getEKey)
+                .eq(WbsFormElement::getFId, tableInfos.get(0)).in(WbsFormElement::getEKey, keyMap.keySet()));
+        if (list == null || list.isEmpty()) {
+            return textdictInfoVOS;
+        }
+        Set<String> names = list.stream().map(WbsFormElement::getEName).collect(Collectors.toSet());
+        List<SignConfigVO> signConfigs = this.baseMapper.getConfigByENames(names);
+        if (signConfigs == null || signConfigs.isEmpty()) {
+            return textdictInfoVOS;
+        }
+        Map<String, List<SignConfigVO>> map = signConfigs.stream().collect(Collectors.groupingBy(SignConfigVO::getEName));
+        Map<String, String> keyNameMap = list.stream().collect(Collectors.toMap(WbsFormElement::getEKey, WbsFormElement::getEName));
+        keyMap.forEach((key, value) -> {
+            String colName = keyNameMap.get(key);
+            if (colName == null) {
+                return;
+            }
+            List<SignConfigVO> signConfigVOS = map.get(colName);
+            if (signConfigVOS == null || signConfigVOS.isEmpty()) {
+                return;
+            }
+            List<Long> roleIds = new ArrayList<>();
+            List<String> roleNames = new ArrayList<>();
+            signConfigVOS.forEach(signConfigVO -> {
+                List<SignConfigRelation> relations = signConfigVO.getRelations();
+                if (relations != null && !relations.isEmpty()) {
+                    Map<Integer, List<SignConfigRelation>> collect = relations.stream().collect(Collectors.groupingBy(SignConfigRelation::getType));
+                    // 部分表,判断tableInfos是否在其中
+                    if (signConfigVO.getTableType() == 1) {
+                        List<SignConfigRelation> tables = collect.get(0);
+                        if (tables == null || tables.isEmpty()) {
+                            return;
+                        }
+                        Map<Long, SignConfigRelation> tableMap = tables.stream().collect(Collectors.toMap(SignConfigRelation::getRelationId, v -> v, (v1, v2) -> v1));
+                        SignConfigRelation relation = tableMap.get(tableInfos.get(0).getId());
+                        if (relation == null) {
+                            return;
+                        }
+                    }
+                    List<SignConfigRelation> roles = collect.get(1);
+                    if (roles != null && !roles.isEmpty()) {
+                        roles.forEach(role -> {
+                            roleIds.add(role.getRelationId());
+                            roleNames.add(role.getRelationName());
+                        });
+                    }
+                }
+            });
+            if (!roleIds.isEmpty()) {
+                TextdictInfoVO textdictInfoVO = new TextdictInfoVO();
+                if (vo != null) {
+                    BeanUtil.copy(vo, textdictInfoVO);
+                }
+                textdictInfoVO.setId(null);
+                textdictInfoVO.setColKey(value);
+                textdictInfoVO.setColName(colName);
+                textdictInfoVO.setIsSystem(1);
+                textdictInfoVO.setSigRoleId(StringUtil.join(roleIds, ","));
+                textdictInfoVO.setSigRoleName(StringUtil.join(roleNames, ","));
+                textdictInfoVOS.add(textdictInfoVO);
+            }
+        });
+        return textdictInfoVOS;
+    }
+
+    @Override
+    public boolean deleteLogic(@NotEmpty List<Long> ids) {
+        return super.deleteLogic(ids);
+    }
+}

+ 34 - 15
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/TextdictInfoServiceImpl.java

@@ -28,18 +28,18 @@ import org.springblade.manager.entity.TextdictInfo;
 import org.springblade.manager.entity.WbsTreePrivate;
 import org.springblade.manager.mapper.TextdictInfoMapper;
 import org.springblade.manager.mapper.WbsTreePrivateMapper;
+import org.springblade.manager.service.ISignConfigService;
 import org.springblade.manager.service.ITextdictInfoService;
 import org.springblade.manager.utils.FileUtils;
 import org.springblade.manager.vo.TextdictInfoVO;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
 import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
+import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * 参数信息表 服务实现类
@@ -51,6 +51,9 @@ import java.util.List;
 public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, TextdictInfo> implements ITextdictInfoService {
     @Resource
     private WbsTreePrivateMapper wbsTreePrivateMapper;
+
+    @Resource
+    private ISignConfigService iSignConfigService;
     @Override
     public IPage<TextdictInfoVO> selectTextdictInfoPage(IPage<TextdictInfoVO> page, TextdictInfoVO textdictInfo) {
         List<TextdictInfoVO> textdict = new ArrayList<>();
@@ -62,20 +65,36 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
                 String htmlString = IoUtil.readToString(fileInputStream);
                 Document doc = Jsoup.parse(htmlString);
                 Elements table = doc.getElementsByAttribute("dqid");
-
-                    List<String> dqid = new ArrayList<>();
-                    for(Element ek:table){
-                        dqid.addAll(Func.toStrList("\\|\\|",ek.attr("dqid")));
+                List<String> dqid = new ArrayList<>();
+                List<String> keys = new ArrayList<>();
+                for(Element ek:table){
+                    dqid.addAll(Func.toStrList("\\|\\|",ek.attr("dqid")));
+                    Elements keyNames = ek.getElementsByAttribute("keyname");
+                    if(Func.isNotEmpty(keyNames)){
+                        for(Element keyName:keyNames){
+                            keys.addAll(Func.toStrList("\\|\\|",keyName.attr("keyname")));
+                        }
                     }
-                    if(Func.isNotEmpty(textdictInfo.getShowType()) && textdictInfo.getShowType() == 1){
-                        if(Func.isNotEmpty(dqid) && dqid.size() > 0){
-                            textdict = baseMapper.selectTextdictBYIds(dqid,privateInfo.getProjectId());
-                        }else {
-                            textdict = new ArrayList<>();
+                }
+                if(Func.isNotEmpty(textdictInfo.getShowType()) && textdictInfo.getShowType() == 1){
+                    if(Func.isNotEmpty(dqid) && dqid.size() > 0){
+                        textdict = baseMapper.selectTextdictBYIds(dqid,privateInfo.getProjectId());
+                        if (textdict != null && !textdict.isEmpty()) {
+                            for (TextdictInfoVO vo : textdict) {
+                                keys.remove(vo.getColKey());
+                            }
+                            if (Func.isNotEmpty(keys)) {
+                                // 查询系统级电签配置
+                                List<TextdictInfoVO> textdictList = iSignConfigService.hasSignConfig(privateInfo.getInitTableName(), keys, textdict.get(0));
+                                textdict.addAll(textdictList);
+                            }
                         }
-                    }else{
-                        textdict = baseMapper.selectTextdictInfoByExcelId(page, textdictInfo);
+                    }else {
+                        textdict = new ArrayList<>();
                     }
+                }else{
+                    textdict = baseMapper.selectTextdictInfoByExcelId(page, textdictInfo);
+                }
             } catch (Exception e) {
                 throw new RuntimeException(e);
             }

+ 25 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/utils/WbsElementUtil.java

@@ -164,6 +164,31 @@ public class WbsElementUtil {
         }
     }
 
+    public static String getElementTypeName(Integer type) {
+        if (type != null) {
+            switch (type) {
+                case 1:
+                    return "字符串";
+                case 2:
+                    return "整数";
+                case 3:
+                    return "小数";
+                case 4:
+                    return "日期";
+                case 5:
+                    return "数值";
+                case 6:
+                    return "签名";
+                case 7:
+                    return "文件";
+                default:
+                    return "其它";
+            }
+        } else {
+            return "其它";
+        }
+    }
+
     public static Integer getTableType(String tableType) {
         if (tableType != null) {
             switch (tableType) {

+ 48 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/wrapper/SignConfigWrapper.java

@@ -0,0 +1,48 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.manager.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.manager.entity.ExcelTab;
+import org.springblade.manager.entity.SignConfig;
+import org.springblade.manager.utils.WbsElementUtil;
+import org.springblade.manager.vo.ExcelTabVO;
+import org.springblade.manager.vo.SignConfigVO;
+
+import java.util.Objects;
+
+/**
+ * 清表基础数据表包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2022-05-18
+ */
+public class SignConfigWrapper extends BaseEntityWrapper<SignConfig, SignConfigVO> {
+
+    public static SignConfigWrapper build() {
+        return new SignConfigWrapper();
+    }
+
+    @Override
+    public SignConfigVO entityVO(SignConfig signConfig) {
+        SignConfigVO signConfigVO = Objects.requireNonNull(BeanUtil.copy(signConfig, SignConfigVO.class));
+        signConfigVO.setElementTypeName(WbsElementUtil.getElementTypeName(signConfig.getElementType()));
+        return signConfigVO;
+    }
+
+}