浏览代码

Merge branch '陈航-机构账号与社区机构账号管理-提交' of sckj/mz-cloud into master

sckj 2 年之前
父节点
当前提交
4f9b402dfc
共有 20 个文件被更改,包括 1901 次插入3 次删除
  1. 135 0
      ruoyi-api/ruoyi-api-ext/src/main/java/com/ruoyi/system/domain/SysJgZhgl.java
  2. 12 0
      ruoyi-modules/mz-organization/src/main/java/com/ruoyi/organization/controller/YljgJcxxController.java
  3. 12 0
      ruoyi-modules/mz-organization/src/main/java/com/ruoyi/organization/controller/YljgsqJcxxController.java
  4. 19 0
      ruoyi-modules/mz-organization/src/main/java/com/ruoyi/organization/mapper/SysJgZhglMapper.java
  5. 40 0
      ruoyi-modules/mz-organization/src/main/java/com/ruoyi/organization/service/ISysJgZhglService.java
  6. 68 0
      ruoyi-modules/mz-organization/src/main/java/com/ruoyi/organization/service/impl/SysJgZhglServiceImpl.java
  7. 57 0
      ruoyi-modules/mz-organization/src/main/resources/mapper/organization/SysJgZhglMapper.xml
  8. 107 0
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysJgZhglController.java
  9. 3 3
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java
  10. 22 0
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysJgZhglMapper.java
  11. 33 0
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/YljgJcxxMapper.java
  12. 31 0
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/YljgsqJcxxMapper.java
  13. 54 0
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysJgZhglService.java
  14. 257 0
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysJgZhglServiceImpl.java
  15. 94 0
      ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysJgZhglMapper.xml
  16. 120 0
      ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/YljgJcxxMapper.xml
  17. 96 0
      ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/YljgsqJcxxMapper.xml
  18. 44 0
      ruoyi-ui/src/api/system/zhgl.js
  19. 348 0
      ruoyi-ui/src/views/system/zhgl/sqyljg/index.vue
  20. 349 0
      ruoyi-ui/src/views/system/zhgl/yljg/index.vue

+ 135 - 0
ruoyi-api/ruoyi-api-ext/src/main/java/com/ruoyi/system/domain/SysJgZhgl.java

@@ -0,0 +1,135 @@
+package com.ruoyi.system.domain;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.ruoyi.ext.api.validate.*;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.core.annotation.Excel;
+import com.ruoyi.ext.api.validate.group.AddGroup;
+import com.ruoyi.common.core.web.domain.BaseEntity;
+import org.hibernate.validator.constraints.Range;
+import com.ruoyi.ext.api.validate.DictV;
+import com.ruoyi.ext.api.validate.DateV;
+import com.ruoyi.ext.api.validate.MobileV;
+import com.ruoyi.ext.api.validate.PhoneV;
+import com.ruoyi.ext.api.validate.IdCardV;
+import com.ruoyi.ext.api.validate.NumberV;
+
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.Size;
+
+/**
+ * 机构账号管理对象 sys_jg_zhgl
+ *
+ * @author CH
+ * @date 2022-05-31
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@TableName("sys_jg_zhgl")
+@ApiModel("机构账号管理")
+public class SysJgZhgl extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键标识 */
+    @Excel(name = "主键标识")
+    @TableId(value = "id",type = IdType.ASSIGN_UUID)
+    @ApiModelProperty(value = "主键标识")
+    private String id;
+
+    /** 系统用户id */
+    @Excel(name = "系统用户id")
+    @ApiModelProperty(value = "系统用户id")
+    private Long sysUserId;
+
+    /** 机构名称 */
+    @Excel(name = "机构名称")
+    @ApiModelProperty(value = "机构名称", required = true)
+    @NotBlank(message = "{机构名称}",groups = AddGroup.class)
+    @Size(min = 1, max = 100, message = "{机构名称}")
+
+    private String jgmc;
+
+    /** 统一社会信用代码 */
+    @Excel(name = "统一社会信用代码")
+    @ApiModelProperty(value = "统一社会信用代码", required = true)
+    @NotBlank(message = "{统一社会信用代码}",groups = AddGroup.class)
+    @Size(min=18, max = 18, message = "{统一社会信用代码}")
+
+    private String tyshxydm;
+
+    /** 负责人 */
+    @Excel(name = "负责人")
+    @ApiModelProperty(value = "负责人")
+    @NotBlank(message = "{负责人}",groups = AddGroup.class)
+    @Size(max = 72, message = "{负责人}")
+
+    private String frxm;
+
+    /** 负责人联系电话 */
+    @Excel(name = "负责人联系电话")
+    @ApiModelProperty(value = "负责人联系电话")
+    @NotBlank(message = "{负责人联系电话}",groups = AddGroup.class)
+    @MobileV(message = "负责人联系电话不符合格式规范")
+
+    private String frlxfs;
+
+    /** 所属区划 */
+    @Excel(name = "所属区划")
+    @ApiModelProperty(value = "所属区划")
+    @Size(max = 12, message = "{所属区划}")
+
+    private String ssxzqh;
+
+    /** 账号名称 */
+    @Excel(name = "账号名称")
+    @ApiModelProperty(value = "账号名称", required = true)
+//    @NotBlank(message = "{账号名称}",groups = AddGroup.class)
+    @Size(min = 1, max = 19, message = "{账号名称}")
+
+    private String userName;
+
+    /** 账号密码 */
+    @Excel(name = "账号密码")
+    @ApiModelProperty(value = "账号密码")
+    @Size(max = 72, message = "{账号密码}")
+
+    private String password;
+
+    /** 账号状态 */
+    @Excel(name = "账号状态")
+    @ApiModelProperty(value = "账号状态", required = true)
+//    @NotBlank(message = "{账号状态}",groups = AddGroup.class)
+    @DictV(type = "XZ078",message = "{账号状态}")
+    private String status;
+
+    /** 账号类别 */
+    @Excel(name = "账号类别")
+    @ApiModelProperty(value = "账号类别")
+    @DictV(type = "CZ035",message = "{账号类别}")
+    private String isZhType;
+
+    /** 所属行政区划名称 */
+    @ApiModelProperty(value = "所属行政区划名称")
+    @TableField(exist = false)
+    private String ssxzqhName;
+
+    /** 所在行政区划名称 */
+    @ApiModelProperty(value = "所属行政区划名称")
+    @TableField(exist = false)
+    private String szxzqhName;
+
+    /** 是否删除 */
+    @ApiModelProperty(value = "是否删除")
+    private String isSc;
+}

+ 12 - 0
ruoyi-modules/mz-organization/src/main/java/com/ruoyi/organization/controller/YljgJcxxController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.organization.controller;
 
+import com.ruoyi.common.core.utils.StringUtils;
 import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.core.web.page.TableDataInfo;
@@ -9,7 +10,9 @@ import com.ruoyi.common.security.annotation.RequiresPermissions;
 import com.ruoyi.common.security.utils.SecurityUtils;
 import com.ruoyi.organization.domain.YljgJcxx;
 import com.ruoyi.ext.api.validate.group.AddGroup;
+import com.ruoyi.organization.service.ISysJgZhglService;
 import com.ruoyi.organization.service.IYljgJcxxService;
+import com.ruoyi.system.domain.SysJgZhgl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
@@ -30,6 +33,9 @@ public class YljgJcxxController extends BaseController
     @Autowired
     private IYljgJcxxService yljgJcxxService;
 
+    @Autowired
+    private ISysJgZhglService sysJgZhglService;
+
     /**
      * 查询机构信息列表
      */
@@ -59,6 +65,12 @@ public class YljgJcxxController extends BaseController
             yljgJcxx.setSsxzqh(deptId);
             Map<String,Object> map = yljgJcxxService.selectJlDeptByParams(null,deptId);
             yljgJcxx.setSsxzqhName(map.get("name").toString());
+            SysJgZhgl sysJgZhgl = sysJgZhglService.selectSysJgZhglByUserId(SecurityUtils.getUserId());
+            if(StringUtils.isNotNull(sysJgZhgl)){
+                yljgJcxx.setJgmc(sysJgZhgl.getJgmc());
+                yljgJcxx.setFrxm(sysJgZhgl.getFrxm());
+                yljgJcxx.setFrlxfs(sysJgZhgl.getFrlxfs());
+            }
             return AjaxResult.success(yljgJcxx);
         }
     }

+ 12 - 0
ruoyi-modules/mz-organization/src/main/java/com/ruoyi/organization/controller/YljgsqJcxxController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.organization.controller;
 
+import com.ruoyi.common.core.utils.StringUtils;
 import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.core.web.page.TableDataInfo;
@@ -9,8 +10,10 @@ import com.ruoyi.common.security.annotation.RequiresPermissions;
 import com.ruoyi.common.security.utils.SecurityUtils;
 import com.ruoyi.ext.api.validate.group.AddGroup;
 import com.ruoyi.organization.domain.YljgsqJcxx;
+import com.ruoyi.organization.service.ISysJgZhglService;
 import com.ruoyi.organization.service.IYljgJcxxService;
 import com.ruoyi.organization.service.IYljgsqJcxxService;
+import com.ruoyi.system.domain.SysJgZhgl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
@@ -34,6 +37,9 @@ public class YljgsqJcxxController extends BaseController
     @Autowired
     private IYljgJcxxService yljgJcxxService;
 
+    @Autowired
+    private ISysJgZhglService sysJgZhglService;
+
     /**
      * 查询社区养老机构_基础信息列表
      */
@@ -63,6 +69,12 @@ public class YljgsqJcxxController extends BaseController
             yljgsqJcxx.setSsxzqh(deptId);
             Map<String,Object> map = yljgJcxxService.selectJlDeptByParams(null,deptId);
             yljgsqJcxx.setSsxzqhName(map.get("name").toString());
+            SysJgZhgl sysJgZhgl = sysJgZhglService.selectSysJgZhglByUserId(SecurityUtils.getUserId());
+            if(StringUtils.isNotNull(sysJgZhgl)){
+                yljgsqJcxx.setJgmc(sysJgZhgl.getJgmc());
+                yljgsqJcxx.setFrxm(sysJgZhgl.getFrxm());
+                yljgsqJcxx.setFrlxfs(sysJgZhgl.getFrlxfs());
+            }
             return AjaxResult.success(yljgsqJcxx);
         }
     }

+ 19 - 0
ruoyi-modules/mz-organization/src/main/java/com/ruoyi/organization/mapper/SysJgZhglMapper.java

@@ -0,0 +1,19 @@
+package com.ruoyi.organization.mapper;
+
+import com.ruoyi.common.datascope.utils.BaseMapperPlus;
+import com.ruoyi.system.domain.SysJgZhgl;
+
+import java.util.List;
+
+/**
+ * 机构账号管理Mapper接口
+ *
+ * @author CH
+ * @date 2022-05-31
+ */
+public interface SysJgZhglMapper extends BaseMapperPlus<SysJgZhgl> {
+
+    public List<SysJgZhgl> selectSysJgZhglList(SysJgZhgl sysJgZhgl);
+    public SysJgZhgl selectSysJgZhglByUserId(Long id);
+
+}

+ 40 - 0
ruoyi-modules/mz-organization/src/main/java/com/ruoyi/organization/service/ISysJgZhglService.java

@@ -0,0 +1,40 @@
+package com.ruoyi.organization.service;
+
+import com.ruoyi.system.domain.SysJgZhgl;
+
+import java.util.List;
+
+/**
+ * 机构账号管理Service接口
+ *
+ * @author CH
+ * @date 2022-05-31
+ */
+public interface ISysJgZhglService
+{
+    /**
+     * 查询机构账号管理
+     *
+     * @param id 机构账号管理主键
+     * @return 机构账号管理
+     */
+    public SysJgZhgl selectSysJgZhglById(String id);
+    public SysJgZhgl selectSysJgZhglByUserId(Long id);
+
+    /**
+     * 查询机构账号管理列表
+     *
+     * @param sysJgZhgl 机构账号管理
+     * @return 机构账号管理集合
+     */
+    public List<SysJgZhgl> selectSysJgZhglList(SysJgZhgl sysJgZhgl);
+
+    /**
+     * 修改机构账号管理
+     *
+     * @param sysJgZhgl 机构账号管理
+     * @return 结果
+     */
+    public int updateSysJgZhgl(SysJgZhgl sysJgZhgl);
+
+}

+ 68 - 0
ruoyi-modules/mz-organization/src/main/java/com/ruoyi/organization/service/impl/SysJgZhglServiceImpl.java

@@ -0,0 +1,68 @@
+package com.ruoyi.organization.service.impl;
+
+
+import com.ruoyi.system.domain.SysJgZhgl;
+import com.ruoyi.organization.mapper.SysJgZhglMapper;
+import com.ruoyi.organization.service.ISysJgZhglService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 机构账号管理Service业务层处理
+ *
+ * @author CH
+ * @date 2022-05-31
+ */
+@Service
+public class SysJgZhglServiceImpl implements ISysJgZhglService
+{
+    @Autowired
+    private SysJgZhglMapper sysJgZhglMapper;
+
+    /**
+     * 查询机构账号管理
+     *
+     * @param id 机构账号管理主键
+     * @return 机构账号管理
+     */
+    @Override
+    public SysJgZhgl selectSysJgZhglById(String id)
+    {
+        return sysJgZhglMapper.selectById(id);
+    }
+
+    @Override
+    public SysJgZhgl selectSysJgZhglByUserId(Long id)
+    {
+        return sysJgZhglMapper.selectSysJgZhglByUserId(id);
+    }
+
+    /**
+     * 查询机构账号管理列表
+     *
+     * @param sysJgZhgl 机构账号管理
+     * @return 机构账号管理
+     */
+    @Override
+    public List<SysJgZhgl> selectSysJgZhglList(SysJgZhgl sysJgZhgl)
+    {
+//        return sysJgZhglMapper.selectList(new LambdaQueryWrapper<>(sysJgZhgl));
+        return sysJgZhglMapper.selectSysJgZhglList(sysJgZhgl);
+    }
+
+    /**
+     * 修改机构账号管理
+     *
+     * @param sysJgZhgl 机构账号管理
+     * @return 结果
+     */
+    @Override
+    public int updateSysJgZhgl(SysJgZhgl sysJgZhgl)
+    {
+
+        return sysJgZhglMapper.updateById(sysJgZhgl);
+    }
+
+}

+ 57 - 0
ruoyi-modules/mz-organization/src/main/resources/mapper/organization/SysJgZhglMapper.xml

@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.organization.mapper.SysJgZhglMapper">
+
+    <resultMap type="com.ruoyi.system.domain.SysJgZhgl" id="SysJgZhglResult">
+        <result property="id"    column="id"    />
+        <result property="sysUserId"    column="sys_user_id"    />
+        <result property="jgmc"    column="jgmc"    />
+        <result property="tyshxydm"    column="tyshxydm"    />
+        <result property="frxm"    column="frxm"    />
+        <result property="frlxfs"    column="frlxfs"    />
+        <result property="ssxzqh"    column="ssxzqh"    />
+        <result property="userName"    column="user_name"    />
+        <result property="password"    column="password"    />
+        <result property="status"    column="status"    />
+        <result property="isZhType"    column="is_zh_type"    />
+        <result property="createTimeStr"    column="create_time_str"    />
+        <result property="createUserId"    column="create_user_id"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createUserType"    column="create_user_type"    />
+        <result property="createUnit"    column="create_unit"    />
+        <result property="createUnitName"    column="create_unit_name"    />
+        <result property="updateTimeStr"    column="update_time_str"    />
+        <result property="updateUserId"    column="update_user_id"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateUnit"    column="update_unit"    />
+        <result property="updateUnitName"    column="update_unit_name"    />
+        <result property="state"    column="state"    />
+        <result property="ssxzqhName"    column="ssxzqh_name"    />
+        <result property="szxzqhName"    column="szxzqh_name"    />
+    </resultMap>
+
+    <select id="selectSysJgZhglList" parameterType="com.ruoyi.system.domain.SysJgZhgl" resultMap="SysJgZhglResult">
+        SELECT  a.*, getxzqhmcbycode(a.ssxzqh) ssxzqh_name
+        FROM sys_jg_zhgl a
+        <where>
+            <if test="sysUserId != null and sysUserId != ''"> and sys_user_id = #{sysUserId}</if>
+            <if test="jgmc != null and jgmc != ''"> and jgmc = #{jgmc}</if>
+            <if test="tyshxydm != null and tyshxydm != ''"> and tyshxydm = #{tyshxydm}</if>
+            <if test="userName != null and userName != ''"> and user_name = #{userName}</if>
+            <if test="status != null and status != ''"> and status = #{status}</if>
+            <if test="isZhType != null and isZhType != ''"> and is_zh_type = #{isZhType}</if>
+        </where>
+        ORDER BY create_time_str DESC AND state='0'
+    </select>
+
+    <select id="selectSysJgZhglByUserId" parameterType="Long" resultMap="SysJgZhglResult">
+        SELECT  a.*, getxzqhmcbycode(a.ssxzqh) ssxzqh_name
+        FROM sys_jg_zhgl a
+        <where>
+            <if test="sysUserId != null and sysUserId != ''"> and sys_user_id = #{sysUserId}</if>
+        </where>
+    </select>
+
+</mapper>

+ 107 - 0
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysJgZhglController.java

@@ -0,0 +1,107 @@
+package com.ruoyi.system.controller;
+
+import java.util.List;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.log.annotation.Log;
+import com.ruoyi.common.log.enums.BusinessType;
+import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.ruoyi.ext.api.validate.group.AddGroup;
+import com.ruoyi.system.domain.SysJgZhgl;
+import com.ruoyi.system.service.ISysJgZhglService;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+
+/**
+ * 机构账号管理Controller
+ *
+ * @author CH
+ * @date 2022-05-31
+ */
+@RestController
+@RequestMapping("/zhgl")
+public class SysJgZhglController extends BaseController
+{
+    @Autowired
+    private ISysJgZhglService sysJgZhglService;
+
+    /**
+     * 查询机构账号管理列表
+     */
+    @RequiresPermissions("system:zhgl:list")
+    @GetMapping("/list")
+    public TableDataInfo list(SysJgZhgl sysJgZhgl)
+    {
+        startPage();
+        List<SysJgZhgl> list = sysJgZhglService.selectSysJgZhglList(sysJgZhgl);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出机构账号管理列表
+     */
+    @RequiresPermissions("system:zhgl:export")
+    @Log(title = "机构账号管理", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, SysJgZhgl sysJgZhgl)
+    {
+        List<SysJgZhgl> list = sysJgZhglService.selectSysJgZhglList(sysJgZhgl);
+        ExcelUtil<SysJgZhgl> util = new ExcelUtil<SysJgZhgl>(SysJgZhgl.class);
+        util.exportExcel(response, list, "机构账号管理数据");
+    }
+
+    /**
+     * 获取机构账号管理详细信息
+     */
+    @RequiresPermissions("system:zhgl:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") String id)
+    {
+        return AjaxResult.success(sysJgZhglService.selectSysJgZhglById(id));
+    }
+
+    /**
+     * 新增机构账号管理
+     */
+    @RequiresPermissions("system:zhgl:add")
+    @Log(title = "机构账号管理", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@Validated({AddGroup.class}) @RequestBody SysJgZhgl sysJgZhgl)
+    {
+        return toAjax(sysJgZhglService.insertSysJgZhgl(sysJgZhgl),sysJgZhgl.getId());
+    }
+
+    /**
+     * 修改机构账号管理
+     */
+    @RequiresPermissions("system:zhgl:edit")
+    @Log(title = "机构账号管理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@Validated @RequestBody SysJgZhgl sysJgZhgl)
+    {
+        return toAjax(sysJgZhglService.updateSysJgZhgl(sysJgZhgl));
+    }
+
+    /**
+     * 删除机构账号管理
+     */
+    @RequiresPermissions("system:zhgl:remove")
+    @Log(title = "机构账号管理", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable String[] ids)
+    {
+        return toAjax(sysJgZhglService.deleteSysJgZhglByIds(ids));
+    }
+}

+ 3 - 3
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java

@@ -31,7 +31,7 @@ import java.util.stream.Collectors;
 
 /**
  * 用户信息
- * 
+ *
  * @author ruoyi
  */
 @RestController
@@ -138,7 +138,7 @@ public class SysUserController extends BaseController
 
     /**
      * 获取用户信息
-     * 
+     *
      * @return 用户信息
      */
     @GetMapping("getInfo")
@@ -201,7 +201,7 @@ public class SysUserController extends BaseController
             return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
         }
         user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
-        return toAjax(userService.insertUser(user));
+        return toAjax(userService.insertUser(user),user.getUserId());
     }
 
     /**

+ 22 - 0
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysJgZhglMapper.java

@@ -0,0 +1,22 @@
+package com.ruoyi.system.mapper;
+
+import java.util.List;
+
+import com.ruoyi.system.api.domain.SysLogininfor;
+import com.ruoyi.system.domain.SysJgZhgl;
+import com.ruoyi.common.datascope.utils.BaseMapperPlus;
+
+/**
+ * 机构账号管理Mapper接口
+ *
+ * @author CH
+ * @date 2022-05-31
+ */
+public interface SysJgZhglMapper extends BaseMapperPlus<SysJgZhgl> {
+
+    public List<SysJgZhgl> selectSysJgZhglList(SysJgZhgl sysJgZhgl);
+    public String selectuserCount(String deptId);
+    public int updateSysHgZhglByyljg(SysJgZhgl deptId);
+    public int updateSysHgZhglBysqjg(SysJgZhgl deptId);
+
+}

+ 33 - 0
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/YljgJcxxMapper.java

@@ -0,0 +1,33 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.common.datascope.handler.DataColumn;
+import com.ruoyi.common.datascope.handler.DataPermission;
+import com.ruoyi.common.datascope.utils.BaseMapperPlus;
+import com.ruoyi.organization.domain.YljgJcxx;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 机构信息Mapper接口
+ *
+ * @author CH
+ * @date 2022-03-27
+ */
+// CHProblem 这里我建议不加数据权限, 因为该接口只有后台调用,并且只有修改账号的状态,才设置机构的运营状态 这块花了1个多小时才确定是数据权限的事
+//@DataPermission({
+//        @DataColumn(key = "userName", value = "create_user_id"),
+//        @DataColumn(key = "jgName", value = "id")
+//})
+public interface YljgJcxxMapper extends BaseMapperPlus<YljgJcxx>
+{
+
+    /**
+     * 修改机构信息
+     *
+     * @param yljgJcxx 机构信息
+     * @return 结果
+     */
+    public int updateYljgJcxx(YljgJcxx yljgJcxx);
+
+}

+ 31 - 0
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/YljgsqJcxxMapper.java

@@ -0,0 +1,31 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.common.datascope.handler.DataColumn;
+import com.ruoyi.common.datascope.handler.DataPermission;
+import com.ruoyi.common.datascope.utils.BaseMapperPlus;
+import com.ruoyi.organization.domain.YljgsqJcxx;
+
+import java.util.List;
+
+/**
+ * 社区养老机构_基础信息Mapper接口
+ *
+ * @author CH
+ * @date 2022-04-06
+ */
+//@DataPermission({
+//        @DataColumn(key = "userName", value = "create_user_id"),
+//        @DataColumn(key = "jgName", value = "id")
+//})
+public interface YljgsqJcxxMapper extends BaseMapperPlus<YljgsqJcxx>
+{
+
+    /**
+     * 修改社区养老机构_基础信息
+     *
+     * @param yljgsqJcxx 社区养老机构_基础信息
+     * @return 结果
+     */
+    public int updateYljgsqJcxx(YljgsqJcxx yljgsqJcxx);
+
+}

+ 54 - 0
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysJgZhglService.java

@@ -0,0 +1,54 @@
+package com.ruoyi.system.service;
+
+import java.util.List;
+import com.ruoyi.system.domain.SysJgZhgl;
+
+/**
+ * 机构账号管理Service接口
+ *
+ * @author CH
+ * @date 2022-05-31
+ */
+public interface ISysJgZhglService
+{
+    /**
+     * 查询机构账号管理
+     *
+     * @param id 机构账号管理主键
+     * @return 机构账号管理
+     */
+    public SysJgZhgl selectSysJgZhglById(String id);
+
+    /**
+     * 查询机构账号管理列表
+     *
+     * @param sysJgZhgl 机构账号管理
+     * @return 机构账号管理集合
+     */
+    public List<SysJgZhgl> selectSysJgZhglList(SysJgZhgl sysJgZhgl);
+
+    /**
+     * 新增机构账号管理
+     *
+     * @param sysJgZhgl 机构账号管理
+     * @return 结果
+     */
+    public int insertSysJgZhgl(SysJgZhgl sysJgZhgl);
+
+    /**
+     * 修改机构账号管理
+     *
+     * @param sysJgZhgl 机构账号管理
+     * @return 结果
+     */
+    public int updateSysJgZhgl(SysJgZhgl sysJgZhgl);
+
+    /**
+     * 批量删除机构账号管理
+     *
+     * @param ids 需要删除的机构账号管理主键集合
+     * @return 结果
+     */
+    public int deleteSysJgZhglByIds(String[] ids);
+
+}

+ 257 - 0
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysJgZhglServiceImpl.java

@@ -0,0 +1,257 @@
+package com.ruoyi.system.service.impl;
+
+import java.text.DecimalFormat;
+import java.util.List;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.bean.copier.CopyOptions;
+import com.ruoyi.common.core.exception.ServiceException;
+import com.ruoyi.common.core.utils.StringUtils;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.security.utils.SecurityUtils;
+import com.ruoyi.organization.domain.YljgJcxx;
+import com.ruoyi.organization.domain.YljgXfaqzcxx;
+import com.ruoyi.organization.domain.YljgsqJcxx;
+import com.ruoyi.system.api.domain.SysUser;
+import com.ruoyi.system.controller.SysUserController;
+import com.ruoyi.system.mapper.SysUserMapper;
+import com.ruoyi.system.mapper.YljgJcxxMapper;
+import com.ruoyi.system.mapper.YljgsqJcxxMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import java.util.Arrays;
+import com.ruoyi.system.mapper.SysJgZhglMapper;
+import com.ruoyi.system.domain.SysJgZhgl;
+import com.ruoyi.system.service.ISysJgZhglService;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 机构账号管理Service业务层处理
+ *
+ * @author CH
+ * @date 2022-05-31
+ */
+@Service
+public class SysJgZhglServiceImpl implements ISysJgZhglService
+{
+    @Autowired
+    private SysJgZhglMapper sysJgZhglMapper;
+
+    @Autowired
+    private SysUserMapper sysUserMapper;
+
+    @Autowired
+    private YljgJcxxMapper yljgJcxxMapper;
+
+    @Autowired
+    private YljgsqJcxxMapper yljgsqJcxxMapper;
+
+    @Autowired
+    private SysUserController sysUserController;
+
+
+
+    /**
+     * 查询机构账号管理
+     *
+     * @param id 机构账号管理主键
+     * @return 机构账号管理
+     */
+    @Override
+    public SysJgZhgl selectSysJgZhglById(String id)
+    {
+        return sysJgZhglMapper.selectById(id);
+    }
+
+    /**
+     * 查询机构账号管理列表
+     *
+     * @param sysJgZhgl 机构账号管理
+     * @return 机构账号管理
+     */
+    @Override
+    public List<SysJgZhgl> selectSysJgZhglList(SysJgZhgl sysJgZhgl)
+    {
+//        return sysJgZhglMapper.selectList(new LambdaQueryWrapper<>(sysJgZhgl));
+        return sysJgZhglMapper.selectSysJgZhglList(sysJgZhgl);
+    }
+
+    /**
+     * 新增机构账号管理
+     *
+     * @param sysJgZhgl 机构账号管理
+     * @return 结果
+     */
+    @Transactional
+    @Override
+    public int insertSysJgZhgl(SysJgZhgl sysJgZhgl)
+    {
+        Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
+        String code = deptId.toString().substring(0,6);
+        String deptCount = sysJgZhglMapper.selectuserCount(code);
+        sysJgZhgl.setSsxzqh(deptId.toString());
+        sysJgZhgl.setPassword(SecurityUtils.encryptPassword("123456"));
+
+        String userName;
+        // 添加系统用户
+        SysUser user = new SysUser();
+
+        Long i = (long) (Integer.parseInt(deptCount) + 1);
+
+        if(sysJgZhgl.getIsZhType().equals("1")){ // 是养老机构
+            Long[] tt = new Long[1];
+            tt[0]=2L;
+            user.setRoleIds(tt);
+            user.setUserType("01");
+
+            String str = code+"0000";
+            Long result = Long.parseLong(str) + i;
+            DecimalFormat decimalFormat = new DecimalFormat("0000000000");
+            userName = "yljg"+decimalFormat.format(result);
+        }else{
+            Long[] tt = new Long[1];
+            tt[0]=4L;
+            user.setRoleIds(tt);
+            user.setUserType("02");
+
+            String str = code+"000000";
+            Long result = Long.parseLong(str) + i;
+            DecimalFormat decimalFormat = new DecimalFormat("000000000000");
+            userName = "sqjg"+decimalFormat.format(result);
+        }
+        user.setDeptId(deptId);
+        user.setNickName(sysJgZhgl.getJgmc());
+        user.setPassword("123456");
+        user.setUserName(userName);
+        user.setPhonenumber(sysJgZhgl.getFrlxfs());
+        user.setStatus("0");
+        AjaxResult ajax = sysUserController.add(user);
+        if(ajax.get("code").toString().equals("500")){
+            throw new ServiceException(ajax.get("msg").toString());
+        }
+        sysJgZhgl.setUserName(userName);
+        sysJgZhgl.setSysUserId(Long.parseLong(ajax.get("data").toString()));
+        return sysJgZhglMapper.insert(sysJgZhgl);
+    }
+
+    /**
+     * 修改机构账号管理
+     *
+     * @param sysJgZhgl 机构账号管理
+     * @return 结果
+     */
+    @Transactional
+    @Override
+    public int updateSysJgZhgl(SysJgZhgl sysJgZhgl)
+    {
+        int rows = 0;
+        // 启用 禁用 删除
+        // 修改机构状态 、 修改系统账号状态 、 修改当前表 、 如果删除则另走
+        SysJgZhgl orginJgZhgl;
+        if (StringUtils.isBlank(sysJgZhgl.getId())){
+            orginJgZhgl = sysJgZhgl;
+        }else{
+            orginJgZhgl = sysJgZhglMapper.selectById(sysJgZhgl.getId());
+            BeanUtil.copyProperties(sysJgZhgl,orginJgZhgl,new CopyOptions().ignoreNullValue());
+        }
+
+        SysUser user = new SysUser();
+        user.setUserId(orginJgZhgl.getSysUserId());
+        SysUser user1 = sysUserMapper.selectUserById(orginJgZhgl.getSysUserId());
+        if(StringUtils.isNotNull(sysJgZhgl.getStatus())){
+
+            // 修改系统账号状态
+            if(sysJgZhgl.getStatus().equals("01")){ //账号启用
+                user.setStatus("0");
+                AjaxResult ajaxResult = sysUserController.changeStatus(user); // 修改系统用户的状态
+                if(ajaxResult.get("code").toString().equals("500")){
+                    throw new ServiceException(ajaxResult.get("msg").toString());
+                }
+                if(StringUtils.isNotNull(user1)){ // 修改机构运营状态
+                    if(orginJgZhgl.getIsZhType().equals("1")){
+                        YljgJcxx yljgJcxx = new YljgJcxx();
+                        yljgJcxx.setId(user1.getJgId());
+                        yljgJcxx.setSczt("01");
+                        yljgJcxxMapper.updateYljgJcxx(yljgJcxx);
+                    }else{
+                        YljgsqJcxx yljgsqJcxx = new YljgsqJcxx();
+                        yljgsqJcxx.setId(user1.getJgId());
+                        yljgsqJcxx.setSczt("01");
+                        yljgsqJcxxMapper.updateYljgsqJcxx(yljgsqJcxx);
+                    }
+                }
+
+            } else if(sysJgZhgl.getStatus().equals("03")){ //账号禁用
+                user.setStatus("1");
+                AjaxResult ajaxResult = sysUserController.changeStatus(user); // 修改系统用户的状态
+                if(ajaxResult.get("code").toString().equals("500")){
+                    throw new ServiceException(ajaxResult.get("msg").toString());
+                }
+                if(StringUtils.isNotNull(user1)){
+                    if(orginJgZhgl.getIsZhType().equals("1")){
+                        YljgJcxx yljgJcxx = new YljgJcxx();
+                        yljgJcxx.setId(user1.getJgId());
+                        yljgJcxx.setSczt("07");
+                        yljgJcxxMapper.updateYljgJcxx(yljgJcxx);
+                    }else{
+                        YljgsqJcxx yljgsqJcxx = new YljgsqJcxx();
+                        yljgsqJcxx.setId(user1.getJgId());
+                        yljgsqJcxx.setSczt("07");
+                        yljgsqJcxxMapper.updateYljgsqJcxx(yljgsqJcxx);
+                    }
+                }
+            }
+            else {
+                throw new ServiceException("状态值错误,请检查其信息");
+            }
+
+            if(orginJgZhgl.getIsZhType().equals("1")){
+                rows++;
+                sysJgZhglMapper.updateSysHgZhglByyljg(sysJgZhgl);
+            }else{
+                rows++;
+                sysJgZhglMapper.updateSysHgZhglBysqjg(sysJgZhgl);
+            }
+        }
+
+        if(StringUtils.isNotNull(sysJgZhgl.getIsSc())){ // 删除操作
+            if(sysJgZhgl.getIsSc().equals("1")){
+                Long[] userId = new Long[1];
+                userId[0] = orginJgZhgl.getSysUserId();
+                AjaxResult ajaxResult =  sysUserController.remove(userId);
+                if(ajaxResult.get("code").toString().equals("500")){
+                    throw new ServiceException(ajaxResult.get("msg").toString());
+                }
+                if(StringUtils.isNotNull(user1)){
+                    if(orginJgZhgl.getIsZhType().equals("1")){
+                        YljgJcxx yljgJcxx = new YljgJcxx();
+                        yljgJcxx.setId(user1.getJgId());
+                        yljgJcxx.setSczt("02");
+                        yljgJcxxMapper.updateYljgJcxx(yljgJcxx);
+                    }else{
+                        YljgsqJcxx yljgsqJcxx = new YljgsqJcxx();
+                        yljgsqJcxx.setId(user1.getJgId());
+                        yljgsqJcxx.setSczt("02");
+                        yljgsqJcxxMapper.updateYljgsqJcxx(yljgsqJcxx);
+                    }
+                }
+                sysJgZhglMapper.updateSysHgZhglByyljg(sysJgZhgl);
+            }
+            rows++;
+        }
+        return rows;
+    }
+
+    /**
+     * 批量删除机构账号管理
+     *
+     * @param ids 需要删除的机构账号管理主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysJgZhglByIds(String[] ids)
+    {
+        return sysJgZhglMapper.deleteBatchIds(Arrays.asList(ids));
+    }
+
+}

+ 94 - 0
ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysJgZhglMapper.xml

@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.system.mapper.SysJgZhglMapper">
+
+    <resultMap type="SysJgZhgl" id="SysJgZhglResult">
+        <result property="id"    column="id"    />
+        <result property="sysUserId"    column="sys_user_id"    />
+        <result property="jgmc"    column="jgmc"    />
+        <result property="tyshxydm"    column="tyshxydm"    />
+        <result property="frxm"    column="frxm"    />
+        <result property="frlxfs"    column="frlxfs"    />
+        <result property="ssxzqh"    column="ssxzqh"    />
+        <result property="userName"    column="user_name"    />
+        <result property="password"    column="password"    />
+        <result property="status"    column="status"    />
+        <result property="isZhType"    column="is_zh_type"    />
+        <result property="createTimeStr"    column="create_time_str"    />
+        <result property="createUserId"    column="create_user_id"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createUserType"    column="create_user_type"    />
+        <result property="createUnit"    column="create_unit"    />
+        <result property="createUnitName"    column="create_unit_name"    />
+        <result property="updateTimeStr"    column="update_time_str"    />
+        <result property="updateUserId"    column="update_user_id"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateUnit"    column="update_unit"    />
+        <result property="updateUnitName"    column="update_unit_name"    />
+        <result property="state"    column="state"    />
+        <result property="ssxzqhName"    column="ssxzqh_name"    />
+        <result property="szxzqhName"    column="szxzqh_name"    />
+        <result property="isSc"    column="is_sc"    />
+    </resultMap>
+
+    <select id="selectSysJgZhglList" parameterType="SysJgZhgl" resultMap="SysJgZhglResult">
+        SELECT  a.*, getxzqhmcbycode(a.ssxzqh) ssxzqh_name
+        FROM sys_jg_zhgl a
+        LEFT JOIN yljg_jcxx b ON b.id = a.id
+        <where>
+            AND a.is_sc = '0'
+            <if test="jgmc != null and jgmc != ''"> and a.jgmc = #{jgmc}</if>
+            <if test="tyshxydm != null and tyshxydm != ''"> and a.tyshxydm = #{tyshxydm}</if>
+            <if test="userName != null and userName != ''"> and a.user_name = #{userName}</if>
+            <if test="status != null and status != ''"> and a.status = #{status}</if>
+            <if test="isZhType != null and isZhType != ''"> and a.is_zh_type = #{isZhType}</if>
+
+        </where>
+        ORDER BY a.create_time_str DESC
+
+    </select>
+
+    <select id="selectuserCount" parameterType="string" resultType="string">
+				SELECT  COUNT(*)
+				FROM sys_user
+				WHERE
+				dept_id like concat('%', #{deptId}, '%')
+    </select>
+
+    <update id="updateSysHgZhglByyljg" parameterType="SysJgZhgl">
+        update sys_jg_zhgl
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="status != null and status != ''">status = #{status},</if>
+            <if test="updateTimeStr != null">update_time_str = #{updateTimeStr},</if>
+            <if test="updateUserId != null">update_user_id = #{updateUserId},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateUnit != null">update_unit = #{updateUnit},</if>
+            <if test="updateUnitName != null">update_unit_name = #{updateUnitName},</if>
+            <if test="state != null">state = #{state},</if>
+            <if test="isSc != null">is_sc = #{isSc},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <update id="updateSysHgZhglBysqjg" parameterType="SysJgZhgl">
+        update sys_jg_zhgl
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="jgmc != null and jgmc != ''">jgmc = #{jgmc},</if>
+            <if test="tyshxydm != null and tyshxydm != ''">tyshxydm = #{tyshxydm},</if>
+            <if test="frxm != null">frxm = #{frxm},</if>
+            <if test="frlxfs != null">frlxfs = #{frlxfs},</if>
+            <if test="status != null and status != ''">status = #{status},</if>
+            <if test="updateTimeStr != null">update_time_str = #{updateTimeStr},</if>
+            <if test="updateUserId != null">update_user_id = #{updateUserId},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateUnit != null">update_unit = #{updateUnit},</if>
+            <if test="updateUnitName != null">update_unit_name = #{updateUnitName},</if>
+            <if test="state != null">state = #{state},</if>
+            <if test="isSc != null">is_sc = #{isSc},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+</mapper>

+ 120 - 0
ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/YljgJcxxMapper.xml

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.system.mapper.YljgJcxxMapper">
+
+    <resultMap type="com.ruoyi.organization.domain.YljgJcxx" id="YljgJcxxResult">
+        <result property="id"    column="id"    />
+        <result property="zzjgdm"    column="zzjgdm"    />
+        <result property="tyshxydm"    column="tyshxydm"    />
+        <result property="jgmc"    column="jgmc"    />
+        <result property="jlrq"    column="jlrq"    />
+        <result property="ssxzqh"    column="ssxzqh"    />
+        <result property="szxzqh"    column="szxzqh"    />
+        <result property="txdz"    column="txdz"    />
+        <result property="frxm"    column="frxm"    />
+        <result property="frlxfs"    column="frlxfs"    />
+        <result property="frzjlx"    column="frzjlx"    />
+        <result property="frzjhm"    column="frzjhm"    />
+        <result property="frdjjg"    column="frdjjg"    />
+        <result property="frlx"    column="frlx"    />
+        <result property="qtcws"    column="qtcws"    />
+        <result property="rtcws"    column="rtcws"    />
+        <result property="hlxcws"    column="hlxcws"    />
+        <result property="cwzs"    column="cwzs"    />
+        <result property="jzmj"    column="jzmj"    />
+        <result property="zdmj"    column="zdmj"    />
+        <result property="csxz"    column="csxz"    />
+        <result property="isXfsyZt"    column="is_xfsy_zt"    />
+        <result property="xfsyYy"    column="xfsy_yy"    />
+        <result property="xfsyYj"    column="xfsy_yj"    />
+        <result property="isSpxkZt"    column="is_spxk_zt"    />
+        <result property="spxkYy"    column="spxk_yy"    />
+        <result property="spxkYj"    column="spxk_yj"    />
+        <result property="dwxz"    column="dwxz"    />
+        <result property="isTgjzgyjg"    column="is_tgjzgyjg"    />
+        <result property="isGry"    column="is_gry"    />
+        <result property="isQyxylfwzx"    column="is_qyxylfwzx"    />
+        <result property="scwz"    column="scwz"    />
+        <result property="xbzt"    column="xbzt"    />
+        <result property="szlrlx"    column="szlrlx"    />
+        <result property="szlrlxQt"    column="szlrlx_qt"    />
+        <result property="isTbzrx"    column="is_tbzrx"    />
+        <result property="isChxddjg"    column="is_chxddjg"    />
+        <result property="isTgjjylsmfw"    column="is_tgjjylsmfw"    />
+        <result property="tgjjylsmfwCwrc"    column="tgjjylsmfw_cwrc"    />
+        <result property="tgjjylsmfwZcrc"    column="tgjjylsmfw_zcrc"    />
+        <result property="tgjjylsmfwZjrc"    column="tgjjylsmfw_zjrc"    />
+        <result property="tgjjylsmfwZxrc"    column="tgjjylsmfw_zxrc"    />
+        <result property="tgjjylsmfwXyrc"    column="tgjjylsmfw_xyrc"    />
+        <result property="tgjjylsmfwKfrc"    column="tgjjylsmfw_kfrc"    />
+        <result property="tgjjylsmfwZyrc"    column="tgjjylsmfw_zyrc"    />
+        <result property="tgjjylsmfwGarc"    column="tgjjylsmfw_garc"    />
+        <result property="tgjjylsmfwQtrc"    column="tgjjylsmfw_qtrc"    />
+        <result property="isTgsqylfw"    column="is_tgsqylfw"    />
+        <result property="tgsqylfwRtrc"    column="tgsqylfw_rtrc"    />
+        <result property="tgsqylfwCzrc"    column="tgsqylfw_czrc"    />
+        <result property="tgsqylfwWyrc"    column="tgsqylfw_wyrc"    />
+        <result property="tgsqylfwZfrc"    column="tgsqylfw_zfrc"    />
+        <result property="tgsqylfwKfrc"    column="tgsqylfw_kfrc"    />
+        <result property="tgsqylfwQtrc"    column="tgsqylfw_qtrc"    />
+        <result property="tgsqylfwQtfw"    column="tgsqylfw_qtfw"    />
+        <result property="isKzylfw"    column="is_kzylfw"    />
+        <result property="nsyljg"    column="nsyljg"    />
+        <result property="yljgqyhz"    column="yljgqyhz"    />
+        <result property="isYljgzyxk"    column="is_yljgzyxk"    />
+        <result property="isYlbxddzg"    column="is_ylbxddzg"    />
+        <result property="fcyhznr"    column="fcyhznr"    />
+        <result property="sffs"    column="sffs"    />
+        <result property="isSfhyz"    column="is_sfhyz"    />
+        <result property="hlfZg"    column="hlf_zg"    />
+        <result property="hlfZd"    column="hlf_zd"    />
+        <result property="cwfZg"    column="cwf_zg"    />
+        <result property="cwfZd"    column="cwf_zd"    />
+        <result property="ssfZg"    column="ssf_zg"    />
+        <result property="ssfZd"    column="ssf_zd"    />
+        <result property="yzZg"    column="yz_zg"    />
+        <result property="yzZd"    column="yz_zd"    />
+        <result property="isQtsf"    column="is_qtsf"    />
+        <result property="qtsfXm"    column="qtsf_xm"    />
+        <result property="qtsfZg"    column="qtsf_zg"    />
+        <result property="qtsfZd"    column="qtsf_zd"    />
+        <result property="ymszlrs"    column="ymszlrs"    />
+        <result property="sczt"    column="sczt"    />
+        <result property="isBa"    column="is_ba"    />
+        <result property="basj"    column="basj"    />
+        <result property="xgrq"    column="xgrq"    />
+        <result property="czyy"    column="czyy"    />
+        <result property="czsj"    column="czsj"    />
+        <result property="createTimeStr"    column="create_time_str"    />
+        <result property="createUserId"    column="create_user_id"    />
+        <result property="createUserType"    column="create_user_type"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createUnit"    column="create_unit"    />
+        <result property="createUnitName"    column="create_unit_name"    />
+        <result property="updateTimeStr"    column="update_time_str"    />
+        <result property="updateUserId"    column="update_user_id"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateUnit"    column="update_unit"    />
+        <result property="updateUnitName"    column="update_unit_name"    />
+        <result property="state"    column="state"    />
+        <result property="ssxzqhName"    column="ssxzqh_name"    />
+        <result property="szxzqhName"    column="szxzqh_name"    />
+    </resultMap>
+
+    <update id="updateYljgJcxx" parameterType="com.ruoyi.organization.domain.YljgJcxx">
+        update yljg_jcxx
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="sczt != null and sczt != ''">sczt = #{sczt},</if>
+            update_time_str = #{updateTimeStr},
+            update_user_id = #{updateUserId},
+            update_by = #{updateBy},
+            update_unit = #{updateUnit},
+            update_unit_name = #{updateUnitName},
+            <if test="state != null">state = #{state},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+</mapper>

+ 96 - 0
ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/YljgsqJcxxMapper.xml

@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.system.mapper.YljgsqJcxxMapper">
+
+    <resultMap type="com.ruoyi.organization.domain.YljgsqJcxx" id="YljgsqJcxxResult">
+        <result property="id"    column="id"    />
+        <result property="zzjgdm"    column="zzjgdm"    />
+        <result property="tyshxydm"    column="tyshxydm"    />
+        <result property="jgmc"    column="jgmc"    />
+        <result property="jlrq"    column="jlrq"    />
+        <result property="ssxzqh"    column="ssxzqh"    />
+        <result property="szxzqh"    column="szxzqh"    />
+        <result property="txdz"    column="txdz"    />
+        <result property="frxm"    column="frxm"    />
+        <result property="frlxfs"    column="frlxfs"    />
+        <result property="frzjlx"    column="frzjlx"    />
+        <result property="frzjhm"    column="frzjhm"    />
+        <result property="frdjjg"    column="frdjjg"    />
+        <result property="frlx"    column="frlx"    />
+        <result property="qtcws"    column="qtcws"    />
+        <result property="rtcws"    column="rtcws"    />
+        <result property="cwzs"    column="cwzs"    />
+        <result property="hlxcws"    column="hlxcws"    />
+        <result property="jzmj"    column="jzmj"    />
+        <result property="zdmj"    column="zdmj"    />
+        <result property="csxz"    column="csxz"    />
+        <result property="isJm"    column="is_jm"    />
+        <result property="dwxz"    column="dwxz"    />
+        <result property="xbzt"    column="xbzt"    />
+        <result property="scwz"    column="scwz"    />
+        <result property="lb"    column="lb"    />
+        <result property="isKzylfw"    column="is_kzylfw"    />
+        <result property="nsyljg"    column="nsyljg"    />
+        <result property="yljgqyhz"    column="yljgqyhz"    />
+        <result property="isTbzrx"    column="is_tbzrx"    />
+        <result property="isChxddjg"    column="is_chxddjg"    />
+        <result property="szlrlx"    column="szlrlx"    />
+        <result property="szlrlxQt"    column="szlrlx_qt"    />
+        <result property="isYlbxddzg"    column="is_ylbxddzg"    />
+        <result property="isYljgzyxk"    column="is_yljgzyxk"    />
+        <result property="isQyxylfwzx"    column="is_qyxylfwzx"    />
+        <result property="isTgjjylsmfw"    column="is_tgjjylsmfw"    />
+        <result property="tgsqylfwQtrc"    column="tgsqylfw_qtrc"    />
+        <result property="tgsqylfwRtrc"    column="tgsqylfw_rtrc"    />
+        <result property="tgsqylfwCzrc"    column="tgsqylfw_czrc"    />
+        <result property="tgsqylfwWyrc"    column="tgsqylfw_wyrc"    />
+        <result property="tgsqylfwZfrc"    column="tgsqylfw_zfrc"    />
+        <result property="tgsqylfwKfrc"    column="tgsqylfw_kfrc"    />
+        <result property="tgsqylfwQtfwrc"    column="tgsqylfw_qtfwrc"    />
+        <result property="tgjjylsmfwCwrc"    column="tgjjylsmfw_cwrc"    />
+        <result property="tgjjylsmfwZcrc"    column="tgjjylsmfw_zcrc"    />
+        <result property="tgjjylsmfwZjrc"    column="tgjjylsmfw_zjrc"    />
+        <result property="tgjjylsmfwZxrc"    column="tgjjylsmfw_zxrc"    />
+        <result property="tgjjylsmfwXyrc"    column="tgjjylsmfw_xyrc"    />
+        <result property="tgjjylsmfwKfrc"    column="tgjjylsmfw_kfrc"    />
+        <result property="tgjjylsmfwZyrc"    column="tgjjylsmfw_zyrc"    />
+        <result property="tgjjylsmfwGarc"    column="tgjjylsmfw_garc"    />
+        <result property="tgjjylsmfwQtrc"    column="tgjjylsmfw_qtrc"    />
+        <result property="tgjjylsmfwQtsm"    column="tgjjylsmfw_qtsm"    />
+        <result property="czyy"    column="czyy"    />
+        <result property="czsj"    column="czsj"    />
+        <result property="sczt"    column="sczt"    />
+        <result property="createTimeStr"    column="create_time_str"    />
+        <result property="createUserId"    column="create_user_id"    />
+        <result property="createUserType"    column="create_user_type"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createUnit"    column="create_unit"    />
+        <result property="createUnitName"    column="create_unit_name"    />
+        <result property="updateTimeStr"    column="update_time_str"    />
+        <result property="updateUserId"    column="update_user_id"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateUnit"    column="update_unit"    />
+        <result property="updateUnitName"    column="update_unit_name"    />
+        <result property="state"    column="state"    />
+        <result property="ssxzqhName"    column="ssxzqh_name"    />
+        <result property="szxzqhName"    column="szxzqh_name"    />
+    </resultMap>
+
+
+    <update id="updateYljgsqJcxx" parameterType="com.ruoyi.organization.domain.YljgsqJcxx">
+        update yljgsq_jcxx
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="sczt != null and sczt != ''">sczt = #{sczt},</if>
+            update_time_str = #{updateTimeStr},
+            update_user_id = #{updateUserId},
+            update_by = #{updateBy},
+            update_unit = #{updateUnit},
+            update_unit_name = #{updateUnitName},
+            <if test="state != null">state = #{state},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+</mapper>

+ 44 - 0
ruoyi-ui/src/api/system/zhgl.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询机构账号管理列表
+export function listZhgl(query) {
+  return request({
+    url: '/system/zhgl/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询机构账号管理详细
+export function getZhgl(id) {
+  return request({
+    url: '/system/zhgl/' + id,
+    method: 'get'
+  })
+}
+
+// 新增机构账号管理
+export function addZhgl(data) {
+  return request({
+    url: '/system/zhgl',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改机构账号管理
+export function updateZhgl(data) {
+  return request({
+    url: '/system/zhgl',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除机构账号管理
+export function delZhgl(id) {
+  return request({
+    url: '/system/zhgl/' + id,
+    method: 'delete'
+  })
+}

+ 348 - 0
ruoyi-ui/src/views/system/zhgl/sqyljg/index.vue

@@ -0,0 +1,348 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="机构名称" prop="jgmc">
+        <el-input
+          v-model="queryParams.jgmc"
+          placeholder="请输入机构名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="统一社会信用代码" prop="tyshxydm">
+        <el-input
+          v-model="queryParams.tyshxydm"
+          placeholder="请输入统一社会信用代码"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="账号名称" prop="userName">
+        <el-input
+          v-model="queryParams.userName"
+          placeholder="请输入账号名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="账号状态" prop="status">
+        <el-select v-model="queryParams.status" placeholder="请选择账号状态" clearable>
+          <el-option
+            v-for="dict in dict.type.XZ078"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['system:zhgl:add']"
+        >新增</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="zhglList" >
+      <el-table-column label="序号" align="center">
+        <template slot-scope="scope">
+          {{(queryParams.pageNum-1)*queryParams.pageSize + scope.$index + 1}}
+        </template>
+      </el-table-column>
+      <el-table-column label="机构名称" align="center" prop="jgmc" />
+      <el-table-column label="统一社会信用代码" align="center" prop="tyshxydm" />
+<!--      <el-table-column label="负责人" align="center" prop="frxm" />-->
+<!--      <el-table-column label="联系电话" align="center" prop="frlxfs" />-->
+<!--      <el-table-column label="所属区划" align="center" prop="ssxzqh" />-->
+      <el-table-column label="账号名称" align="center" prop="userName" />
+<!--      <el-table-column label="账号密码" align="center" prop="password" />-->
+      <el-table-column label="账号状态" align="center" prop="status">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.XZ078" :value="scope.row.status"/>
+        </template>
+      </el-table-column>
+<!--      <el-table-column label="账号类别" align="center" prop="isZhType">-->
+<!--        <template slot-scope="scope">-->
+<!--          <dict-tag :options="dict.type.CZ035" :value="scope.row.isZhType"/>-->
+<!--        </template>-->
+<!--      </el-table-column>-->
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['system:zhgl:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row,scope.$index)"
+            v-hasPermi="['system:zhgl:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改机构账号管理对话框 -->
+    <el-dialog v-dialog-drag :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+
+        <el-form-item label="机构名称" prop="jgmc">
+          <el-input v-model="form.jgmc" placeholder="请输入机构名称" />
+        </el-form-item>
+
+        <el-form-item label="统一社会信用代码" prop="tyshxydm">
+          <el-input v-model="form.tyshxydm" placeholder="请输入统一社会信用代码" />
+        </el-form-item>
+
+        <el-form-item label="负责人" prop="frxm">
+          <el-input v-model="form.frxm" placeholder="请输入负责人" />
+        </el-form-item>
+        <el-form-item label="负责人联系电话" prop="frlxfs">
+          <el-input v-model="form.frlxfs" placeholder="请输入负责人联系电话" />
+        </el-form-item>
+
+        <el-form-item label="账号状态" prop="status" >
+<!--          <el-radio-group v-model="form.status" :disabled="true">-->
+          <el-radio-group v-model="form.status">
+            <el-radio
+              v-for="dict in dict.type.XZ078"
+              :key="dict.value"
+              :label="dict.value"
+            >{{dict.label}}</el-radio>
+          </el-radio-group>
+        </el-form-item>
+
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm" :loading="submitFormLoading">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listZhgl, getZhgl, delZhgl, addZhgl, updateZhgl } from "@/api/system/zhgl";
+import { Regular,chineseOne, idCard } from '@/utils/regular'
+
+export default {
+  name: "Zhgl",
+  dicts: ['CZ035', 'XZ078'],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      submitFormLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 机构账号管理表格数据
+      zhglList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        jgmc: [
+          { required: true, message: "机构名称不能为空", trigger: "blur" },
+          { max: 100, message: '机构名称不能超过100个字符', trigger: 'blur'},
+        ],
+        tyshxydm: [
+          { required: true, message: "统一社会信用代码不能为空", trigger: "blur" },
+          { max: 18, message: '统一社会信用代码不能超过18个字符', trigger: 'blur'},
+        ],
+        frxm: [
+          { max: 72, message: '负责人不能超过72个字符', trigger: 'blur'},
+        ],
+        frlxfs: [
+          { max: 18, message: '联系电话不能超过18个字符', trigger: 'blur'},
+        ],
+        // ssxzqh: [
+        //   { max: 12, message: '所属区划不能超过12个字符', trigger: 'blur'},
+        // ],
+        // userName: [
+        //   { required: true, message: "账号名称不能为空", trigger: "blur" },
+        //   { max: 19, message: '账号名称不能超过19个字符', trigger: 'blur'},
+        // ],
+        // password: [
+        //   { max: 72, message: '账号密码不能超过72个字符', trigger: 'blur'},
+        // ],
+        // status: [
+        //   { required: true, message: "账号状态不能为空", trigger: "blur" },
+        // ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询机构账号管理列表 */
+    getList() {
+      this.loading = true;
+      this.queryParams.isZhType='0';
+      listZhgl(this.queryParams).then(response => {
+        this.zhglList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.submitFormLoading =false;
+      this.form = {
+        id: null,
+        jgmc: null,
+        tyshxydm: null,
+        frxm: null,
+        frlxfs: null,
+        ssxzqh: null,
+        userName: null,
+        password: null,
+        status: null,
+        isZhType: null,
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加机构账号管理";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getZhgl(id).then(response => {
+        this.form = response.data;
+        /****** sks 需要改动的地方 start ******/
+        this.copyForm=this.deepCopy(response.data)
+        /****** sks 需要改动的地方 end ******/
+        this.open = true;
+        this.title = "修改机构账号管理";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          this.submitFormLoading = true;
+          if (this.form.id != null) {
+            /****** sks 需要改动的地方 start ******/
+            let formData=this.comparisonObject(this.form,this.copyForm);
+            if(formData) {
+              updateZhgl({...formData,id:this.form.id}).then(response => {
+                this.$modal.msgSuccess("修改成功");
+                this.open = false;
+                this.zhglList=this.dataReplacement(this.zhglList,this.form.id,formData);
+                // this.getList();
+              }).finally(()=>this.submitFormLoading =false);
+            }else{
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.submitFormLoading = false;
+            }
+            /****** sks 需要改动的地方 end ******/
+          } else {
+            this.form.isZhType = '0';
+            addZhgl(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              // this.getList();
+              /****** sks 需要改动的地方 start ******/
+              if (this.queryParams.pageSize===this.zhglList.length)
+              {
+                this.zhglList.pop();
+              }
+              this.zhglList.unshift({...this.form,id:response.data});
+              this.total++;
+              /****** sks 需要改动的地方 end ******/
+            }).finally(()=>this.submitFormLoading =false);
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row,index) {
+      const ids = row.id || this.ids;
+      const xh = (this.queryParams.pageNum-1)*this.queryParams.pageSize + index + 1;
+      this.$modal.confirm('确认删除' + this.changeDelData(row,'id','ID值',xh) + '的记录?').then(function() {
+        return delZhgl(ids);
+      }).then(() => {
+        // this.getList();
+        /****** sks 需要改动的地方 ind参数需要传进来 start ******/
+        this.zhglList.splice(index,1);
+        if(this.zhglList.length===0)
+        {
+          this.getList();
+        }else {
+          this.total--;
+        }
+        this.$modal.msgSuccess("删除成功");
+        /****** sks 需要改动的地方 end ******/
+      }).catch(() => {});
+    }
+  }
+};
+</script>

+ 349 - 0
ruoyi-ui/src/views/system/zhgl/yljg/index.vue

@@ -0,0 +1,349 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="机构名称" prop="jgmc">
+        <el-input
+          v-model="queryParams.jgmc"
+          placeholder="请输入机构名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="统一社会信用代码" prop="tyshxydm">
+        <el-input
+          v-model="queryParams.tyshxydm"
+          placeholder="请输入统一社会信用代码"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="账号名称" prop="userName">
+        <el-input
+          v-model="queryParams.userName"
+          placeholder="请输入账号名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="账号状态" prop="status">
+        <el-select v-model="queryParams.status" placeholder="请选择账号状态" clearable>
+          <el-option
+            v-for="dict in dict.type.XZ078"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['system:zhgl:add']"
+        >新增</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="zhglList" >
+      <el-table-column label="序号" align="center">
+        <template slot-scope="scope">
+          {{(queryParams.pageNum-1)*queryParams.pageSize + scope.$index + 1}}
+        </template>
+      </el-table-column>
+      <el-table-column label="机构名称" align="center" prop="jgmc" />
+      <el-table-column label="统一社会信用代码" align="center" prop="tyshxydm" />
+<!--      <el-table-column label="负责人" align="center" prop="frxm" />-->
+<!--      <el-table-column label="联系电话" align="center" prop="frlxfs" />-->
+<!--      <el-table-column label="所属区划" align="center" prop="ssxzqh" />-->
+      <el-table-column label="账号名称" align="center" prop="userName" />
+<!--      <el-table-column label="账号密码" align="center" prop="password" />-->
+      <el-table-column label="账号状态" align="center" prop="status">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.XZ078" :value="scope.row.status"/>
+        </template>
+      </el-table-column>
+<!--      <el-table-column label="账号类别" align="center" prop="isZhType">-->
+<!--        <template slot-scope="scope">-->
+<!--          <dict-tag :options="dict.type.CZ035" :value="scope.row.isZhType"/>-->
+<!--        </template>-->
+<!--      </el-table-column>-->
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['system:zhgl:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row,scope.$index)"
+            v-hasPermi="['system:zhgl:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改机构账号管理对话框 -->
+    <el-dialog v-dialog-drag :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+
+        <el-form-item label="机构名称" prop="jgmc">
+          <el-input v-model="form.jgmc" placeholder="请输入机构名称" />
+        </el-form-item>
+
+        <el-form-item label="统一社会信用代码" prop="tyshxydm">
+          <el-input v-model="form.tyshxydm" placeholder="请输入统一社会信用代码" />
+        </el-form-item>
+
+        <el-form-item label="负责人" prop="frxm">
+          <el-input v-model="form.frxm" placeholder="请输入负责人" />
+        </el-form-item>
+        <el-form-item label="负责人联系电话" prop="frlxfs">
+          <el-input v-model="form.frlxfs" placeholder="请输入负责人联系电话" />
+        </el-form-item>
+
+        <el-form-item label="账号状态" prop="status" >
+<!--          <el-radio-group v-model="form.status" :disabled="true">-->
+          <el-radio-group v-model="form.status">
+            <el-radio
+              v-for="dict in dict.type.XZ078"
+              :key="dict.value"
+              :label="dict.value"
+            >{{dict.label}}</el-radio>
+          </el-radio-group>
+        </el-form-item>
+
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm" :loading="submitFormLoading">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listZhgl, getZhgl, delZhgl, addZhgl, updateZhgl } from "@/api/system/zhgl";
+import { Regular,chineseOne, idCard } from '@/utils/regular'
+
+export default {
+  name: "Zhgl",
+  dicts: ['CZ035', 'XZ078'],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      submitFormLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 机构账号管理表格数据
+      zhglList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        jgmc: [
+          { required: true, message: "机构名称不能为空", trigger: "blur" },
+          { max: 100, message: '机构名称不能超过100个字符', trigger: 'blur'},
+        ],
+        tyshxydm: [
+          { required: true, message: "统一社会信用代码不能为空", trigger: "blur" },
+          { max: 18, message: '统一社会信用代码不能超过18个字符', trigger: 'blur'},
+        ],
+        frxm: [
+          { max: 72, message: '负责人不能超过72个字符', trigger: 'blur'},
+        ],
+        frlxfs: [
+          { max: 18, message: '联系电话不能超过18个字符', trigger: 'blur'},
+        ],
+        // ssxzqh: [
+        //   { max: 12, message: '所属区划不能超过12个字符', trigger: 'blur'},
+        // ],
+        // userName: [
+        //   { required: true, message: "账号名称不能为空", trigger: "blur" },
+        //   { max: 19, message: '账号名称不能超过19个字符', trigger: 'blur'},
+        // ],
+        // password: [
+        //   { max: 72, message: '账号密码不能超过72个字符', trigger: 'blur'},
+        // ],
+        // status: [
+        //   { required: true, message: "账号状态不能为空", trigger: "blur" },
+        // ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询机构账号管理列表 */
+    getList() {
+      this.loading = true;
+      this.queryParams.isZhType='1';
+      listZhgl(this.queryParams).then(response => {
+        this.zhglList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.submitFormLoading =false;
+      this.form = {
+        id: null,
+        jgmc: null,
+        tyshxydm: null,
+        frxm: null,
+        frlxfs: null,
+        ssxzqh: null,
+        userName: null,
+        password: null,
+        status: null,
+        isZhType: null,
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加机构账号管理";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getZhgl(id).then(response => {
+        this.form = response.data;
+        /****** sks 需要改动的地方 start ******/
+        this.copyForm=this.deepCopy(response.data)
+        /****** sks 需要改动的地方 end ******/
+        this.open = true;
+        this.title = "修改机构账号管理";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          this.submitFormLoading = true;
+          if (this.form.id != null) {
+            /****** sks 需要改动的地方 start ******/
+            let formData=this.comparisonObject(this.form,this.copyForm);
+            if(formData) {
+              updateZhgl({...formData,id:this.form.id}).then(response => {
+                this.$modal.msgSuccess("修改成功");
+                this.open = false;
+                this.zhglList=this.dataReplacement(this.zhglList,this.form.id,formData);
+                // this.getList();
+              }).finally(()=>this.submitFormLoading =false);
+            }else{
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.submitFormLoading = false;
+            }
+            /****** sks 需要改动的地方 end ******/
+          } else {
+            this.form.isZhType = '1';
+            addZhgl(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              // this.getList();
+              /****** sks 需要改动的地方 start ******/
+              if (this.queryParams.pageSize===this.zhglList.length)
+              {
+                this.zhglList.pop();
+              }
+              this.zhglList.unshift({...this.form,id:response.data});
+              this.total++;
+              /****** sks 需要改动的地方 end ******/
+            }).finally(()=>this.submitFormLoading =false);
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row,index) {
+      const ids = row.id || this.ids;
+      const xh = (this.queryParams.pageNum-1)*this.queryParams.pageSize + index + 1;
+      this.$modal.confirm('确认删除' + this.changeDelData(row,'id','ID值',xh) + '的记录?').then(function() {
+        return updateZhgl({id:ids,isSc:1});
+        // return delZhgl(ids);
+      }).then(() => {
+        // this.getList();
+        /****** sks 需要改动的地方 ind参数需要传进来 start ******/
+        this.zhglList.splice(index,1);
+        if(this.zhglList.length===0)
+        {
+          this.getList();
+        }else {
+          this.total--;
+        }
+        this.$modal.msgSuccess("删除成功");
+        /****** sks 需要改动的地方 end ******/
+      }).catch(() => {});
+    }
+  }
+};
+</script>