Lin Qilong 10 часов назад
Родитель
Сommit
2537e36b7a
33 измененных файлов с 1674 добавлено и 276 удалено
  1. 16 0
      gw-admin/src/main/java/com/goldenwater/web/controller/system/SysProfileController.java
  2. 6 0
      gw-admin/src/main/java/com/goldenwater/web/domain/OrgTypeConst.java
  3. 4 0
      gw-admin/src/main/java/com/goldenwater/web/service/OrgCompositeService.java
  4. 11 0
      gw-admin/src/main/java/com/goldenwater/web/service/OrgUwatCompositeService.java
  5. 4 0
      gw-admin/src/main/java/com/goldenwater/web/service/OrgWsubCompositeService.java
  6. 28 0
      gw-common/src/main/java/com/goldenwater/common/core/domain/entity/SysDept.java
  7. 286 0
      gw-common/src/main/java/com/goldenwater/common/core/domain/entity/SysUser.java
  8. 3 1
      gw-slaj/src/main/java/com/goldenwater/slaj/eme/controller/MediaController.java
  9. 9 0
      gw-slaj/src/main/java/com/goldenwater/slaj/hidd/controller/AttEngBaseController.java
  10. 60 0
      gw-slaj/src/main/java/com/goldenwater/slaj/hidd/mapper/AttEngBaseMapper.java
  11. 8 0
      gw-slaj/src/main/java/com/goldenwater/slaj/hidd/service/IAttEngBaseService.java
  12. 26 0
      gw-slaj/src/main/java/com/goldenwater/slaj/hidd/service/impl/AttEngBaseServiceImpl.java
  13. 0 3
      gw-slaj/src/main/java/com/goldenwater/slaj/infoquery/controller/InfoQueryController.java
  14. 0 9
      gw-slaj/src/main/java/com/goldenwater/slaj/infoquery/domain/OrgStatExportVo.java
  15. 0 6
      gw-slaj/src/main/java/com/goldenwater/slaj/infoquery/domain/OrgStatVo.java
  16. 394 0
      gw-slaj/src/main/resources/mapper/slaj/hidd/AttEngBaseMapper.xml
  17. 8 20
      gw-slaj/src/main/resources/mapper/slaj/infoquery/InfoQueryMapper.xml
  18. 12 3
      gw-system/src/main/resources/mapper/system/SysDeptMapper.xml
  19. 75 1
      gw-system/src/main/resources/mapper/system/SysUserMapper.xml
  20. 11 2
      gw-ui/src/components/FileUpload/index.vue
  21. 41 0
      gw-ui/src/utils/orgUnitType.js
  22. 1 1
      gw-ui/src/views/slaj/eng/attengcws/index.vue
  23. 1 1
      gw-ui/src/views/slaj/eng/attengothe/index.vue
  24. 0 3
      gw-ui/src/views/slaj/infoquery/org/index.vue
  25. 1 1
      gw-ui/src/views/system/adbase/index.vue
  26. 55 68
      gw-ui/src/views/system/dept/index.vue
  27. 39 23
      gw-ui/src/views/system/orgInfo/index.vue
  28. 5 4
      gw-ui/src/views/system/orgext/index.vue
  29. 16 6
      gw-ui/src/views/system/orguwatbase/index.vue
  30. 3 2
      gw-ui/src/views/system/orgwsub/index.vue
  31. 355 96
      gw-ui/src/views/system/user/index.vue
  32. 6 2
      gw-ui/src/views/system/user/profile/index.vue
  33. 190 24
      gw-ui/src/views/system/user/profile/userInfo.vue

+ 16 - 0
gw-admin/src/main/java/com/goldenwater/web/controller/system/SysProfileController.java

@@ -68,6 +68,22 @@ public class SysProfileController extends BaseController
         currentUser.setEmail(user.getEmail());
         currentUser.setPhonenumber(user.getPhonenumber());
         currentUser.setSex(user.getSex());
+        currentUser.setNickname(user.getNickname());
+        currentUser.setCategoryId(user.getCategoryId());
+        currentUser.setAdCode(user.getAdCode());
+        currentUser.setQq(user.getQq());
+        currentUser.setXlwb(user.getXlwb());
+        currentUser.setPhone(user.getPhone());
+        currentUser.setCasn(user.getCasn());
+        currentUser.setMac(user.getMac());
+        currentUser.setIp(user.getIp());
+        currentUser.setIdCard(user.getIdCard());
+        currentUser.setLoginFromCaFlag(user.getLoginFromCaFlag());
+        currentUser.setSortNum(user.getSortNum());
+        currentUser.setPersType(user.getPersType());
+        currentUser.setFaxNumb(user.getFaxNumb());
+        currentUser.setOrgCheckType(user.getOrgCheckType());
+        currentUser.setRemark(user.getRemark());
         if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser))
         {
             return error("修改用户'" + loginUser.getUsername() + "'失败,手机号码已存在");

+ 6 - 0
gw-admin/src/main/java/com/goldenwater/web/domain/OrgTypeConst.java

@@ -14,6 +14,12 @@ public class OrgTypeConst
     /** 参建单位(att_org_uwat_base + att_org_uwat_ext) */
     public static final String UWAT = "3";
 
+    /** 单位分类-水利(sys_dept.org_check_type) */
+    public static final String ORG_CHECK_WATER = "1";
+
+    /** 单位分类-非水利(sys_dept.org_check_type) */
+    public static final String ORG_CHECK_NON_WATER = "2";
+
     private OrgTypeConst()
     {
     }

+ 4 - 0
gw-admin/src/main/java/com/goldenwater/web/service/OrgCompositeService.java

@@ -52,6 +52,8 @@ public class OrgCompositeService
         // 1) 先插入 sys_dept(框架 insertDept 内部会重新生成 deptId)
         dept.setParentId(parentGuid);
         dept.setOrgType(OrgTypeConst.WATER);
+        dept.setOrgCheckType(OrgTypeConst.ORG_CHECK_WATER);
+        dept.setType(ext.getOrgType());
         dept.setCreateBy(SecurityUtils.getUserId());
         deptService.insertDept(dept);
 
@@ -107,6 +109,8 @@ public class OrgCompositeService
         // 2) sys_dept 部门,parent_id = 上级单位
         dept.setParentId(parentGuid);
         dept.setOrgType(OrgTypeConst.WATER);
+        dept.setOrgCheckType(OrgTypeConst.ORG_CHECK_WATER);
+        dept.setType(ext.getOrgType());
         dept.setUpdateBy(SecurityUtils.getUserId());
         deptService.updateDept(dept);
 

+ 11 - 0
gw-admin/src/main/java/com/goldenwater/web/service/OrgUwatCompositeService.java

@@ -50,6 +50,8 @@ public class OrgUwatCompositeService
         dept.setStatus(StringUtils.isEmpty(base.getStatus()) ? "0" : base.getStatus());
         dept.setOrderNum(base.getOrdernum() == null ? 1 : base.getOrdernum().intValue());
         dept.setOrgType(OrgTypeConst.UWAT);
+        dept.setOrgCheckType(OrgTypeConst.ORG_CHECK_NON_WATER);
+        dept.setType(base.getOrgType());
         dept.setCreateBy(SecurityUtils.getUserId());
         if (!deptService.checkDeptNameUnique(dept))
         {
@@ -70,6 +72,15 @@ public class OrgUwatCompositeService
         // 3) att_org_uwat_ext 参建单位扩展信息,从 dept 同步冗余字段
         ext.setOrgGuid(guid);
         ext.setWiunName(dept.getDeptName());
+        // att_org_uwat_ext.org_type 仅存 1施工/2监理:由单位类型(base.org_type 3施工/4监理)映射
+        if ("3".equals(base.getOrgType()))
+        {
+            ext.setOrgType("1");
+        }
+        else if ("4".equals(base.getOrgType()))
+        {
+            ext.setOrgType("2");
+        }
         if (StringUtils.isEmpty(ext.getGuid()))
         {
             ext.setGuid(IdUtils.fastSimpleUUID());

+ 4 - 0
gw-admin/src/main/java/com/goldenwater/web/service/OrgWsubCompositeService.java

@@ -48,6 +48,8 @@ public class OrgWsubCompositeService
 
         // 1) 先插入 sys_dept(框架 insertDept 内部会重新生成 deptId)
         dept.setOrgType(OrgTypeConst.WSUB);
+        dept.setOrgCheckType(OrgTypeConst.ORG_CHECK_NON_WATER);
+        dept.setType(orgType);
         dept.setCreateBy(SecurityUtils.getUserId());
         deptService.insertDept(dept);
 
@@ -99,6 +101,8 @@ public class OrgWsubCompositeService
 
         // 2) sys_dept 部门
         dept.setOrgType(OrgTypeConst.WSUB);
+        dept.setOrgCheckType(OrgTypeConst.ORG_CHECK_NON_WATER);
+        dept.setType(orgType);
         dept.setUpdateBy(SecurityUtils.getUserId());
         deptService.updateDept(dept);
 

+ 28 - 0
gw-common/src/main/java/com/goldenwater/common/core/domain/entity/SysDept.java

@@ -52,6 +52,12 @@ public class SysDept extends BaseEntity
     /** 机构类型(对应不同机构:1水利机构 2分包单位 3参建单位) */
     private String orgType;
 
+    /** 单位分类(org_check_type:1水利 2非水利) */
+    private String orgCheckType;
+
+    /** 单位类型原值(type:1水行政 2企事业单位 3施工 4监理) */
+    private String type;
+
     /** 父部门名称 */
     private String parentName;
 
@@ -177,6 +183,26 @@ public class SysDept extends BaseEntity
         this.orgType = orgType;
     }
 
+    public String getOrgCheckType()
+    {
+        return orgCheckType;
+    }
+
+    public void setOrgCheckType(String orgCheckType)
+    {
+        this.orgCheckType = orgCheckType;
+    }
+
+    public String getType()
+    {
+        return type;
+    }
+
+    public void setType(String type)
+    {
+        this.type = type;
+    }
+
     public String getParentName()
     {
         return parentName;
@@ -221,6 +247,8 @@ public class SysDept extends BaseEntity
             .append("status", getStatus())
             .append("delFlag", getDelFlag())
             .append("orgType", getOrgType())
+            .append("orgCheckType", getOrgCheckType())
+            .append("type", getType())
             .append("createBy", getCreateBy())
             .append("createTime", getCreateTime())
             .append("updateBy", getUpdateBy())

+ 286 - 0
gw-common/src/main/java/com/goldenwater/common/core/domain/entity/SysUser.java

@@ -75,6 +75,72 @@ public class SysUser extends BaseEntity
     /** 密码最后更新时间 */
     private Date pwdUpdateDate;
 
+    /** 用户类型(00系统用户 01注册用户) */
+    private String userType;
+
+    /** 是否锁定(0正常 1锁定,系统维护) */
+    private String locked;
+
+    /** 昵称 */
+    private String nickname;
+
+    /** 用户类别(旧系统 CATEGORY_ID) */
+    private String categoryId;
+
+    /** 用户编号 */
+    private String userNo;
+
+    /** 行政区划编码 */
+    private String adCode;
+
+    /** QQ号码 */
+    private String qq;
+
+    /** 新浪微博 */
+    private String xlwb;
+
+    /** 固定电话 */
+    private String phone;
+
+    /** CA认证SN */
+    private String casn;
+
+    /** 电脑物理地址 */
+    private String mac;
+
+    /** 固定IP */
+    private String ip;
+
+    /** 身份证号 */
+    private String idCard;
+
+    /** 手机号码密文(系统维护) */
+    private String otlcolCnknoqprn;
+
+    /** 是否只允许从CA登录(0否 1是) */
+    private Integer loginFromCaFlag;
+
+    /** 登录次数(系统维护) */
+    private Integer loginTimes;
+
+    /** 排序 */
+    private Integer sortNum;
+
+    /** 版本(系统维护) */
+    private Integer version;
+
+    /** 所属租户(系统维护) */
+    private String tenantId;
+
+    /** 人员类型 */
+    private String persType;
+
+    /** 传真号码 */
+    private String faxNumb;
+
+    /** 单位类型 */
+    private String orgCheckType;
+
     /** 部门对象 */
     @Excels({
         @Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
@@ -258,6 +324,226 @@ public class SysUser extends BaseEntity
         this.pwdUpdateDate = pwdUpdateDate;
     }
 
+    public String getUserType()
+    {
+        return userType;
+    }
+
+    public void setUserType(String userType)
+    {
+        this.userType = userType;
+    }
+
+    public String getLocked()
+    {
+        return locked;
+    }
+
+    public void setLocked(String locked)
+    {
+        this.locked = locked;
+    }
+
+    public String getNickname()
+    {
+        return nickname;
+    }
+
+    public void setNickname(String nickname)
+    {
+        this.nickname = nickname;
+    }
+
+    public String getCategoryId()
+    {
+        return categoryId;
+    }
+
+    public void setCategoryId(String categoryId)
+    {
+        this.categoryId = categoryId;
+    }
+
+    public String getUserNo()
+    {
+        return userNo;
+    }
+
+    public void setUserNo(String userNo)
+    {
+        this.userNo = userNo;
+    }
+
+    public String getAdCode()
+    {
+        return adCode;
+    }
+
+    public void setAdCode(String adCode)
+    {
+        this.adCode = adCode;
+    }
+
+    public String getQq()
+    {
+        return qq;
+    }
+
+    public void setQq(String qq)
+    {
+        this.qq = qq;
+    }
+
+    public String getXlwb()
+    {
+        return xlwb;
+    }
+
+    public void setXlwb(String xlwb)
+    {
+        this.xlwb = xlwb;
+    }
+
+    public String getPhone()
+    {
+        return phone;
+    }
+
+    public void setPhone(String phone)
+    {
+        this.phone = phone;
+    }
+
+    public String getCasn()
+    {
+        return casn;
+    }
+
+    public void setCasn(String casn)
+    {
+        this.casn = casn;
+    }
+
+    public String getMac()
+    {
+        return mac;
+    }
+
+    public void setMac(String mac)
+    {
+        this.mac = mac;
+    }
+
+    public String getIp()
+    {
+        return ip;
+    }
+
+    public void setIp(String ip)
+    {
+        this.ip = ip;
+    }
+
+    public String getIdCard()
+    {
+        return idCard;
+    }
+
+    public void setIdCard(String idCard)
+    {
+        this.idCard = idCard;
+    }
+
+    public String getOtlcolCnknoqprn()
+    {
+        return otlcolCnknoqprn;
+    }
+
+    public void setOtlcolCnknoqprn(String otlcolCnknoqprn)
+    {
+        this.otlcolCnknoqprn = otlcolCnknoqprn;
+    }
+
+    public Integer getLoginFromCaFlag()
+    {
+        return loginFromCaFlag;
+    }
+
+    public void setLoginFromCaFlag(Integer loginFromCaFlag)
+    {
+        this.loginFromCaFlag = loginFromCaFlag;
+    }
+
+    public Integer getLoginTimes()
+    {
+        return loginTimes;
+    }
+
+    public void setLoginTimes(Integer loginTimes)
+    {
+        this.loginTimes = loginTimes;
+    }
+
+    public Integer getSortNum()
+    {
+        return sortNum;
+    }
+
+    public void setSortNum(Integer sortNum)
+    {
+        this.sortNum = sortNum;
+    }
+
+    public Integer getVersion()
+    {
+        return version;
+    }
+
+    public void setVersion(Integer version)
+    {
+        this.version = version;
+    }
+
+    public String getTenantId()
+    {
+        return tenantId;
+    }
+
+    public void setTenantId(String tenantId)
+    {
+        this.tenantId = tenantId;
+    }
+
+    public String getPersType()
+    {
+        return persType;
+    }
+
+    public void setPersType(String persType)
+    {
+        this.persType = persType;
+    }
+
+    public String getFaxNumb()
+    {
+        return faxNumb;
+    }
+
+    public void setFaxNumb(String faxNumb)
+    {
+        this.faxNumb = faxNumb;
+    }
+
+    public String getOrgCheckType()
+    {
+        return orgCheckType;
+    }
+
+    public void setOrgCheckType(String orgCheckType)
+    {
+        this.orgCheckType = orgCheckType;
+    }
+
     public SysDept getDept()
     {
         return dept;

+ 3 - 1
gw-slaj/src/main/java/com/goldenwater/slaj/eme/controller/MediaController.java

@@ -32,7 +32,8 @@ public class MediaController extends BaseController {
     public AjaxResult upload(
             @RequestParam("file") MultipartFile file,
             @RequestParam("bisTablename") String bisTablename,
-            @RequestParam("bisGuid") String bisGuid) throws Exception {
+            @RequestParam("bisGuid") String bisGuid,
+            @RequestParam(value = "bis_rel_columns", required = false) String bisRelColumns) throws Exception {
 
         // 1. 上传
         String filePath = RuoYiConfig.getUploadPath();
@@ -61,6 +62,7 @@ public class MediaController extends BaseController {
         rel.setBisTablename(bisTablename);
         rel.setBisGuid(bisGuid);
         rel.setMedGuid(med.getGuid());
+        rel.setBisRelColumns(bisRelColumns);
         rel.setFromDate(new Date());
         relBisMedMapper.insertRelBisMed(rel);
 //        }

+ 9 - 0
gw-slaj/src/main/java/com/goldenwater/slaj/hidd/controller/AttEngBaseController.java

@@ -44,4 +44,13 @@ public class AttEngBaseController extends BaseController {
     public AjaxResult remove(@PathVariable String[] guids) {
         return toAjax(attEngBaseService.deleteAttEngBaseByGuids(guids));
     }
+
+    /**
+     * 将各工程类型子表数据同步到工程基础表 att_eng_base
+     * @return 各子表同步影响行数
+     */
+    @PostMapping("/sync")
+    public AjaxResult sync() {
+        return AjaxResult.success(attEngBaseService.syncEngBaseFromAttrs());
+    }
 }

+ 60 - 0
gw-slaj/src/main/java/com/goldenwater/slaj/hidd/mapper/AttEngBaseMapper.java

@@ -51,4 +51,64 @@ public interface AttEngBaseMapper {
      * @return 影响行数
      */
     int deleteAttEngBaseByGuids(String[] guids);
+
+    /**
+     * 从水闸工程表(att_eng_waga)同步到工程基础表(att_eng_base)
+     * @return 影响行数
+     */
+    int syncFromAttEngWaga();
+
+    /**
+     * 从引调水工程表(att_eng_wadi)同步到工程基础表(att_eng_base)
+     * @return 影响行数
+     */
+    int syncFromAttEngWadi();
+
+    /**
+     * 从淤地坝工程表(att_eng_sd)同步到工程基础表(att_eng_base)
+     * @return 影响行数
+     */
+    int syncFromAttEngSd();
+
+    /**
+     * 从水库工程表(att_eng_res)同步到工程基础表(att_eng_base)
+     * @return 影响行数
+     */
+    int syncFromAttEngRes();
+
+    /**
+     * 从泵站工程表(att_eng_pust)同步到工程基础表(att_eng_base)
+     * @return 影响行数
+     */
+    int syncFromAttEngPust();
+
+    /**
+     * 从其他工程表(att_eng_othe)同步到工程基础表(att_eng_base)
+     * @return 影响行数
+     */
+    int syncFromAttEngOthe();
+
+    /**
+     * 从灌区工程表(att_eng_irr)同步到工程基础表(att_eng_base)
+     * @return 影响行数
+     */
+    int syncFromAttEngIrr();
+
+    /**
+     * 从水电站工程表(att_eng_hyst)同步到工程基础表(att_eng_base)
+     * @return 影响行数
+     */
+    int syncFromAttEngHyst();
+
+    /**
+     * 从堤防工程表(att_eng_dike)同步到工程基础表(att_eng_base)
+     * @return 影响行数
+     */
+    int syncFromAttEngDike();
+
+    /**
+     * 从农村供水工程表(att_eng_cws)同步到工程基础表(att_eng_base)
+     * @return 影响行数
+     */
+    int syncFromAttEngCws();
 }

+ 8 - 0
gw-slaj/src/main/java/com/goldenwater/slaj/hidd/service/IAttEngBaseService.java

@@ -1,6 +1,7 @@
 package com.goldenwater.slaj.hidd.service;
 
 import java.util.List;
+import java.util.Map;
 import com.goldenwater.slaj.hidd.domain.AttEngBase;
 
 /**
@@ -49,4 +50,11 @@ public interface IAttEngBaseService {
      * @return 影响行数
      */
     int deleteAttEngBaseByGuids(String[] guids);
+
+    /**
+     * 将各工程类型子表(att_eng_waga/wadi/sd/res/pust/othe/irr/hyst/dike/cws)
+     * 的公共字段同步(upsert)到工程基础表 att_eng_base
+     * @return 各子表同步影响行数(键为子表英文名,值为影响行数)
+     */
+    Map<String, Integer> syncEngBaseFromAttrs();
 }

+ 26 - 0
gw-slaj/src/main/java/com/goldenwater/slaj/hidd/service/impl/AttEngBaseServiceImpl.java

@@ -7,8 +7,11 @@ import com.goldenwater.slaj.hidd.mapper.AttEngBaseMapper;
 import com.goldenwater.slaj.hidd.service.IAttEngBaseService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
+import java.util.LinkedHashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 工程基础信息 服务层实现
@@ -103,4 +106,27 @@ public class AttEngBaseServiceImpl implements IAttEngBaseService {
         if (rows > 0) { for (String guid : guids) objSyncMapper.deleteObjEng(guid); }
         return rows;
     }
+
+    /**
+     * 将各工程类型子表的公共字段同步(upsert)到工程基础表 att_eng_base
+     * 以子表 eng_guid 作为 base.guid,已存在则更新,不存在则新增
+     *
+     * @return 各子表同步影响行数
+     */
+    @Override
+    @Transactional
+    public Map<String, Integer> syncEngBaseFromAttrs() {
+        Map<String, Integer> result = new LinkedHashMap<>();
+        result.put("waga", attEngBaseMapper.syncFromAttEngWaga());
+        result.put("wadi", attEngBaseMapper.syncFromAttEngWadi());
+        result.put("sd", attEngBaseMapper.syncFromAttEngSd());
+        result.put("res", attEngBaseMapper.syncFromAttEngRes());
+        result.put("pust", attEngBaseMapper.syncFromAttEngPust());
+        result.put("othe", attEngBaseMapper.syncFromAttEngOthe());
+        result.put("irr", attEngBaseMapper.syncFromAttEngIrr());
+        result.put("hyst", attEngBaseMapper.syncFromAttEngHyst());
+        result.put("dike", attEngBaseMapper.syncFromAttEngDike());
+        result.put("cws", attEngBaseMapper.syncFromAttEngCws());
+        return result;
+    }
 }

+ 0 - 3
gw-slaj/src/main/java/com/goldenwater/slaj/infoquery/controller/InfoQueryController.java

@@ -67,9 +67,6 @@ public class InfoQueryController extends BaseController {
             vo.setOrgName(row.getOrgName());
             vo.setOrgCode(row.getOrgCode());
             vo.setWiunProp(row.getWiunProp());
-            vo.setEngCount(row.getEngCount());
-            vo.setMajorHazCount(row.getMajorHazCount());
-            vo.setMajorHiddCount(row.getMajorHiddCount());
             exportList.add(vo);
         }
         ExcelUtil<OrgStatExportVo> util = new ExcelUtil<>(OrgStatExportVo.class);

+ 0 - 9
gw-slaj/src/main/java/com/goldenwater/slaj/infoquery/domain/OrgStatExportVo.java

@@ -19,13 +19,4 @@ public class OrgStatExportVo {
 
     @Excel(name = "单位性质", width = 15, dictType = "slaj_wiun_prop")
     private String wiunProp;
-
-    @Excel(name = "所辖工程数量", width = 15)
-    private Long engCount;
-
-    @Excel(name = "重大危险源数量", width = 18)
-    private Long majorHazCount;
-
-    @Excel(name = "重大隐患数量", width = 15)
-    private Long majorHiddCount;
 }

+ 0 - 6
gw-slaj/src/main/java/com/goldenwater/slaj/infoquery/domain/OrgStatVo.java

@@ -17,10 +17,4 @@ public class OrgStatVo {
     private String orgCode;
     /** 单位性质(att_org_ext.wiun_prop,字典 slaj_wiun_prop) */
     private String wiunProp;
-    /** 所辖工程数量 */
-    private Long engCount;
-    /** 重大危险源数量 */
-    private Long majorHazCount;
-    /** 重大隐患数量 */
-    private Long majorHiddCount;
 }

+ 394 - 0
gw-slaj/src/main/resources/mapper/slaj/hidd/AttEngBaseMapper.xml

@@ -150,4 +150,398 @@
             #{guid}
         </foreach>
     </delete>
+
+    <!-- ==================== 子表数据同步到 att_eng_base(以子表 eng_guid 作为 base.guid,upsert) ==================== -->
+    <insert id="syncFromAttEngWaga">
+        insert into att_eng_base (guid, pguid, ad_guid, lk_guid, eng_name, eng_guid, impo_grad, eng_scal, appr_budg,
+                                  if_rein_force, eng_grad, rv_guid, des_fl_stand, oflp_code, proj_guid, cen_long,
+                                  cen_lat, stat, start_date, comp_date, eng_stat, org_guid, eng_rein_force_guid, note,
+                                  coll_time, upd_time, rec_pers)
+        select e.eng_guid, e.p_guid, e.ad_guid, e.lk_guid, e.eng_name, e.eng_guid, e.impo_grad, e.eng_scal,
+               e.appr_budg, e.if_rein_force, e.eng_grad, e.rv_guid, e.des_fl_sta, e.oflp_code, e.proj_guid,
+               e.cen_long, e.cen_lat, e.stat, e.start_date, e.comp_date, e.eng_stat, e.org_guid,
+               e.eng_rein_force_guid, e.note, COALESCE(e.coll_time, now()), COALESCE(e.upd_time, now()), e.rec_pers
+        from att_eng_waga e
+        where e.eng_guid is not null and e.eng_guid != ''
+        on conflict (guid) do update set
+            pguid = excluded.pguid,
+            ad_guid = excluded.ad_guid,
+            lk_guid = excluded.lk_guid,
+            eng_name = excluded.eng_name,
+            eng_guid = excluded.eng_guid,
+            impo_grad = excluded.impo_grad,
+            eng_scal = excluded.eng_scal,
+            appr_budg = excluded.appr_budg,
+            if_rein_force = excluded.if_rein_force,
+            eng_grad = excluded.eng_grad,
+            rv_guid = excluded.rv_guid,
+            des_fl_stand = excluded.des_fl_stand,
+            oflp_code = excluded.oflp_code,
+            proj_guid = excluded.proj_guid,
+            cen_long = excluded.cen_long,
+            cen_lat = excluded.cen_lat,
+            stat = excluded.stat,
+            start_date = excluded.start_date,
+            comp_date = excluded.comp_date,
+            eng_stat = excluded.eng_stat,
+            org_guid = excluded.org_guid,
+            eng_rein_force_guid = excluded.eng_rein_force_guid,
+            note = excluded.note,
+            coll_time = excluded.coll_time,
+            upd_time = excluded.upd_time,
+            rec_pers = excluded.rec_pers
+    </insert>
+
+    <insert id="syncFromAttEngWadi">
+        insert into att_eng_base (guid, pguid, eng_name, eng_guid, impo_grad, appr_budg, start_date, comp_date,
+                                  eng_stat, org_guid, oflp_code, if_rein_force, proj_guid, stat, start_long, start_lat,
+                                  end_long, end_lat, start_loc, end_loc, firs_poin_ad_guid, end_ad_guid, rv_guid,
+                                  eng_grad, eng_scal, note, coll_time, upd_time, rec_pers, eng_rein_force_guid)
+        select e.eng_guid, e.p_guid, e.eng_name, e.eng_guid, e.impo_grad, e.appr_budg, e.start_date, e.comp_date,
+               e.eng_stat, e.org_guid, e.oflp_code, e.if_rein_force, e.proj_guid, e.stat, e.start_long, e.start_lat,
+               e.end_long, e.end_lat, e.start_loc, e.end_loc, e.firs_poin_ad_guid, e.end_ad_guid, e.rv_guid,
+               e.eng_grad, e.eng_scal, e.note, COALESCE(e.coll_time, now()), COALESCE(e.upd_time, now()), e.rec_pers,
+               e.eng_rein_force_guid
+        from att_eng_wadi e
+        where e.eng_guid is not null and e.eng_guid != ''
+        on conflict (guid) do update set
+            pguid = excluded.pguid,
+            eng_name = excluded.eng_name,
+            eng_guid = excluded.eng_guid,
+            impo_grad = excluded.impo_grad,
+            appr_budg = excluded.appr_budg,
+            start_date = excluded.start_date,
+            comp_date = excluded.comp_date,
+            eng_stat = excluded.eng_stat,
+            org_guid = excluded.org_guid,
+            oflp_code = excluded.oflp_code,
+            if_rein_force = excluded.if_rein_force,
+            proj_guid = excluded.proj_guid,
+            stat = excluded.stat,
+            start_long = excluded.start_long,
+            start_lat = excluded.start_lat,
+            end_long = excluded.end_long,
+            end_lat = excluded.end_lat,
+            start_loc = excluded.start_loc,
+            end_loc = excluded.end_loc,
+            firs_poin_ad_guid = excluded.firs_poin_ad_guid,
+            end_ad_guid = excluded.end_ad_guid,
+            rv_guid = excluded.rv_guid,
+            eng_grad = excluded.eng_grad,
+            eng_scal = excluded.eng_scal,
+            note = excluded.note,
+            coll_time = excluded.coll_time,
+            upd_time = excluded.upd_time,
+            rec_pers = excluded.rec_pers,
+            eng_rein_force_guid = excluded.eng_rein_force_guid
+    </insert>
+
+    <insert id="syncFromAttEngSd">
+        insert into att_eng_base (guid, pguid, ad_guid, eng_name, eng_guid, impo_grad, eng_scal, appr_budg,
+                                  if_rein_force, tot_cap, des_fl_stand, oflp_code, proj_guid, cen_long, cen_lat, stat,
+                                  start_date, comp_date, eng_stat, org_guid, eng_rein_force_guid, note, coll_time,
+                                  upd_time, rec_pers)
+        select e.eng_guid, e.p_guid, e.ad_guid, e.eng_name, e.eng_guid, e.impo_grad, e.eng_scal, e.appr_budg,
+               e.if_rein_force, e.tot_cap, e.des_fl_sta, e.oflp_code, e.proj_guid, e.cen_long, e.cen_lat, e.stat,
+               e.start_date, e.comp_date, e.eng_stat, e.org_guid, e.eng_rein_force_guid, e.note,
+               COALESCE(e.coll_time, now()), COALESCE(e.upd_time, now()), e.rec_pers
+        from att_eng_sd e
+        where e.eng_guid is not null and e.eng_guid != ''
+        on conflict (guid) do update set
+            pguid = excluded.pguid,
+            ad_guid = excluded.ad_guid,
+            eng_name = excluded.eng_name,
+            eng_guid = excluded.eng_guid,
+            impo_grad = excluded.impo_grad,
+            eng_scal = excluded.eng_scal,
+            appr_budg = excluded.appr_budg,
+            if_rein_force = excluded.if_rein_force,
+            tot_cap = excluded.tot_cap,
+            des_fl_stand = excluded.des_fl_stand,
+            oflp_code = excluded.oflp_code,
+            proj_guid = excluded.proj_guid,
+            cen_long = excluded.cen_long,
+            cen_lat = excluded.cen_lat,
+            stat = excluded.stat,
+            start_date = excluded.start_date,
+            comp_date = excluded.comp_date,
+            eng_stat = excluded.eng_stat,
+            org_guid = excluded.org_guid,
+            eng_rein_force_guid = excluded.eng_rein_force_guid,
+            note = excluded.note,
+            coll_time = excluded.coll_time,
+            upd_time = excluded.upd_time,
+            rec_pers = excluded.rec_pers
+    </insert>
+
+    <insert id="syncFromAttEngRes">
+        insert into att_eng_base (guid, pguid, ad_guid, eng_name, eng_guid, impo_grad, eng_scal, appr_budg,
+                                  if_rein_force, eng_grad, tot_cap, res_code, rv_guid, des_fl_stand, oflp_code,
+                                  proj_guid, cen_long, cen_lat, stat, start_date, comp_date, eng_stat, org_guid,
+                                  eng_rein_force_guid, note, coll_time, upd_time, rec_pers)
+        select e.eng_guid, e.p_guid, e.ad_guid, e.eng_name, e.eng_guid, e.impo_grad, e.eng_scal, e.appr_budg,
+               e.if_rein_force, e.eng_grad, e.tot_cap, e.res_code, e.rv_guid, e.des_fl_stand, e.oflp_code,
+               e.proj_guid, e.cen_long, e.cen_lat, e.stat, e.start_date, e.comp_date, e.eng_stat, e.org_guid,
+               e.eng_rein_force_guid, e.note, COALESCE(e.coll_time, now()), COALESCE(e.upd_time, now()), e.rec_pers
+        from att_eng_res e
+        where e.eng_guid is not null and e.eng_guid != ''
+        on conflict (guid) do update set
+            pguid = excluded.pguid,
+            ad_guid = excluded.ad_guid,
+            eng_name = excluded.eng_name,
+            eng_guid = excluded.eng_guid,
+            impo_grad = excluded.impo_grad,
+            eng_scal = excluded.eng_scal,
+            appr_budg = excluded.appr_budg,
+            if_rein_force = excluded.if_rein_force,
+            eng_grad = excluded.eng_grad,
+            tot_cap = excluded.tot_cap,
+            res_code = excluded.res_code,
+            rv_guid = excluded.rv_guid,
+            des_fl_stand = excluded.des_fl_stand,
+            oflp_code = excluded.oflp_code,
+            proj_guid = excluded.proj_guid,
+            cen_long = excluded.cen_long,
+            cen_lat = excluded.cen_lat,
+            stat = excluded.stat,
+            start_date = excluded.start_date,
+            comp_date = excluded.comp_date,
+            eng_stat = excluded.eng_stat,
+            org_guid = excluded.org_guid,
+            eng_rein_force_guid = excluded.eng_rein_force_guid,
+            note = excluded.note,
+            coll_time = excluded.coll_time,
+            upd_time = excluded.upd_time,
+            rec_pers = excluded.rec_pers
+    </insert>
+
+    <insert id="syncFromAttEngPust">
+        insert into att_eng_base (guid, pguid, ad_guid, lk_guid, eng_name, eng_guid, impo_grad, eng_scal, appr_budg,
+                                  if_rein_force, eng_grad, rv_guid, oflp_code, proj_guid, cen_long, cen_lat, stat,
+                                  start_date, comp_date, eng_stat, org_guid, eng_rein_force_guid, note, coll_time,
+                                  upd_time, rec_pers)
+        select e.eng_guid, e.p_guid, e.ad_guid, e.lk_guid, e.eng_name, e.eng_guid, e.impo_grad, e.eng_scal,
+               e.appr_budg, e.if_rein_force, e.eng_grad, e.rv_guid, e.oflp_code, e.proj_guid, e.cen_long, e.cen_lat,
+               e.stat, e.start_date, e.comp_date, e.eng_stat, e.org_guid, e.eng_rein_force_guid, e.note,
+               COALESCE(e.coll_time, now()), COALESCE(e.upd_time, now()), e.rec_pers
+        from att_eng_pust e
+        where e.eng_guid is not null and e.eng_guid != ''
+        on conflict (guid) do update set
+            pguid = excluded.pguid,
+            ad_guid = excluded.ad_guid,
+            lk_guid = excluded.lk_guid,
+            eng_name = excluded.eng_name,
+            eng_guid = excluded.eng_guid,
+            impo_grad = excluded.impo_grad,
+            eng_scal = excluded.eng_scal,
+            appr_budg = excluded.appr_budg,
+            if_rein_force = excluded.if_rein_force,
+            eng_grad = excluded.eng_grad,
+            rv_guid = excluded.rv_guid,
+            oflp_code = excluded.oflp_code,
+            proj_guid = excluded.proj_guid,
+            cen_long = excluded.cen_long,
+            cen_lat = excluded.cen_lat,
+            stat = excluded.stat,
+            start_date = excluded.start_date,
+            comp_date = excluded.comp_date,
+            eng_stat = excluded.eng_stat,
+            org_guid = excluded.org_guid,
+            eng_rein_force_guid = excluded.eng_rein_force_guid,
+            note = excluded.note,
+            coll_time = excluded.coll_time,
+            upd_time = excluded.upd_time,
+            rec_pers = excluded.rec_pers
+    </insert>
+
+    <insert id="syncFromAttEngOthe">
+        insert into att_eng_base (guid, pguid, ad_guid, eng_name, eng_guid, impo_grad, appr_budg, start_date,
+                                  comp_date, eng_stat, org_guid, oflp_code, if_rein_force, proj_guid, stat, cen_long,
+                                  cen_lat, note, coll_time, upd_time, rec_pers, eng_rein_force_guid)
+        select e.eng_guid, e.p_guid, e.ad_guid, e.eng_name, e.eng_guid, e.impo_grad, e.appr_budg, e.start_date,
+               e.comp_date, e.eng_stat, e.org_guid, e.oflp_code, e.if_rein_force, e.proj_guid, e.stat, e.cen_long,
+               e.cen_lat, e.note, COALESCE(e.coll_time, now()), COALESCE(e.upd_time, now()), e.rec_pers,
+               e.eng_rein_force_guid
+        from att_eng_othe e
+        where e.eng_guid is not null and e.eng_guid != ''
+        on conflict (guid) do update set
+            pguid = excluded.pguid,
+            ad_guid = excluded.ad_guid,
+            eng_name = excluded.eng_name,
+            eng_guid = excluded.eng_guid,
+            impo_grad = excluded.impo_grad,
+            appr_budg = excluded.appr_budg,
+            start_date = excluded.start_date,
+            comp_date = excluded.comp_date,
+            eng_stat = excluded.eng_stat,
+            org_guid = excluded.org_guid,
+            oflp_code = excluded.oflp_code,
+            if_rein_force = excluded.if_rein_force,
+            proj_guid = excluded.proj_guid,
+            stat = excluded.stat,
+            cen_long = excluded.cen_long,
+            cen_lat = excluded.cen_lat,
+            note = excluded.note,
+            coll_time = excluded.coll_time,
+            upd_time = excluded.upd_time,
+            rec_pers = excluded.rec_pers,
+            eng_rein_force_guid = excluded.eng_rein_force_guid
+    </insert>
+
+    <insert id="syncFromAttEngIrr">
+        insert into att_eng_base (guid, pguid, ad_guid, eng_name, eng_guid, impo_grad, eng_scal, appr_budg,
+                                  if_rein_force, rv_guid, oflp_code, proj_guid, cen_long, cen_lat, stat, start_date,
+                                  comp_date, eng_stat, org_guid, eng_rein_force_guid, note, coll_time, upd_time,
+                                  rec_pers)
+        select e.eng_guid, e.p_guid, e.ad_guid, e.eng_name, e.eng_guid, e.impo_grad, e.eng_scal, e.appr_budg,
+               e.if_rein_force, e.rv_guid, e.oflp_code, e.proj_guid, e.cen_long, e.cen_lat, e.stat, e.start_date,
+               e.comp_date, e.eng_stat, e.org_guid, e.eng_rein_force_guid, e.note, COALESCE(e.coll_time, now()),
+               COALESCE(e.upd_time, now()), e.rec_pers
+        from att_eng_irr e
+        where e.eng_guid is not null and e.eng_guid != ''
+        on conflict (guid) do update set
+            pguid = excluded.pguid,
+            ad_guid = excluded.ad_guid,
+            eng_name = excluded.eng_name,
+            eng_guid = excluded.eng_guid,
+            impo_grad = excluded.impo_grad,
+            eng_scal = excluded.eng_scal,
+            appr_budg = excluded.appr_budg,
+            if_rein_force = excluded.if_rein_force,
+            rv_guid = excluded.rv_guid,
+            oflp_code = excluded.oflp_code,
+            proj_guid = excluded.proj_guid,
+            cen_long = excluded.cen_long,
+            cen_lat = excluded.cen_lat,
+            stat = excluded.stat,
+            start_date = excluded.start_date,
+            comp_date = excluded.comp_date,
+            eng_stat = excluded.eng_stat,
+            org_guid = excluded.org_guid,
+            eng_rein_force_guid = excluded.eng_rein_force_guid,
+            note = excluded.note,
+            coll_time = excluded.coll_time,
+            upd_time = excluded.upd_time,
+            rec_pers = excluded.rec_pers
+    </insert>
+
+    <insert id="syncFromAttEngHyst">
+        insert into att_eng_base (guid, pguid, ad_guid, eng_name, eng_guid, impo_grad, eng_scal, appr_budg,
+                                  if_rein_force, eng_grad, tot_cap, res_code, rv_guid, oflp_code, proj_guid, cen_long,
+                                  cen_lat, stat, start_date, comp_date, eng_stat, org_guid, eng_rein_force_guid, note,
+                                  coll_time, upd_time, rec_pers)
+        select e.eng_guid, e.p_guid, e.ad_guid, e.eng_name, e.eng_guid, e.impo_grad, e.eng_scal, e.appr_budg,
+               e.if_rein_force, e.eng_grad, e.tot_cap, e.res_code, e.rv_guid, e.oflp_code, e.proj_guid, e.cen_long,
+               e.cen_lat, e.stat, e.start_date, e.comp_date, e.eng_stat, e.org_guid, e.eng_rein_force_guid, e.note,
+               COALESCE(e.coll_time, now()), COALESCE(e.upd_time, now()), e.rec_pers
+        from att_eng_hyst e
+        where e.eng_guid is not null and e.eng_guid != ''
+        on conflict (guid) do update set
+            pguid = excluded.pguid,
+            ad_guid = excluded.ad_guid,
+            eng_name = excluded.eng_name,
+            eng_guid = excluded.eng_guid,
+            impo_grad = excluded.impo_grad,
+            eng_scal = excluded.eng_scal,
+            appr_budg = excluded.appr_budg,
+            if_rein_force = excluded.if_rein_force,
+            eng_grad = excluded.eng_grad,
+            tot_cap = excluded.tot_cap,
+            res_code = excluded.res_code,
+            rv_guid = excluded.rv_guid,
+            oflp_code = excluded.oflp_code,
+            proj_guid = excluded.proj_guid,
+            cen_long = excluded.cen_long,
+            cen_lat = excluded.cen_lat,
+            stat = excluded.stat,
+            start_date = excluded.start_date,
+            comp_date = excluded.comp_date,
+            eng_stat = excluded.eng_stat,
+            org_guid = excluded.org_guid,
+            eng_rein_force_guid = excluded.eng_rein_force_guid,
+            note = excluded.note,
+            coll_time = excluded.coll_time,
+            upd_time = excluded.upd_time,
+            rec_pers = excluded.rec_pers
+    </insert>
+
+    <insert id="syncFromAttEngDike">
+        insert into att_eng_base (guid, pguid, lk_guid, eng_name, eng_guid, impo_grad, appr_budg, start_date,
+                                  comp_date, eng_stat, org_guid, oflp_code, if_rein_force, proj_guid, stat,
+                                  start_long, start_lat, end_long, end_lat, start_loc, end_loc, firs_poin_ad_guid,
+                                  end_ad_guid, rv_guid, note, coll_time, upd_time, rec_pers, eng_rein_force_guid)
+        select e.eng_guid, e.p_guid, e.lk_guid, e.eng_name, e.eng_guid, e.impo_grad, e.appr_budg, e.start_date,
+               e.comp_date, e.eng_stat, e.org_guid, e.oflp_code, e.if_rein_force, e.proj_guid, e.stat, e.start_long,
+               e.start_lat, e.end_long, e.end_lat, e.start_loc, e.end_loc, e.firs_poin_ad_guid, e.end_ad_guid,
+               e.rv_guid, e.note, COALESCE(e.coll_time, now()), COALESCE(e.upd_time, now()), e.rec_pers,
+               e.eng_rein_force_guid
+        from att_eng_dike e
+        where e.eng_guid is not null and e.eng_guid != ''
+        on conflict (guid) do update set
+            pguid = excluded.pguid,
+            lk_guid = excluded.lk_guid,
+            eng_name = excluded.eng_name,
+            eng_guid = excluded.eng_guid,
+            impo_grad = excluded.impo_grad,
+            appr_budg = excluded.appr_budg,
+            start_date = excluded.start_date,
+            comp_date = excluded.comp_date,
+            eng_stat = excluded.eng_stat,
+            org_guid = excluded.org_guid,
+            oflp_code = excluded.oflp_code,
+            if_rein_force = excluded.if_rein_force,
+            proj_guid = excluded.proj_guid,
+            stat = excluded.stat,
+            start_long = excluded.start_long,
+            start_lat = excluded.start_lat,
+            end_long = excluded.end_long,
+            end_lat = excluded.end_lat,
+            start_loc = excluded.start_loc,
+            end_loc = excluded.end_loc,
+            firs_poin_ad_guid = excluded.firs_poin_ad_guid,
+            end_ad_guid = excluded.end_ad_guid,
+            rv_guid = excluded.rv_guid,
+            note = excluded.note,
+            coll_time = excluded.coll_time,
+            upd_time = excluded.upd_time,
+            rec_pers = excluded.rec_pers,
+            eng_rein_force_guid = excluded.eng_rein_force_guid
+    </insert>
+
+    <insert id="syncFromAttEngCws">
+        insert into att_eng_base (guid, pguid, ad_guid, eng_name, eng_guid, impo_grad, eng_scal, appr_budg,
+                                  if_rein_force, oflp_code, proj_guid, cen_long, cen_lat, stat, start_date, comp_date,
+                                  eng_stat, org_guid, eng_rein_force_guid, note, coll_time, upd_time, rec_pers,
+                                  eng_type)
+        select e.eng_guid, e.p_guid, e.ad_guid, e.eng_name, e.eng_guid, e.impo_grad, e.eng_scal, e.appr_budg,
+               e.if_rein_force, e.oflp_code, e.proj_guid, e.cen_long, e.cen_lat, e.stat, e.start_date, e.comp_date,
+               e.eng_stat, e.org_guid, e.eng_rein_force_guid, e.note, COALESCE(e.coll_time, now()),
+               COALESCE(e.upd_time, now()), e.rec_pers, e.eng_type
+        from att_eng_cws e
+        where e.eng_guid is not null and e.eng_guid != ''
+        on conflict (guid) do update set
+            pguid = excluded.pguid,
+            ad_guid = excluded.ad_guid,
+            eng_name = excluded.eng_name,
+            eng_guid = excluded.eng_guid,
+            impo_grad = excluded.impo_grad,
+            eng_scal = excluded.eng_scal,
+            appr_budg = excluded.appr_budg,
+            if_rein_force = excluded.if_rein_force,
+            oflp_code = excluded.oflp_code,
+            proj_guid = excluded.proj_guid,
+            cen_long = excluded.cen_long,
+            cen_lat = excluded.cen_lat,
+            stat = excluded.stat,
+            start_date = excluded.start_date,
+            comp_date = excluded.comp_date,
+            eng_stat = excluded.eng_stat,
+            org_guid = excluded.org_guid,
+            eng_rein_force_guid = excluded.eng_rein_force_guid,
+            note = excluded.note,
+            coll_time = excluded.coll_time,
+            upd_time = excluded.upd_time,
+            rec_pers = excluded.rec_pers,
+            eng_type = excluded.eng_type
+    </insert>
 </mapper>

+ 8 - 20
gw-slaj/src/main/resources/mapper/slaj/infoquery/InfoQueryMapper.xml

@@ -4,17 +4,16 @@
 
     <!--
       按单位查询:只查本单位和下级单位(subOrgs 递归范围)。
-      单位 = att_org_base;所辖工程 = att_eng_base.org_guid;
-      重大危险源 = obj_haz.hidd_grad='2';重大隐患 = obj_hidd.hidd_grad='2'。
+      仅关联基础表:单位 = att_org_base + att_org_ext(单位性质)。
     -->
     <select id="selectOrgStatList"
             parameterType="com.goldenwater.slaj.infoquery.domain.OrgStatVo"
             resultType="com.goldenwater.slaj.infoquery.domain.OrgStatVo">
         WITH RECURSIVE subOrgs AS (
             SELECT guid FROM att_org_base WHERE guid = #{orgGuid}
-            UNION ALL
+            UNION
             SELECT e.org_guid FROM att_org_ext e WHERE e.admin_wiun_guid = #{orgGuid}
-            UNION ALL
+            UNION
             SELECT b.guid FROM att_org_base b
             INNER JOIN subOrgs s ON b.pguid = s.guid
         )
@@ -22,25 +21,14 @@
             o.guid AS org_guid,
             o.org_name AS org_name,
             o.org_code AS org_code,
-            e.wiun_prop AS wiun_prop,
-            coalesce(stat.eng_count, 0) AS eng_count,
-            coalesce(stat.major_haz_count, 0) AS major_haz_count,
-            coalesce(stat.major_hidd_count, 0) AS major_hidd_count
+            e.wiun_prop AS wiun_prop
         FROM att_org_base o
         INNER JOIN subOrgs so ON so.guid = o.guid
-        LEFT JOIN att_org_ext e ON e.org_guid = o.guid
         LEFT JOIN (
-            SELECT
-                u.guid AS org_guid,
-                count(DISTINCT eb.guid) AS eng_count,
-                count(DISTINCT CASE WHEN hz.hidd_grad = '2' THEN hz.guid END) AS major_haz_count,
-                count(DISTINCT CASE WHEN hd.hidd_grad = '2' THEN hd.guid END) AS major_hidd_count
-            FROM att_org_base u
-            LEFT JOIN att_eng_base eb ON eb.org_guid = u.guid
-            LEFT JOIN obj_haz hz ON hz.org_guid = u.guid
-            LEFT JOIN obj_hidd hd ON hd.org_guid = u.guid
-            GROUP BY u.guid
-        ) stat ON stat.org_guid = o.guid
+            SELECT DISTINCT ON (org_guid) org_guid, wiun_prop
+            FROM att_org_ext
+            ORDER BY org_guid
+        ) e ON e.org_guid = o.guid
         <where>
             <if test="orgName != null and orgName != ''">AND o.org_name LIKE '%' || #{orgName} || '%'</if>
         </where>

+ 12 - 3
gw-system/src/main/resources/mapper/system/SysDeptMapper.xml

@@ -16,6 +16,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<result property="status"     column="status"      />
 		<result property="delFlag"    column="del_flag"    />
 		<result property="orgType"    column="org_type"    />
+		<result property="orgCheckType" column="org_check_type" />
+		<result property="type"       column="type"        />
 		<result property="parentName" column="parent_name" />
 		<result property="createBy"   column="create_by"   />
 		<result property="createTime" column="create_time" />
@@ -25,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	</resultMap>
 
 	<sql id="selectDeptVo">
-        select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.org_type, d.create_by, d.create_time
+        select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.org_type, d.org_check_type, d.type, d.create_by, d.create_time
         from sys_dept d
     </sql>
 
@@ -61,7 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	</select>
 
     <select id="selectDeptById" parameterType="String" resultMap="SysDeptResult">
-		select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.org_type,
+		select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.org_type, d.org_check_type, d.type,
 			(select dept_name from sys_dept where dept_id = d.parent_id) parent_name
 		from sys_dept d
 		where d.dept_id = #{deptId}
@@ -77,7 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	</select>
 
 	<select id="selectChildrenDeptByParentId" resultMap="SysDeptResult">
-		select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time,
+		select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.org_type, d.org_check_type, d.type, d.create_by, d.create_time,
 		( (select count(1) from sys_dept where del_flag = '0' and parent_id = d.dept_id) > 0 ) as has_children
 		from sys_dept d
 		where d.del_flag = '0'
@@ -135,6 +137,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="email != null and email != ''">email,</if>
  			<if test="status != null">status,</if>
  			<if test="orgType != null and orgType != ''">org_type,</if>
+ 			<if test="orgCheckType != null and orgCheckType != ''">org_check_type,</if>
+ 			<if test="type != null and type != ''">type,</if>
  			<if test="createBy != null and createBy != ''">create_by,</if>
  			create_time
  		)values(
@@ -148,6 +152,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="email != null and email != ''">#{email},</if>
  			<if test="status != null">#{status},</if>
  			<if test="orgType != null and orgType != ''">#{orgType},</if>
+ 			<if test="orgCheckType != null and orgCheckType != ''">#{orgCheckType},</if>
+ 			<if test="type != null and type != ''">#{type},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
  			now()
  		)
@@ -164,6 +170,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="phone != null">phone = #{phone},</if>
  			<if test="email != null">email = #{email},</if>
  			<if test="status != null and status != ''">status = #{status},</if>
+ 			<if test="orgType != null and orgType != ''">org_type = #{orgType},</if>
+ 			<if test="orgCheckType != null and orgCheckType != ''">org_check_type = #{orgCheckType},</if>
+ 			<if test="type != null and type != ''">type = #{type},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  			update_time = now()
  		</set>

+ 75 - 1
gw-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -19,6 +19,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="loginIp"       column="login_ip"        />
         <result property="loginDate"     column="login_date"      />
         <result property="pwdUpdateDate" column="pwd_update_date" />
+        <result property="userType"         column="user_type"          />
+        <result property="locked"           column="locked"             />
+        <result property="nickname"         column="nickname"           />
+        <result property="categoryId"       column="category_id"        />
+        <result property="userNo"           column="user_no"            />
+        <result property="adCode"           column="ad_code"            />
+        <result property="qq"               column="qq"                 />
+        <result property="xlwb"             column="xlwb"               />
+        <result property="phone"            column="phone"              />
+        <result property="casn"             column="casn"               />
+        <result property="mac"              column="mac"                />
+        <result property="ip"               column="ip"                 />
+        <result property="idCard"           column="id_card"            />
+        <result property="otlcolCnknoqprn"  column="otlcol_cnknoqprn"   />
+        <result property="loginFromCaFlag"  column="login_from_ca_flag" />
+        <result property="loginTimes"       column="login_times"        />
+        <result property="sortNum"          column="sort_num"           />
+        <result property="version"          column="version"            />
+        <result property="tenantId"         column="tenant_id"          />
+        <result property="persType"         column="pers_type"          />
+        <result property="faxNumb"          column="fax_numb"           />
+        <result property="orgCheckType"     column="org_check_type"     />
         <result property="createBy"      column="create_by"       />
         <result property="createTime"    column="create_time"     />
         <result property="updateBy"      column="update_by"       />
@@ -49,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 	<sql id="selectUserVo">
         select u.user_id, u.dept_id, u.user_name, u.real_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.pwd_update_date, u.create_by, u.create_time, u.remark,
+        u.user_type, u.locked, u.nickname, u.category_id, u.user_no, u.ad_code, u.qq, u.xlwb, u.phone, u.casn, u.mac, u.ip, u.id_card, u.otlcol_cnknoqprn, u.login_from_ca_flag, u.login_times, u.sort_num, u.version, u.tenant_id, u.pers_type, u.fax_numb, u.org_check_type,
         d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
         r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
         from sys_user u
@@ -156,6 +179,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="password != null and password != ''">password,</if>
  			<if test="status != null and status != ''">status,</if>
  			<if test="pwdUpdateDate != null">pwd_update_date,</if>
+ 			<if test="userType != null and userType != ''">user_type,</if>
+ 			<if test="nickname != null and nickname != ''">nickname,</if>
+ 			<if test="categoryId != null and categoryId != ''">category_id,</if>
+ 			<if test="userNo != null and userNo != ''">user_no,</if>
+ 			<if test="adCode != null and adCode != ''">ad_code,</if>
+ 			<if test="qq != null and qq != ''">qq,</if>
+ 			<if test="xlwb != null and xlwb != ''">xlwb,</if>
+ 			<if test="phone != null and phone != ''">phone,</if>
+ 			<if test="casn != null and casn != ''">casn,</if>
+ 			<if test="mac != null and mac != ''">mac,</if>
+ 			<if test="ip != null and ip != ''">ip,</if>
+ 			<if test="idCard != null and idCard != ''">id_card,</if>
+ 			<if test="loginFromCaFlag != null">login_from_ca_flag,</if>
+ 			<if test="sortNum != null">sort_num,</if>
+ 			<if test="persType != null and persType != ''">pers_type,</if>
+ 			<if test="faxNumb != null and faxNumb != ''">fax_numb,</if>
+ 			<if test="orgCheckType != null and orgCheckType != ''">org_check_type,</if>
  			<if test="createBy != null and createBy != ''">create_by,</if>
  			<if test="remark != null and remark != ''">remark,</if>
  			create_time
@@ -171,6 +211,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="password != null and password != ''">#{password},</if>
  			<if test="status != null and status != ''">#{status},</if>
  			<if test="pwdUpdateDate != null">#{pwdUpdateDate},</if>
+ 			<if test="userType != null and userType != ''">#{userType},</if>
+ 			<if test="nickname != null and nickname != ''">#{nickname},</if>
+ 			<if test="categoryId != null and categoryId != ''">#{categoryId},</if>
+ 			<if test="userNo != null and userNo != ''">#{userNo},</if>
+ 			<if test="adCode != null and adCode != ''">#{adCode},</if>
+ 			<if test="qq != null and qq != ''">#{qq},</if>
+ 			<if test="xlwb != null and xlwb != ''">#{xlwb},</if>
+ 			<if test="phone != null and phone != ''">#{phone},</if>
+ 			<if test="casn != null and casn != ''">#{casn},</if>
+ 			<if test="mac != null and mac != ''">#{mac},</if>
+ 			<if test="ip != null and ip != ''">#{ip},</if>
+ 			<if test="idCard != null and idCard != ''">#{idCard},</if>
+ 			<if test="loginFromCaFlag != null">#{loginFromCaFlag},</if>
+ 			<if test="sortNum != null">#{sortNum},</if>
+ 			<if test="persType != null and persType != ''">#{persType},</if>
+ 			<if test="faxNumb != null and faxNumb != ''">#{faxNumb},</if>
+ 			<if test="orgCheckType != null and orgCheckType != ''">#{orgCheckType},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
  			<if test="remark != null and remark != ''">#{remark},</if>
  			now()
@@ -183,11 +240,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="deptId != null and deptId != ''">dept_id = #{deptId},</if>
  			<if test="realName != null and realName != ''">real_name = #{realName},</if>
  			<if test="email != null ">email = #{email},</if>
- 			<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
+ 			<if test="phonenumber != null and phonenumber != ''">phonenumber = #{phonenumber},</if>
  			<if test="sex != null and sex != ''">sex = #{sex},</if>
  			<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
  			<if test="password != null and password != ''">password = #{password},</if>
  			<if test="status != null and status != ''">status = #{status},</if>
+ 			<if test="userType != null and userType != ''">user_type = #{userType},</if>
+ 			<if test="nickname != null and nickname != ''">nickname = #{nickname},</if>
+ 			<if test="categoryId != null and categoryId != ''">category_id = #{categoryId},</if>
+ 			<if test="userNo != null and userNo != ''">user_no = #{userNo},</if>
+ 			<if test="adCode != null and adCode != ''">ad_code = #{adCode},</if>
+ 			<if test="qq != null and qq != ''">qq = #{qq},</if>
+ 			<if test="xlwb != null and xlwb != ''">xlwb = #{xlwb},</if>
+ 			<if test="phone != null and phone != ''">phone = #{phone},</if>
+ 			<if test="casn != null and casn != ''">casn = #{casn},</if>
+ 			<if test="mac != null and mac != ''">mac = #{mac},</if>
+ 			<if test="ip != null and ip != ''">ip = #{ip},</if>
+ 			<if test="idCard != null and idCard != ''">id_card = #{idCard},</if>
+ 			<if test="loginFromCaFlag != null">login_from_ca_flag = #{loginFromCaFlag},</if>
+ 			<if test="sortNum != null">sort_num = #{sortNum},</if>
+ 			<if test="persType != null and persType != ''">pers_type = #{persType},</if>
+ 			<if test="faxNumb != null and faxNumb != ''">fax_numb = #{faxNumb},</if>
+ 			<if test="orgCheckType != null and orgCheckType != ''">org_check_type = #{orgCheckType},</if>
  			<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
  			<if test="loginDate != null">login_date = #{loginDate},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>

+ 11 - 2
gw-ui/src/components/FileUpload/index.vue

@@ -87,6 +87,11 @@ const props = defineProps({
   bisGuid: {
     type: String,
     default: ''
+  },
+  /** 业务多媒体模式的关联业务字段名(rel_bis_med.bis_rel_columns,非必填) */
+  bisRelColumns: {
+    type: String,
+    default: ''
   }
 })
 
@@ -108,10 +113,14 @@ const uploadUrl = computed(() => {
   return props.action
 })
 
-/** 动态计算上传附加数据:bizMedia 模式自动携带 bisTablename 和 bisGuid */
+/** 动态计算上传附加数据:bizMedia 模式自动携带 bisTablename、bisGuid 及可选的 bis_rel_columns */
 const uploadData = computed(() => {
   if (props.bizMedia) {
-    return { bisTablename: props.bisTablename, bisGuid: props.bisGuid }
+    const data = { bisTablename: props.bisTablename, bisGuid: props.bisGuid }
+    if (props.bisRelColumns) {
+      data.bis_rel_columns = props.bisRelColumns
+    }
+    return data
   }
   return props.data
 })

+ 41 - 0
gw-ui/src/utils/orgUnitType.js

@@ -0,0 +1,41 @@
+/**
+ * 单位类型常量与映射
+ *
+ * 单位类型(sys_dept.type / att_org_base.org_type / att_org_uwat_base.org_type / att_org_ext.org_type):
+ *   1 水行政 / 2 企事业单位 / 3 施工 / 4 监理
+ *
+ * 注意:att_org_uwat_ext.org_type 只有 1 施工 / 2 监理,
+ * 由单位类型映射而来:3 施工 → 1,4 监理 → 2。
+ */
+export const UNIT_TYPE_OPTIONS = [
+  { label: '水行政', value: '1' },
+  { label: '企事业单位', value: '2' },
+  { label: '施工', value: '3' },
+  { label: '监理', value: '4' }
+]
+
+/** 参建单位(非水利)可选单位类型:仅施工/监理 */
+export const UWAT_UNIT_TYPE_OPTIONS = [
+  { label: '施工', value: '3' },
+  { label: '监理', value: '4' }
+]
+
+/** 参建单位扩展表单位类型(att_org_uwat_ext.org_type):1 施工 / 2 监理 */
+export const UWAT_EXT_TYPE_OPTIONS = [
+  { label: '施工单位', value: '1' },
+  { label: '监理单位', value: '2' }
+]
+
+/** 单位类型(3施工/4监理)→ att_org_uwat_ext.org_type(1施工/2监理) */
+export function unitTypeToUwatExtType(unitType) {
+  if (unitType === '3') return '1'
+  if (unitType === '4') return '2'
+  return undefined
+}
+
+/** att_org_uwat_ext.org_type(1施工/2监理)→ 单位类型(3施工/4监理) */
+export function uwatExtTypeToUnitType(extOrgType) {
+  if (extOrgType === '1') return '3'
+  if (extOrgType === '2') return '4'
+  return undefined
+}

+ 1 - 1
gw-ui/src/views/slaj/eng/attengcws/index.vue

@@ -45,7 +45,7 @@
         <el-table-column label="工程名称" prop="engName" align="center" :show-overflow-tooltip="true"
           v-if="columns.engName.visible" />
         <el-table-column label="工程代码" prop="cwsCode" align="center" v-if="columns.cwsCode.visible" />
-        <el-table-column label="工程位置" prop="cwsLoc" align="center" v-if="columns.cwsLoc.visible" />
+        <el-table-column label="工程位置" prop="cwsLoc" align="center" v-if="columns.cwsLoc.visible"  :show-overflow-tooltip="true"/>
         <el-table-column label="工程类型" align="center" v-if="columns.engType.visible">
           <template #default="scope">
             <dict-tag :options="slaj_cws_eng_type" :value="scope.row.engType" />

+ 1 - 1
gw-ui/src/views/slaj/eng/attengothe/index.vue

@@ -34,7 +34,7 @@
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="工程名称" prop="engName" align="center" />
       <el-table-column label="工程代码" prop="objCode" align="center" />
-      <el-table-column label="工程位置" prop="engLoc" align="center" />
+      <el-table-column label="工程位置" prop="engLoc" align="center"  :show-overflow-tooltip="true"/>
       <el-table-column label="自定义1" prop="custom1" align="center" />
       <el-table-column label="自定义2" prop="custom2" align="center" />
       <el-table-column label="自定义3" prop="custom3" align="center" />

+ 0 - 3
gw-ui/src/views/slaj/infoquery/org/index.vue

@@ -40,9 +40,6 @@
             <dict-tag :options="slaj_wiun_prop" :value="scope.row.wiunProp" />
           </template>
         </el-table-column>
-        <el-table-column label="所辖工程数量" align="center" prop="engCount" width="120" />
-        <el-table-column label="重大危险源数量" align="center" prop="majorHazCount" width="130" />
-        <el-table-column label="重大隐患数量" align="center" prop="majorHiddCount" width="120" />
         <el-table-column label="操作" align="center" width="90" fixed="right">
           <template #default="scope">
             <el-button link type="primary" @click="handleDetail(scope.row)">详情</el-button>

+ 1 - 1
gw-ui/src/views/system/adbase/index.vue

@@ -35,7 +35,7 @@
         </el-form>
       </div>
 
-      <el-table :height="tableHeight" v-loading="loading" :data="attAdBaseList"
+      <el-table height="calc(100% - 100px)" v-loading="loading" :data="attAdBaseList"
         row-key="guid" lazy :load="loadChildren"
         :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
         @selection-change="handleSelectionChange">

+ 55 - 68
gw-ui/src/views/system/dept/index.vue

@@ -99,11 +99,19 @@
             <!-- 机构类型选择(新增时可选,修改时锁定) -->
             <el-row>
                <el-col :span="24">
-                  <el-form-item label="机构类型" prop="orgType">
-                     <el-select v-model="form.orgType" placeholder="请选择机构类型" :disabled="!!form.deptId" @change="onOrgTypeChange" style="width:100%">
-                        <el-option label="水利机构" value="1"/>
-                        <el-option label="参建单位" value="2"/>
-                        <el-option label="分包单位" value="3"/>
+                  <el-form-item label="机构类型" prop="orgCheckType">
+                     <el-radio-group v-model="form.orgCheckType" :disabled="!!form.deptId" @change="onOrgCheckTypeChange">
+                        <el-radio value="1">水利机构</el-radio>
+                        <el-radio value="2">非水利(参建单位)</el-radio>
+                     </el-radio-group>
+                  </el-form-item>
+               </el-col>
+            </el-row>
+            <el-row>
+               <el-col :span="12">
+                  <el-form-item label="单位类型" prop="unitType">
+                     <el-select v-model="form.unitType" placeholder="请选择单位类型" style="width:100%">
+                        <el-option v-for="d in unitTypeOptions" :key="d.value" :label="d.label" :value="d.value"/>
                      </el-select>
                   </el-form-item>
                </el-col>
@@ -143,11 +151,8 @@
             </el-row>
 
             <!-- 水利机构专属字段 -->
-            <template v-if="form.orgType === '1'">
+            <template v-if="form.orgCheckType === '1'">
                <el-row>
-                  <el-col :span="12">
-                     <el-form-item label="单位类型"><el-select v-model="form.extOrgType" placeholder="请选择" style="width:100%"><el-option v-for="d in slaj_ext_org_type" :key="d.value" :label="d.label" :value="d.value"/></el-select></el-form-item>
-                  </el-col>
                   <el-col :span="12">
                      <el-form-item label="单位规格"><el-select v-model="form.extOrgLevel" placeholder="请选择" style="width:100%"><el-option v-for="d in slaj_org_level" :key="d.value" :label="d.label" :value="d.value"/></el-select></el-form-item>
                   </el-col>
@@ -164,11 +169,8 @@
             </template>
 
             <!-- 参建单位专属字段 -->
-            <template v-if="form.orgType === '2'">
+            <template v-if="form.orgCheckType === '2'">
                <el-row>
-                  <el-col :span="12">
-                     <el-form-item label="单位类型"><el-select v-model="form.baseOrgType" placeholder="请选择" style="width:100%"><el-option v-for="d in slaj_org_type" :key="d.value" :label="d.label" :value="d.value"/></el-select></el-form-item>
-                  </el-col>
                   <el-col :span="12">
                      <el-form-item label="单位规格"><el-select v-model="form.baseOrgLevel" placeholder="请选择" style="width:100%"><el-option v-for="d in slaj_org_level" :key="d.value" :label="d.label" :value="d.value"/></el-select></el-form-item>
                   </el-col>
@@ -181,29 +183,6 @@
                </el-row>
             </template>
 
-            <!-- 分包单位专属字段 -->
-            <template v-if="form.orgType === '3'">
-               <el-row>
-                  <el-col :span="12">
-                     <el-form-item label="社会信用代码"><el-input v-model="form.wsubSocCreCode" placeholder="请输入"/></el-form-item>
-                  </el-col>
-                  <el-col :span="12">
-                     <el-form-item label="施工总承包资质"><el-select v-model="form.wsubContrQualGrad" placeholder="请选择" style="width:100%"><el-option v-for="d in slaj_contr_qual_grad" :key="d.value" :label="d.label" :value="d.value"/></el-select></el-form-item>
-                  </el-col>
-                  <el-col :span="12">
-                     <el-form-item label="项目负责人"><el-input v-model="form.wsubLegPers" placeholder="请输入"/></el-form-item>
-                  </el-col>
-                  <el-col :span="12">
-                     <el-form-item label="项目负责人电话"><el-input v-model="form.wsubLegPersTel" placeholder="请输入"/></el-form-item>
-                  </el-col>
-                  <el-col :span="12">
-                     <el-form-item label="安全员"><el-input v-model="form.wsubSafePers" placeholder="请输入"/></el-form-item>
-                  </el-col>
-                  <el-col :span="12">
-                     <el-form-item label="安全生产许可证编号"><el-input v-model="form.wsubSafeProdLiceCode" placeholder="请输入"/></el-form-item>
-                  </el-col>
-               </el-row>
-            </template>
          </el-form>
          <template #footer>
             <div class="dialog-footer">
@@ -219,14 +198,14 @@
 import { listDept, getDept, delDept, addDept, updateDept, updateDeptSort, listDeptExcludeChild, listDeptChildren } from "@/api/system/dept"
 import { addOrgWithDept } from "@/api/system/attOrgExt"
 import { addOrgUwatWithExt } from "@/api/system/attOrgUwatBase"
-import { addOrgWsubWithDept } from "@/api/system/attOrgWsub"
 import { useTableHeight } from '@/hooks/useTableHeight'
+import { UNIT_TYPE_OPTIONS, UWAT_UNIT_TYPE_OPTIONS, unitTypeToUwatExtType } from '@/utils/orgUnitType'
 
 const { tableHeight, containerRef } = useTableHeight()
 
 const { proxy } = getCurrentInstance()
 const { sys_normal_disable } = proxy.useDict("sys_normal_disable")
-const { slaj_ext_org_type, slaj_org_level, slaj_contr_qual_grad, slaj_org_type } = proxy.useDict("slaj_ext_org_type","slaj_org_level","slaj_contr_qual_grad","slaj_org_type")
+const { slaj_org_level } = proxy.useDict("slaj_org_level")
 
 const deptList = ref([])
 const deptTableRef = ref(null)
@@ -243,19 +222,15 @@ const data = reactive({
   form: {
     // 公共字段
     deptId: undefined, parentId: undefined, deptName: undefined,
-    orgType: undefined, orgCode: undefined,
+    orgCheckType: undefined, unitType: undefined, orgCode: undefined,
     leader: undefined, phone: undefined, email: undefined,
     status: "0", orderNum: 0,
     // 水利机构扩展
-    extOrgType: undefined, extOrgLevel: undefined, extWiunCode: undefined,
+    extOrgLevel: undefined, extWiunCode: undefined,
     extRegName: undefined, extLegRep: undefined,
     // 参建单位扩展
-    baseOrgType: undefined, baseOrgLevel: undefined, baseOrdernum: undefined,
+    baseOrgLevel: undefined, baseOrdernum: undefined,
     baseAdCode: undefined,
-    // 分包单位扩展
-    wsubSocCreCode: undefined, wsubContrQualGrad: undefined,
-    wsubLegPers: undefined, wsubLegPersTel: undefined,
-    wsubSafePers: undefined, wsubSafeProdLiceCode: undefined,
   },
   queryParams: {
     deptName: undefined,
@@ -266,7 +241,7 @@ const data = reactive({
   rules: {
     parentId: [{ required: true, message: "上级机构不能为空", trigger: "blur" }],
     deptName: [{ required: true, message: "机构名称不能为空", trigger: "blur" }],
-    orgType: [{ required: true, message: "机构类型不能为空", trigger: "change" }],
+    orgCheckType: [{ required: true, message: "机构类型不能为空", trigger: "change" }],
     orgCode: [{ required: true, message: "机构代码不能为空", trigger: "blur" }],
     orderNum: [{ required: true, message: "显示排序不能为空", trigger: "blur" }],
     email: [{ type: "email", message: "请输入正确的邮箱地址", trigger: ["blur", "change"] }],
@@ -276,6 +251,9 @@ const data = reactive({
 
 const { queryParams, form, rules } = toRefs(data)
 
+/** 单位类型选项:非水利(参建单位)仅施工/监理(att_org_uwat_ext 只有 1施工/2监理) */
+const unitTypeOptions = computed(() => form.value.orgCheckType === '2' ? UWAT_UNIT_TYPE_OPTIONS : UNIT_TYPE_OPTIONS)
+
 /** 查询机构列表(懒加载模式,支持搜索过滤,顶级分页) */
 function getList() {
   loading.value = true
@@ -304,21 +282,23 @@ function cancel() {
 function reset() {
   form.value = {
     deptId: undefined, parentId: undefined, deptName: undefined,
-    orgType: undefined, orgCode: undefined,
+    orgCheckType: undefined, unitType: undefined, orgCode: undefined,
     leader: undefined, phone: undefined, email: undefined,
     status: "0", orderNum: 0,
-    extOrgType: undefined, extOrgLevel: undefined, extWiunCode: undefined,
+    extOrgLevel: undefined, extWiunCode: undefined,
     extRegName: undefined, extLegRep: undefined,
-    baseOrgType: undefined, baseOrgLevel: undefined, baseOrdernum: undefined,
+    baseOrgLevel: undefined, baseOrdernum: undefined,
     baseAdCode: undefined,
-    wsubSocCreCode: undefined, wsubContrQualGrad: undefined,
-    wsubLegPers: undefined, wsubLegPersTel: undefined,
-    wsubSafePers: undefined, wsubSafeProdLiceCode: undefined,
   }
   proxy.resetForm("deptRef")
 }
 
-function onOrgTypeChange() {}
+/** 机构类型切换:非水利时清掉非施工/监理的单位类型 */
+function onOrgCheckTypeChange(val) {
+  if (val === '2' && form.value.unitType !== '3' && form.value.unitType !== '4') {
+    form.value.unitType = undefined
+  }
+}
 
 /** 搜索按钮操作 */
 function handleQuery() {
@@ -355,12 +335,16 @@ function handleUpdate(row) {
   })
   getDept(row.deptId).then(response => {
     form.value = response.data
+    // 旧数据兼容:org_check_type 为空时按 org_type 映射(1=水利机构,其余=非水利)
+    form.value.orgCheckType = response.data.orgCheckType || (response.data.orgType === '1' ? '1' : '2')
+    // 单位类型从 sys_dept.type 回显(type:1水行政 2企事业单位 3施工 4监理)
+    form.value.unitType = response.data.type
     open.value = true
     title.value = "修改机构"
   })
 }
 
-/** 提交按钮:按机构类型路由到不同复合 API */
+/** 提交按钮:按机构类型(org_check_type)路由到不同复合 API */
 function submitForm() {
   proxy.$refs["deptRef"].validate(valid => {
     if (!valid) return
@@ -373,24 +357,27 @@ function submitForm() {
       })
       return
     }
-    // 新增:按机构类型调用不同复合接口
+    // 新增:按机构类型(org_check_type)调用不同复合接口
     const dept = { parentId: form.value.parentId, deptName: form.value.deptName, leader: form.value.leader, phone: form.value.phone, email: form.value.email, status: form.value.status, orderNum: form.value.orderNum }
     const orgCode = form.value.orgCode
-    const orgType = form.value.orgType
+    const orgCheckType = form.value.orgCheckType
+    const unitType = form.value.unitType
+    if (!unitType) {
+      proxy.$modal.msgWarning("请选择单位类型")
+      return
+    }
     let promise
-    if (orgType === '1') {
-      // 水利机构
-      const ext = { wiunName: form.value.deptName, orgType: form.value.extOrgType, orgLevel: form.value.extOrgLevel, wiunCode: form.value.extWiunCode, regName: form.value.extRegName, legRep: form.value.extLegRep, proOrgGuid: form.value.parentId }
-      promise = addOrgWithDept({ dept, ext, orgCode })
-    } else if (orgType === '2') {
-      // 参建单位
-      const base = { orgName: form.value.deptName, orgCode, orgType: form.value.baseOrgType, orgLevel: form.value.baseOrgLevel, ordernum: form.value.baseOrdernum, adCode: form.value.baseAdCode, pguid: form.value.parentId, status: form.value.status }
-      const ext = { wiunName: form.value.deptName, proOrgGuid: form.value.parentId }
+    if (orgCheckType === '1') {
+      // 水利机构:单位类型同步到 att_org_base + att_org_ext
+      const deptData = { ...dept, orgCheckType: '1', type: unitType }
+      const ext = { wiunName: form.value.deptName, orgType: unitType, orgLevel: form.value.extOrgLevel, wiunCode: form.value.extWiunCode, regName: form.value.extRegName, legRep: form.value.extLegRep, proOrgGuid: form.value.parentId }
+      promise = addOrgWithDept({ dept: deptData, ext, orgCode })
+    } else if (orgCheckType === '2') {
+      // 非水利=参建单位:单位类型同步到 att_org_uwat_base + att_org_uwat_ext
+      const base = { orgName: form.value.deptName, orgCode, orgType: unitType, orgLevel: form.value.baseOrgLevel, ordernum: form.value.baseOrdernum, adCode: form.value.baseAdCode, pguid: form.value.parentId, status: form.value.status }
+      // att_org_uwat_ext.org_type 仅 1施工/2监理:由单位类型 3施工/4监理 映射
+      const ext = { wiunName: form.value.deptName, orgType: unitTypeToUwatExtType(unitType), proOrgGuid: form.value.parentId }
       promise = addOrgUwatWithExt({ base, ext })
-    } else if (orgType === '3') {
-      // 分包单位
-      const wsub = { wiunWsubName: form.value.deptName, socCreCode: form.value.wsubSocCreCode, contrQualGrad: form.value.wsubContrQualGrad, legPers: form.value.wsubLegPers, legPersTel: form.value.wsubLegPersTel, safePers: form.value.wsubSafePers, safeProdLiceCode: form.value.wsubSafeProdLiceCode }
-      promise = addOrgWsubWithDept({ dept, wsub, orgCode, orgType: form.value.extOrgType, orgLevel: form.value.extOrgLevel })
     } else {
       proxy.$modal.msgWarning("请选择机构类型")
       return

+ 39 - 23
gw-ui/src/views/system/orgInfo/index.vue

@@ -33,11 +33,11 @@
         </div>
       </template>
 
-      <el-form ref="formRef" :model="form" :rules="rules" label-width="180px" v-loading="loading"
+      <el-form ref="formRef" :model="form" :rules="rules" label-width="190px" v-loading="loading"
                style="padding: 20px;">
 
         <!-- 水利机构 (orgType=1) 单位信息填报 -->
-        <template v-if="form.orgType === '1'">
+        <template v-if="form.type === '1'">
           <el-divider content-position="left">单位信息填报</el-divider>
           <el-row :gutter="20">
             <el-col :span="12">
@@ -135,7 +135,7 @@
             <el-col :span="24">
               <el-form-item label="标准化证书附件">
                 <FileUpload v-model="form.stanCertFiles" :disabled="!editing" :limit="3" bizMedia
-                            bisTablename="ATT_ORG_EXT_STAN_CERT" :bisGuid="form.deptId">
+                            bisTablename="ORG_MESSAGE" :bisGuid="form.deptId" bisRelColumns="标准化证书">
                 </FileUpload>
                 <div class="upload-notice">
                   本平台为互联网非涉密平台,严禁处理、传输国家秘密。请确认扫描、传输的文件资料不涉及国家秘密。
@@ -145,7 +145,7 @@
             <el-col :span="24">
               <el-form-item label="营业执照附件">
                 <FileUpload v-model="form.bizLicenseFiles" :disabled="!editing" :limit="3" bizMedia
-                            bisTablename="ATT_ORG_EXT_BIZ_LICENSE" :bisGuid="form.deptId"/>
+                            bisTablename="ORG_MESSAGE" :bisGuid="form.deptId" bisRelColumns="营业执照"/>
                 <div class="upload-notice">
                   本平台为互联网非涉密平台,严禁处理、传输国家秘密。请确认扫描、传输的文件资料不涉及国家秘密。
                 </div>
@@ -154,7 +154,7 @@
             <el-col :span="24">
               <el-form-item label="承诺书附件">
                 <FileUpload v-model="form.pledgeFiles" :disabled="!editing" :limit="3" bizMedia
-                            bisTablename="ATT_ORG_EXT_PLEDGE" :bisGuid="form.deptId"/>
+                            bisTablename="ORG_MESSAGE" :bisGuid="form.deptId" bisRelColumns="承诺书"/>
                 <div class="upload-notice">
                   本平台为互联网非涉密平台,严禁处理、传输国家秘密。请确认扫描、传输的文件资料不涉及国家秘密。
                 </div>
@@ -164,7 +164,7 @@
         </template>
 
         <!-- 参建单位 (orgType=2) -->
-        <template v-if="form.orgType === '2'">
+        <template v-if="form.type === '2'">
           <el-divider content-position="left">基础信息</el-divider>
           <el-row :gutter="20">
             <el-col :span="12">
@@ -187,7 +187,7 @@
             <el-col :span="12">
               <el-form-item label="单位类型" prop="orgType">
                 <el-select v-model="form.orgType" :disabled="!editing" style="width:100%">
-                  <el-option v-for="d in slaj_org_type" :key="d.value" :label="d.label" :value="d.value"/>
+                  <el-option v-for="d in UNIT_TYPE_OPTIONS" :key="d.value" :label="d.label" :value="d.value"/>
                 </el-select>
               </el-form-item>
             </el-col>
@@ -366,7 +366,7 @@
         </template>
 
         <!-- 分包单位 (orgType=3) -->
-        <template v-if="form.orgType === '3'">
+        <template v-if="form.type === '3'">
           <el-divider content-position="left">基本信息</el-divider>
           <el-row :gutter="20">
             <el-col :span="12">
@@ -394,7 +394,7 @@
             <el-col :span="12">
               <el-form-item label="单位类型" prop="orgType">
                 <el-select v-model="form.orgType" :disabled="!editing" style="width:100%">
-                  <el-option v-for="d in slaj_ext_org_type" :key="d.value" :label="d.label" :value="d.value"/>
+                  <el-option v-for="d in UNIT_TYPE_OPTIONS" :key="d.value" :label="d.label" :value="d.value"/>
                 </el-select>
               </el-form-item>
             </el-col>
@@ -474,19 +474,20 @@ import useUserStore from '@/store/modules/user'
 import FileUpload from '@/components/FileUpload/index.vue'
 import {listMedia} from '@/api/slaj/eme'
 import {Check, Edit, OfficeBuilding, Refresh} from '@element-plus/icons-vue'
+import {UNIT_TYPE_OPTIONS, unitTypeToUwatExtType} from '@/utils/orgUnitType'
 
 const {proxy} = getCurrentInstance()
 const userStore = useUserStore()
 
 // 字典
 const {
-  slaj_org_level, slaj_org_type, slaj_org_status, slaj_area_type,
-  slaj_org_clien_type, slaj_ext_org_type, slaj_wiun_prop, slaj_if_wate_ente,
+  slaj_org_level, slaj_org_status, slaj_area_type,
+  slaj_org_clien_type, slaj_wiun_prop, slaj_if_wate_ente,
   slaj_is_leg_enti, slaj_if_mini_dire, slaj_contr_qual_grad, slaj_sup_qual_grad,
   slaj_stan_grad, slaj_fund_sour
 } = proxy.useDict(
-    'slaj_org_level', 'slaj_org_type', 'slaj_org_status', 'slaj_area_type',
-    'slaj_org_clien_type', 'slaj_ext_org_type', 'slaj_wiun_prop', 'slaj_if_wate_ente',
+    'slaj_org_level', 'slaj_org_status', 'slaj_area_type',
+    'slaj_org_clien_type', 'slaj_wiun_prop', 'slaj_if_wate_ente',
     'slaj_is_leg_enti', 'slaj_if_mini_dire', 'slaj_contr_qual_grad', 'slaj_sup_qual_grad',
     'slaj_stan_grad', 'slaj_fund_sour')
 
@@ -498,7 +499,7 @@ const originalForm = ref({})
 
 // 初始表单数据
 const EMPTY_FORM = {
-  deptId: '', deptName: '', orgType: '', orgCode: '', leader: '', phone: '', email: '', status: '0', note: '',
+  type: '', deptId: '', deptName: '', orgType: '', orgCode: '', leader: '', phone: '', email: '', status: '0', note: '',
   // 水利机构 — 填报字段
   socCreCode: '', adGuid: '', addr: '', jurd: '', stanGrad: '', fundSour: '',
   safetyLegPers: '', safetyLegPersTel: '', safeProdConta: '', safeProdContaTel: '',
@@ -554,13 +555,22 @@ function loadData() {
       proxy.$modal.msgWarning('未找到单位信息');
       return
     }
-
-    if (dept.orgType === '1') {
+    // 页面分区:1 水利机构 / 2 参建单位 / 3 分包单位
+    // 由 sys_dept.org_type 映射(1水利机构 2分包单位 3参建单位);旧数据 org_type 为空时按 org_check_type/type 兜底
+    const orgTypeMap = {'1': '1', '3': '2', '2': '3'}
+    form.type = orgTypeMap[dept.orgType]
+    if (!form.type) {
+      form.type = dept.orgCheckType === '1' ? '1'
+          : (dept.type === '3' || dept.type === '4') ? '2'
+              : dept.type || ''
+    }
+    if (form.type === '1') {
       // 水利机构:一个接口返回三表全部数据(后台 JOIN),前端只展示
       getAttOrgExt(orgGuid).then(r2 => {
         const data = r2.data
         if (data) {
           Object.assign(form, {...EMPTY_FORM})
+          form.type = '1'
           form.deptId = data.deptId || ''
           form.deptName = data.deptName || ''
           form.orgType = data.orgType || ''
@@ -585,12 +595,13 @@ function loadData() {
       }).catch(() => {
         loadAttachments(orgGuid, () => finishLoad())
       })
-    } else if (dept.orgType === '2') {
+    } else if (form.type === '2') {
       Promise.all([
         getAttOrgUwatBase(orgGuid),
         listAttOrgUwatExt({orgGuid, pageSize: 1})
       ]).then(([rBase, rExt]) => {
         const base = rBase.data
+        form.deptId = orgGuid
         if (base) {
           form.orgCode = base.orgCode;
           form.orgLevel = base.orgLevel;
@@ -631,10 +642,11 @@ function loadData() {
         }
         finishLoad()
       }).catch(() => finishLoad())
-    } else if (dept.orgType === '3') {
+    } else if (form.type === '3') {
       getAttOrgWsub(orgGuid).then(r2 => {
         const wsub = r2.data
         if (wsub) {
+          form.deptId = orgGuid
           form.orgCode = wsub.orgCode || ''
           form.socCreCode = wsub.socCreCode;
           form.contrQualGrad = wsub.contrQualGrad
@@ -720,7 +732,7 @@ function submitForm() {
     saving.value = true
 
     let promise
-    if (form.orgType === '1') {
+    if (form.type === '1') {
       promise = updateOrgWithDept({
         dept: {
           deptId: form.deptId,
@@ -748,7 +760,7 @@ function submitForm() {
         },
         orgCode: form.orgCode
       })
-    } else if (form.orgType === '2') {
+    } else if (form.type === '2') {
       promise = updateAttOrgUwatBase({
         guid: form.deptId, orgCode: form.orgCode, orgName: form.deptName, orgLevel: form.orgLevel,
         orgType: form.orgType, ordernum: form.ordernum, adCode: form.adCode, jurd: form.jurd,
@@ -760,7 +772,7 @@ function submitForm() {
           wiunName: form.deptName,
           socCreCode: form.socCreCode,
           orgClienType: form.orgClienType,
-          orgType: form.orgType,
+          orgType: unitTypeToUwatExtType(form.orgType),
           orgLevel: form.orgLevel,
           wiunCode: form.wiunCode,
           regName: form.regName,
@@ -782,9 +794,13 @@ function submitForm() {
           regLoc: form.regLoc,
           note: form.note
         }
-        return extData.guid ? updateAttOrgUwatExt(extData) : Promise.resolve()
+        return Promise.all([
+          extData.guid ? updateAttOrgUwatExt(extData) : Promise.resolve(),
+          // 同步 sys_dept.type(单位类型:1水行政 2企事业单位 3施工 4监理)
+          updateDept({deptId: form.deptId, type: form.orgType})
+        ])
       })
-    } else if (form.orgType === '3') {
+    } else if (form.type === '3') {
       promise = updateOrgWsubWithDept({
         dept: {
           deptId: form.deptId,

+ 5 - 4
gw-ui/src/views/system/orgext/index.vue

@@ -25,7 +25,7 @@
               </el-form-item>
               <el-form-item label="单位类型" prop="orgType">
                 <el-select v-model="queryParams.orgType" placeholder="请选择单位类型" clearable>
-                  <el-option v-for="dict in slaj_ext_org_type" :key="dict.value" :label="dict.label" :value="dict.value" />
+                  <el-option v-for="dict in UNIT_TYPE_OPTIONS" :key="dict.value" :label="dict.label" :value="dict.value" />
                 </el-select>
               </el-form-item>
 
@@ -41,7 +41,7 @@
         <el-table-column label="单位名称" align="center" prop="wiunName" :show-overflow-tooltip="true" />
         <el-table-column label="单位类型" align="center" prop="orgType" :show-overflow-tooltip="true">
           <template #default="scope">
-            <dict-tag :options="slaj_ext_org_type" :value="scope.row.orgType" />
+            <dict-tag :options="UNIT_TYPE_OPTIONS" :value="scope.row.orgType" />
           </template>
         </el-table-column>
         <el-table-column label="单位规格" align="center" prop="orgLevel" :show-overflow-tooltip="true">
@@ -108,7 +108,7 @@
                <el-col :span="12">
                   <el-form-item label="单位类型" prop="orgType">
                      <el-select v-model="form.orgType" placeholder="请选择单位类型" style="width:100%">
-                        <el-option v-for="dict in slaj_ext_org_type" :key="dict.value" :label="dict.label" :value="dict.value" />
+                        <el-option v-for="dict in UNIT_TYPE_OPTIONS" :key="dict.value" :label="dict.label" :value="dict.value" />
                      </el-select>
                   </el-form-item>
                </el-col>
@@ -460,11 +460,12 @@ import TreePanel from "@/components/TreePanel"
 import OrgSelect from "@/components/OrgSelect"
 import { useTableHeight } from '@/hooks/useTableHeight'
 import { Plus, Delete, Search, Refresh, OfficeBuilding } from '@element-plus/icons-vue'
+import { UNIT_TYPE_OPTIONS } from '@/utils/orgUnitType'
 
 const { tableHeight, containerRef } = useTableHeight()
 const { proxy } = getCurrentInstance()
 
-const { slaj_org_clien_type, slaj_ext_org_type, slaj_org_level, slaj_wiun_prop, slaj_if_wate_ente, slaj_is_leg_enti, slaj_if_mini_dire, slaj_contr_qual_grad, slaj_sup_qual_grad, slaj_stan_grad, slaj_fund_sour } = proxy.useDict("slaj_org_clien_type", "slaj_ext_org_type", "slaj_org_level", "slaj_wiun_prop", "slaj_if_wate_ente", "slaj_is_leg_enti", "slaj_if_mini_dire", "slaj_contr_qual_grad", "slaj_sup_qual_grad", "slaj_stan_grad", "slaj_fund_sour")
+const { slaj_org_clien_type, slaj_org_level, slaj_wiun_prop, slaj_if_wate_ente, slaj_is_leg_enti, slaj_if_mini_dire, slaj_contr_qual_grad, slaj_sup_qual_grad, slaj_stan_grad, slaj_fund_sour } = proxy.useDict("slaj_org_clien_type", "slaj_org_level", "slaj_wiun_prop", "slaj_if_wate_ente", "slaj_is_leg_enti", "slaj_if_mini_dire", "slaj_contr_qual_grad", "slaj_sup_qual_grad", "slaj_stan_grad", "slaj_fund_sour")
 
 const attOrgExtList = ref([])
 const open = ref(false)

+ 16 - 6
gw-ui/src/views/system/orguwatbase/index.vue

@@ -28,7 +28,7 @@
               </el-form-item>
               <el-form-item label="类型" prop="orgType">
                 <el-select v-model="queryParams.orgType" style="width: 120px;" placeholder="请选择类型" clearable>
-                  <el-option v-for="dict in slaj_org_type" :key="dict.value" :label="dict.label" :value="dict.value" />
+                  <el-option v-for="dict in UNIT_TYPE_OPTIONS" :key="dict.value" :label="dict.label" :value="dict.value" />
                 </el-select>
               </el-form-item>
               <el-form-item label="状态" prop="status">
@@ -55,7 +55,7 @@
         </el-table-column>
         <el-table-column label="类型" align="center" prop="orgType" :show-overflow-tooltip="true">
           <template #default="scope">
-            <dict-tag :options="slaj_org_type" :value="scope.row.orgType" />
+            <dict-tag :options="UNIT_TYPE_OPTIONS" :value="scope.row.orgType" />
           </template>
         </el-table-column>
         <el-table-column label="顺序号" align="center" prop="ordernum" :show-overflow-tooltip="true" />
@@ -127,8 +127,8 @@
                </el-col>
                <el-col :span="12">
                   <el-form-item label="单位类型" prop="orgType">
-                     <el-select v-model="baseForm.orgType" placeholder="请选择类型" clearable style="width:100%">
-                        <el-option v-for="dict in slaj_org_type" :key="dict.value" :label="dict.label" :value="dict.value" />
+                     <el-select v-model="baseForm.orgType" placeholder="请选择单位类型" clearable style="width:100%" @change="handleBaseOrgTypeChange">
+                        <el-option v-for="dict in UNIT_TYPE_OPTIONS" :key="dict.value" :label="dict.label" :value="dict.value" />
                      </el-select>
                   </el-form-item>
                </el-col>
@@ -361,12 +361,12 @@ import { listAttAdBase, getAttAdBase } from "@/api/system/attAdBase"
 import TreePanel from "@/components/TreePanel"
 import { useTableHeight } from '@/hooks/useTableHeight'
 import { Plus, Delete, Search, Refresh, OfficeBuilding } from '@element-plus/icons-vue'
+import { UNIT_TYPE_OPTIONS, unitTypeToUwatExtType } from '@/utils/orgUnitType'
 
 const { tableHeight, containerRef } = useTableHeight()
 const { proxy } = getCurrentInstance()
 const {
   slaj_org_level,
-  slaj_org_type,
   slaj_org_status,
   slaj_area_type,
   slaj_org_clien_type,
@@ -380,7 +380,7 @@ const {
   slaj_stan_grad,
   slaj_fund_sour
 } = proxy.useDict(
-  "slaj_org_level", "slaj_org_type", "slaj_org_status", "slaj_area_type",
+  "slaj_org_level", "slaj_org_status", "slaj_area_type",
   "slaj_org_clien_type", "slaj_uwat_org_type", "slaj_wiun_prop",
   "slaj_if_wate_ente", "slaj_is_leg_enti", "slaj_if_mini_dire",
   "slaj_contr_qual_grad", "slaj_sup_qual_grad", "slaj_stan_grad", "slaj_fund_sour"
@@ -540,6 +540,11 @@ const data = reactive({
 
 const { queryParams, baseForm, extForm, rules, extRules } = toRefs(data)
 
+/** 基础表单位类型变化时,同步扩展表类型(att_org_uwat_ext.org_type 仅 1施工/2监理) */
+function handleBaseOrgTypeChange(val) {
+  extForm.value.orgType = unitTypeToUwatExtType(val)
+}
+
 /** 远程搜索水利机构(按单位名称模糊查询,存 orgGuid 显示 wiunName) */
 function remoteSearchWiun(query) {
   if (!query) {
@@ -765,6 +770,11 @@ async function submitForm() {
   // 冗余字段从 base 同步到 ext:上级机构、单位名称
   extForm.value.wiunName = baseForm.value.orgName
   extForm.value.proOrgGuid = baseForm.value.pguid
+  // 扩展表单位类型由基础表单位类型映射(3施工→1,4监理→2),保证落库一致
+  const mappedExtType = unitTypeToUwatExtType(baseForm.value.orgType)
+  if (mappedExtType) {
+    extForm.value.orgType = mappedExtType
+  }
 
   if (isEdit) {
     await updateAttOrgUwatBase(baseForm.value)

+ 3 - 2
gw-ui/src/views/system/orgwsub/index.vue

@@ -139,7 +139,7 @@
                <el-col :span="12">
                   <el-form-item label="单位类型" prop="orgType">
                      <el-select v-model="form.orgType" placeholder="请选择单位类型" style="width:100%">
-                        <el-option v-for="dict in slaj_ext_org_type" :key="dict.value" :label="dict.label" :value="dict.value" />
+                        <el-option v-for="dict in UNIT_TYPE_OPTIONS" :key="dict.value" :label="dict.label" :value="dict.value" />
                      </el-select>
                   </el-form-item>
                </el-col>
@@ -165,11 +165,12 @@ import { listAttOrgWsub, getAttOrgWsub, delOrgWsubWithDept, addOrgWsubWithDept,
 import OrgSelect from "@/components/OrgSelect"
 import { useTableHeight } from '@/hooks/useTableHeight'
 import { Plus, Delete, Search, Refresh, OfficeBuilding } from '@element-plus/icons-vue'
+import { UNIT_TYPE_OPTIONS } from '@/utils/orgUnitType'
 
 const { tableHeight, containerRef } = useTableHeight()
 const { proxy } = getCurrentInstance()
 
-const { slaj_contr_qual_grad, slaj_ext_org_type, slaj_org_level } = proxy.useDict("slaj_contr_qual_grad", "slaj_ext_org_type", "slaj_org_level")
+const { slaj_contr_qual_grad, slaj_org_level } = proxy.useDict("slaj_contr_qual_grad", "slaj_org_level")
 
 const attOrgWsubList = ref([])
 const open = ref(false)

+ 355 - 96
gw-ui/src/views/system/user/index.vue

@@ -6,8 +6,8 @@
     <div class="tree-sidebar-content">
       <div class="content-inner">
         <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
-          <el-form-item label="用户名称" prop="userName">
-            <el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable style="width: 240px"
+          <el-form-item label="登录账号" prop="userName">
+            <el-input v-model="queryParams.userName" placeholder="请输入登录账号" clearable style="width: 240px"
               @keyup.enter="handleQuery" />
           </el-form-item>
           <el-form-item label="手机号码" prop="phonenumber">
@@ -58,9 +58,9 @@
           <el-table :height="tableHeight" v-loading="loading" :data="userList"
             @selection-change="handleSelectionChange">
             <el-table-column type="selection" width="50" align="center" />
-            <el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns.userName.visible"
+            <el-table-column label="登录账号" align="center" key="userName" prop="userName" v-if="columns.userName.visible"
               :show-overflow-tooltip="true" />
-            <el-table-column label="用户昵称" align="center" key="realName" prop="realName" v-if="columns.realName.visible"
+            <el-table-column label="用户姓名" align="center" key="realName" prop="realName" v-if="columns.realName.visible"
               :show-overflow-tooltip="true" />
             <el-table-column label="部门" align="center" key="deptName" prop="dept.deptName"
               v-if="columns.deptName.visible" :show-overflow-tooltip="true" />
@@ -106,94 +106,304 @@
     </div>
 
     <!-- 添加或修改用户配置对话框 -->
-    <el-dialog :title="title" v-model="open" width="600px" append-to-body>
-      <el-form :model="form" :rules="rules" ref="userRef" label-width="80px">
-        <el-row>
-          <el-col :span="12">
-            <el-form-item label="用户昵称" prop="realName">
-              <el-input v-model="form.realName" placeholder="请输入用户昵称" maxlength="30" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="归属部门" prop="deptId">
-              <el-tree-select v-model="form.deptId" :data="enabledDeptOptions"
-                :props="{ value: 'id', label: 'label', children: 'children' }" value-key="id" placeholder="请选择归属部门"
-                clearable check-strictly />
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="12">
-            <el-form-item label="手机号码" prop="phonenumber">
-              <el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="邮箱" prop="email">
-              <el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="12">
-            <el-form-item v-if="form.userId == undefined" label="用户名称" prop="userName">
-              <el-input v-model="form.userName" placeholder="请输入用户名称" maxlength="30" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item v-if="form.userId == undefined" label="用户密码" prop="password">
-              <el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password />
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="12">
-            <el-form-item label="用户性别">
-              <el-select v-model="form.sex" placeholder="请选择">
-                <el-option v-for="dict in sys_user_sex" :key="dict.value" :label="dict.label"
-                  :value="dict.value"></el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="状态">
-              <el-radio-group v-model="form.status">
-                <el-radio v-for="dict in sys_normal_disable" :key="dict.value" :value="dict.value">{{ dict.label
-                }}</el-radio>
-              </el-radio-group>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="12">
-            <el-form-item label="岗位">
-              <el-select v-model="form.postIds" multiple placeholder="请选择">
-                <el-option v-for="item in postOptions" :key="item.postId" :label="item.postName" :value="item.postId"
-                  :disabled="item.status == 1"></el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="角色">
-              <el-select v-model="form.roleIds" multiple placeholder="请选择">
-                <el-option v-for="item in roleOptions" :key="item.roleId" :label="item.roleName" :value="item.roleId"
-                  :disabled="item.status == 1"></el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="24">
-            <el-form-item label="备注">
-              <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
-            </el-form-item>
-          </el-col>
-        </el-row>
+    <el-dialog :title="title" v-model="open" width="900px" append-to-body>
+      <el-form :model="form" :rules="rules" ref="userRef" label-width="100px">
+        <el-tabs v-model="activeTab">
+          <el-tab-pane name="base">
+            <template #label>
+              <el-icon><User /></el-icon>
+              <span class="tab-label">基本信息</span>
+            </template>
+            <el-row>
+              <el-col :span="12">
+                <el-form-item v-if="form.userId == undefined" label="登录账号" prop="userName">
+                  <el-input v-model="form.userName" placeholder="请输入登录账号" maxlength="100" />
+                </el-form-item>
+                <el-form-item v-else label="登录账号">
+                  <el-input v-model="form.userName" disabled />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="用户姓名" prop="realName">
+                  <el-input v-model="form.realName" placeholder="请输入用户姓名" maxlength="150" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="12">
+                <el-form-item v-if="form.userId == undefined" label="用户密码" prop="password">
+                  <el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="归属部门" prop="deptId">
+                  <el-tree-select v-model="form.deptId" :data="enabledDeptOptions"
+                    :props="{ value: 'id', label: 'label', children: 'children' }" value-key="id" placeholder="请选择归属部门"
+                    clearable check-strictly style="width: 100%" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="12">
+                <el-form-item label="用户类型">
+                  <el-select v-model="form.userType" placeholder="请选择" style="width: 100%">
+                    <el-option label="系统用户" value="00" />
+                    <el-option label="注册用户" value="01" />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="状态">
+                  <el-radio-group v-model="form.status">
+                    <el-radio v-for="dict in sys_normal_disable" :key="dict.value" :value="dict.value">{{ dict.label
+                    }}</el-radio>
+                  </el-radio-group>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="12">
+                <el-form-item label="用户性别">
+                  <el-select v-model="form.sex" placeholder="请选择" style="width: 100%">
+                    <el-option v-for="dict in sys_user_sex" :key="dict.value" :label="dict.label"
+                      :value="dict.value"></el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="头像">
+                  <el-input v-model="form.avatar" placeholder="请输入头像路径" maxlength="100" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-tab-pane>
+
+          <el-tab-pane name="contact">
+            <template #label>
+              <el-icon><Phone /></el-icon>
+              <span class="tab-label">联系信息</span>
+            </template>
+            <el-alert title="手机号码、身份证号为加密数据,如需修改请直接输入新值,留空表示不修改"
+              type="info" :closable="false" show-icon class="form-tip" />
+            <el-row>
+              <el-col :span="12">
+                <el-form-item label="手机号码">
+                  <el-input v-model="form.phonenumber" placeholder="已加密,留空不修改" maxlength="255" clearable />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="邮箱" prop="email">
+                  <el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="12">
+                <el-form-item label="身份证号">
+                  <el-input v-model="form.idCard" placeholder="已加密,留空不修改" maxlength="320" clearable />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="固定电话">
+                  <el-input v-model="form.phone" placeholder="请输入固定电话" maxlength="50" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="12">
+                <el-form-item label="传真号码">
+                  <el-input v-model="form.faxNumb" placeholder="请输入传真号码" maxlength="20" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="QQ号码">
+                  <el-input v-model="form.qq" placeholder="请输入QQ号码" maxlength="50" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="12">
+                <el-form-item label="新浪微博">
+                  <el-input v-model="form.xlwb" placeholder="请输入新浪微博" maxlength="50" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="行政区划编码">
+                  <el-input v-model="form.adCode" placeholder="请输入行政区划编码" maxlength="255" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-tab-pane>
+
+          <el-tab-pane name="ext">
+            <template #label>
+              <el-icon><Setting /></el-icon>
+              <span class="tab-label">扩展信息</span>
+            </template>
+            <el-row>
+              <el-col :span="12">
+                <el-form-item label="昵称">
+                  <el-input v-model="form.nickname" placeholder="请输入昵称" maxlength="255" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="用户类别">
+                  <el-input v-model="form.categoryId" placeholder="请输入用户类别" maxlength="32" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="12">
+                <el-form-item label="人员类型">
+                  <el-input v-model="form.persType" placeholder="请输入人员类型" maxlength="2" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="单位类型">
+                  <el-input v-model="form.orgCheckType" placeholder="请输入单位类型" maxlength="1" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="12">
+                <el-form-item label="排序">
+                  <el-input-number v-model="form.sortNum" :min="0" controls-position="right" style="width: 100%" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="仅CA登录">
+                  <el-select v-model="form.loginFromCaFlag" placeholder="请选择" style="width: 100%">
+                    <el-option :value="0" label="否" />
+                    <el-option :value="1" label="是" />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="12">
+                <el-form-item label="CA认证SN">
+                  <el-input v-model="form.casn" placeholder="请输入CA认证SN" maxlength="100" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="电脑物理地址">
+                  <el-input v-model="form.mac" placeholder="请输入电脑物理地址" maxlength="32" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="12">
+                <el-form-item label="固定IP">
+                  <el-input v-model="form.ip" placeholder="请输入固定IP" maxlength="32" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="岗位">
+                  <el-select v-model="form.postIds" multiple placeholder="请选择" style="width: 100%">
+                    <el-option v-for="item in postOptions" :key="item.postId" :label="item.postName" :value="item.postId"
+                      :disabled="item.status == 1"></el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="12">
+                <el-form-item label="角色">
+                  <el-select v-model="form.roleIds" multiple placeholder="请选择" style="width: 100%">
+                    <el-option v-for="item in roleOptions" :key="item.roleId" :label="item.roleName" :value="item.roleId"
+                      :disabled="item.status == 1"></el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="备注">
+                  <el-input v-model="form.remark" type="textarea" :rows="2" placeholder="请输入内容" maxlength="4000" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-tab-pane>
+
+          <el-tab-pane name="sys">
+            <template #label>
+              <el-icon><Lock /></el-icon>
+              <span class="tab-label">系统信息</span>
+            </template>
+            <el-alert title="以下字段由系统维护,不可配置" type="warning" :closable="false" show-icon class="form-tip" />
+            <el-row>
+              <el-col :span="8">
+                <el-form-item label="是否锁定">
+                  <el-switch v-model="form.locked" :active-value="'1'" :inactive-value="'0'" disabled />
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="删除标志">
+                  <el-input v-model="form.delFlag" disabled />
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="登录次数">
+                  <el-input v-model="form.loginTimes" disabled />
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="8">
+                <el-form-item label="版本">
+                  <el-input v-model="form.version" disabled />
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="所属租户">
+                  <el-input v-model="form.tenantId" disabled />
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="最后登录IP">
+                  <el-input v-model="form.loginIp" disabled />
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="8">
+                <el-form-item label="最后登录时间">
+                  <el-input v-model="form.loginDate" disabled />
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="密码更新时间">
+                  <el-input v-model="form.pwdUpdateDate" disabled />
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="创建人">
+                  <el-input v-model="form.createBy" disabled />
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="8">
+                <el-form-item label="创建时间">
+                  <el-input v-model="form.createTime" disabled />
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="更新人">
+                  <el-input v-model="form.updateBy" disabled />
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="更新时间">
+                  <el-input v-model="form.updateTime" disabled />
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-tab-pane>
+        </el-tabs>
       </el-form>
       <template #footer>
         <div class="dialog-footer">
-          <el-button type="primary" @click="submitForm">确 定</el-button>
-          <el-button @click="cancel">取 消</el-button>
+          <el-button type="primary" @click="submitForm">确定</el-button>
+          <el-button @click="cancel">取消</el-button>
         </div>
       </template>
     </el-dialog>
@@ -221,6 +431,7 @@ const { sys_normal_disable, sys_user_sex } = proxy.useDict("sys_normal_disable",
 
 const userList = ref([])
 const open = ref(false)
+const activeTab = ref("base")
 const loading = ref(true)
 const showSearch = ref(true)
 const ids = ref([])
@@ -238,8 +449,8 @@ const roleOptions = ref([])
 // 列显隐信息
 const columns = ref({
   userId: { label: '用户编号', visible: true },
-  userName: { label: '用户名称', visible: true },
-  realName: { label: '用户昵称', visible: true },
+  userName: { label: '登录账号', visible: true },
+  realName: { label: '用户姓名', visible: true },
   deptName: { label: '部门', visible: true },
   phonenumber: { label: '手机号码', visible: true },
   status: { label: '状态', visible: true },
@@ -257,11 +468,10 @@ const data = reactive({
     deptId: undefined
   },
   rules: {
-    userName: [{ required: true, message: "用户名称不能为空", trigger: "blur" }, { min: 2, max: 20, message: "用户名称长度必须介于 2 和 20 之间", trigger: "blur" }],
-    realName: [{ required: true, message: "用户昵称不能为空", trigger: "blur" }],
+    userName: [{ required: true, message: "登录账号不能为空", trigger: "blur" }, { min: 2, max: 30, message: "登录账号长度必须介于 2 和 30 之间", trigger: "blur" }],
+    realName: [{ required: true, message: "用户姓名不能为空", trigger: "blur" }],
     password: [{ required: true, message: "用户密码不能为空", trigger: "blur" }, { min: 5, max: 20, message: "用户密码长度必须介于 5 和 20 之间", trigger: "blur" }, { pattern: /^[^<>"'|\\]+$/, message: "不能包含非法字符:< > \" ' \\\ |", trigger: "blur" }],
-    email: [{ type: "email", message: "请输入正确的邮箱地址", trigger: ["blur", "change"] }],
-    phonenumber: [{ pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "请输入正确的手机号码", trigger: "blur" }]
+    email: [{ type: "email", message: "请输入正确的邮箱地址", trigger: ["blur", "change"] }]
   }
 })
 
@@ -428,10 +638,40 @@ function reset() {
     userName: undefined,
     realName: undefined,
     password: undefined,
-    phonenumber: undefined,
+    phonenumber: '',
     email: undefined,
     sex: undefined,
     status: "0",
+    userType: "00",
+    avatar: undefined,
+    nickname: undefined,
+    categoryId: undefined,
+    adCode: undefined,
+    qq: undefined,
+    xlwb: undefined,
+    phone: undefined,
+    casn: undefined,
+    mac: undefined,
+    ip: undefined,
+    idCard: '',
+    otlcolCnknoqprn: undefined,
+    loginFromCaFlag: 0,
+    loginTimes: undefined,
+    sortNum: undefined,
+    version: undefined,
+    tenantId: undefined,
+    persType: undefined,
+    faxNumb: undefined,
+    orgCheckType: undefined,
+    locked: "0",
+    delFlag: "0",
+    loginIp: undefined,
+    loginDate: undefined,
+    pwdUpdateDate: undefined,
+    createBy: undefined,
+    createTime: undefined,
+    updateBy: undefined,
+    updateTime: undefined,
     remark: undefined,
     postIds: [],
     roleIds: []
@@ -463,6 +703,9 @@ function handleUpdate(row) {
   const userId = row.userId || ids.value
   getUser(userId).then(response => {
     form.value = response.data
+    // 手机号、身份证号为加密数据,不展示原值;留空表示不修改
+    form.value.phonenumber = ''
+    form.value.idCard = ''
     postOptions.value = response.posts
     roleOptions.value = response.roles
     form.value.postIds = response.postIds
@@ -502,3 +745,19 @@ onMounted(() => {
   })
 })
 </script>
+
+<style scoped lang="scss">
+.tab-label {
+  margin-left: 4px;
+}
+
+.form-tip {
+  margin-bottom: 16px;
+}
+
+:deep(.el-tabs__content) {
+  overflow: auto;
+  max-height: calc(65vh - 40px);
+  padding-right: 6px;
+}
+</style>

+ 6 - 2
gw-ui/src/views/system/user/profile/index.vue

@@ -14,12 +14,16 @@
                   </div>
                   <ul class="list-group list-group-striped">
                      <li class="list-group-item">
-                        <svg-icon icon-class="user" />用户名称
+                        <svg-icon icon-class="user" />登录账号
                         <div class="pull-right">{{ state.user.userName }}</div>
                      </li>
+                     <li class="list-group-item">
+                        <svg-icon icon-class="people" />用户姓名
+                        <div class="pull-right">{{ state.user.realName }}</div>
+                     </li>
                      <li class="list-group-item">
                         <svg-icon icon-class="phone" />手机号码
-                        <div class="pull-right">{{ state.user.phonenumber }}</div>
+                        <div class="pull-right">{{ state.user.phonenumber ? '已加密' : '' }}</div>
                      </li>
                      <li class="list-group-item">
                         <svg-icon icon-class="email" />用户邮箱

+ 190 - 24
gw-ui/src/views/system/user/profile/userInfo.vue

@@ -1,25 +1,154 @@
 <template>
-   <el-form ref="userRef" :model="form" :rules="rules" label-width="80px">
-      <el-form-item label="用户昵称" prop="realName">
-         <el-input v-model="form.realName" maxlength="30" />
-      </el-form-item>
-      <el-form-item label="手机号码" prop="phonenumber">
-         <el-input v-model="form.phonenumber" maxlength="11" />
-      </el-form-item>
-      <el-form-item label="邮箱" prop="email">
-         <el-input v-model="form.email" maxlength="50" />
-      </el-form-item>
-      <el-form-item label="性别">
-         <el-radio-group v-model="form.sex">
+  <el-form ref="userRef" :model="form" :rules="rules" label-width="90px">
+    <el-divider content-position="left">
+      <el-icon><User /></el-icon>
+      <span class="tab-label">基本信息</span>
+    </el-divider>
+    <el-row>
+      <el-col :span="12">
+        <el-form-item label="用户姓名" prop="realName">
+          <el-input v-model="form.realName" placeholder="请输入用户姓名" maxlength="150" />
+        </el-form-item>
+      </el-col>
+      <el-col :span="12">
+        <el-form-item label="性别">
+          <el-radio-group v-model="form.sex">
             <el-radio value="0">男</el-radio>
             <el-radio value="1">女</el-radio>
-         </el-radio-group>
-      </el-form-item>
-      <el-form-item>
+            <el-radio value="2">未知</el-radio>
+          </el-radio-group>
+        </el-form-item>
+      </el-col>
+    </el-row>
+    <el-row>
+      <el-col :span="12">
+        <el-form-item label="昵称">
+          <el-input v-model="form.nickname" placeholder="请输入昵称" maxlength="255" />
+        </el-form-item>
+      </el-col>
+      <el-col :span="12">
+        <el-form-item label="备注">
+          <el-input v-model="form.remark" type="textarea" :rows="2" placeholder="请输入内容" maxlength="4000" />
+        </el-form-item>
+      </el-col>
+    </el-row>
+
+    <el-divider content-position="left">
+      <el-icon><Phone /></el-icon>
+      <span class="tab-label">联系信息</span>
+    </el-divider>
+    <el-alert title="手机号码、身份证号为加密数据,如需修改请直接输入新值,留空表示不修改"
+      type="info" :closable="false" show-icon class="form-tip" />
+    <el-row>
+      <el-col :span="12">
+        <el-form-item label="手机号码">
+          <el-input v-model="form.phonenumber" placeholder="已加密,留空不修改" maxlength="255" clearable />
+        </el-form-item>
+      </el-col>
+      <el-col :span="12">
+        <el-form-item label="邮箱" prop="email">
+          <el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
+        </el-form-item>
+      </el-col>
+    </el-row>
+    <el-row>
+      <el-col :span="12">
+        <el-form-item label="身份证号">
+          <el-input v-model="form.idCard" placeholder="已加密,留空不修改" maxlength="320" clearable />
+        </el-form-item>
+      </el-col>
+      <el-col :span="12">
+        <el-form-item label="固定电话">
+          <el-input v-model="form.phone" placeholder="请输入固定电话" maxlength="50" />
+        </el-form-item>
+      </el-col>
+    </el-row>
+    <el-row>
+      <el-col :span="12">
+        <el-form-item label="传真号码">
+          <el-input v-model="form.faxNumb" placeholder="请输入传真号码" maxlength="20" />
+        </el-form-item>
+      </el-col>
+      <el-col :span="12">
+        <el-form-item label="QQ号码">
+          <el-input v-model="form.qq" placeholder="请输入QQ号码" maxlength="50" />
+        </el-form-item>
+      </el-col>
+    </el-row>
+    <el-row>
+      <el-col :span="12">
+        <el-form-item label="新浪微博">
+          <el-input v-model="form.xlwb" placeholder="请输入新浪微博" maxlength="50" />
+        </el-form-item>
+      </el-col>
+      <el-col :span="12">
+        <el-form-item label="行政区划编码">
+          <el-input v-model="form.adCode" placeholder="请输入行政区划编码" maxlength="255" />
+        </el-form-item>
+      </el-col>
+    </el-row>
+
+    <el-divider content-position="left">
+      <el-icon><Setting /></el-icon>
+      <span class="tab-label">扩展信息</span>
+    </el-divider>
+    <el-row>
+      <el-col :span="12">
+        <el-form-item label="用户类别">
+          <el-input v-model="form.categoryId" placeholder="请输入用户类别" maxlength="32" />
+        </el-form-item>
+      </el-col>
+      <el-col :span="12">
+        <el-form-item label="人员类型">
+          <el-input v-model="form.persType" placeholder="请输入人员类型" maxlength="2" />
+        </el-form-item>
+      </el-col>
+    </el-row>
+    <el-row>
+      <el-col :span="12">
+        <el-form-item label="单位类型">
+          <el-input v-model="form.orgCheckType" placeholder="请输入单位类型" maxlength="1" />
+        </el-form-item>
+      </el-col>
+      <el-col :span="12">
+        <el-form-item label="排序">
+          <el-input-number v-model="form.sortNum" :min="0" controls-position="right" style="width: 100%" />
+        </el-form-item>
+      </el-col>
+    </el-row>
+    <el-row>
+      <el-col :span="12">
+        <el-form-item label="仅CA登录">
+          <el-select v-model="form.loginFromCaFlag" placeholder="请选择" style="width: 100%">
+            <el-option :value="0" label="否" />
+            <el-option :value="1" label="是" />
+          </el-select>
+        </el-form-item>
+      </el-col>
+      <el-col :span="12">
+        <el-form-item label="CA认证SN">
+          <el-input v-model="form.casn" placeholder="请输入CA认证SN" maxlength="100" />
+        </el-form-item>
+      </el-col>
+    </el-row>
+    <el-row>
+      <el-col :span="12">
+        <el-form-item label="电脑物理地址">
+          <el-input v-model="form.mac" placeholder="请输入电脑物理地址" maxlength="32" />
+        </el-form-item>
+      </el-col>
+      <el-col :span="12">
+        <el-form-item label="固定IP">
+          <el-input v-model="form.ip" placeholder="请输入固定IP" maxlength="32" />
+        </el-form-item>
+      </el-col>
+    </el-row>
+
+    <el-form-item class="form-actions">
       <el-button type="primary" @click="submit">保存</el-button>
-      <el-button type="danger" @click="close">关闭</el-button>
-      </el-form-item>
-   </el-form>
+      <el-button @click="close">关闭</el-button>
+    </el-form-item>
+  </el-form>
 </template>
 
 <script setup>
@@ -35,9 +164,8 @@ const { proxy } = getCurrentInstance()
 
 const form = ref({})
 const rules = ref({
-  realName: [{ required: true, message: "用户昵称不能为空", trigger: "blur" }],
-  email: [{ required: true, message: "邮箱地址不能为空", trigger: "blur" }, { type: "email", message: "请输入正确的邮箱地址", trigger: ["blur", "change"] }],
-  phonenumber: [{ required: true, message: "手机号码不能为空", trigger: "blur" }, { pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "请输入正确的手机号码", trigger: "blur" }],
+  realName: [{ required: true, message: "用户姓名不能为空", trigger: "blur" }],
+  email: [{ type: "email", message: "请输入正确的邮箱地址", trigger: ["blur", "change"] }]
 })
 
 /** 提交按钮 */
@@ -46,8 +174,11 @@ function submit() {
     if (valid) {
       updateUserProfile(form.value).then(() => {
         proxy.$modal.msgSuccess("修改成功")
-        props.user.phonenumber = form.value.phonenumber
+        props.user.realName = form.value.realName
+        props.user.nickname = form.value.nickname
         props.user.email = form.value.email
+        props.user.sex = form.value.sex
+        props.user.remark = form.value.remark
       })
     }
   })
@@ -58,10 +189,45 @@ function close() {
   proxy.$tab.closePage()
 }
 
-// 回显当前登录用户信息
+// 回显当前登录用户信息(手机号、身份证号为加密数据,不展示原值,留空表示不修改)
 watch(() => props.user, user => {
   if (user) {
-    form.value = { realName: user.realName, phonenumber: user.phonenumber, email: user.email, sex: user.sex }
+    form.value = {
+      realName: user.realName || '',
+      nickname: user.nickname || '',
+      phonenumber: '',
+      idCard: '',
+      email: user.email || '',
+      sex: user.sex || '0',
+      phone: user.phone || '',
+      faxNumb: user.faxNumb || '',
+      qq: user.qq || '',
+      xlwb: user.xlwb || '',
+      adCode: user.adCode || '',
+      categoryId: user.categoryId || '',
+      persType: user.persType || '',
+      orgCheckType: user.orgCheckType || '',
+      sortNum: user.sortNum,
+      loginFromCaFlag: user.loginFromCaFlag != null ? user.loginFromCaFlag : 0,
+      casn: user.casn || '',
+      mac: user.mac || '',
+      ip: user.ip || '',
+      remark: user.remark || ''
+    }
   }
 },{ immediate: true })
 </script>
+
+<style scoped lang="scss">
+.tab-label {
+  margin-left: 4px;
+}
+
+.form-tip {
+  margin-bottom: 16px;
+}
+
+.form-actions {
+  margin-top: 16px;
+}
+</style>