c38a400aba3221fdff0bb576d177c1a6a590ecb7..25b639f34bd7e80a69cdb5b46b2d082c1590d033
2023-12-08 cy
feat: 部门管理-新增报错 Closes #12537
25b639 对比 | 目录
2023-12-08 cy
feat: 数据字典左侧的机构数 bug12544
b5b6d1 对比 | 目录
4个文件已修改
42 ■■■■■ 已修改文件
admin-web/src/views/systemSetting/dict/index.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
consum-base/src/main/java/com/consum/base/controller/FinSysTenantDepartmentController.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
consum-base/src/main/java/com/consum/base/service/FinSysTenantDepartmentService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
consum-base/src/main/java/com/consum/base/service/impl/FinSysTenantDepartmentServiceImpl.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin-web/src/views/systemSetting/dict/index.vue
@@ -1,11 +1,11 @@
<template>
  <div class="app-container">
    <!--左侧树形开始-->
    <el-col :span="5">
        <el-card class="box-card" shadow="never">
          <my-tree ref="searchTree" :tree-list="treeDataList" @setNode="nodeClick" @search="search"></my-tree>
        </el-card>
      </el-col>
<!--    <el-col :span="5">-->
<!--        <el-card class="box-card" shadow="never">-->
<!--          <my-tree ref="searchTree" :tree-list="treeDataList" @setNode="nodeClick" @search="search"></my-tree>-->
<!--        </el-card>-->
<!--      </el-col>-->
      <!--左侧树形结束-->
      <!--右侧列表开始-->
    <el-container>
consum-base/src/main/java/com/consum/base/controller/FinSysTenantDepartmentController.java
@@ -13,13 +13,10 @@
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * @Description 部门管理
@@ -56,7 +53,7 @@
        if (StringUtils.isEmpty(param.getCode())) {
            return ResponseValue.error("编号为空");
        }
        FinSysTenantDepartment tenantDepartment = this.departmentService.selectByCode(param.getCode());
        FinSysTenantDepartment tenantDepartment = this.departmentService.selectByCode(param.getCode(),param.getId());
        if (tenantDepartment != null) {
            return ResponseValue.error("部门编号已存在");
        }
@@ -137,7 +134,7 @@
        if (sysInfo == null) {
            return ResponseValue.error("登录用户信息不存在");
        }
        FinSysTenantDepartment tenantDepartment = this.departmentService.selectByCode(param.getCode());
        FinSysTenantDepartment tenantDepartment = this.departmentService.selectByCode(param.getCode(),param.getId());
        if (tenantDepartment != null) {
            return ResponseValue.error("部门编号已存在");
        }
consum-base/src/main/java/com/consum/base/service/FinSysTenantDepartmentService.java
@@ -26,7 +26,7 @@
     */
    GenericPager<FinSysTenantDepartment> queryList(FinSysTenantDepartmentParam param);
    FinSysTenantDepartment selectByCode(String code);
    FinSysTenantDepartment selectByCode(String code,Long id);
    /**
     * @Description 编辑
consum-base/src/main/java/com/consum/base/service/impl/FinSysTenantDepartmentServiceImpl.java
@@ -10,10 +10,12 @@
import com.walker.infrastructure.utils.DateUtils;
import com.walker.infrastructure.utils.StringUtils;
import com.walker.jdbc.service.BaseServiceImpl;
import java.util.HashMap;
import java.util.List;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
 * @Description 部门管理
@@ -105,8 +107,15 @@
    }
    @Override
    public FinSysTenantDepartment selectByCode(String code) {
        List<FinSysTenantDepartment> select = this.select(QUERY_BY_CODE, new Object[]{code}, new FinSysTenantDepartment());
    public FinSysTenantDepartment selectByCode(String code, Long id) {
        StringBuilder sql = new StringBuilder(QUERY_BY_CODE);
        ArrayList<Object> param = new ArrayList<>(2);
        param.add(code);
        if (id != null) {
            sql.append(" and id != ?");
            param.add(id);
        }
        List<FinSysTenantDepartment> select = this.select(sql.toString(), param.toArray(), new FinSysTenantDepartment());
        if (StringUtils.isEmptyList(select)) {
            return null;
        } else {